<?xml version="1.0" encoding="UTF-8" ?>
|
<!DOCTYPE mapper
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.ltkj.hosp.mapper.TjTollCollectorMapper">
|
|
<resultMap type="TjTollCollector" id="TjTollCollectorResult">
|
<result property="id" column="id"/>
|
<result property="accountId" column="account_id"/>
|
<result property="tollCollectorId" column="toll_collector_id"/>
|
<result property="tollCollector" column="toll_collector"/>
|
<result property="createBy" column="create_by"/>
|
<result property="createTime" column="create_time"/>
|
<result property="updateBy" column="update_by"/>
|
<result property="updateTime" column="update_time"/>
|
<result property="deleted" column="deleted"/>
|
<result property="accountBeginTime" column="account_begin_time"/>
|
<result property="accountEndTime" column="account_end_time"/>
|
<result property="amountReceived" column="amount_received"/>
|
<result property="refundAmount" column="refund_amount"/>
|
<result property="payable" column="payable"/>
|
</resultMap>
|
|
<resultMap id="TjTollCollectorTjTollCollectorDetailResult" type="TjTollCollector" extends="TjTollCollectorResult">
|
<collection property="tjTollCollectorDetailList" notNullColumn="sub_id"
|
javaType="java.util.List" resultMap="TjTollCollectorDetailResult"/>
|
</resultMap>
|
|
<resultMap type="TjTollCollectorDetail" id="TjTollCollectorDetailResult">
|
<result property="id" column="sub_id"/>
|
<result property="accountId" column="sub_account_id"/>
|
<result property="payType" column="sub_pay_type"/>
|
<result property="amountReceived" column="sub_amount_received"/>
|
<result property="refundAmount" column="sub_refund_amount"/>
|
<result property="payable" column="sub_payable"/>
|
<result property="createBy" column="sub_create_by"/>
|
<result property="createTime" column="sub_create_time"/>
|
<result property="updateBy" column="sub_update_by"/>
|
<result property="updateTime" column="sub_update_time"/>
|
<result property="deleted" column="sub_deleted"/>
|
</resultMap>
|
|
<sql id="selectTjTollCollectorVo">
|
select id, account_id, toll_collector_id, toll_collector, create_by, create_time, update_by, update_time, deleted, account_begin_time, account_end_time, amount_received, refund_amount, payable
|
from tj_toll_collector
|
</sql>
|
|
<select id="selectTjTollCollectorList" parameterType="TjTollCollector" resultMap="TjTollCollectorResult">
|
<include refid="selectTjTollCollectorVo"/>
|
<where>
|
<if test="tollCollector != null and tollCollector != ''">
|
and toll_collector = #{tollCollector}
|
</if>
|
</where>
|
</select>
|
|
<select id="selectTjTollCollectorById" parameterType="Long"
|
resultMap="TjTollCollectorTjTollCollectorDetailResult">
|
select a.id, a.account_id, a.toll_collector_id, a.toll_collector, a.create_by, a.create_time, a.update_by, a.update_time, a.deleted, a.account_begin_time, a.account_end_time, a.amount_received, a.refund_amount, a.payable,
|
b.id as
|
sub_id, b.account_id as
|
sub_account_id, b.pay_type as
|
sub_pay_type, b.amount_received as
|
sub_amount_received, b.refund_amount as
|
sub_refund_amount, b.payable as
|
sub_payable, b.create_by as
|
sub_create_by, b.create_time as
|
sub_create_time, b.update_by as
|
sub_update_by, b.update_time as
|
sub_update_time, b.deleted as
|
sub_deleted
|
from tj_toll_collector a
|
left join tj_toll_collector_detail b on b.account_id = a.id
|
where a.id = #{id}
|
</select>
|
|
<insert id="insertTjTollCollector" parameterType="TjTollCollector" useGeneratedKeys="true"
|
keyProperty="id">
|
insert into tj_toll_collector
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="accountId != null">account_id,
|
</if>
|
<if test="tollCollectorId != null">toll_collector_id,
|
</if>
|
<if test="tollCollector != null">toll_collector,
|
</if>
|
<if test="createBy != null">create_by,
|
</if>
|
<if test="createTime != null">create_time,
|
</if>
|
<if test="updateBy != null">update_by,
|
</if>
|
<if test="updateTime != null">update_time,
|
</if>
|
<if test="deleted != null">deleted,
|
</if>
|
<if test="accountBeginTime != null">account_begin_time,
|
</if>
|
<if test="accountEndTime != null">account_end_time,
|
</if>
|
<if test="amountReceived != null">amount_received,
|
</if>
|
<if test="refundAmount != null">refund_amount,
|
</if>
|
<if test="payable != null">payable,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="accountId != null">#{accountId},
|
</if>
|
<if test="tollCollectorId != null">#{tollCollectorId},
|
</if>
|
<if test="tollCollector != null">#{tollCollector},
|
</if>
|
<if test="createBy != null">#{createBy},
|
</if>
|
<if test="createTime != null">#{createTime},
|
</if>
|
<if test="updateBy != null">#{updateBy},
|
</if>
|
<if test="updateTime != null">#{updateTime},
|
</if>
|
<if test="deleted != null">#{deleted},
|
</if>
|
<if test="accountBeginTime != null">#{accountBeginTime},
|
</if>
|
<if test="accountEndTime != null">#{accountEndTime},
|
</if>
|
<if test="amountReceived != null">#{amountReceived},
|
</if>
|
<if test="refundAmount != null">#{refundAmount},
|
</if>
|
<if test="payable != null">#{payable},
|
</if>
|
</trim>
|
</insert>
|
|
<update id="updateTjTollCollector" parameterType="TjTollCollector">
|
update tj_toll_collector
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="accountId != null">account_id =
|
#{accountId},
|
</if>
|
<if test="tollCollectorId != null">toll_collector_id =
|
#{tollCollectorId},
|
</if>
|
<if test="tollCollector != null">toll_collector =
|
#{tollCollector},
|
</if>
|
<if test="createBy != null">create_by =
|
#{createBy},
|
</if>
|
<if test="createTime != null">create_time =
|
#{createTime},
|
</if>
|
<if test="updateBy != null">update_by =
|
#{updateBy},
|
</if>
|
<if test="updateTime != null">update_time =
|
#{updateTime},
|
</if>
|
<if test="deleted != null">deleted =
|
#{deleted},
|
</if>
|
<if test="accountBeginTime != null">account_begin_time =
|
#{accountBeginTime},
|
</if>
|
<if test="accountEndTime != null">account_end_time =
|
#{accountEndTime},
|
</if>
|
<if test="amountReceived != null">amount_received =
|
#{amountReceived},
|
</if>
|
<if test="refundAmount != null">refund_amount =
|
#{refundAmount},
|
</if>
|
<if test="payable != null">payable =
|
#{payable},
|
</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteTjTollCollectorById" parameterType="Long">
|
delete
|
from tj_toll_collector where id = #{id}
|
</delete>
|
|
<delete id="deleteTjTollCollectorByIds" parameterType="String">
|
delete from tj_toll_collector where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
<delete id="deleteTjTollCollectorDetailByAccountIds" parameterType="String">
|
delete from tj_toll_collector_detail where account_id in
|
<foreach item="accountId" collection="array" open="(" separator="," close=")">
|
#{accountId}
|
</foreach>
|
</delete>
|
|
<delete id="deleteTjTollCollectorDetailByAccountId" parameterType="Long">
|
delete
|
from tj_toll_collector_detail where account_id = #{accountId}
|
</delete>
|
|
<insert id="batchTjTollCollectorDetail">
|
insert into tj_toll_collector_detail
|
( id , account_id , pay_type , amount_received , refund_amount , payable , create_by , create_time , update_by , update_time , deleted) values
|
<foreach item="item" index="index" collection="list" separator=",">
|
( #{item.id
|
}, #{item.accountId
|
}, #{item.payType
|
}, #{item.amountReceived
|
}, #{item.refundAmount
|
}, #{item.payable
|
}, #{item.createBy
|
}, #{item.createTime
|
}, #{item.updateBy
|
}, #{item.updateTime
|
}, #{item.deleted
|
})
|
</foreach>
|
</insert>
|
</mapper>
|