240 lines
9.3 KiB
XML
240 lines
9.3 KiB
XML
<?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.zhwl.travelagency.account.mapper.ZdyTravelAgencyAccountBalanceChangesMapper">
|
|
|
|
<resultMap type="ZdyTravelAgencyAccountBalanceChanges" id="ZdyTravelAgencyAccountBalanceChangesResult">
|
|
<result property="id" column="id"/>
|
|
<result property="travelAgencyInfoId" column="travel_agency_info_id"/>
|
|
<result property="operatorType" column="operator_type"/>
|
|
<result property="beforeAdjustmentAmount" column="before_adjustment_amount"/>
|
|
<result property="adjustmentAmount" column="adjustment_amount"/>
|
|
<result property="afterAdjustmentAmount" column="after_adjustment_amount"/>
|
|
<result property="orderNo" column="order_no"/>
|
|
<result property="delFlag" column="del_flag"/>
|
|
<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="remark" column="remark"/>
|
|
</resultMap>
|
|
|
|
<resultMap type="ZdyTravelAgencyAccountBalanceChangesVO" id="ZdyTravelAgencyAccountBalanceChangesResultVO">
|
|
<result property="operatorType" column="operator_type"/>
|
|
<result property="travelAgencyId" column="id"/>
|
|
<result property="travelAgencyName" column="name"/>
|
|
<result property="head" column="head"/>
|
|
<result property="beforeAdjustmentAmount" column="before_adjustment_amount"/>
|
|
<result property="adjustmentAmount" column="adjustment_amount"/>
|
|
<result property="afterAdjustmentAmount" column="after_adjustment_amount"/>
|
|
<result property="applyTime" column="create_time"/>
|
|
<result property="operatorName" column="create_by"/>
|
|
<result property="orderNo" column="order_no"/>
|
|
</resultMap>
|
|
<sql id="selectZdyTravelAgencyAccountBalanceChangesVo">
|
|
select id,
|
|
travel_agency_info_id,
|
|
operator_type,
|
|
before_adjustment_amount,
|
|
adjustment_amount,
|
|
after_adjustment_amount,
|
|
order_no,
|
|
del_flag,
|
|
create_by,
|
|
create_time,
|
|
update_by,
|
|
update_time,
|
|
remark
|
|
from zdy_travel_agency_account_balance_changes
|
|
</sql>
|
|
|
|
<select id="selectZdyTravelAgencyAccountBalanceChangesList" parameterType="ZdyTravelAgencyAccountBalanceChangesDTO"
|
|
resultMap="ZdyTravelAgencyAccountBalanceChangesResultVO">
|
|
select a.id,a.name, a.head
|
|
from zdy_travel_agency_info a
|
|
inner join
|
|
(select travel_agency_info_id
|
|
from zdy_travel_agency_account_balance_changes
|
|
where 1=1 and del_flag = '0'
|
|
<if test="orderNo!=null and orderNo!=''">
|
|
and order_no = #{orderNo}
|
|
</if>
|
|
group by travel_agency_info_id) b
|
|
on a.id = b.travel_agency_info_id
|
|
inner join sys_user c on a.sys_user_id=c.user_id
|
|
<where>
|
|
c.del_flag='0'
|
|
<if test="travelAgencyId != null">
|
|
and id = #{travelAgencyId}
|
|
</if>
|
|
${params.dataScope}
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectZdyTravelAgencyAccountBalanceChangesById" parameterType="Long"
|
|
resultMap="ZdyTravelAgencyAccountBalanceChangesResult">
|
|
<include refid="selectZdyTravelAgencyAccountBalanceChangesVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertZdyTravelAgencyAccountBalanceChanges" parameterType="ZdyTravelAgencyAccountBalanceChanges"
|
|
useGeneratedKeys="true"
|
|
keyProperty="id">
|
|
insert into zdy_travel_agency_account_balance_changes
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="travelAgencyInfoId != null">travel_agency_info_id,
|
|
</if>
|
|
<if test="operatorType != null">operator_type,
|
|
</if>
|
|
<if test="beforeAdjustmentAmount != null">before_adjustment_amount,
|
|
</if>
|
|
<if test="adjustmentAmount != null">adjustment_amount,
|
|
</if>
|
|
<if test="afterAdjustmentAmount != null">after_adjustment_amount,
|
|
</if>
|
|
<if test="orderNo != null">order_no,
|
|
</if>
|
|
<if test="delFlag != null">del_flag,
|
|
</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="remark != null">remark,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="travelAgencyInfoId != null">#{travelAgencyInfoId},
|
|
</if>
|
|
<if test="operatorType != null">#{operatorType},
|
|
</if>
|
|
<if test="beforeAdjustmentAmount != null">#{beforeAdjustmentAmount},
|
|
</if>
|
|
<if test="adjustmentAmount != null">#{adjustmentAmount},
|
|
</if>
|
|
<if test="afterAdjustmentAmount != null">#{afterAdjustmentAmount},
|
|
</if>
|
|
<if test="orderNo != null">#{orderNo},
|
|
</if>
|
|
<if test="delFlag != null">#{delFlag},
|
|
</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="remark != null">#{remark},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateZdyTravelAgencyAccountBalanceChanges" parameterType="ZdyTravelAgencyAccountBalanceChanges">
|
|
update zdy_travel_agency_account_balance_changes
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="travelAgencyInfoId != null">travel_agency_info_id =
|
|
#{travelAgencyInfoId},
|
|
</if>
|
|
<if test="operatorType != null">operator_type =
|
|
#{operatorType},
|
|
</if>
|
|
<if test="beforeAdjustmentAmount != null">before_adjustment_amount =
|
|
#{beforeAdjustmentAmount},
|
|
</if>
|
|
<if test="adjustmentAmount != null">adjustment_amount =
|
|
#{adjustmentAmount},
|
|
</if>
|
|
<if test="afterAdjustmentAmount != null">after_adjustment_amount =
|
|
#{afterAdjustmentAmount},
|
|
</if>
|
|
<if test="orderNo != null">order_no =
|
|
#{orderNo},
|
|
</if>
|
|
<if test="delFlag != null">del_flag =
|
|
#{delFlag},
|
|
</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="remark != null">remark =
|
|
#{remark},
|
|
</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteZdyTravelAgencyAccountBalanceChangesById" parameterType="Long">
|
|
delete
|
|
from zdy_travel_agency_account_balance_changes
|
|
where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteZdyTravelAgencyAccountBalanceChangesByIds" parameterType="String">
|
|
delete from zdy_travel_agency_account_balance_changes where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<select id="selectZdyTravelAgencyAccountBalanceChangesByTravelAgencyId" parameterType="long"
|
|
resultMap="ZdyTravelAgencyAccountBalanceChangesResultVO">
|
|
select a.id,
|
|
a.travel_agency_info_id,
|
|
a.operator_type,
|
|
a.before_adjustment_amount,
|
|
a.adjustment_amount,
|
|
a.after_adjustment_amount,
|
|
a.order_no,
|
|
a.create_by,
|
|
a.create_time,
|
|
b.name,
|
|
b.head
|
|
from zdy_travel_agency_account_balance_changes a
|
|
left join zdy_travel_agency_info b on a.travel_agency_info_id = b.id
|
|
<where>
|
|
a.del_flag = '0'
|
|
<if test="travelAgencyId != null">
|
|
and a.travel_agency_info_id = #{travelAgencyId}
|
|
</if>
|
|
</where>
|
|
order by a.create_time desc
|
|
</select>
|
|
|
|
<select id="selectZdyTravelAgencyAccountBalanceChanges" parameterType="baseEntity"
|
|
resultMap="ZdyTravelAgencyAccountBalanceChangesResultVO">
|
|
select a.id,
|
|
a.travel_agency_info_id,
|
|
a.operator_type,
|
|
a.before_adjustment_amount,
|
|
a.adjustment_amount,
|
|
a.after_adjustment_amount,
|
|
a.order_no,
|
|
a.create_by,
|
|
a.create_time,
|
|
b.name,
|
|
b.head
|
|
from zdy_travel_agency_account_balance_changes a
|
|
left join zdy_travel_agency_info b on a.travel_agency_info_id = b.id
|
|
<where>
|
|
a.del_flag = '0'
|
|
${params.dataScope}
|
|
</where>
|
|
order by a.create_time desc
|
|
</select>
|
|
</mapper> |