This commit is contained in:
linfso 2024-08-07 22:04:09 +08:00
parent 6bc71782f4
commit 4d9fe63510
4 changed files with 51 additions and 89 deletions

View File

@ -131,13 +131,17 @@
</if>
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
and ( salesmen=#{params.privEmpName}
or payee=#{params.privEmpName}
and (
a.salesmen=#{params.privEmpName}
or a.payee=#{params.privEmpName}
or a.salesmen in(
select salesmen from emis_salesmen_rel where sales_ass=#{params.privEmpName}
)
)
</if>
</where>
order by create_time desc
</select>

View File

@ -95,6 +95,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<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.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 ( 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>
</where>
order by create_time desc
</select>
@ -315,8 +329,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<delete id="deleteEmisSettleInvoiceChRecordById" parameterType="Long">
update emis_settle_invoice_ch_record set del_flag='0' where id = #{id}
</delete>

View File

@ -114,6 +114,21 @@
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<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.privSiteCode != null and params.privSiteCode != '88888'">
and settle_bill_no in(
select bill_no from emis_settle_sub_bill b where del_flag='0'
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>
</where>
order by create_time desc
</select>

View File

@ -185,36 +185,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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}
a.salesmen=#{params.privEmpName}
or a.payee=#{params.privEmpName}
)
</if>
or a.salesmen in(
select salesmen from emis_salesmen_rel where sales_ass=#{params.privEmpName}
)
)
</if>
</where>
order by b.create_time desc
@ -309,34 +286,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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}
a.salesmen=#{params.privEmpName}
or a.payee=#{params.privEmpName}
or salesmen in(
select salesmen from emis_salesmen_rel where sales_ass=#{params.privEmpName}
)
)
</if>
@ -444,34 +398,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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}
a.salesmen=#{params.privEmpName}
or a.payee=#{params.privEmpName}
or salesmen in(
select salesmen from emis_salesmen_rel where sales_ass=#{params.privEmpName}
)
)
</if>