This commit is contained in:
linfso 2024-08-12 13:38:54 +08:00
parent a8896d2e6b
commit 32721533c9

View File

@ -96,6 +96,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != ''">
and a.create_time <![CDATA[ >= ]]> #{params.beginCreateTime}
</if>
<if test="params.endCreateTime != null and params.endCreateTime != ''">
and a.create_time <![CDATA[ <= ]]> #{params.endCreateTime}
</if>
<if test="params.billCode != null and params.billCode != ''">
AND apply_seq_no IN (
SELECT x1.apply_seq_no FROM
@ -122,42 +130,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
</if>
<if test="params.billCode != null and params.billCode != ''">
AND apply_seq_no IN (
SELECT x1.apply_seq_no FROM
emis_settle_invoice_record x1,
emis_settle_bill x2
WHERE
x1.del_flag = '0'
AND x2.del_flag = '0'
AND FIND_IN_SET( x2.settle_bill_no, x1.settle_bill_no )
AND exists (
select 1 from emis_settle_sub_bill b
where x2.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.beginCreateTime != null and params.beginCreateTime != ''">
and a.create_time <![CDATA[ >= ]]> #{params.beginCreateTime}
</if>
<if test="params.endCreateTime != null and params.endCreateTime != ''">
and a.create_time <![CDATA[ <= ]]> #{params.endCreateTime}
</if>
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
and apply_seq_no in(
select apply_seq_no from emis_settle_invoice_record
where del_flag='0' and settle_bill_no in(
select bill_no from emis_settle_sub_bill b
where del_flag='0'
AND apply_seq_no IN (
SELECT x1.apply_seq_no FROM
emis_settle_invoice_record x1,
emis_settle_bill x2
WHERE x1.del_flag = '0' AND x2.del_flag = '0'
AND FIND_IN_SET( x2.settle_bill_no, x1.settle_bill_no )
AND exists (
select 1 from emis_settle_sub_bill b
where x2.settle_bill_no=b.settle_bill_no
and ( b.salesmen=#{params.privEmpName} or b.payee=#{params.privEmpName}
or b.salesmen in(select salesmen from emis_salesmen_rel where sales_ass=#{params.privEmpName})
)
)
)
)
</if>