Commit 531164a7 authored by 332784038@qq.com's avatar 332784038@qq.com

订单动态多参数查询bug修复

parent 644b7db7
......@@ -140,8 +140,115 @@
<include refid="myOrderQuery">
</include>
</select>
<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.statusList' >
#{status}
</foreach>
</if>
<if test="query.dynamicStatusList.size()>1 ">
or o.`status` in
<foreach item='status' index="index" collection='query.statusList' open='(' separator=',' close=')'>
#{status}
</foreach>
</if>
<if test="query.dynamicShipmentStateList != null and query.dynamicShipmentStateList.size()>0">
<if test="query.dynamicShipmentStateList.size()==1 ">
AND o.`shipment_State` =
<foreach item='shipmentState' index="index" collection='query.dynamicShipmentStateList' >
#{shipmentState}
</foreach>
</if>
<if test="query.dynamicShipmentStateList.size()>1 ">
AND 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">
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'>
<choose>
<when test="airShipment == 1">
or (o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0)
</when>
<when test="airShipment == 2">
or (o.`status` = 5 AND o.air_shipment = 2)
</when>
<when test="airShipment == 3">
or (o.`status` = 5 AND o.air_shipment = 3)
</when>
<when test="airShipment == 4">
or (o.`status` = 5 AND o.air_shipment = 4)
</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>
</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>
<otherwise>
OR o.`abnormal_state` != 0
</otherwise>
</choose>
</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>
<otherwise>
or o.`audit_type` != 0
</otherwise>
</choose>
</when>
<otherwise>
or o.`audit_type` = 0
</otherwise>
</choose>
</foreach>
</if>
)
</if>
</sql>
<sql id="orderQuerySql">
<include refid="dynamicQuery"/>
<if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
......@@ -367,7 +474,6 @@
#{shipmentState}
</foreach>
</if>
<if test="query.shipmentStateList != null and query.shipmentStateList.size()>1 ">
AND o.`shipment_State` in
<foreach item='shipmentState' index="index" collection='query.shipmentStateList' open='(' separator=',' close=')'>
......@@ -742,6 +848,7 @@
</sql>
<sql id="myOrderQuerySql">
<include refid="dynamicQuery"/>
<if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
......@@ -1690,6 +1797,7 @@
</select>
<sql id="myOrderQuery">
<include refid="dynamicQuery"/>
<if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
......@@ -2486,6 +2594,7 @@
<sql id="orderQuery">
<include refid="dynamicQuery"/>
<if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
......@@ -3433,6 +3542,7 @@
</sql>
<sql id="issuedOrderQuery">
<include refid="dynamicQuery"/>
<if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
......@@ -5073,6 +5183,7 @@
<include refid="appOrderQurey"/>
</select>
<sql id="appOrderQurey">
<include refid="dynamicQuery"/>
<if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
......
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