555 lines
31 KiB
XML
555 lines
31 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.EmisSettleSubBillMapper">
|
|
|
|
<resultMap type="EmisSettleSubBill" id="BaseEmisSettleSubBillResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
|
|
<result property="id" column="id" />
|
|
<result property="billNo" column="bill_no" />
|
|
<result property="parentBillNo" column="parent_bill_no" />
|
|
<result property="settleBillNo" column="settle_bill_no" />
|
|
<result property="billCode" column="bill_code" />
|
|
<result property="billDate" column="bill_date" />
|
|
<result property="billFee" column="bill_fee" />
|
|
<result property="currency" column="currency" />
|
|
<result property="settleType" column="settle_type" />
|
|
<result property="blSplit" column="bl_split" />
|
|
<result property="billMonth" column="bill_month" />
|
|
<result property="custNo" column="cust_no" />
|
|
<result property="customerCode" column="customer_code" />
|
|
<result property="customerName" column="customer_name" />
|
|
<result property="blConfirm" column="bl_confirm" />
|
|
<result property="confirmDate" column="confirm_date" />
|
|
<result property="confirmSite" column="confirm_site" />
|
|
<result property="confirmManCode" column="confirm_man_code" />
|
|
<result property="blSiteConfirm" column="bl_site_confirm" />
|
|
<result property="confirmNote" column="confirm_note" />
|
|
<result property="siteConfirmDate" column="site_confirm_date" />
|
|
<result property="siteConfirmManCode" column="site_confirm_man_code" />
|
|
<result property="siteConfirmNote" column="site_confirm_note" />
|
|
|
|
|
|
</resultMap>
|
|
|
|
<resultMap id="EmisSettleSubBillResult" type="EmisSettleSubBill" extends="BaseEmisSettleSubBillResult" >
|
|
<association property="waybillDetail"
|
|
column="bill_code"
|
|
select="com.xdadan.erp.emis.mapper.EmisWaybillMapper.selectWaybillBaseInfoByBillCode"
|
|
fetchType="lazy"
|
|
/>
|
|
|
|
<association property="feeitemList"
|
|
column="bill_no"
|
|
select="com.xdadan.erp.emis.mapper.EmisSettleSubBillFeeitemMapper.selectFeeitemListBySubBillNo"
|
|
fetchType="lazy"
|
|
/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectEmisSettleSubBillVo">
|
|
select id, bill_no, parent_bill_no, settle_bill_no, bill_code, bill_date, bill_fee, currency, settle_type, bl_split, bill_month, cust_no, customer_code, customer_name, bl_confirm, confirm_date, confirm_site, confirm_man_code, bl_site_confirm, confirm_note, site_confirm_date, site_confirm_man_code, site_confirm_note, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_settle_sub_bill
|
|
</sql>
|
|
|
|
<select id="selectEmisSettleSubBillList" parameterType="EmisSettleSubBill" resultMap="EmisSettleSubBillResult">
|
|
select b.id, b.bill_no, b.parent_bill_no, b.settle_bill_no,
|
|
b.bill_code, b.bill_date, b.bill_fee, b.currency, b.settle_type,
|
|
b.bl_split, b.bill_month, b.cust_no, b.customer_code, b.customer_name,
|
|
b.bl_confirm, b.confirm_date, b.confirm_site, b.confirm_man_code,
|
|
b.bl_site_confirm, b.confirm_note, b.site_confirm_date, b.site_confirm_man_code,
|
|
b.site_confirm_note, b.del_flag, b.create_by, b.create_time, b.update_by,
|
|
b.update_time, b.create_site, b.update_site
|
|
from emis_settle_sub_bill b ,emis_waybill a
|
|
|
|
<where>
|
|
a.bill_code=b.bill_code and a.del_flag='0' and b.del_flag='0'
|
|
<if test="id != null "> and b.id = #{id}</if>
|
|
<if test="billNo != null and billNo != ''"> and FIND_IN_SET(b.`bill_no`,#{billNo}) </if>
|
|
<if test="parentBillNo != null and parentBillNo != ''"> and b.parent_bill_no=#{parentBillNo}</if>
|
|
<if test="settleBillNo != null and settleBillNo != ''"> and b.settle_bill_no=#{settleBillNo}</if>
|
|
<if test="billCode != null and billCode != ''"> and ( FIND_IN_SET(b.`bill_code`,#{billCode}) or b.bill_code like concat('%', #{billCode}, '%') ) </if>
|
|
|
|
<if test="billDate != null "> and bill_date = #{billDate}</if>
|
|
<if test="billFee != null "> and bill_fee = #{billFee}</if>
|
|
<if test="currency != null and currency != ''"> and currency= #{currency}</if>
|
|
<if test="settleType != null and settleType != ''"> and settle_type=#{settleType}</if>
|
|
<if test="blSplit != null and blSplit != ''"> and bl_split=#{blSplit}</if>
|
|
<if test="billMonth != null and billMonth != ''"> and bill_month=#{billMonth}</if>
|
|
<if test="custNo != null and custNo != ''"> and cust_no=#{custNo}</if>
|
|
<if test="customerCode != null and customerCode != ''"> and customer_code=#{customerCode}</if>
|
|
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
|
|
<if test="blConfirm != null and blConfirm != ''"> and bl_confirm=#{blConfirm}</if>
|
|
<if test="confirmDate != null and confirmDate != ''"> and confirm_date like concat('%', #{confirmDate}, '%')</if>
|
|
<if test="confirmSite != null and confirmSite != ''"> and confirm_site=#{confirmSite}</if>
|
|
<if test="confirmManCode != null and confirmManCode != ''"> and confirm_man_code= #{confirmManCode}</if>
|
|
<if test="blSiteConfirm != null and blSiteConfirm != ''"> and bl_site_confirm=#{blSiteConfirm}</if>
|
|
<if test="confirmNote != null and confirmNote != ''"> and confirm_note like concat('%', #{confirmNote}, '%')</if>
|
|
<if test="siteConfirmDate != null and siteConfirmDate != ''"> and site_confirm_date like concat('%', #{siteConfirmDate}, '%')</if>
|
|
<if test="siteConfirmManCode != null and siteConfirmManCode != ''"> and site_confirm_man_code=#{siteConfirmManCode}</if>
|
|
<if test="siteConfirmNote != null and siteConfirmNote != ''"> and site_confirm_note like concat('%', #{siteConfirmNote}, '%')</if>
|
|
|
|
<if test="params.sendSiteCode != null and params.sendSiteCode != ''">
|
|
and a.send_site_code = #{params.sendSiteCode}
|
|
</if>
|
|
|
|
<if test="params.dispatchUnderlingSiteCode != null and params.dispatchUnderlingSiteCode != ''">
|
|
and a.dispatch_underling_site_code = #{params.dispatchUnderlingSiteCode}
|
|
</if>
|
|
|
|
<if test="params.payee != null and params.payee != ''">
|
|
and a.payee = #{params.payee}
|
|
</if>
|
|
|
|
<if test="params.salesmen != null and params.salesmen != ''">
|
|
and a.salesmen = #{params.salesmen}
|
|
</if>
|
|
|
|
|
|
<if test="params.salesmen != null and params.salesmen != ''">
|
|
and a.salesmen = #{params.salesmen}
|
|
</if>
|
|
|
|
<if test="params.paymentType != null and params.paymentType != ''">
|
|
and a.payment_type = #{params.paymentType}
|
|
</if>
|
|
|
|
|
|
<if test="params.beginSendDate != null and params.beginSendDate != ''">
|
|
and a.send_date <![CDATA[ >= ]]> #{params.beginSendDate}
|
|
</if>
|
|
<if test="params.endSendDate != null and params.endSendDate != ''">
|
|
and a.send_date <![CDATA[ <= ]]> #{params.endSendDate}
|
|
</if>
|
|
|
|
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
|
|
and (
|
|
a.send_site_code in (
|
|
SELECT t1.site_code FROM (
|
|
SELECT * FROM emis_site WHERE parent_site_code IS NOT NULL ) t1,( SELECT @pid :=
|
|
#{params.privSiteCode} ) pd
|
|
WHERE FIND_IN_SET( parent_site_code, @pid ) > 0 AND @pid := concat(@pid,',',site_code)
|
|
UNION
|
|
SELECT #{params.privSiteCode} FROM dual
|
|
)
|
|
or
|
|
a.dispatch_site_code in (
|
|
SELECT t1.site_code FROM (
|
|
SELECT * FROM emis_site WHERE parent_site_code IS NOT NULL ) t1,( SELECT @pid :=
|
|
#{params.privSiteCode} ) pd
|
|
WHERE FIND_IN_SET( parent_site_code, @pid ) > 0 AND @pid := concat(@pid,',',site_code)
|
|
UNION
|
|
SELECT #{params.privSiteCode} FROM dual
|
|
)
|
|
or
|
|
a.sign_site_code in (
|
|
SELECT t1.site_code FROM (
|
|
SELECT * FROM emis_site WHERE parent_site_code IS NOT NULL ) t1,( SELECT @pid :=
|
|
#{params.privSiteCode} ) pd
|
|
WHERE FIND_IN_SET( parent_site_code, @pid ) > 0 AND @pid := concat(@pid,',',site_code)
|
|
UNION
|
|
SELECT #{params.privSiteCode} FROM dual
|
|
)
|
|
or a.salesmen=#{params.privEmpName}
|
|
or a.payee=#{params.privEmpName}
|
|
)
|
|
</if>
|
|
|
|
</where>
|
|
order by b.create_time desc
|
|
</select>
|
|
|
|
|
|
<select id="getQueryStatInfoMap" parameterType="EmisSettleSubBill" resultType="map">
|
|
select
|
|
count(distinct a.bill_code) as totalNum,
|
|
round(sum(b.bill_fee),2) as totalBillFee
|
|
from emis_settle_sub_bill b ,emis_waybill a
|
|
<where>
|
|
a.bill_code=b.bill_code and a.del_flag='0' and b.del_flag='0'
|
|
<if test="id != null "> and b.id = #{id}</if>
|
|
<if test="billNo != null and billNo != ''"> and FIND_IN_SET(b.`bill_no`,#{billNo}) </if>
|
|
<if test="parentBillNo != null and parentBillNo != ''"> and b.parent_bill_no=#{parentBillNo}</if>
|
|
<if test="settleBillNo != null and settleBillNo != ''"> and b.settle_bill_no=#{settleBillNo}</if>
|
|
<if test="billCode != null and billCode != ''"> and ( FIND_IN_SET(b.`bill_code`,#{billCode}) or b.bill_code like concat('%', #{billCode}, '%') ) </if>
|
|
|
|
<if test="billDate != null "> and bill_date = #{billDate}</if>
|
|
<if test="billFee != null "> and bill_fee = #{billFee}</if>
|
|
<if test="currency != null and currency != ''"> and currency= #{currency}</if>
|
|
<if test="settleType != null and settleType != ''"> and settle_type=#{settleType}</if>
|
|
<if test="blSplit != null and blSplit != ''"> and bl_split=#{blSplit}</if>
|
|
<if test="billMonth != null and billMonth != ''"> and bill_month=#{billMonth}</if>
|
|
<if test="custNo != null and custNo != ''"> and cust_no=#{custNo}</if>
|
|
<if test="customerCode != null and customerCode != ''"> and customer_code=#{customerCode}</if>
|
|
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
|
|
<if test="blConfirm != null and blConfirm != ''"> and bl_confirm=#{blConfirm}</if>
|
|
<if test="confirmDate != null and confirmDate != ''"> and confirm_date like concat('%', #{confirmDate}, '%')</if>
|
|
<if test="confirmSite != null and confirmSite != ''"> and confirm_site=#{confirmSite}</if>
|
|
<if test="confirmManCode != null and confirmManCode != ''"> and confirm_man_code= #{confirmManCode}</if>
|
|
<if test="blSiteConfirm != null and blSiteConfirm != ''"> and bl_site_confirm=#{blSiteConfirm}</if>
|
|
<if test="confirmNote != null and confirmNote != ''"> and confirm_note like concat('%', #{confirmNote}, '%')</if>
|
|
<if test="siteConfirmDate != null and siteConfirmDate != ''"> and site_confirm_date like concat('%', #{siteConfirmDate}, '%')</if>
|
|
<if test="siteConfirmManCode != null and siteConfirmManCode != ''"> and site_confirm_man_code=#{siteConfirmManCode}</if>
|
|
<if test="siteConfirmNote != null and siteConfirmNote != ''"> and site_confirm_note like concat('%', #{siteConfirmNote}, '%')</if>
|
|
|
|
<if test="params.sendSiteCode != null and params.sendSiteCode != ''">
|
|
and a.send_site_code = #{params.sendSiteCode}
|
|
</if>
|
|
|
|
<if test="params.dispatchUnderlingSiteCode != null and params.dispatchUnderlingSiteCode != ''">
|
|
and a.dispatch_underling_site_code = #{params.dispatchUnderlingSiteCode}
|
|
</if>
|
|
|
|
<if test="params.payee != null and params.payee != ''">
|
|
and a.payee = #{params.payee}
|
|
</if>
|
|
|
|
<if test="params.salesmen != null and params.salesmen != ''">
|
|
and a.salesmen = #{params.salesmen}
|
|
</if>
|
|
|
|
|
|
<if test="params.salesmen != null and params.salesmen != ''">
|
|
and a.salesmen = #{params.salesmen}
|
|
</if>
|
|
|
|
<if test="params.paymentType != null and params.paymentType != ''">
|
|
and a.payment_type = #{params.paymentType}
|
|
</if>
|
|
|
|
|
|
<if test="params.beginSendDate != null and params.beginSendDate != ''">
|
|
and a.send_date <![CDATA[ >= ]]> #{params.beginSendDate}
|
|
</if>
|
|
<if test="params.endSendDate != null and params.endSendDate != ''">
|
|
and a.send_date <![CDATA[ <= ]]> #{params.endSendDate}
|
|
</if>
|
|
|
|
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
|
|
and (
|
|
a.send_site_code in (
|
|
SELECT t1.site_code FROM (
|
|
SELECT * FROM emis_site WHERE parent_site_code IS NOT NULL ) t1,( SELECT @pid :=
|
|
#{params.privSiteCode} ) pd
|
|
WHERE FIND_IN_SET( parent_site_code, @pid ) > 0 AND @pid := concat(@pid,',',site_code)
|
|
UNION
|
|
SELECT #{params.privSiteCode} FROM dual
|
|
)
|
|
or
|
|
a.dispatch_site_code in (
|
|
SELECT t1.site_code FROM (
|
|
SELECT * FROM emis_site WHERE parent_site_code IS NOT NULL ) t1,( SELECT @pid :=
|
|
#{params.privSiteCode} ) pd
|
|
WHERE FIND_IN_SET( parent_site_code, @pid ) > 0 AND @pid := concat(@pid,',',site_code)
|
|
UNION
|
|
SELECT #{params.privSiteCode} FROM dual
|
|
)
|
|
or
|
|
a.sign_site_code in (
|
|
SELECT t1.site_code FROM (
|
|
SELECT * FROM emis_site WHERE parent_site_code IS NOT NULL ) t1,( SELECT @pid :=
|
|
#{params.privSiteCode} ) pd
|
|
WHERE FIND_IN_SET( parent_site_code, @pid ) > 0 AND @pid := concat(@pid,',',site_code)
|
|
UNION
|
|
SELECT #{params.privSiteCode} FROM dual
|
|
)
|
|
or a.salesmen=#{params.privEmpName}
|
|
or a.payee=#{params.privEmpName}
|
|
)
|
|
</if>
|
|
|
|
</where>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="checkUnique" parameterType="EmisSettleSubBill" resultType="int">
|
|
select count(1) from emis_settle_sub_bill
|
|
where del_flag='0'
|
|
and id = #{id}
|
|
and bill_no = #{billNo}
|
|
and parent_bill_no = #{parentBillNo}
|
|
and settle_bill_no = #{settleBillNo}
|
|
and bill_code = #{billCode}
|
|
and bill_date = #{billDate}
|
|
and bill_fee = #{billFee}
|
|
and currency = #{currency}
|
|
and settle_type = #{settleType}
|
|
and bl_split = #{blSplit}
|
|
and bill_month = #{billMonth}
|
|
and cust_no = #{custNo}
|
|
and customer_code = #{customerCode}
|
|
and customer_name = #{customerName}
|
|
and bl_confirm = #{blConfirm}
|
|
and confirm_date = #{confirmDate}
|
|
and confirm_site = #{confirmSite}
|
|
and confirm_man_code = #{confirmManCode}
|
|
and bl_site_confirm = #{blSiteConfirm}
|
|
and confirm_note = #{confirmNote}
|
|
and site_confirm_date = #{siteConfirmDate}
|
|
and site_confirm_man_code = #{siteConfirmManCode}
|
|
and site_confirm_note = #{siteConfirmNote}
|
|
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="selectEmisSettleSubBillById" parameterType="Long" resultMap="EmisSettleSubBillResult">
|
|
select id, bill_no, parent_bill_no, settle_bill_no, bill_code, bill_date, bill_fee, currency, settle_type, bl_split, bill_month, cust_no, customer_code, customer_name, bl_confirm, confirm_date, confirm_site, confirm_man_code, bl_site_confirm, confirm_note, site_confirm_date, site_confirm_man_code, site_confirm_note, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
|
|
from emis_settle_sub_bill a
|
|
where a.id = #{id}
|
|
</select>
|
|
|
|
<select id="selectSettleSubBillByBillCode" parameterType="String" resultMap="EmisSettleSubBillResult">
|
|
select id, bill_no, parent_bill_no, settle_bill_no, bill_code, bill_date, bill_fee, currency, settle_type, bl_split, bill_month, cust_no, customer_code, customer_name, bl_confirm, confirm_date, confirm_site, confirm_man_code, bl_site_confirm, confirm_note, site_confirm_date, site_confirm_man_code, site_confirm_note, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
|
|
from emis_settle_sub_bill a
|
|
where a.del_flag='0' and a.bill_code = #{billCode} and a.parent_bill_no='0' limit 1
|
|
</select>
|
|
|
|
<insert id="insertEmisSettleSubBill" parameterType="EmisSettleSubBill" useGeneratedKeys="true" keyProperty="id">
|
|
insert into emis_settle_sub_bill
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">id,</if>
|
|
<if test="billNo != null and billNo != ''">bill_no,</if>
|
|
<if test="parentBillNo != null and parentBillNo != ''">parent_bill_no,</if>
|
|
<if test="settleBillNo != null and settleBillNo != ''">settle_bill_no,</if>
|
|
<if test="billCode != null and billCode != ''">bill_code,</if>
|
|
<if test="billDate != null">bill_date,</if>
|
|
<if test="billFee != null">bill_fee,</if>
|
|
<if test="currency != null and currency != ''">currency,</if>
|
|
<if test="settleType != null and settleType != ''">settle_type,</if>
|
|
<if test="blSplit != null and blSplit != ''">bl_split,</if>
|
|
<if test="billMonth != null and billMonth != ''">bill_month,</if>
|
|
<if test="custNo != null and custNo != ''">cust_no,</if>
|
|
<if test="customerCode != null and customerCode != ''">customer_code,</if>
|
|
<if test="customerName != null and customerName != ''">customer_name,</if>
|
|
<if test="blConfirm != null and blConfirm != ''">bl_confirm,</if>
|
|
<if test="confirmDate != null and confirmDate != ''">confirm_date,</if>
|
|
<if test="confirmSite != null and confirmSite != ''">confirm_site,</if>
|
|
<if test="confirmManCode != null and confirmManCode != ''">confirm_man_code,</if>
|
|
<if test="blSiteConfirm != null and blSiteConfirm != ''">bl_site_confirm,</if>
|
|
<if test="confirmNote != null and confirmNote != ''">confirm_note,</if>
|
|
<if test="siteConfirmDate != null and siteConfirmDate != ''">site_confirm_date,</if>
|
|
<if test="siteConfirmManCode != null and siteConfirmManCode != ''">site_confirm_man_code,</if>
|
|
<if test="siteConfirmNote != null and siteConfirmNote != ''">site_confirm_note,</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="id != null">#{id},</if>
|
|
<if test="billNo != null and billNo != ''">#{billNo},</if>
|
|
<if test="parentBillNo != null and parentBillNo != ''">#{parentBillNo},</if>
|
|
<if test="settleBillNo != null and settleBillNo != ''">#{settleBillNo},</if>
|
|
<if test="billCode != null and billCode != ''">#{billCode},</if>
|
|
<if test="billDate != null">#{billDate},</if>
|
|
<if test="billFee != null">#{billFee},</if>
|
|
<if test="currency != null and currency != ''">#{currency},</if>
|
|
<if test="settleType != null and settleType != ''">#{settleType},</if>
|
|
<if test="blSplit != null and blSplit != ''">#{blSplit},</if>
|
|
<if test="billMonth != null and billMonth != ''">#{billMonth},</if>
|
|
<if test="custNo != null and custNo != ''">#{custNo},</if>
|
|
<if test="customerCode != null and customerCode != ''">#{customerCode},</if>
|
|
<if test="customerName != null and customerName != ''">#{customerName},</if>
|
|
<if test="blConfirm != null and blConfirm != ''">#{blConfirm},</if>
|
|
<if test="confirmDate != null and confirmDate != ''">#{confirmDate},</if>
|
|
<if test="confirmSite != null and confirmSite != ''">#{confirmSite},</if>
|
|
<if test="confirmManCode != null and confirmManCode != ''">#{confirmManCode},</if>
|
|
<if test="blSiteConfirm != null and blSiteConfirm != ''">#{blSiteConfirm},</if>
|
|
<if test="confirmNote != null and confirmNote != ''">#{confirmNote},</if>
|
|
<if test="siteConfirmDate != null and siteConfirmDate != ''">#{siteConfirmDate},</if>
|
|
<if test="siteConfirmManCode != null and siteConfirmManCode != ''">#{siteConfirmManCode},</if>
|
|
<if test="siteConfirmNote != null and siteConfirmNote != ''">#{siteConfirmNote},</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="updateEmisSettleSubBill" parameterType="EmisSettleSubBill">
|
|
update emis_settle_sub_bill
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="billNo != null and billNo != ''">bill_no = #{billNo},</if>
|
|
<if test="parentBillNo != null and parentBillNo != ''">parent_bill_no = #{parentBillNo},</if>
|
|
<if test="settleBillNo != null and settleBillNo != ''">settle_bill_no = #{settleBillNo},</if>
|
|
<if test="billCode != null and billCode != ''">bill_code = #{billCode},</if>
|
|
<if test="billDate != null">bill_date = #{billDate},</if>
|
|
<if test="billFee != null">bill_fee = #{billFee},</if>
|
|
<if test="currency != null and currency != ''">currency = #{currency},</if>
|
|
<if test="settleType != null and settleType != ''">settle_type = #{settleType},</if>
|
|
<if test="blSplit != null and blSplit != ''">bl_split = #{blSplit},</if>
|
|
<if test="billMonth != null and billMonth != ''">bill_month = #{billMonth},</if>
|
|
<if test="custNo != null and custNo != ''">cust_no = #{custNo},</if>
|
|
<if test="customerCode != null and customerCode != ''">customer_code = #{customerCode},</if>
|
|
<if test="customerName != null and customerName != ''">customer_name = #{customerName},</if>
|
|
<if test="blConfirm != null and blConfirm != ''">bl_confirm = #{blConfirm},</if>
|
|
<if test="confirmDate != null and confirmDate != ''">confirm_date = #{confirmDate},</if>
|
|
<if test="confirmSite != null and confirmSite != ''">confirm_site = #{confirmSite},</if>
|
|
<if test="confirmManCode != null and confirmManCode != ''">confirm_man_code = #{confirmManCode},</if>
|
|
<if test="blSiteConfirm != null and blSiteConfirm != ''">bl_site_confirm = #{blSiteConfirm},</if>
|
|
<if test="confirmNote != null and confirmNote != ''">confirm_note = #{confirmNote},</if>
|
|
<if test="siteConfirmDate != null and siteConfirmDate != ''">site_confirm_date = #{siteConfirmDate},</if>
|
|
<if test="siteConfirmManCode != null and siteConfirmManCode != ''">site_confirm_man_code = #{siteConfirmManCode},</if>
|
|
<if test="siteConfirmNote != null and siteConfirmNote != ''">site_confirm_note = #{siteConfirmNote},</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>
|
|
|
|
|
|
<!-- 中心确认 -->
|
|
<update id="confirmBillByCenter" parameterType="EmisSettleSubBill">
|
|
update emis_settle_sub_bill
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
bl_confirm = '1',
|
|
confirm_date = now(),
|
|
confirm_man_code = #{confirmManCode},
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<!-- 中心取消确认 -->
|
|
<update id="cancelConfirmBillByCenter" parameterType="EmisSettleSubBill">
|
|
update emis_settle_sub_bill
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
bl_confirm = '0',
|
|
confirm_date = null,
|
|
confirm_man_code =null,
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<!-- 中心确认不出账 2-->
|
|
<update id="confirmNoBillByCenter" parameterType="EmisSettleSubBill">
|
|
update emis_settle_sub_bill
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
bl_confirm = '2',
|
|
confirm_date = now(),
|
|
confirm_man_code = #{confirmManCode},
|
|
confirm_note = #{confirmNote},
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<!-- 中心账单设置异常 3 -->
|
|
<update id="setBillErrorByCenter" parameterType="EmisSettleSubBill">
|
|
update emis_settle_sub_bill
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
bl_confirm = '3',
|
|
confirm_date = now(),
|
|
confirm_man_code = #{confirmManCode},
|
|
confirm_note = #{confirmNote},
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<!-- 站点业务确认 -->
|
|
<update id="confirmBillBySite" parameterType="EmisSettleSubBill">
|
|
update emis_settle_sub_bill
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
bl_site_confirm = '1',
|
|
site_confirm_date = now(),
|
|
confirm_site = #{confirmSite},
|
|
site_confirm_man_code = #{confirmManCode},
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<!-- 站点取消确认 -->
|
|
<update id="cancelConfirmBillBySite" parameterType="EmisSettleSubBill">
|
|
update emis_settle_sub_bill
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
bl_confirm = '0',
|
|
site_confirm_date = null,
|
|
site_confirm_man_code =null,
|
|
confirm_site = null,
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<!-- 站点确认不出账 2-->
|
|
<update id="confirmNoBillBySite" parameterType="EmisSettleSubBill">
|
|
update emis_settle_sub_bill
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
bl_confirm = '2',
|
|
confirm_date = now(),
|
|
confirm_man_code = #{confirmManCode},
|
|
confirm_site = #{confirmSite},
|
|
site_confirm_note = #{siteConfirmNote},
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<!-- 站点账单设置异常 3 -->
|
|
<update id="setBillErrorBySite" parameterType="EmisSettleSubBill">
|
|
update emis_settle_sub_bill
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
bl_confirm = '3',
|
|
confirm_date = now(),
|
|
confirm_man_code = #{confirmManCode},
|
|
confirm_site = #{confirmSite},
|
|
site_confirm_note = #{siteConfirmNote},
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteEmisSettleSubBillByBillCode" parameterType="String">
|
|
update emis_settle_sub_bill set del_flag='1' where bill_code = #{billCode} and del_flag='0'
|
|
</delete>
|
|
|
|
<delete id="deleteEmisSettleSubBillById" parameterType="Long">
|
|
update emis_settle_sub_bill set del_flag='1' where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteEmisSettleSubBillByIds" parameterType="String">
|
|
update emis_settle_sub_bill set del_flag='1' where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |