Commit 2aa080f5 authored by zhengyi's avatar zhengyi

查询参数补充

parent 9468acdb
......@@ -571,6 +571,9 @@ public class OrderQueryVO {
@ApiModelProperty(value = "目的国ids")
private List<Long> destCountryIds ;
@ApiModelProperty(value = "订单类型筛选条件:0 普通订单 1 集运服务 2 海外仓")
private List<String> types;
@ApiModelProperty(value = "入仓类型")
private List<Integer> warehouseTypes;
......@@ -625,6 +628,7 @@ public class OrderQueryVO {
@ApiModelProperty(value = "是否有收货人")
private Boolean hasConsignee;
public void setHasConsignee(Boolean hasConsignee) {
if (Objects.nonNull(hasConsignee)) {
// 这里数据的条件正好相反,数据库是同步的客户信息设置,是否允许无收货人,true为允许无收货人
......
......@@ -1481,14 +1481,22 @@
</select>
<sql id="myOrderQuery">
<if test="query.type != null and query.type != '' and query.type.size()>0 ">
<if test="query.type != null and query.type != '' and query.type.size()>1 ">
<if test="query.type != null and query.type != '' and query.type == 0 ">
AND (o.type is null or o.type = '' or o.type = '0')
</if>
<if test="query.type == 1 ">
AND FIND_IN_SET(1, o.type)
</if>
<if test="query.type == 2 ">
AND FIND_IN_SET(2, o.type)
</if>
<if test="query.types != null and query.types.size()>0 ">
<if test=" query.types.size()>1 ">
AND (1 !=1
<foreach item='type' index="index" collection='query.type' >
<foreach item='type' index="index" collection='query.types' >
<if test="type == 0 ">
OR (o.type is null or o.type = '' or o.type = '0')
</if>
<if test="type == 1 ">
OR FIND_IN_SET(1, o.type)
......@@ -1499,8 +1507,8 @@
</foreach>
)
</if>
<if test="query.type != null and query.type != '' and query.type.size()==1 ">
<foreach item='type' index="index" collection='query.type' >
<if test="query.types.size()==1 ">
<foreach item='type' index="index" collection='query.types' >
<if test="type == 0 ">
AND (o.type is null or o.type = '' or o.type = '0')
......@@ -1513,7 +1521,6 @@
</if>
</foreach>
</if>
</if>
<if test="query.pdaStartWareIds != null and query.pdaStartWareIds != '' ">
......@@ -2284,6 +2291,37 @@
<if test="query.type == 2 ">
AND FIND_IN_SET(2, o.type)
</if>
<if test="query.types != null and query.types.size()>0 ">
<if test=" query.types.size()>1 ">
AND (1 !=1
<foreach item='type' index="index" collection='query.types' >
<if test="type == 0 ">
OR (o.type is null or o.type = '' or o.type = '0')
</if>
<if test="type == 1 ">
OR FIND_IN_SET(1, o.type)
</if>
<if test="type == 2 ">
OR FIND_IN_SET(2, o.type)
</if>
</foreach>
)
</if>
<if test="query.types.size()==1 ">
<foreach item='type' index="index" collection='query.types' >
<if test="type == 0 ">
AND (o.type is null or o.type = '' or o.type = '0')
</if>
<if test="type == 1 ">
AND FIND_IN_SET(1, o.type)
</if>
<if test="type == 2 ">
AND FIND_IN_SET(2, o.type)
</if>
</foreach>
</if>
</if>
<if test="query.pdaStartWareIds != null and query.pdaStartWareIds != '' ">
AND FIND_IN_SET(ew_start.`id`, #{query.pdaStartWareIds})
</if>
......@@ -3015,6 +3053,37 @@
<if test="query.type == 2 ">
AND FIND_IN_SET(2, o.type)
</if>
<if test="query.types != null and query.types.size()>0 ">
<if test=" query.types.size()>1 ">
AND (1 !=1
<foreach item='type' index="index" collection='query.types' >
<if test="type == 0 ">
OR (o.type is null or o.type = '' or o.type = '0')
</if>
<if test="type == 1 ">
OR FIND_IN_SET(1, o.type)
</if>
<if test="type == 2 ">
OR FIND_IN_SET(2, o.type)
</if>
</foreach>
)
</if>
<if test="query.types.size()==1 ">
<foreach item='type' index="index" collection='query.types' >
<if test="type == 0 ">
AND (o.type is null or o.type = '' or o.type = '0')
</if>
<if test="type == 1 ">
AND FIND_IN_SET(1, o.type)
</if>
<if test="type == 2 ">
AND FIND_IN_SET(2, o.type)
</if>
</foreach>
</if>
</if>
<if test="query.pdaStartWareIds != null and query.pdaStartWareIds != '' ">
AND FIND_IN_SET(ew_start.`id`, #{query.pdaStartWareIds})
</if>
......@@ -4404,6 +4473,37 @@
<if test="query.type == 2 ">
AND FIND_IN_SET(2, o.type)
</if>
<if test="query.types != null and query.types.size()>0 ">
<if test=" query.types.size()>1 ">
AND (1 !=1
<foreach item='type' index="index" collection='query.types' >
<if test="type == 0 ">
OR (o.type is null or o.type = '' or o.type = '0')
</if>
<if test="type == 1 ">
OR FIND_IN_SET(1, o.type)
</if>
<if test="type == 2 ">
OR FIND_IN_SET(2, o.type)
</if>
</foreach>
)
</if>
<if test="query.types.size()==1 ">
<foreach item='type' index="index" collection='query.types' >
<if test="type == 0 ">
AND (o.type is null or o.type = '' or o.type = '0')
</if>
<if test="type == 1 ">
AND FIND_IN_SET(1, o.type)
</if>
<if test="type == 2 ">
AND FIND_IN_SET(2, o.type)
</if>
</foreach>
</if>
</if>
<if test="query.pdaStartWareIds != null and query.pdaStartWareIds != '' ">
AND FIND_IN_SET(ew_start.`id`, #{query.pdaStartWareIds})
</if>
......@@ -4840,12 +4940,46 @@
<if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
<if test="query.type != null and query.type != '' and query.type == 0 ">
AND (o.type is null or o.type = '' or o.type = '0')
</if>
<if test="query.type == 1 ">
AND FIND_IN_SET(1, o.type)
</if>
<if test="query.type == 2 ">
AND FIND_IN_SET(2, o.type)
</if>
<if test="query.types != null and query.types.size()>0 ">
<if test=" query.types.size()>1 ">
AND (1 !=1
<foreach item='type' index="index" collection='query.types' >
<if test="type == 0 ">
OR (o.type is null or o.type = '' or o.type = '0')
</if>
<if test="type == 1 ">
OR FIND_IN_SET(1, o.type)
</if>
<if test="type == 2 ">
OR FIND_IN_SET(2, o.type)
</if>
</foreach>
)
</if>
<if test="query.types.size()==1 ">
<foreach item='type' index="index" collection='query.types' >
<if test="type == 0 ">
AND (o.type is null or o.type = '' or o.type = '0')
</if>
<if test="type == 1 ">
AND FIND_IN_SET(1, o.type)
</if>
<if test="type == 2 ">
AND FIND_IN_SET(2, o.type)
</if>
</foreach>
</if>
</if>
<if test="query.marks != null and query.marks != '' ">
AND o.`marks` like concat("%",concat(#{query.marks},"%"))
</if>
......@@ -5050,6 +5184,37 @@
<if test="query.type == 2 ">
AND FIND_IN_SET(2, o.type)
</if>
<if test="query.types != null and query.types.size()>0 ">
<if test=" query.types.size()>1 ">
AND (1 !=1
<foreach item='type' index="index" collection='query.types' >
<if test="type == 0 ">
OR (o.type is null or o.type = '' or o.type = '0')
</if>
<if test="type == 1 ">
OR FIND_IN_SET(1, o.type)
</if>
<if test="type == 2 ">
OR FIND_IN_SET(2, o.type)
</if>
</foreach>
)
</if>
<if test="query.types.size()==1 ">
<foreach item='type' index="index" collection='query.types' >
<if test="type == 0 ">
AND (o.type is null or o.type = '' or o.type = '0')
</if>
<if test="type == 1 ">
AND FIND_IN_SET(1, o.type)
</if>
<if test="type == 2 ">
AND FIND_IN_SET(2, o.type)
</if>
</foreach>
</if>
</if>
<if test="query.orderNo != null and query.orderNo != '' ">
AND o.`order_no` like concat("%",concat(#{query.orderNo},"%"))
</if>
......@@ -5242,6 +5407,37 @@
<if test="query.type == 2 ">
AND FIND_IN_SET(2, o.type)
</if>
<if test="query.types != null and query.types.size()>0 ">
<if test=" query.types.size()>1 ">
AND (1 !=1
<foreach item='type' index="index" collection='query.types' >
<if test="type == 0 ">
OR (o.type is null or o.type = '' or o.type = '0')
</if>
<if test="type == 1 ">
OR FIND_IN_SET(1, o.type)
</if>
<if test="type == 2 ">
OR FIND_IN_SET(2, o.type)
</if>
</foreach>
)
</if>
<if test="query.types.size()==1 ">
<foreach item='type' index="index" collection='query.types' >
<if test="type == 0 ">
AND (o.type is null or o.type = '' or o.type = '0')
</if>
<if test="type == 1 ">
AND FIND_IN_SET(1, o.type)
</if>
<if test="type == 2 ">
AND FIND_IN_SET(2, o.type)
</if>
</foreach>
</if>
</if>
<if test="query.orderNo != null and query.orderNo != '' ">
AND o.`order_no` like concat("%",concat(#{query.orderNo},"%"))
</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