往来单位查询

dev
黄泽腾 2 years ago
parent a9f1ff3932
commit 6b6280852f

@ -197,5 +197,6 @@ public class FilterOrderRequest extends ListPageRequest {
private String unionRemark; private String unionRemark;
private String remark; private String remark;
private String keyWords;
private Integer confirmStatus; private Integer confirmStatus;
} }

@ -15,6 +15,9 @@
(select name from basic_corp bc where bc.erpId = io.fromCorp) fromCorpName, (select name from basic_corp bc where bc.erpId = io.fromCorp) fromCorpName,
(select name from basic_corp bc where bc.erpId = io.customerId) customerName (select name from basic_corp bc where bc.erpId = io.customerId) customerName
from io_order as io from io_order as io
left join auth_warehouse aw on aw.code = io.fromInvCode
left join basic_corp bc on bc.erpId = io.fromCorp
<if test="uploadKey != null and uploadKey != ''"> <if test="uploadKey != null and uploadKey != ''">
INNER JOIN io_unit_maintain_platform a2 on io.action = a2.sourceAction AND io.fromCorp = a2.unitId INNER JOIN io_unit_maintain_platform a2 on io.action = a2.sourceAction AND io.fromCorp = a2.unitId
</if> </if>
@ -22,6 +25,10 @@
<if test="id != null and id != ''"> <if test="id != null and id != ''">
AND id = #{id} AND id = #{id}
</if> </if>
<if test="keyWords != null and keyWords != ''">
AND (aw.name like concat('%', #{keyWords}, '%') or bc.name like concat('%', #{keyWords}, '%'))
</if>
<if test="corpName != null and corpName != ''"> <if test="corpName != null and corpName != ''">
AND (SELECT NAME FROM auth_warehouse aw2 WHERE aw2.CODE = io.fromInvCode) like AND (SELECT NAME FROM auth_warehouse aw2 WHERE aw2.CODE = io.fromInvCode) like
concat('%', #{corpName}, '%') concat('%', #{corpName}, '%')
@ -85,7 +92,7 @@
or io.outSickInfo like concat('%', #{unionRemark}, '%')) or io.outSickInfo like concat('%', #{unionRemark}, '%'))
</if> </if>
<if test="statuses != null and statuses.size() != 0"> <if test="statuses != null and statuses.size() != 0">
AND status in AND io.status in
<foreach collection="statuses" index="index" item="item" open="(" close=")" separator=","> <foreach collection="statuses" index="index" item="item" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
@ -103,7 +110,7 @@
</foreach> </foreach>
</if> </if>
<if test="status != null"> <if test="status != null">
AND status = #{status} AND io.status = #{status}
</if> </if>
<if test="orderType != null"> <if test="orderType != null">
AND orderType = #{orderType} AND orderType = #{orderType}
@ -115,7 +122,7 @@
<foreach collection="invoiceActions1" index="index" item="item" open="(" close=")" separator=","> <foreach collection="invoiceActions1" index="index" item="item" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
and status = 10) and io.status = 10)
</if> </if>
<if test="invoiceActions1 == null and invoiceActions2 != null"> <if test="invoiceActions1 == null and invoiceActions2 != null">
@ -124,7 +131,7 @@
<foreach collection="invoiceActions2" index="index" item="item" open="(" close=")" separator=","> <foreach collection="invoiceActions2" index="index" item="item" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
and status = 7 and io.status = 7
) )
</if> </if>
@ -133,13 +140,13 @@
<foreach collection="invoiceActions1" index="index" item="item" open="(" close=")" separator=","> <foreach collection="invoiceActions1" index="index" item="item" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
and status = 10) and io.status = 10)
or ( or (
`action` in `action` in
<foreach collection="invoiceActions2" index="index" item="item" open="(" close=")" separator=","> <foreach collection="invoiceActions2" index="index" item="item" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
and status = 7) and io.status = 7)
) )
</if> </if>
</if> </if>

Loading…
Cancel
Save