md
This commit is contained in:
parent
e99d55714e
commit
695d1f0901
@ -125,6 +125,8 @@
|
||||
tba.settle_type as settleType,
|
||||
tba.open_bill_status as openBillStatus,
|
||||
tba.payment_status as paymentStatus,
|
||||
tba.settle_day as settleDay,
|
||||
tba.payment_due_date as paymentDueDate,
|
||||
tba.rec_money as recMoney,
|
||||
tba.reced_money as recedMoney,
|
||||
tba.salesmen as salesmen,
|
||||
@ -144,6 +146,8 @@
|
||||
settle_type,
|
||||
open_bill_status,
|
||||
payment_status,
|
||||
settle_day,
|
||||
payment_due_date,
|
||||
rec_money,
|
||||
reced_money,
|
||||
salesmen,
|
||||
@ -172,19 +176,18 @@
|
||||
SELECT
|
||||
a.settle_bill_no,
|
||||
sum( if( b.trade_date <![CDATA[ <= ]]> a.payment_due_date,b.pay_money,0) ) AS recdMoneyIn,
|
||||
sum( if(b.trade_date <![CDATA[ > ]]> a.payment_due_date and b.trade_date <![CDATA[ <= ]]> DATE_SUB( a.payment_due_date, INTERVAL - 30 DAY ),b.pay_money,0) ) AS recdPayMoney60D
|
||||
sum( if(b.trade_date <![CDATA[ > ]]> a.payment_due_date and b.trade_date <![CDATA[ <= ]]> DATE_SUB( a.payment_due_date, INTERVAL - 30 DAY ),b.pay_money,0) ) AS recdPayMoney60D,
|
||||
sum( if(b.trade_date <![CDATA[ > ]]> DATE_SUB( a.payment_due_date, INTERVAL - 30 DAY ),b.pay_money,0) ) AS recdPayMoneyGreat60D
|
||||
FROM
|
||||
emis_settle_bill a,
|
||||
emis_settle_pay_record b,
|
||||
emis_settle_pay_bill_rel c
|
||||
emis_settle_bill a,
|
||||
emis_settle_pay_record b,
|
||||
emis_settle_pay_bill_rel c
|
||||
<where>
|
||||
a.del_flag = '0'
|
||||
AND b.del_flag = '0'
|
||||
AND c.del_flag = '0'
|
||||
AND a.settle_bill_no = c.settle_bill_no
|
||||
AND b.pay_id = c.pay_id
|
||||
AND b.trade_date <![CDATA[ > ]]> a.payment_due_date
|
||||
AND b.trade_date <![CDATA[ <= ]]> DATE_SUB( a.payment_due_date, INTERVAL - 30 DAY )
|
||||
<if test="salesmen != null and salesmen!='' "> and a.salesmen = #{salesmen}</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>
|
||||
@ -192,11 +195,11 @@
|
||||
<if test="paymentStatus != null and paymentStatus != ''"> and a.payment_status = #{paymentStatus}</if>
|
||||
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
|
||||
and (
|
||||
a.salesmen=#{params.privEmpName}
|
||||
or a.payee=#{params.privEmpName}
|
||||
or a.salesmen in(
|
||||
select salesmen from emis_salesmen_rel esr where esr.del_flag='0' and esr.bl_open='1' and now() <![CDATA[ >= ]]> esr.start_date and now() <![CDATA[ <= ]]> esr.end_date and esr.sales_ass=#{params.privEmpName}
|
||||
)
|
||||
a.salesmen=#{params.privEmpName}
|
||||
or a.payee=#{params.privEmpName}
|
||||
or a.salesmen in(
|
||||
select salesmen from emis_salesmen_rel esr where esr.del_flag='0' and esr.bl_open='1' and now() <![CDATA[ >= ]]> esr.start_date and now() <![CDATA[ <= ]]> esr.end_date and esr.sales_ass=#{params.privEmpName}
|
||||
)
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user