emis-service/emis-biz/src/main/resources/mapper/EmisCustomerSettleBillMapper.xml
2024-04-24 13:36:51 +08:00

296 lines
26 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.EmisCustomerSettleBillMapper">
<resultMap type="EmisCustomerSettleBill" id="EmisCustomerSettleBillResult">
<result property="id" column="id" />
<result property="settleBillNo" column="settle_bill_no" />
<result property="settleDateScope" column="settle_date_scope" />
<result property="settleBillMonth" column="settle_bill_month" />
<result property="payStatus" column="pay_status" />
<result property="recMoney" column="rec_money" />
<result property="recedMoney" column="reced_money" />
<result property="userId" column="user_id" />
<result property="customerCode" column="customer_code" />
<result property="customerName" column="customer_name" />
<result property="siteCode" column="site_code" />
<result property="siteName" column="site_name" />
<result property="blConfirm" column="bl_confirm" />
<result property="billCodeDesc" column="bill_code_desc" />
<result property="satisfyMoney" column="satisfy_money" />
<result property="allowanceMoney" column="allowance_money" />
<result property="deductionMoney" column="deduction_money" />
<result property="otherMoney" column="other_money" />
<result property="satisfyReason" column="satisfy_reason" />
<result property="allowanceReason" column="allowance_reason" />
<result property="deductionReason" column="deduction_reason" />
<result property="otherReason" column="other_reason" />
<result property="openBillStatus" column="open_bill_status" />
<result property="blConfirmName" column="bl_confirm_name" />
<result property="sendPieceSum" column="send_piece_sum" />
<result property="pieceNumber" column="piece_number" />
<result property="feeWeight" column="fee_weight" />
<result property="sendMoneySum" column="send_money_sum" />
<result property="monthlyKnotCode" column="monthly_knot_code" />
<result property="uncollectedAmount" column="uncollected_amount" />
<result property="refundAmount" column="refund_amount" />
<result property="createMan" column="create_man" />
<result property="createManCode" column="create_man_code" />
<result property="confirmDate" column="confirm_date" />
<result property="confirmSite" column="confirm_site" />
<result property="unConfirmDate" column="un_confirm_date" />
<result property="unConfirmMan" column="un_confirm_man" />
<result property="unConfirmSite" column="un_confirm_site" />
<result property="refundMoney" column="refund_money" />
<result property="confirmMan" column="confirm_man" />
<result property="createSite" column="create_site" />
<result property="createSiteCode" column="create_site_code" />
<result property="modifySiteCode" column="modify_site_code" />
<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>
<sql id="selectEmisCustomerSettleBillVo">
select id, settle_bill_no, settle_date_scope, settle_bill_month, pay_status, rec_money, reced_money, user_id, customer_code, customer_name, site_code, site_name, bl_confirm, bill_code_desc, satisfy_money, allowance_money, deduction_money, other_money, satisfy_reason, allowance_reason, deduction_reason, other_reason, open_bill_status, bl_confirm_name, send_piece_sum, piece_number, fee_weight, send_money_sum, monthly_knot_code, uncollected_amount, refund_amount, create_man, create_man_code, confirm_date, confirm_site, un_confirm_date, un_confirm_man, un_confirm_site, refund_money, confirm_man, create_site, create_site_code, modify_site_code, del_flag, create_by, create_time, update_by, update_time, remark from emis_customer_settle_bill
</sql>
<select id="selectEmisCustomerSettleBillList" parameterType="EmisCustomerSettleBill" resultMap="EmisCustomerSettleBillResult">
<include refid="selectEmisCustomerSettleBillVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="settleBillNo != null and settleBillNo != ''"> and settle_bill_no like concat('%', #{settleBillNo}, '%')</if>
<if test="settleDateScope != null and settleDateScope != ''"> and settle_date_scope like concat('%', #{settleDateScope}, '%')</if>
<if test="settleBillMonth != null and settleBillMonth != ''"> and settle_bill_month like concat('%', #{settleBillMonth}, '%')</if>
<if test="payStatus != null and payStatus != ''"> and pay_status like concat('%', #{payStatus}, '%')</if>
<if test="recMoney != null and recMoney != ''"> and rec_money like concat('%', #{recMoney}, '%')</if>
<if test="recedMoney != null and recedMoney != ''"> and reced_money like concat('%', #{recedMoney}, '%')</if>
<if test="userId != null and userId != ''"> and user_id like concat('%', #{userId}, '%')</if>
<if test="customerCode != null and customerCode != ''"> and customer_code like concat('%', #{customerCode}, '%')</if>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<if test="siteCode != null and siteCode != ''"> and site_code like concat('%', #{siteCode}, '%')</if>
<if test="siteName != null and siteName != ''"> and site_name like concat('%', #{siteName}, '%')</if>
<if test="blConfirm != null and blConfirm != ''"> and bl_confirm like concat('%', #{blConfirm}, '%')</if>
<if test="billCodeDesc != null and billCodeDesc != ''"> and bill_code_desc like concat('%', #{billCodeDesc}, '%')</if>
<if test="satisfyMoney != null and satisfyMoney != ''"> and satisfy_money like concat('%', #{satisfyMoney}, '%')</if>
<if test="allowanceMoney != null and allowanceMoney != ''"> and allowance_money like concat('%', #{allowanceMoney}, '%')</if>
<if test="deductionMoney != null and deductionMoney != ''"> and deduction_money like concat('%', #{deductionMoney}, '%')</if>
<if test="otherMoney != null and otherMoney != ''"> and other_money like concat('%', #{otherMoney}, '%')</if>
<if test="satisfyReason != null and satisfyReason != ''"> and satisfy_reason like concat('%', #{satisfyReason}, '%')</if>
<if test="allowanceReason != null and allowanceReason != ''"> and allowance_reason like concat('%', #{allowanceReason}, '%')</if>
<if test="deductionReason != null and deductionReason != ''"> and deduction_reason like concat('%', #{deductionReason}, '%')</if>
<if test="otherReason != null and otherReason != ''"> and other_reason like concat('%', #{otherReason}, '%')</if>
<if test="openBillStatus != null and openBillStatus != ''"> and open_bill_status like concat('%', #{openBillStatus}, '%')</if>
<if test="blConfirmName != null and blConfirmName != ''"> and bl_confirm_name like concat('%', #{blConfirmName}, '%')</if>
<if test="sendPieceSum != null and sendPieceSum != ''"> and send_piece_sum like concat('%', #{sendPieceSum}, '%')</if>
<if test="pieceNumber != null and pieceNumber != ''"> and piece_number like concat('%', #{pieceNumber}, '%')</if>
<if test="feeWeight != null and feeWeight != ''"> and fee_weight like concat('%', #{feeWeight}, '%')</if>
<if test="sendMoneySum != null and sendMoneySum != ''"> and send_money_sum like concat('%', #{sendMoneySum}, '%')</if>
<if test="monthlyKnotCode != null and monthlyKnotCode != ''"> and monthly_knot_code like concat('%', #{monthlyKnotCode}, '%')</if>
<if test="uncollectedAmount != null and uncollectedAmount != ''"> and uncollected_amount like concat('%', #{uncollectedAmount}, '%')</if>
<if test="refundAmount != null and refundAmount != ''"> and refund_amount like concat('%', #{refundAmount}, '%')</if>
<if test="createMan != null and createMan != ''"> and create_man like concat('%', #{createMan}, '%')</if>
<if test="createManCode != null and createManCode != ''"> and create_man_code like concat('%', #{createManCode}, '%')</if>
<if test="confirmDate != null and confirmDate != ''"> and confirm_date like concat('%', #{confirmDate}, '%')</if>
<if test="confirmSite != null and confirmSite != ''"> and confirm_site like concat('%', #{confirmSite}, '%')</if>
<if test="unConfirmDate != null and unConfirmDate != ''"> and un_confirm_date like concat('%', #{unConfirmDate}, '%')</if>
<if test="unConfirmMan != null and unConfirmMan != ''"> and un_confirm_man like concat('%', #{unConfirmMan}, '%')</if>
<if test="unConfirmSite != null and unConfirmSite != ''"> and un_confirm_site like concat('%', #{unConfirmSite}, '%')</if>
<if test="refundMoney != null and refundMoney != ''"> and refund_money like concat('%', #{refundMoney}, '%')</if>
<if test="confirmMan != null and confirmMan != ''"> and confirm_man like concat('%', #{confirmMan}, '%')</if>
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
<if test="createSiteCode != null and createSiteCode != ''"> and create_site_code like concat('%', #{createSiteCode}, '%')</if>
<if test="modifySiteCode != null and modifySiteCode != ''"> and modify_site_code like concat('%', #{modifySiteCode}, '%')</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="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
</where>
order by create_time desc
</select>
<select id="selectEmisCustomerSettleBillById" parameterType="Long" resultMap="EmisCustomerSettleBillResult">
select id, settle_bill_no, settle_date_scope, settle_bill_month, pay_status, rec_money, reced_money, user_id, customer_code, customer_name, site_code, site_name, bl_confirm, bill_code_desc, satisfy_money, allowance_money, deduction_money, other_money, satisfy_reason, allowance_reason, deduction_reason, other_reason, open_bill_status, bl_confirm_name, send_piece_sum, piece_number, fee_weight, send_money_sum, monthly_knot_code, uncollected_amount, refund_amount, create_man, create_man_code, confirm_date, confirm_site, un_confirm_date, un_confirm_man, un_confirm_site, refund_money, confirm_man, create_site, create_site_code, modify_site_code, del_flag, create_by, create_time, update_by, update_time, remark
from emis_customer_settle_bill a
where a.id = #{id}
</select>
<insert id="insertEmisCustomerSettleBill" parameterType="EmisCustomerSettleBill">
insert into emis_customer_settle_bill
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="settleBillNo != null and settleBillNo != ''">settle_bill_no,</if>
<if test="settleDateScope != null and settleDateScope != ''">settle_date_scope,</if>
<if test="settleBillMonth != null and settleBillMonth != ''">settle_bill_month,</if>
<if test="payStatus != null and payStatus != ''">pay_status,</if>
<if test="recMoney != null and recMoney != ''">rec_money,</if>
<if test="recedMoney != null and recedMoney != ''">reced_money,</if>
<if test="userId != null and userId != ''">user_id,</if>
<if test="customerCode != null and customerCode != ''">customer_code,</if>
<if test="customerName != null and customerName != ''">customer_name,</if>
<if test="siteCode != null and siteCode != ''">site_code,</if>
<if test="siteName != null and siteName != ''">site_name,</if>
<if test="blConfirm != null and blConfirm != ''">bl_confirm,</if>
<if test="billCodeDesc != null and billCodeDesc != ''">bill_code_desc,</if>
<if test="satisfyMoney != null and satisfyMoney != ''">satisfy_money,</if>
<if test="allowanceMoney != null and allowanceMoney != ''">allowance_money,</if>
<if test="deductionMoney != null and deductionMoney != ''">deduction_money,</if>
<if test="otherMoney != null and otherMoney != ''">other_money,</if>
<if test="satisfyReason != null and satisfyReason != ''">satisfy_reason,</if>
<if test="allowanceReason != null and allowanceReason != ''">allowance_reason,</if>
<if test="deductionReason != null and deductionReason != ''">deduction_reason,</if>
<if test="otherReason != null and otherReason != ''">other_reason,</if>
<if test="openBillStatus != null and openBillStatus != ''">open_bill_status,</if>
<if test="blConfirmName != null and blConfirmName != ''">bl_confirm_name,</if>
<if test="sendPieceSum != null and sendPieceSum != ''">send_piece_sum,</if>
<if test="pieceNumber != null and pieceNumber != ''">piece_number,</if>
<if test="feeWeight != null and feeWeight != ''">fee_weight,</if>
<if test="sendMoneySum != null and sendMoneySum != ''">send_money_sum,</if>
<if test="monthlyKnotCode != null and monthlyKnotCode != ''">monthly_knot_code,</if>
<if test="uncollectedAmount != null and uncollectedAmount != ''">uncollected_amount,</if>
<if test="refundAmount != null and refundAmount != ''">refund_amount,</if>
<if test="createMan != null and createMan != ''">create_man,</if>
<if test="createManCode != null and createManCode != ''">create_man_code,</if>
<if test="confirmDate != null and confirmDate != ''">confirm_date,</if>
<if test="confirmSite != null and confirmSite != ''">confirm_site,</if>
<if test="unConfirmDate != null and unConfirmDate != ''">un_confirm_date,</if>
<if test="unConfirmMan != null and unConfirmMan != ''">un_confirm_man,</if>
<if test="unConfirmSite != null and unConfirmSite != ''">un_confirm_site,</if>
<if test="refundMoney != null and refundMoney != ''">refund_money,</if>
<if test="confirmMan != null and confirmMan != ''">confirm_man,</if>
<if test="createSite != null and createSite != ''">create_site,</if>
<if test="createSiteCode != null and createSiteCode != ''">create_site_code,</if>
<if test="modifySiteCode != null and modifySiteCode != ''">modify_site_code,</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="remark != null and remark != ''">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="settleBillNo != null and settleBillNo != ''">#{settleBillNo},</if>
<if test="settleDateScope != null and settleDateScope != ''">#{settleDateScope},</if>
<if test="settleBillMonth != null and settleBillMonth != ''">#{settleBillMonth},</if>
<if test="payStatus != null and payStatus != ''">#{payStatus},</if>
<if test="recMoney != null and recMoney != ''">#{recMoney},</if>
<if test="recedMoney != null and recedMoney != ''">#{recedMoney},</if>
<if test="userId != null and userId != ''">#{userId},</if>
<if test="customerCode != null and customerCode != ''">#{customerCode},</if>
<if test="customerName != null and customerName != ''">#{customerName},</if>
<if test="siteCode != null and siteCode != ''">#{siteCode},</if>
<if test="siteName != null and siteName != ''">#{siteName},</if>
<if test="blConfirm != null and blConfirm != ''">#{blConfirm},</if>
<if test="billCodeDesc != null and billCodeDesc != ''">#{billCodeDesc},</if>
<if test="satisfyMoney != null and satisfyMoney != ''">#{satisfyMoney},</if>
<if test="allowanceMoney != null and allowanceMoney != ''">#{allowanceMoney},</if>
<if test="deductionMoney != null and deductionMoney != ''">#{deductionMoney},</if>
<if test="otherMoney != null and otherMoney != ''">#{otherMoney},</if>
<if test="satisfyReason != null and satisfyReason != ''">#{satisfyReason},</if>
<if test="allowanceReason != null and allowanceReason != ''">#{allowanceReason},</if>
<if test="deductionReason != null and deductionReason != ''">#{deductionReason},</if>
<if test="otherReason != null and otherReason != ''">#{otherReason},</if>
<if test="openBillStatus != null and openBillStatus != ''">#{openBillStatus},</if>
<if test="blConfirmName != null and blConfirmName != ''">#{blConfirmName},</if>
<if test="sendPieceSum != null and sendPieceSum != ''">#{sendPieceSum},</if>
<if test="pieceNumber != null and pieceNumber != ''">#{pieceNumber},</if>
<if test="feeWeight != null and feeWeight != ''">#{feeWeight},</if>
<if test="sendMoneySum != null and sendMoneySum != ''">#{sendMoneySum},</if>
<if test="monthlyKnotCode != null and monthlyKnotCode != ''">#{monthlyKnotCode},</if>
<if test="uncollectedAmount != null and uncollectedAmount != ''">#{uncollectedAmount},</if>
<if test="refundAmount != null and refundAmount != ''">#{refundAmount},</if>
<if test="createMan != null and createMan != ''">#{createMan},</if>
<if test="createManCode != null and createManCode != ''">#{createManCode},</if>
<if test="confirmDate != null and confirmDate != ''">#{confirmDate},</if>
<if test="confirmSite != null and confirmSite != ''">#{confirmSite},</if>
<if test="unConfirmDate != null and unConfirmDate != ''">#{unConfirmDate},</if>
<if test="unConfirmMan != null and unConfirmMan != ''">#{unConfirmMan},</if>
<if test="unConfirmSite != null and unConfirmSite != ''">#{unConfirmSite},</if>
<if test="refundMoney != null and refundMoney != ''">#{refundMoney},</if>
<if test="confirmMan != null and confirmMan != ''">#{confirmMan},</if>
<if test="createSite != null and createSite != ''">#{createSite},</if>
<if test="createSiteCode != null and createSiteCode != ''">#{createSiteCode},</if>
<if test="modifySiteCode != null and modifySiteCode != ''">#{modifySiteCode},</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="remark != null and remark != ''">#{remark},</if>
</trim>
</insert>
<update id="updateEmisCustomerSettleBill" parameterType="EmisCustomerSettleBill">
update emis_customer_settle_bill
<trim prefix="SET" suffixOverrides=",">
<if test="settleBillNo != null and settleBillNo != ''">settle_bill_no = #{settleBillNo},</if>
<if test="settleDateScope != null and settleDateScope != ''">settle_date_scope = #{settleDateScope},</if>
<if test="settleBillMonth != null and settleBillMonth != ''">settle_bill_month = #{settleBillMonth},</if>
<if test="payStatus != null and payStatus != ''">pay_status = #{payStatus},</if>
<if test="recMoney != null and recMoney != ''">rec_money = #{recMoney},</if>
<if test="recedMoney != null and recedMoney != ''">reced_money = #{recedMoney},</if>
<if test="userId != null and userId != ''">user_id = #{userId},</if>
<if test="customerCode != null and customerCode != ''">customer_code = #{customerCode},</if>
<if test="customerName != null and customerName != ''">customer_name = #{customerName},</if>
<if test="siteCode != null and siteCode != ''">site_code = #{siteCode},</if>
<if test="siteName != null and siteName != ''">site_name = #{siteName},</if>
<if test="blConfirm != null and blConfirm != ''">bl_confirm = #{blConfirm},</if>
<if test="billCodeDesc != null and billCodeDesc != ''">bill_code_desc = #{billCodeDesc},</if>
<if test="satisfyMoney != null and satisfyMoney != ''">satisfy_money = #{satisfyMoney},</if>
<if test="allowanceMoney != null and allowanceMoney != ''">allowance_money = #{allowanceMoney},</if>
<if test="deductionMoney != null and deductionMoney != ''">deduction_money = #{deductionMoney},</if>
<if test="otherMoney != null and otherMoney != ''">other_money = #{otherMoney},</if>
<if test="satisfyReason != null and satisfyReason != ''">satisfy_reason = #{satisfyReason},</if>
<if test="allowanceReason != null and allowanceReason != ''">allowance_reason = #{allowanceReason},</if>
<if test="deductionReason != null and deductionReason != ''">deduction_reason = #{deductionReason},</if>
<if test="otherReason != null and otherReason != ''">other_reason = #{otherReason},</if>
<if test="openBillStatus != null and openBillStatus != ''">open_bill_status = #{openBillStatus},</if>
<if test="blConfirmName != null and blConfirmName != ''">bl_confirm_name = #{blConfirmName},</if>
<if test="sendPieceSum != null and sendPieceSum != ''">send_piece_sum = #{sendPieceSum},</if>
<if test="pieceNumber != null and pieceNumber != ''">piece_number = #{pieceNumber},</if>
<if test="feeWeight != null and feeWeight != ''">fee_weight = #{feeWeight},</if>
<if test="sendMoneySum != null and sendMoneySum != ''">send_money_sum = #{sendMoneySum},</if>
<if test="monthlyKnotCode != null and monthlyKnotCode != ''">monthly_knot_code = #{monthlyKnotCode},</if>
<if test="uncollectedAmount != null and uncollectedAmount != ''">uncollected_amount = #{uncollectedAmount},</if>
<if test="refundAmount != null and refundAmount != ''">refund_amount = #{refundAmount},</if>
<if test="createMan != null and createMan != ''">create_man = #{createMan},</if>
<if test="createManCode != null and createManCode != ''">create_man_code = #{createManCode},</if>
<if test="confirmDate != null and confirmDate != ''">confirm_date = #{confirmDate},</if>
<if test="confirmSite != null and confirmSite != ''">confirm_site = #{confirmSite},</if>
<if test="unConfirmDate != null and unConfirmDate != ''">un_confirm_date = #{unConfirmDate},</if>
<if test="unConfirmMan != null and unConfirmMan != ''">un_confirm_man = #{unConfirmMan},</if>
<if test="unConfirmSite != null and unConfirmSite != ''">un_confirm_site = #{unConfirmSite},</if>
<if test="refundMoney != null and refundMoney != ''">refund_money = #{refundMoney},</if>
<if test="confirmMan != null and confirmMan != ''">confirm_man = #{confirmMan},</if>
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
<if test="createSiteCode != null and createSiteCode != ''">create_site_code = #{createSiteCode},</if>
<if test="modifySiteCode != null and modifySiteCode != ''">modify_site_code = #{modifySiteCode},</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="remark != null and remark != ''">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteEmisCustomerSettleBillById" parameterType="Long">
delete from emis_customer_settle_bill where id = #{id}
</delete>
<delete id="deleteEmisCustomerSettleBillByIds" parameterType="String">
delete from emis_customer_settle_bill where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>