285 lines
20 KiB
XML
285 lines
20 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.xdadan.erp.emis.mapper.EmisCommissionDtlMapper">
|
|
|
|
<resultMap type="EmisCommissionDtl" id="BaseEmisCommissionDtlResult">
|
|
<result property="id" column="id" />
|
|
<result property="feeType" column="fee_type" />
|
|
<result property="money" column="money" />
|
|
<result property="billMonth" column="bill_month" />
|
|
<result property="billType" column="bill_type" />
|
|
<result property="billCode" column="bill_code" />
|
|
<result property="quoteId" column="quote_id" />
|
|
<result property="quoteName" column="quote_name" />
|
|
<result property="exprId" column="expr_id" />
|
|
<result property="calcExpr" column="calc_expr" />
|
|
<result property="feeRemark" column="fee_remark" />
|
|
<result property="empCode" column="emp_code" />
|
|
<result property="empName" column="emp_name" />
|
|
<result property="blConfirmCenter" column="bl_confirm_center" />
|
|
<result property="confirmCenterDate" column="confirm_center_date" />
|
|
<result property="confirmCenterNote" column="confirm_center_note" />
|
|
<result property="confirmCenterManCode" column="confirm_center_man_code" />
|
|
<result property="confirmCenterCode" column="confirm_center_code" />
|
|
<result property="blConfirmSite" column="bl_confirm_site" />
|
|
<result property="confirmSiteDate" column="confirm_site_date" />
|
|
<result property="confirmSiteManCode" column="confirm_site_man_code" />
|
|
<result property="confirmSiteNote" column="confirm_site_note" />
|
|
<result property="confirmSiteCode" column="confirm_site_code" />
|
|
</resultMap>
|
|
|
|
<resultMap id="EmisCommissionDtlResult" type="EmisCommissionDtl" extends="BaseEmisCommissionDtlResult" >
|
|
<association property="waybillDetail"
|
|
column="bill_code"
|
|
select="com.xdadan.erp.emis.mapper.EmisWaybillMapper.selectWaybillBaseInfoByBillCode"
|
|
fetchType="lazy"
|
|
/>
|
|
|
|
</resultMap>
|
|
|
|
<resultMap id="EmisBatchCommissionDtlResult" type="EmisCommissionDtl" extends="BaseEmisCommissionDtlResult" >
|
|
<association property="batchDetail"
|
|
column="bill_code"
|
|
select="com.xdadan.erp.emis.mapper.EmisTmsSiteBatchMapper.selectTmsSiteBatchByBatchNo"
|
|
fetchType="lazy"
|
|
/>
|
|
|
|
</resultMap>
|
|
|
|
<sql id="selectEmisCommissionDtlVo">
|
|
select id, fee_type, money, bill_month, bill_type, bill_code, quote_id, quote_name, expr_id, calc_expr, fee_remark, emp_code, emp_name, bl_confirm_center, confirm_center_date, confirm_center_note, confirm_center_man_code, confirm_center_code, bl_confirm_site, confirm_site_date, confirm_site_man_code, confirm_site_note, confirm_site_code, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_commission_dtl
|
|
</sql>
|
|
|
|
<select id="selectEmisCommissionDtlList" parameterType="EmisCommissionDtl" resultMap="EmisCommissionDtlResult">
|
|
<include refid="selectEmisCommissionDtlVo"/>
|
|
<where>
|
|
del_flag='0' and bill_type='1'
|
|
<if test="id != null "> and id = #{id}</if>
|
|
<if test="feeType != null and feeType != ''"> and fee_type=#{feeType}</if>
|
|
<if test="money != null "> and money = #{money}</if>
|
|
<if test="billMonth != null and billMonth != ''"> and bill_month=#{billMonth} </if>
|
|
<if test="billCode != null and billCode != ''"> and ( FIND_IN_SET(bill_code,#{billCode}) or bill_code like concat('%', #{billCode}, '%') )</if>
|
|
<if test="feeRemark != null and feeRemark != ''"> and fee_remark like concat('%', #{feeRemark}, '%')</if>
|
|
<if test="empCode != null and empCode != ''"> and emp_code=#{empCode}</if>
|
|
<if test="empName != null and empName != ''"> and emp_name=#{empName}</if>
|
|
<if test="blConfirmCenter != null and blConfirmCenter != ''"> and bl_confirm_center=#{blConfirmCenter}</if>
|
|
<if test="confirmCenterDate != null "> and confirm_center_date = #{confirmCenterDate}</if>
|
|
<if test="confirmCenterNote != null and confirmCenterNote != ''"> and confirm_center_note like concat('%', #{confirmCenterNote}, '%')</if>
|
|
<if test="confirmCenterManCode != null and confirmCenterManCode != ''"> and confirm_center_man_code= #{confirmCenterManCode}</if>
|
|
<if test="confirmCenterCode != null and confirmCenterCode != ''"> and confirm_center_code=#{confirmCenterCode}</if>
|
|
<if test="blConfirmSite != null and blConfirmSite != ''"> and bl_confirm_site=#{blConfirmSite}</if>
|
|
<if test="confirmSiteDate != null "> and confirm_site_date = #{confirmSiteDate}</if>
|
|
<if test="confirmSiteManCode != null and confirmSiteManCode != ''"> and confirm_site_man_code=#{confirmSiteManCode}</if>
|
|
<if test="confirmSiteNote != null and confirmSiteNote != ''"> and confirm_site_note like concat('%', #{confirmSiteNote}, '%')</if>
|
|
<if test="confirmSiteCode != null and confirmSiteCode != ''"> and confirm_site_code=#{confirmSiteCode}</if>
|
|
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
|
|
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
|
|
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
|
|
<if test="createTime != null "> and create_time = #{createTime}</if>
|
|
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
|
|
<if test="updateTime != null "> and update_time = #{updateTime}</if>
|
|
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
|
|
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
|
|
</where>
|
|
order by create_time desc
|
|
</select>
|
|
|
|
|
|
<select id="selectBatchCommissionDtlList" parameterType="EmisCommissionDtl" resultMap="EmisBatchCommissionDtlResult">
|
|
<include refid="selectEmisCommissionDtlVo"/>
|
|
<where>
|
|
del_flag='0' and bill_type='2'
|
|
<if test="id != null "> and id = #{id}</if>
|
|
<if test="feeType != null and feeType != ''"> and fee_type=#{feeType}</if>
|
|
<if test="money != null "> and money = #{money}</if>
|
|
<if test="billMonth != null and billMonth != ''"> and bill_month=#{billMonth} </if>
|
|
<if test="billCode != null and billCode != ''"> and ( FIND_IN_SET(bill_code,#{billCode}) or bill_code like concat('%', #{billCode}, '%') )</if>
|
|
<if test="feeRemark != null and feeRemark != ''"> and fee_remark like concat('%', #{feeRemark}, '%')</if>
|
|
<if test="empCode != null and empCode != ''"> and emp_code=#{empCode}</if>
|
|
<if test="empName != null and empName != ''"> and emp_name=#{empName}</if>
|
|
<if test="blConfirmCenter != null and blConfirmCenter != ''"> and bl_confirm_center=#{blConfirmCenter}</if>
|
|
<if test="confirmCenterDate != null "> and confirm_center_date = #{confirmCenterDate}</if>
|
|
<if test="confirmCenterNote != null and confirmCenterNote != ''"> and confirm_center_note like concat('%', #{confirmCenterNote}, '%')</if>
|
|
<if test="confirmCenterManCode != null and confirmCenterManCode != ''"> and confirm_center_man_code= #{confirmCenterManCode}</if>
|
|
<if test="confirmCenterCode != null and confirmCenterCode != ''"> and confirm_center_code=#{confirmCenterCode}</if>
|
|
<if test="blConfirmSite != null and blConfirmSite != ''"> and bl_confirm_site=#{blConfirmSite}</if>
|
|
<if test="confirmSiteDate != null "> and confirm_site_date = #{confirmSiteDate}</if>
|
|
<if test="confirmSiteManCode != null and confirmSiteManCode != ''"> and confirm_site_man_code=#{confirmSiteManCode}</if>
|
|
<if test="confirmSiteNote != null and confirmSiteNote != ''"> and confirm_site_note like concat('%', #{confirmSiteNote}, '%')</if>
|
|
<if test="confirmSiteCode != null and confirmSiteCode != ''"> and confirm_site_code=#{confirmSiteCode}</if>
|
|
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
|
|
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
|
|
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
|
|
<if test="createTime != null "> and create_time = #{createTime}</if>
|
|
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
|
|
<if test="updateTime != null "> and update_time = #{updateTime}</if>
|
|
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
|
|
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
|
|
</where>
|
|
order by create_time desc
|
|
</select>
|
|
|
|
<select id="checkUnique" parameterType="EmisCommissionDtl" resultType="int">
|
|
select count(1) from emis_commission_dtl
|
|
where del_flag='0'
|
|
and id = #{id}
|
|
and fee_type = #{feeType}
|
|
and money = #{money}
|
|
and bill_month = #{billMonth}
|
|
and bill_code = #{billCode}
|
|
and fee_remark = #{feeRemark}
|
|
and emp_code = #{empCode}
|
|
and emp_name = #{empName}
|
|
and bl_confirm_center = #{blConfirmCenter}
|
|
and confirm_center_date = #{confirmCenterDate}
|
|
and confirm_center_note = #{confirmCenterNote}
|
|
and confirm_center_man_code = #{confirmCenterManCode}
|
|
and confirm_center_code = #{confirmCenterCode}
|
|
and bl_confirm_site = #{blConfirmSite}
|
|
and confirm_site_date = #{confirmSiteDate}
|
|
and confirm_site_man_code = #{confirmSiteManCode}
|
|
and confirm_site_note = #{confirmSiteNote}
|
|
and confirm_site_code = #{confirmSiteCode}
|
|
and remark = #{remark}
|
|
and del_flag = #{delFlag}
|
|
and create_by = #{createBy}
|
|
and create_time = #{createTime}
|
|
and update_by = #{updateBy}
|
|
and update_time = #{updateTime}
|
|
and create_site = #{createSite}
|
|
and update_site = #{updateSite}
|
|
limit 1
|
|
</select>
|
|
|
|
<select id="selectEmisCommissionDtlById" parameterType="Long" resultMap="EmisCommissionDtlResult">
|
|
select id, fee_type, money, bill_month, bill_type, bill_code, quote_id, quote_name, expr_id, calc_expr, fee_remark, emp_code, emp_name, bl_confirm_center, confirm_center_date, confirm_center_note, confirm_center_man_code, confirm_center_code, bl_confirm_site, confirm_site_date, confirm_site_man_code, confirm_site_note, confirm_site_code, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
|
|
from emis_commission_dtl a
|
|
where a.id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertEmisCommissionDtl" parameterType="EmisCommissionDtl" useGeneratedKeys="true" keyProperty="id">
|
|
insert into emis_commission_dtl
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="feeType != null and feeType != ''">fee_type,</if>
|
|
<if test="money != null">money,</if>
|
|
<if test="billMonth != null and billMonth != ''">bill_month,</if>
|
|
<if test="billType != null and billType != ''">bill_type,</if>
|
|
<if test="billCode != null and billCode != ''">bill_code,</if>
|
|
<if test="quoteId != null">quote_id,</if>
|
|
<if test="quoteName != null and quoteName != ''">quote_name,</if>
|
|
<if test="exprId != null">expr_id,</if>
|
|
<if test="calcExpr != null and calcExpr != ''">calc_expr,</if>
|
|
<if test="feeRemark != null and feeRemark != ''">fee_remark,</if>
|
|
<if test="empCode != null and empCode != ''">emp_code,</if>
|
|
<if test="empName != null and empName != ''">emp_name,</if>
|
|
<if test="blConfirmCenter != null and blConfirmCenter != ''">bl_confirm_center,</if>
|
|
<if test="confirmCenterDate != null">confirm_center_date,</if>
|
|
<if test="confirmCenterNote != null and confirmCenterNote != ''">confirm_center_note,</if>
|
|
<if test="confirmCenterManCode != null and confirmCenterManCode != ''">confirm_center_man_code,</if>
|
|
<if test="confirmCenterCode != null and confirmCenterCode != ''">confirm_center_code,</if>
|
|
<if test="blConfirmSite != null and blConfirmSite != ''">bl_confirm_site,</if>
|
|
<if test="confirmSiteDate != null">confirm_site_date,</if>
|
|
<if test="confirmSiteManCode != null and confirmSiteManCode != ''">confirm_site_man_code,</if>
|
|
<if test="confirmSiteNote != null and confirmSiteNote != ''">confirm_site_note,</if>
|
|
<if test="confirmSiteCode != null and confirmSiteCode != ''">confirm_site_code,</if>
|
|
<if test="remark != null and remark != ''">remark,</if>
|
|
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="createSite != null and createSite != ''">create_site,</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="feeType != null and feeType != ''">#{feeType},</if>
|
|
<if test="money != null">#{money},</if>
|
|
<if test="billMonth != null and billMonth != ''">#{billMonth},</if>
|
|
<if test="billType != null and billType != ''">#{billType},</if>
|
|
<if test="billCode != null and billCode != ''">#{billCode},</if>
|
|
<if test="quoteId != null">#{quoteId},</if>
|
|
<if test="quoteName != null and quoteName != ''">#{quoteName},</if>
|
|
<if test="exprId != null">#{exprId},</if>
|
|
<if test="calcExpr != null and calcExpr != ''">#{calcExpr},</if>
|
|
<if test="feeRemark != null and feeRemark != ''">#{feeRemark},</if>
|
|
<if test="empCode != null and empCode != ''">#{empCode},</if>
|
|
<if test="empName != null and empName != ''">#{empName},</if>
|
|
<if test="blConfirmCenter != null and blConfirmCenter != ''">#{blConfirmCenter},</if>
|
|
<if test="confirmCenterDate != null">#{confirmCenterDate},</if>
|
|
<if test="confirmCenterNote != null and confirmCenterNote != ''">#{confirmCenterNote},</if>
|
|
<if test="confirmCenterManCode != null and confirmCenterManCode != ''">#{confirmCenterManCode},</if>
|
|
<if test="confirmCenterCode != null and confirmCenterCode != ''">#{confirmCenterCode},</if>
|
|
<if test="blConfirmSite != null and blConfirmSite != ''">#{blConfirmSite},</if>
|
|
<if test="confirmSiteDate != null">#{confirmSiteDate},</if>
|
|
<if test="confirmSiteManCode != null and confirmSiteManCode != ''">#{confirmSiteManCode},</if>
|
|
<if test="confirmSiteNote != null and confirmSiteNote != ''">#{confirmSiteNote},</if>
|
|
<if test="confirmSiteCode != null and confirmSiteCode != ''">#{confirmSiteCode},</if>
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
|
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="createSite != null and createSite != ''">#{createSite},</if>
|
|
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateEmisCommissionDtl" parameterType="EmisCommissionDtl">
|
|
update emis_commission_dtl
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="feeType != null and feeType != ''">fee_type = #{feeType},</if>
|
|
<if test="money != null">money = #{money},</if>
|
|
<if test="billMonth != null and billMonth != ''">bill_month = #{billMonth},</if>
|
|
<if test="billType != null and billType != ''">bill_type = #{billType},</if>
|
|
<if test="billCode != null and billCode != ''">bill_code = #{billCode},</if>
|
|
<if test="quoteId != null">quote_id = #{quoteId},</if>
|
|
<if test="quoteName != null and quoteName != ''">quote_name = #{quoteName},</if>
|
|
<if test="exprId != null">expr_id = #{exprId},</if>
|
|
<if test="calcExpr != null and calcExpr != ''">calc_expr = #{calcExpr},</if>
|
|
<if test="feeRemark != null and feeRemark != ''">fee_remark = #{feeRemark},</if>
|
|
<if test="empCode != null and empCode != ''">emp_code = #{empCode},</if>
|
|
<if test="empName != null and empName != ''">emp_name = #{empName},</if>
|
|
<if test="blConfirmCenter != null and blConfirmCenter != ''">bl_confirm_center = #{blConfirmCenter},</if>
|
|
<if test="confirmCenterDate != null">confirm_center_date = #{confirmCenterDate},</if>
|
|
<if test="confirmCenterNote != null and confirmCenterNote != ''">confirm_center_note = #{confirmCenterNote},</if>
|
|
<if test="confirmCenterManCode != null and confirmCenterManCode != ''">confirm_center_man_code = #{confirmCenterManCode},</if>
|
|
<if test="confirmCenterCode != null and confirmCenterCode != ''">confirm_center_code = #{confirmCenterCode},</if>
|
|
<if test="blConfirmSite != null and blConfirmSite != ''">bl_confirm_site = #{blConfirmSite},</if>
|
|
<if test="confirmSiteDate != null">confirm_site_date = #{confirmSiteDate},</if>
|
|
<if test="confirmSiteManCode != null and confirmSiteManCode != ''">confirm_site_man_code = #{confirmSiteManCode},</if>
|
|
<if test="confirmSiteNote != null and confirmSiteNote != ''">confirm_site_note = #{confirmSiteNote},</if>
|
|
<if test="confirmSiteCode != null and confirmSiteCode != ''">confirm_site_code = #{confirmSiteCode},</if>
|
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
|
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
|
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteEmisCommissionDtlByBillCode" parameterType="String">
|
|
update emis_commission_dtl set del_flag='1' where bill_code = #{billCode} and bill_type='1'
|
|
</delete>
|
|
|
|
<delete id="deleteEmisCommissionDtlByBatchNo" parameterType="String">
|
|
update emis_commission_dtl set del_flag='1' where bill_code = #{batchNo} and bill_type='2'
|
|
</delete>
|
|
|
|
<delete id="deleteEmisCommissionDtlById" parameterType="Long">
|
|
update emis_commission_dtl set del_flag='1' where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteEmisCommissionDtlByIds" parameterType="String">
|
|
update emis_commission_dtl set del_flag='1' where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |