|
|
@@ -727,6 +727,55 @@
|
|
|
or kllu.contacts like concat('%', #{logisticsReq.keywords,jdbcType=VARCHAR}, '%')
|
|
|
)
|
|
|
</if>
|
|
|
+ <if test="logisticsReq.unitType == 1">
|
|
|
+ and (
|
|
|
+ case when kll.status in (1, 6)
|
|
|
+ then
|
|
|
+ kll.create_by in
|
|
|
+ <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
+ when kll.status in (2, 3, 4, 5) then
|
|
|
+ (
|
|
|
+ kll.create_by in
|
|
|
+ <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
+ or kllu2.contacts_id in
|
|
|
+ <foreach collection="authList" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
+ )
|
|
|
+ end
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="logisticsReq.unitType == 2">
|
|
|
+ and (
|
|
|
+ case
|
|
|
+ when kll.status = 2 then
|
|
|
+ true
|
|
|
+ when kll.status in (3, 4, 5) then
|
|
|
+ (
|
|
|
+ (
|
|
|
+ kllu2.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 = kll.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>
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
</where>
|