mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 05:42:06 +08:00
订单管理、装配设置 条件过滤作用到子单修复
This commit is contained in:
+122
-35
@@ -34,23 +34,32 @@
|
|||||||
t.root_id
|
t.root_id
|
||||||
|
|
||||||
FROM orders t
|
FROM orders t
|
||||||
|
where 1=1
|
||||||
|
|
||||||
<if test="reqVO.processStatus != null">
|
<if test="reqVO.assembly or reqVO.processStatus != null">
|
||||||
JOIN order_component oc
|
|
||||||
ON oc.order_id = t.id
|
|
||||||
AND oc.deleted = 0
|
|
||||||
AND oc.pid = 0
|
|
||||||
</if>
|
|
||||||
|
|
||||||
WHERE 1 = 1
|
|
||||||
|
|
||||||
<if test="reqVO.assembly and reqVO.processStatus == null">
|
|
||||||
AND EXISTS (
|
AND EXISTS (
|
||||||
SELECT 1
|
SELECT 1
|
||||||
FROM order_component oc
|
FROM order_component oc
|
||||||
WHERE oc.order_id = t.id
|
WHERE oc.order_id = t.id
|
||||||
AND oc.deleted = 0
|
AND oc.deleted = 0
|
||||||
AND oc.pid = 0
|
AND oc.pid = 0
|
||||||
|
<if test="reqVO.processStatus != null">
|
||||||
|
<choose>
|
||||||
|
<when test="reqVO.processStatus == 0">
|
||||||
|
AND oc.extra_process_status = 0
|
||||||
|
</when>
|
||||||
|
<when test="reqVO.processStatus == 1">
|
||||||
|
AND oc.process_status = 1
|
||||||
|
AND (oc.extra_process_status IS NULL OR oc.extra_process_status != 0)
|
||||||
|
</when>
|
||||||
|
<when test="reqVO.processStatus == 2">
|
||||||
|
AND oc.process_status = 2
|
||||||
|
</when>
|
||||||
|
<when test="reqVO.processStatus == 3">
|
||||||
|
AND oc.extra_process_status = 3
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</if>
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
@@ -134,31 +143,6 @@
|
|||||||
AND t.create_time BETWEEN #{reqVO.createTime[0]} AND #{reqVO.createTime[1]}
|
AND t.create_time BETWEEN #{reqVO.createTime[0]} AND #{reqVO.createTime[1]}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="reqVO.processStatus != null">
|
|
||||||
|
|
||||||
<choose>
|
|
||||||
|
|
||||||
<when test="reqVO.processStatus == 0">
|
|
||||||
AND oc.extra_process_status = 0
|
|
||||||
</when>
|
|
||||||
|
|
||||||
<when test="reqVO.processStatus == 1">
|
|
||||||
AND oc.process_status = 1
|
|
||||||
AND oc.extra_process_status IS NULL
|
|
||||||
</when>
|
|
||||||
|
|
||||||
<when test="reqVO.processStatus == 2">
|
|
||||||
AND oc.process_status = 2
|
|
||||||
</when>
|
|
||||||
|
|
||||||
<when test="reqVO.processStatus == 3">
|
|
||||||
AND oc.extra_process_status = 3
|
|
||||||
</when>
|
|
||||||
|
|
||||||
</choose>
|
|
||||||
|
|
||||||
</if>
|
|
||||||
|
|
||||||
AND t.deleted = #{reqVO.deleted}
|
AND t.deleted = #{reqVO.deleted}
|
||||||
|
|
||||||
<choose>
|
<choose>
|
||||||
@@ -202,6 +186,109 @@
|
|||||||
#{parentId}
|
#{parentId}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
||||||
|
<if test="reqVO.assembly or reqVO.processStatus != null">
|
||||||
|
AND EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM order_component oc
|
||||||
|
WHERE oc.order_id = t.id
|
||||||
|
AND oc.deleted = 0
|
||||||
|
AND oc.pid = 0
|
||||||
|
<if test="reqVO.processStatus != null">
|
||||||
|
<choose>
|
||||||
|
<when test="reqVO.processStatus == 0">
|
||||||
|
AND oc.extra_process_status = 0
|
||||||
|
</when>
|
||||||
|
<when test="reqVO.processStatus == 1">
|
||||||
|
AND oc.process_status = 1
|
||||||
|
AND (oc.extra_process_status IS NULL OR oc.extra_process_status != 0)
|
||||||
|
</when>
|
||||||
|
<when test="reqVO.processStatus == 2">
|
||||||
|
AND oc.process_status = 2
|
||||||
|
</when>
|
||||||
|
<when test="reqVO.processStatus == 3">
|
||||||
|
AND oc.extra_process_status = 3
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</if>
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="reqVO.id != null and reqVO.id != ''">
|
||||||
|
AND CAST(t.id AS CHAR) LIKE CONCAT('%', #{reqVO.id}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="reqVO.apiOrderId != null and reqVO.apiOrderId != ''">
|
||||||
|
AND t.api_order_id = #{reqVO.apiOrderId}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="reqVO.orderDate != null and reqVO.orderDate.length == 2">
|
||||||
|
AND t.order_date BETWEEN #{reqVO.orderDate[0]} AND #{reqVO.orderDate[1]}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="reqVO.deliveryDate != null and reqVO.deliveryDate.length == 2">
|
||||||
|
AND t.delivery_date BETWEEN #{reqVO.deliveryDate[0]} AND #{reqVO.deliveryDate[1]}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="reqVO.orderType != null">
|
||||||
|
AND t.order_type = #{reqVO.orderType}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="reqVO.orderSort != null">
|
||||||
|
AND t.order_sort = #{reqVO.orderSort}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="reqVO.dataType != null">
|
||||||
|
AND t.data_type = #{reqVO.dataType}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="reqVO.status != null">
|
||||||
|
AND t.status = #{reqVO.status}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="reqVO.customOrderNo != null and reqVO.customOrderNo != ''">
|
||||||
|
AND t.custom_order_no LIKE CONCAT('%', #{reqVO.customOrderNo}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="reqVO.customer != null and reqVO.customer != ''">
|
||||||
|
AND t.customer = #{reqVO.customer}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="reqVO.address != null and reqVO.address != ''">
|
||||||
|
AND t.address LIKE CONCAT('%', #{reqVO.address}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="reqVO.phoneNumber != null and reqVO.phoneNumber != ''">
|
||||||
|
AND t.phone_number = #{reqVO.phoneNumber}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="reqVO.dealer != null and reqVO.dealer != ''">
|
||||||
|
AND t.dealer LIKE CONCAT('%', #{reqVO.dealer}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="reqVO.dealerPhoneNumber != null and reqVO.dealerPhoneNumber != ''">
|
||||||
|
AND t.dealer_phone_number = #{reqVO.dealerPhoneNumber}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="reqVO.salesman != null and reqVO.salesman != ''">
|
||||||
|
AND t.salesman = #{reqVO.salesman}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="reqVO.splitter != null and reqVO.splitter != ''">
|
||||||
|
AND t.splitter = #{reqVO.splitter}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="reqVO.remark != null and reqVO.remark != ''">
|
||||||
|
AND t.remark = #{reqVO.remark}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="reqVO.organId != null">
|
||||||
|
AND t.organ_id = #{reqVO.organId}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="reqVO.createTime != null and reqVO.createTime.length == 2">
|
||||||
|
AND t.create_time BETWEEN #{reqVO.createTime[0]} AND #{reqVO.createTime[1]}
|
||||||
|
</if>
|
||||||
|
|
||||||
AND t.deleted = #{reqVO.deleted}
|
AND t.deleted = #{reqVO.deleted}
|
||||||
|
|
||||||
ORDER BY t.id DESC
|
ORDER BY t.id DESC
|
||||||
|
|||||||
Reference in New Issue
Block a user