This commit is contained in:
linfso 2025-05-06 05:52:05 +08:00
parent de2035866d
commit 9151b2cdd2

View File

@ -132,6 +132,7 @@
tba.reced_money as recedMoney,
tba.salesmen as salesmen,
tba.payee as payee,
tba.create_time as createTime,
IFNULL( tbb.recdMoneyIn, 0 ) AS recdMoneyIn,
IFNULL( tbb.recdPayMoney60D, 0 ) recdPayMoney60D,
IFNULL( tbb.recdPayMoneyGreat60D, 0 ) recdPayMoneyGreat60D,
@ -154,16 +155,50 @@
rec_money,
reced_money,
salesmen,
payee
payee,
create_time
FROM
emis_settle_bill a
<where>
a.del_flag='0'
<if test="settleBillNo != null and settleBillNo != ''"> and FIND_IN_SET(a.`settle_bill_no`,#{settleBillNo})</if>
<if test="custNo != null and custNo != ''"> and a.cust_no = #{custNo}</if>
<if test="salesmen != null and salesmen!='' "> and a.salesmen = #{salesmen}</if>
<if test="payee != null and payee!='' "> and a.payee = #{payee}</if>
<if test="settleType != null and settleType != ''"> and a.settle_type= #{settleType}</if>
<if test="billMonth != null and billMonth!='' "> and a.bill_month = #{billMonth}</if>
<if test="billMonth != null and billMonth!='' "> and FIND_IN_SET(a.`bill_month`,#{billMonth})</if>
<if test="openBillStatus != null and openBillStatus != ''"> and a.open_bill_status = #{openBillStatus}</if>
<if test="paymentStatus != null and paymentStatus != ''"> and a.payment_status = #{paymentStatus}</if>
<if test="params.billCode != null and params.billCode != ''">
and exists (
select 1 from emis_settle_sub_bill b
where a.settle_bill_no=b.settle_bill_no
and ( FIND_IN_SET(b.`bill_code`,#{params.billCode}) or b.bill_code like concat('%', #{params.billCode}, '%') )
)
</if>
<if test="params.beginTradeDate != null and params.beginTradeDate != ''">
and exists (
select 1 from emis_settle_pay_record espr,emis_settle_pay_bill_rel espbr
where espr.del_flag='0' and espbr.del_flag='0' and a.settle_bill_no=espr.settle_bill_no and espr.pay_id = espbr.pay_id
and espr.trade_date <![CDATA[ >= ]]> #{params.beginTradeDate}
)
</if>
<if test="params.payCreateBy != null and params.payCreateBy != ''">
and exists (
select 1 from emis_settle_pay_record espr,emis_settle_pay_bill_rel espbr
where espr.del_flag='0' and espbr.del_flag='0' and a.settle_bill_no=espr.settle_bill_no and espr.pay_id = espbr.pay_id
and espr.create_by = #{params.payCreateBy}
)
</if>
<if test="params.endTradeDate != null and params.endTradeDate != ''">
and exists (
select 1 from emis_settle_pay_record espr,emis_settle_pay_bill_rel espbr
where espr.del_flag='0' and espbr.del_flag='0' and a.settle_bill_no=espr.settle_bill_no and espr.pay_id = espbr.pay_id
and espr.trade_date <![CDATA[ <= ]]> #{params.endTradeDate}
)
</if>
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
and (
a.salesmen=#{params.privEmpName}
@ -191,11 +226,30 @@
AND c.del_flag = '0'
AND a.settle_bill_no = c.settle_bill_no
AND b.pay_id = c.pay_id
<if test="settleBillNo != null and settleBillNo != ''"> and FIND_IN_SET(a.`settle_bill_no`,#{settleBillNo})</if>
<if test="custNo != null and custNo != ''"> and a.cust_no = #{custNo}</if>
<if test="salesmen != null and salesmen!='' "> and a.salesmen = #{salesmen}</if>
<if test="payee != null and payee!='' "> and a.payee = #{payee}</if>
<if test="settleType != null and settleType != ''"> and a.settle_type= #{settleType}</if>
<if test="billMonth != null and billMonth!='' "> and a.bill_month = #{billMonth}</if>
<if test="billMonth != null and billMonth!='' "> and FIND_IN_SET(a.`bill_month`,#{billMonth})</if>
<if test="openBillStatus != null and openBillStatus != ''"> and a.open_bill_status = #{openBillStatus}</if>
<if test="paymentStatus != null and paymentStatus != ''"> and a.payment_status = #{paymentStatus}</if>
<if test="params.billCode != null and params.billCode != ''">
and exists (
select 1 from emis_settle_sub_bill b
where a.settle_bill_no=b.settle_bill_no
and ( FIND_IN_SET(b.`bill_code`,#{params.billCode}) or b.bill_code like concat('%', #{params.billCode}, '%') )
)
</if>
<if test="params.payCreateBy != null and params.payCreateBy != ''">
and b.create_by = #{params.payCreateBy}
</if>
<if test="params.beginTradeDate != null and params.beginTradeDate != ''">
and b.trade_date <![CDATA[ >= ]]> #{params.beginTradeDate}
</if>
<if test="params.endTradeDate != null and params.endTradeDate != ''">
and b.trade_date <![CDATA[ <= ]]> #{params.endTradeDate}
</if>
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
and (
a.salesmen=#{params.privEmpName}