Commit 066fe581 authored by zhengyi's avatar zhengyi

订单动态多值查询bug修复

parent 8e7bcdb1
......@@ -143,106 +143,47 @@
<sql id="dynamicQuery">
<if test="query.dynamicStatusList != null and query.dynamicStatusList.size()>0">
AND (1 != 1
<if test="query.dynamicStatusList.size()==1 ">
or o.`status` =
<foreach item='status' index="index" collection='query.dynamicStatusList' >
#{status}
</foreach>
</if>
<if test="query.dynamicStatusList.size()>1 ">
or o.`status` in
<foreach item='status' index="index" collection='query.dynamicStatusList' open='(' separator=',' close=')'>
#{status}
</foreach>
</if>
<if test="query.dynamicShipmentStateList != null and query.dynamicShipmentStateList.size()>0">
<if test="query.dynamicShipmentStateList.size()==1 ">
or o.`shipment_State` =
<foreach item='shipmentState' index="index" collection='query.dynamicShipmentStateList' >
#{shipmentState}
</foreach>
</if>
<if test="query.dynamicShipmentStateList.size()>1 ">
or o.`shipment_State` in
<foreach item='shipmentState' index="index" collection='query.dynamicShipmentStateList' open='(' separator=',' close=')'>
#{shipmentState}
</foreach>
</if>
</if>
<if test="query.dynamicTransportIdList != null and query.dynamicTransportIdList.size() > 0">
or o.`transport_id` in
<foreach item='transportId' index='index' collection='query.dynamicTransportIdList' open='(' separator=',' close=')'>
#{transportId}
</foreach>
</if>
<if test="query.dynamicAirShipmentList != null and query.dynamicAirShipmentList.size() > 0">
<foreach item='airShipment' index="index" collection='query.dynamicAirShipmentList'>
<foreach item='status' index="index" collection='query.dynamicStatusList'>
<choose>
<when test="airShipment == 1">
or (o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0)
<when test="status == 12325">
or (o.`status` = 12 and o.`shipment_State` = 325)
</when>
<when test="airShipment == 2">
or (o.`status` = 5 AND o.air_shipment = 2)
<when test="status == 10501">
or (o.`status` = 5 AND o.air_shipment = 1 and o.abnormal_state = 0 and o.audit_type = 0 and o.transport_id = 3)
</when>
<when test="airShipment == 3">
or (o.`status` = 5 AND o.air_shipment = 3)
<when test="status == 10502">
or (o.`status` = 5 AND o.air_shipment in(2,3) and o.abnormal_state = 0 and o.audit_type = 0 and o.transport_id = 3)
</when>
<when test="airShipment == 4">
or (o.`status` = 5 AND o.air_shipment = 4)
<when test="status == 10503">
or (o.`status` = 5 AND o.air_shipment = 4 and o.transport_id = 3)
</when>
<when test="airShipment == 10">
or (o.`status` = 5 AND o.air_shipment in(2,3,4))
</when>
<when test="airShipment == 11">
or (o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0)
</when>
<when test="airShipment == 12">
or (o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0)
</when>
<when test="airShipment == 20">
or (o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0)
<when test="status == 10504">
or (
o.`status` = 5 and o.abnormal_state = 0 and o.audit_type = 0
and (
(o.transport_id = 3 AND o.air_shipment in(2,3,4))
or
(o.transport_id = 1 AND o.air_shipment in(0,2,3,4))
)
)
</when>
</choose>
</foreach>
</if>
<if test="query.dynamicAbnormalStateList != null and query.dynamicAbnormalStateList.size()>0">
<foreach item='abnormalState' index="index" collection='query.dynamicAbnormalStateList'>
<choose>
<when test="abnormalState != '0'">
<choose>
<when test="abnormalState != '-1'">
OR o.`abnormal_state` = #{abnormalState}
<when test="status == 132411">
or (o.`status` = 32 AND o.shipment_State = 411 and o.transport_id = 3)
</when>
<otherwise>
OR o.`abnormal_state` != 0
</otherwise>
</choose>
<when test="status == 132412">
or (o.`status` = 32 AND o.shipment_State = 412 and o.transport_id = 3)
</when>
<otherwise>
OR o.`abnormal_state` = 0
</otherwise>
</choose>
</foreach>
</if>
<if test="query.dynamicAuditTypeList != null and query.dynamicAuditTypeList.size()>0">
<foreach item='auditType' index="index" collection='query.dynamicAuditTypeList'>
<choose>
<when test="auditType != 0">
<choose>
<when test="auditType != -1">
or o.`audit_type` = #{auditType}
<when test="status == 132409">
or (o.`status` = 32 AND o.shipment_State = 409 and o.transport_id = 3)
</when>
<otherwise>
or o.`audit_type` != 0
</otherwise>
</choose>
<when test="status == 118428">
or (o.`status` = 32 AND o.shipment_State = 428 and o.transport_id = 3)
</when>
<otherwise>
or o.`audit_type` = 0
or o.`status` = #{status}
</otherwise>
</choose>
</foreach>
</if>
)
</if>
</sql>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment