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

特需查询sql参数调整

parent 2a220a51
......@@ -249,6 +249,9 @@
<sql id="orderQuerySql">
<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 ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
......@@ -672,9 +675,6 @@
</foreach>
)
</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 != '' ">
AND (o.`number` like concat("%",concat(#{query.number},"%")) or o.order_id in( select distinct oi.order_id
from ecw_order_item oi
......@@ -849,6 +849,9 @@
<sql id="myOrderQuerySql">
<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 ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
......@@ -1096,9 +1099,6 @@
)
</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 != '' ">
AND (o.`number` like concat("%",concat(#{query.number},"%")) or o.order_id in( select distinct oi.order_id
from ecw_order_item oi
......@@ -1798,6 +1798,9 @@
<sql id="myOrderQuery">
<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 ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
......@@ -2355,9 +2358,7 @@
<if test="query.consignorPhone != null and query.consignorPhone != '' ">
AND nor.`phone` = #{query.consignorPhone}
</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 ">
AND nee.`customer_id` = #{query.consigneeId}
</if>
......@@ -2595,6 +2596,9 @@
<sql id="orderQuery">
<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 ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
......@@ -3211,9 +3215,6 @@
<if test="query.consignorPhone != null and query.consignorPhone != '' ">
AND nor.`phone` = #{query.consignorPhone}
</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 ">
AND nee.`customer_id` = #{query.consigneeId}
</if>
......@@ -3543,6 +3544,9 @@
<sql id="issuedOrderQuery">
<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 ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
......@@ -4097,9 +4101,6 @@
<if test="query.consignorId != null ">
AND nor.`customer_id` = #{query.consignorId}
</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 ">
AND nee.`customer_id` = #{query.consigneeId}
</if>
......@@ -5184,6 +5185,9 @@
</select>
<sql id="appOrderQurey">
<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 ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
......@@ -5327,9 +5331,6 @@
<if test="query.pdaDestWareIds != null and query.pdaDestWareIds != '' ">
AND FIND_IN_SET(ew_dest.`id`, #{query.pdaDestWareIds})
</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">
AND o.`is_external_warehouse` = #{query.isExternalWarehouse}
</if>
......@@ -6077,8 +6078,6 @@
from (
select
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.dial_code as cargo_control_country_code,
occ.phone as cargo_control_phone,
......@@ -6094,6 +6093,10 @@
left join ecw_order_cargo_control occ
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
<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">
AND o.`status` = #{query.status}
</if>
......@@ -6329,9 +6332,6 @@
<if test="query.beginCreateTime != null and query.endCreateTime != null ">
AND o.`create_time` between #{query.beginCreateTime} and #{query.endCreateTime}
</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 ">
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})
......@@ -6556,8 +6556,6 @@
from (
select
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_ratio,
occ.`name` as cargo_control_name,
......@@ -6575,6 +6573,10 @@
left join ecw_order_cargo_control occ
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
<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">
AND o.`status` = #{query.status}
</if>
......@@ -6810,9 +6812,7 @@
<if test="query.beginCreateTime != null and query.endCreateTime != null ">
AND o.`create_time` between #{query.beginCreateTime} and #{query.endCreateTime}
</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 ">
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})
......
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