|
|
@@ -149,26 +149,28 @@
|
|
|
, '%')
|
|
|
)
|
|
|
</if>
|
|
|
- and (
|
|
|
- case when klt.status in (1, 6)
|
|
|
- then
|
|
|
- klt.create_by in
|
|
|
- <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
- #{item,jdbcType=BIGINT}
|
|
|
- </foreach>
|
|
|
- when klt.status in (2, 3, 4, 5) then
|
|
|
- (
|
|
|
- klt.create_by in
|
|
|
- <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
- #{item,jdbcType=BIGINT}
|
|
|
- </foreach>
|
|
|
- or kltu2.contacts_id in
|
|
|
- <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
- #{item,jdbcType=BIGINT}
|
|
|
- </foreach>
|
|
|
- )
|
|
|
- end
|
|
|
- )
|
|
|
+ <if test="authList != null and authList.size() != 0">
|
|
|
+ and (
|
|
|
+ case when klt.status in (1, 6)
|
|
|
+ then
|
|
|
+ klt.create_by in
|
|
|
+ <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
+ when klt.status in (2, 3, 4, 5) then
|
|
|
+ (
|
|
|
+ klt.create_by in
|
|
|
+ <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
+ or kltu2.contacts_id in
|
|
|
+ <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
+ )
|
|
|
+ end
|
|
|
+ )
|
|
|
+ </if>
|
|
|
</where>
|
|
|
order by klt.generate_time desc
|
|
|
</select>
|
|
|
@@ -319,31 +321,33 @@
|
|
|
, '%')
|
|
|
)
|
|
|
</if>
|
|
|
- and (
|
|
|
- case
|
|
|
- when klt.status = 2 then
|
|
|
- true
|
|
|
- when klt.status in (3, 4, 5) then
|
|
|
- (
|
|
|
+ <if test="authList != null and authList.size() != 0">
|
|
|
+ and (
|
|
|
+ case
|
|
|
+ when klt.status = 2 then
|
|
|
+ true
|
|
|
+ when klt.status in (3, 4, 5) then
|
|
|
+ (
|
|
|
+ (
|
|
|
+ kltu2.contacts_id in
|
|
|
+ <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>)
|
|
|
+ or
|
|
|
(
|
|
|
- kltu2.contacts_id in
|
|
|
- <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
- #{item,jdbcType=BIGINT}
|
|
|
- </foreach>)
|
|
|
- or
|
|
|
- (
|
|
|
- select kllt.id
|
|
|
- from kwp_ledger_logistics_track kllt where kllt.del_flag = 0
|
|
|
- and kllt.l_ledger_id = klt.id
|
|
|
- and kllt.status in (3, 5)
|
|
|
- and kllt.create_by in
|
|
|
- <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
- #{item,jdbcType=BIGINT}
|
|
|
- </foreach>
|
|
|
- )
|
|
|
- )
|
|
|
- end
|
|
|
+ select kllt.id
|
|
|
+ from kwp_ledger_logistics_track kllt where kllt.del_flag = 0
|
|
|
+ and kllt.l_ledger_id = klt.id
|
|
|
+ and kllt.status in (3, 5)
|
|
|
+ and kllt.create_by in
|
|
|
+ <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
)
|
|
|
+ )
|
|
|
+ end
|
|
|
+ )
|
|
|
+ </if>
|
|
|
</where>
|
|
|
order by klt.generate_time desc
|
|
|
</select>
|
|
|
@@ -524,26 +528,28 @@
|
|
|
, '%')
|
|
|
)
|
|
|
</if>
|
|
|
- and (
|
|
|
- case when klt.status in (1, 6)
|
|
|
- then
|
|
|
- klt.create_by in
|
|
|
- <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
- #{item,jdbcType=BIGINT}
|
|
|
- </foreach>
|
|
|
- when klt.status in (2, 3, 4, 5) then
|
|
|
- (
|
|
|
- klt.create_by in
|
|
|
- <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
- #{item,jdbcType=BIGINT}
|
|
|
- </foreach>
|
|
|
- or kltu2.contacts_id in
|
|
|
- <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
- #{item,jdbcType=BIGINT}
|
|
|
- </foreach>
|
|
|
- )
|
|
|
- end
|
|
|
- )
|
|
|
+ <if test="authList != null and authList.size() != 0">
|
|
|
+ and (
|
|
|
+ case when klt.status in (1, 6)
|
|
|
+ then
|
|
|
+ klt.create_by in
|
|
|
+ <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
+ when klt.status in (2, 3, 4, 5) then
|
|
|
+ (
|
|
|
+ klt.create_by in
|
|
|
+ <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
+ or kltu2.contacts_id in
|
|
|
+ <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
+ )
|
|
|
+ end
|
|
|
+ )
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
<select id="countPurchaseOrder" resultType="java.util.Map">
|
|
|
@@ -587,31 +593,33 @@
|
|
|
, '%')
|
|
|
)
|
|
|
</if>
|
|
|
- and (
|
|
|
- case
|
|
|
- when klt.status = 2 then
|
|
|
- true
|
|
|
- when klt.status in (3, 4, 5) then
|
|
|
- (
|
|
|
+ <if test="authList != null and authList.size() != 0">
|
|
|
+ and (
|
|
|
+ case
|
|
|
+ when klt.status = 2 then
|
|
|
+ true
|
|
|
+ when klt.status in (3, 4, 5) then
|
|
|
+ (
|
|
|
+ (
|
|
|
+ kltu2.contacts_id in
|
|
|
+ <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>)
|
|
|
+ or
|
|
|
(
|
|
|
- kltu2.contacts_id in
|
|
|
- <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
- #{item,jdbcType=BIGINT}
|
|
|
- </foreach>)
|
|
|
- or
|
|
|
- (
|
|
|
- select kllt.id
|
|
|
- from kwp_ledger_logistics_track kllt where kllt.del_flag = 0
|
|
|
- and kllt.l_ledger_id = klt.id
|
|
|
- and kllt.status in (3, 5)
|
|
|
- and kllt.create_by in
|
|
|
- <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
- #{item,jdbcType=BIGINT}
|
|
|
- </foreach>
|
|
|
- )
|
|
|
- )
|
|
|
- end
|
|
|
+ select kllt.id
|
|
|
+ from kwp_ledger_logistics_track kllt where kllt.del_flag = 0
|
|
|
+ and kllt.l_ledger_id = klt.id
|
|
|
+ and kllt.status in (3, 5)
|
|
|
+ and kllt.create_by in
|
|
|
+ <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
)
|
|
|
+ )
|
|
|
+ end
|
|
|
+ )
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
@@ -838,69 +846,71 @@
|
|
|
</if>
|
|
|
<if test="tradeReq.endCreateTime != null and tradeReq.endCreateTime != '' and tradeReq.startCreateTime != null and tradeReq.startCreateTime != ''">
|
|
|
and klt.generate_time between #{tradeReq.startCreateTime,jdbcType=TIMESTAMP}
|
|
|
- and #{tradeReq.endCreateTime,jdbcType=TIMESTAMP}
|
|
|
+ and #{tradeReq.endCreateTime,jdbcType=TIMESTAMP}
|
|
|
</if>
|
|
|
<if test="tradeReq.keywords != null and tradeReq.keywords != ''">
|
|
|
and (
|
|
|
- klt.t_ledger_no like concat('%'
|
|
|
- , #{tradeReq.keywords,jdbcType=VARCHAR}
|
|
|
- , '%')
|
|
|
- or kltu.firm_name like concat('%'
|
|
|
- , #{tradeReq.keywords,jdbcType=VARCHAR}
|
|
|
- , '%')
|
|
|
- or kltu.contacts like concat('%'
|
|
|
- , #{tradeReq.keywords,jdbcType=VARCHAR}
|
|
|
- , '%')
|
|
|
- )
|
|
|
+ klt.t_ledger_no like concat('%'
|
|
|
+ , #{tradeReq.keywords,jdbcType=VARCHAR}
|
|
|
+ , '%')
|
|
|
+ or kltu.firm_name like concat('%'
|
|
|
+ , #{tradeReq.keywords,jdbcType=VARCHAR}
|
|
|
+ , '%')
|
|
|
+ or kltu.contacts like concat('%'
|
|
|
+ , #{tradeReq.keywords,jdbcType=VARCHAR}
|
|
|
+ , '%')
|
|
|
+ )
|
|
|
</if>
|
|
|
- <if test="tradeReq.unitType == 1">
|
|
|
- and (
|
|
|
- case when klt.status in (1, 6)
|
|
|
- then
|
|
|
- klt.create_by in
|
|
|
- <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
- #{item,jdbcType=BIGINT}
|
|
|
- </foreach>
|
|
|
- when klt.status in (2, 3, 4, 5) then
|
|
|
- (
|
|
|
- klt.create_by in
|
|
|
- <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
- #{item,jdbcType=BIGINT}
|
|
|
- </foreach>
|
|
|
- or kltu2.contacts_id in
|
|
|
- <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
- #{item,jdbcType=BIGINT}
|
|
|
- </foreach>
|
|
|
- )
|
|
|
- end
|
|
|
- )
|
|
|
- </if>
|
|
|
- <if test="tradeReq.unitType == 2">
|
|
|
- and (
|
|
|
- case
|
|
|
- when klt.status = 2 then
|
|
|
- true
|
|
|
- when klt.status in (3, 4, 5) then
|
|
|
- (
|
|
|
- (
|
|
|
- kltu2.contacts_id in
|
|
|
- <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
- #{item,jdbcType=BIGINT}
|
|
|
- </foreach>)
|
|
|
- or
|
|
|
+ <if test="authList != null and authList.size() != 0">
|
|
|
+ <if test="tradeReq.unitType == 1">
|
|
|
+ and (
|
|
|
+ case when klt.status in (1, 6)
|
|
|
+ then
|
|
|
+ klt.create_by in
|
|
|
+ <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
+ when klt.status in (2, 3, 4, 5) then
|
|
|
+ (
|
|
|
+ klt.create_by in
|
|
|
+ <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
+ or kltu2.contacts_id in
|
|
|
+ <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
+ )
|
|
|
+ end
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="tradeReq.unitType == 2">
|
|
|
+ and (
|
|
|
+ case
|
|
|
+ when klt.status = 2 then
|
|
|
+ true
|
|
|
+ when klt.status in (3, 4, 5) then
|
|
|
+ (
|
|
|
+ (
|
|
|
+ kltu2.contacts_id in
|
|
|
+ <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>)
|
|
|
+ or
|
|
|
(
|
|
|
select kllt.id
|
|
|
from kwp_ledger_logistics_track kllt where kllt.del_flag = 0
|
|
|
- and kllt.l_ledger_id = klt.id
|
|
|
- and kllt.status in (3, 5)
|
|
|
- and kllt.create_by in
|
|
|
- <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
- #{item,jdbcType=BIGINT}
|
|
|
- </foreach>
|
|
|
- )
|
|
|
- )
|
|
|
- end
|
|
|
- )
|
|
|
+ and kllt.l_ledger_id = klt.id
|
|
|
+ and kllt.status in (3, 5)
|
|
|
+ and kllt.create_by in
|
|
|
+ <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
+ )
|
|
|
+ )
|
|
|
+ end
|
|
|
+ )
|
|
|
+ </if>
|
|
|
</if>
|
|
|
</otherwise>
|
|
|
</choose>
|