demand: TMS系统 - 运单管理 - 寄件运单查询/寄件运单查询新/派件运单查询/中心运单查询 - 新增查询条件“现金客户” 导出的数据也包含现金客户

This commit is contained in:
aike 2026-01-05 13:50:27 +08:00
parent 05bd48d437
commit f008dd2a94

View File

@ -1941,6 +1941,7 @@
from emis_waybill a
left join emis_customer_user a4 on a.cust_no=a4.monthly_pay_code and a4.del_flag='0'
left join emis_waybill_other wss on a.id=wss.waybill_id and wss.del_flag='0'
left join emis_money_user mu on wss.money_user_id=mu.id and mu.del_flag='0'
<where>
a.del_flag='0' and a.order_status !='0' and a.order_status!='2'
<if test="id != null "> and a.id = #{id}</if>
@ -2256,6 +2257,9 @@
and DATEDIFF(NOW(), a.send_date) <![CDATA[ <= ]]> 10
</if>
<if test="params.moneyUserId != null and params.moneyUserId != ''">
AND mu.id = #{params.moneyUserId}
</if>
<if test="(params.isNeedBatch == null or (params.isNeedBatch != null and params.isNeedBatch != 1) ) " >
<if test="(salesmen == null or salesmen=='') and params.privSiteCode != null and params.privSiteCode != '88888'">
and (
@ -2271,6 +2275,21 @@
select 1 from emis_customer_user ecu where a.cust_no=ecu.monthly_pay_code and ecu.owner_site=#{params.privSiteCode}
)
</if>
<if test="params.moneyUserId != null and params.moneyUserId != ''">
or EXISTS (
select 1 from emis_waybill_other wss_mu
inner join emis_money_user emu on wss_mu.money_user_id=emu.id and emu.del_flag='0'
left join sys_user su_payee on emu.payee=su_payee.emp_name and su_payee.del_flag='0'
left join sys_user su_salesmen on emu.salesmen=su_salesmen.emp_name and su_salesmen.del_flag='0'
left join sys_user su_sales_support on emu.sales_support=su_sales_support.emp_name and su_sales_support.del_flag='0'
where wss_mu.waybill_id=a.id and wss_mu.del_flag='0'
and (
su_payee.owner_site_code=#{params.privSiteCode}
or su_salesmen.owner_site_code=#{params.privSiteCode}
or su_sales_support.owner_site_code=#{params.privSiteCode}
)
)
</if>
or a.salesmen=#{params.privEmpName}
or a.payee=#{params.privEmpName}