Commit e5d427d7 authored by 332784038@qq.com's avatar 332784038@qq.com

特需查询sql参数调整

parent 2a220a51
...@@ -249,6 +249,9 @@ ...@@ -249,6 +249,9 @@
<sql id="orderQuerySql"> <sql id="orderQuerySql">
<include refid="dynamicQuery"/> <include refid="dynamicQuery"/>
<if test="query.packageType != null and query.packageType != '' ">
AND CONCAT(',',o.package_type,',') REGEXP CONCAT(',',REPLACE(#{query.packageType},',',',|,'), ',')
</if>
<if test="query.isNeat == false "> <if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum' AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if> </if>
...@@ -672,9 +675,6 @@ ...@@ -672,9 +675,6 @@
</foreach> </foreach>
) )
</if> </if>
<if test="query.packageType != null and query.packageType != '' ">
AND CONCAT(',',o.package_type,',') REGEXP CONCAT(',',REPLACE(#{query.packageType},',',',|,'), ',')
</if>
<if test="query.number != null and query.number != '' "> <if test="query.number != null and query.number != '' ">
AND (o.`number` like concat("%",concat(#{query.number},"%")) or o.order_id in( select distinct oi.order_id AND (o.`number` like concat("%",concat(#{query.number},"%")) or o.order_id in( select distinct oi.order_id
from ecw_order_item oi from ecw_order_item oi
...@@ -849,6 +849,9 @@ ...@@ -849,6 +849,9 @@
<sql id="myOrderQuerySql"> <sql id="myOrderQuerySql">
<include refid="dynamicQuery"/> <include refid="dynamicQuery"/>
<if test="query.packageType != null and query.packageType != '' ">
AND CONCAT(',',o.package_type,',') REGEXP CONCAT(',',REPLACE(#{query.packageType},',',',|,'), ',')
</if>
<if test="query.isNeat == false "> <if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum' AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if> </if>
...@@ -1096,9 +1099,6 @@ ...@@ -1096,9 +1099,6 @@
) )
</if> </if>
</if> </if>
<if test="query.packageType != null and query.packageType != '' ">
AND CONCAT(',',o.package_type,',') REGEXP CONCAT(',',REPLACE(#{query.packageType},',',',|,'), ',')
</if>
<if test="query.number != null and query.number != '' "> <if test="query.number != null and query.number != '' ">
AND (o.`number` like concat("%",concat(#{query.number},"%")) or o.order_id in( select distinct oi.order_id AND (o.`number` like concat("%",concat(#{query.number},"%")) or o.order_id in( select distinct oi.order_id
from ecw_order_item oi from ecw_order_item oi
...@@ -1798,6 +1798,9 @@ ...@@ -1798,6 +1798,9 @@
<sql id="myOrderQuery"> <sql id="myOrderQuery">
<include refid="dynamicQuery"/> <include refid="dynamicQuery"/>
<if test="query.packageType != null and query.packageType != '' ">
AND CONCAT(',',o.package_type,',') REGEXP CONCAT(',',REPLACE(#{query.packageType},',',',|,'), ',')
</if>
<if test="query.isNeat == false "> <if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum' AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if> </if>
...@@ -2355,9 +2358,7 @@ ...@@ -2355,9 +2358,7 @@
<if test="query.consignorPhone != null and query.consignorPhone != '' "> <if test="query.consignorPhone != null and query.consignorPhone != '' ">
AND nor.`phone` = #{query.consignorPhone} AND nor.`phone` = #{query.consignorPhone}
</if> </if>
<if test="query.packageType != null and query.packageType != '' ">
AND CONCAT(',',o.package_type,',') REGEXP CONCAT(',',REPLACE(#{query.packageType},',',',|,'), ',')
</if>
<if test="query.consigneeId != null "> <if test="query.consigneeId != null ">
AND nee.`customer_id` = #{query.consigneeId} AND nee.`customer_id` = #{query.consigneeId}
</if> </if>
...@@ -2595,6 +2596,9 @@ ...@@ -2595,6 +2596,9 @@
<sql id="orderQuery"> <sql id="orderQuery">
<include refid="dynamicQuery"/> <include refid="dynamicQuery"/>
<if test="query.packageType != null and query.packageType != '' ">
AND CONCAT(',',o.package_type,',') REGEXP CONCAT(',',REPLACE(#{query.packageType},',',',|,'), ',')
</if>
<if test="query.isNeat == false "> <if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum' AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if> </if>
...@@ -3211,9 +3215,6 @@ ...@@ -3211,9 +3215,6 @@
<if test="query.consignorPhone != null and query.consignorPhone != '' "> <if test="query.consignorPhone != null and query.consignorPhone != '' ">
AND nor.`phone` = #{query.consignorPhone} AND nor.`phone` = #{query.consignorPhone}
</if> </if>
<if test="query.packageType != null and query.packageType != '' ">
AND CONCAT(',',o.package_type,',') REGEXP CONCAT(',',REPLACE(#{query.packageType},',',',|,'), ',')
</if>
<if test="query.consigneeId != null "> <if test="query.consigneeId != null ">
AND nee.`customer_id` = #{query.consigneeId} AND nee.`customer_id` = #{query.consigneeId}
</if> </if>
...@@ -3543,6 +3544,9 @@ ...@@ -3543,6 +3544,9 @@
<sql id="issuedOrderQuery"> <sql id="issuedOrderQuery">
<include refid="dynamicQuery"/> <include refid="dynamicQuery"/>
<if test="query.packageType != null and query.packageType != '' ">
AND CONCAT(',',o.package_type,',') REGEXP CONCAT(',',REPLACE(#{query.packageType},',',',|,'), ',')
</if>
<if test="query.isNeat == false "> <if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum' AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if> </if>
...@@ -4097,9 +4101,6 @@ ...@@ -4097,9 +4101,6 @@
<if test="query.consignorId != null "> <if test="query.consignorId != null ">
AND nor.`customer_id` = #{query.consignorId} AND nor.`customer_id` = #{query.consignorId}
</if> </if>
<if test="query.packageType != null and query.packageType != '' ">
AND CONCAT(',',o.package_type,',') REGEXP CONCAT(',',REPLACE(#{query.packageType},',',',|,'), ',')
</if>
<if test="query.consigneeId != null "> <if test="query.consigneeId != null ">
AND nee.`customer_id` = #{query.consigneeId} AND nee.`customer_id` = #{query.consigneeId}
</if> </if>
...@@ -5184,6 +5185,9 @@ ...@@ -5184,6 +5185,9 @@
</select> </select>
<sql id="appOrderQurey"> <sql id="appOrderQurey">
<include refid="dynamicQuery"/> <include refid="dynamicQuery"/>
<if test="query.packageType != null and query.packageType != '' ">
AND CONCAT(',',o.package_type,',') REGEXP CONCAT(',',REPLACE(#{query.packageType},',',',|,'), ',')
</if>
<if test="query.isNeat == false "> <if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum' AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if> </if>
...@@ -5327,9 +5331,6 @@ ...@@ -5327,9 +5331,6 @@
<if test="query.pdaDestWareIds != null and query.pdaDestWareIds != '' "> <if test="query.pdaDestWareIds != null and query.pdaDestWareIds != '' ">
AND FIND_IN_SET(ew_dest.`id`, #{query.pdaDestWareIds}) AND FIND_IN_SET(ew_dest.`id`, #{query.pdaDestWareIds})
</if> </if>
<if test="query.packageType != null and query.packageType != '' ">
AND CONCAT(',',o.package_type,',') REGEXP CONCAT(',',REPLACE(#{query.packageType},',',',|,'), ',')
</if>
<if test="query.isExternalWarehouse != null"> <if test="query.isExternalWarehouse != null">
AND o.`is_external_warehouse` = #{query.isExternalWarehouse} AND o.`is_external_warehouse` = #{query.isExternalWarehouse}
</if> </if>
...@@ -6077,8 +6078,6 @@ ...@@ -6077,8 +6078,6 @@
from ( from (
select select
o.*, o.*,
-- (select ifnull(sum(ccp.pick_num),0) from ecw_order_cargo_control_pick ccp where ccp.order_id = o.order_id and
-- ccp.status in(1,2,3,4) ) as release_num,
occ.`name` as cargo_control_name, occ.`name` as cargo_control_name,
occ.dial_code as cargo_control_country_code, occ.dial_code as cargo_control_country_code,
occ.phone as cargo_control_phone, occ.phone as cargo_control_phone,
...@@ -6094,6 +6093,10 @@ ...@@ -6094,6 +6093,10 @@
left join ecw_order_cargo_control occ left join ecw_order_cargo_control occ
on occ.order_id = nor.order_id and occ.is_actual = 1 and occ.deleted = 0 on occ.order_id = nor.order_id and occ.is_actual = 1 and occ.deleted = 0
where o.deleted = 0 and o.in_warehouse_state != 211 and o.in_warehouse_state != 208 and o.status != 10 where o.deleted = 0 and o.in_warehouse_state != 211 and o.in_warehouse_state != 208 and o.status != 10
<include refid="dynamicQuery"/>
<if test="query.packageType != null and query.packageType != '' ">
AND CONCAT(',',o.package_type,',') REGEXP CONCAT(',',REPLACE(#{query.packageType},',',',|,'), ',')
</if>
<if test="query.status != null"> <if test="query.status != null">
AND o.`status` = #{query.status} AND o.`status` = #{query.status}
</if> </if>
...@@ -6329,9 +6332,6 @@ ...@@ -6329,9 +6332,6 @@
<if test="query.beginCreateTime != null and query.endCreateTime != null "> <if test="query.beginCreateTime != null and query.endCreateTime != null ">
AND o.`create_time` between #{query.beginCreateTime} and #{query.endCreateTime} AND o.`create_time` between #{query.beginCreateTime} and #{query.endCreateTime}
</if> </if>
<if test="query.packageType != null and query.packageType != '' ">
AND CONCAT(',',o.package_type,',') REGEXP CONCAT(',',REPLACE(#{query.packageType},',',',|,'), ',')
</if>
<if test="query.beginPickTime != null and query.endPickTime != null "> <if test="query.beginPickTime != null and query.endPickTime != null ">
AND o.order_id in(select distinct op.order_id from ecw_order_cargo_control_pick op where op.deleted = 0 and AND o.order_id in(select distinct op.order_id from ecw_order_cargo_control_pick op where op.deleted = 0 and
op.status in(1,3) and op.`create_time` between #{query.beginPickTime} and #{query.endPickTime}) op.status in(1,3) and op.`create_time` between #{query.beginPickTime} and #{query.endPickTime})
...@@ -6556,8 +6556,6 @@ ...@@ -6556,8 +6556,6 @@
from ( from (
select select
o.*, o.*,
-- (select ifnull(sum(ccp.pick_num),0) from ecw_order_cargo_control_pick ccp where ccp.order_id = o.order_id and
-- ccp.status in(1,2,3,4) ) as release_num,
o.release_num, o.release_num,
o.release_ratio, o.release_ratio,
occ.`name` as cargo_control_name, occ.`name` as cargo_control_name,
...@@ -6575,6 +6573,10 @@ ...@@ -6575,6 +6573,10 @@
left join ecw_order_cargo_control occ left join ecw_order_cargo_control occ
on occ.order_id = nor.order_id and occ.is_actual = 1 and occ.deleted = 0 on occ.order_id = nor.order_id and occ.is_actual = 1 and occ.deleted = 0
where o.deleted = 0 and o.in_warehouse_state != 211 and o.in_warehouse_state != 208 and o.status != 10 where o.deleted = 0 and o.in_warehouse_state != 211 and o.in_warehouse_state != 208 and o.status != 10
<include refid="dynamicQuery"/>
<if test="query.packageType != null and query.packageType != '' ">
AND CONCAT(',',o.package_type,',') REGEXP CONCAT(',',REPLACE(#{query.packageType},',',',|,'), ',')
</if>
<if test="query.status != null"> <if test="query.status != null">
AND o.`status` = #{query.status} AND o.`status` = #{query.status}
</if> </if>
...@@ -6810,9 +6812,7 @@ ...@@ -6810,9 +6812,7 @@
<if test="query.beginCreateTime != null and query.endCreateTime != null "> <if test="query.beginCreateTime != null and query.endCreateTime != null ">
AND o.`create_time` between #{query.beginCreateTime} and #{query.endCreateTime} AND o.`create_time` between #{query.beginCreateTime} and #{query.endCreateTime}
</if> </if>
<if test="query.packageType != null and query.packageType != '' ">
AND CONCAT(',',o.package_type,',') REGEXP CONCAT(',',REPLACE(#{query.packageType},',',',|,'), ',')
</if>
<if test="query.beginPickTime != null and query.endPickTime != null "> <if test="query.beginPickTime != null and query.endPickTime != null ">
AND o.order_id in(select distinct op.order_id from ecw_order_cargo_control_pick op where op.deleted = 0 and AND o.order_id in(select distinct op.order_id from ecw_order_cargo_control_pick op where op.deleted = 0 and
op.status in(1,3) and op.`create_time` between #{query.beginPickTime} and #{query.endPickTime}) op.status in(1,3) and op.`create_time` between #{query.beginPickTime} and #{query.endPickTime})
......
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