From 19ff5993c13a86934fe29b3a58a88d29258dfda5 Mon Sep 17 00:00:00 2001
From: lyfO_o <764716047@qq.com>
Date: 星期一, 13 十二月 2021 10:28:47 +0800
Subject: [PATCH] 货柜预警:判断重复插入

---
 src/main/java/com/nanometer/smartlab/dao/OpeApplyDao.xml |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/nanometer/smartlab/dao/OpeApplyDao.xml b/src/main/java/com/nanometer/smartlab/dao/OpeApplyDao.xml
index f4c2a24..56a1cff 100644
--- a/src/main/java/com/nanometer/smartlab/dao/OpeApplyDao.xml
+++ b/src/main/java/com/nanometer/smartlab/dao/OpeApplyDao.xml
@@ -355,7 +355,7 @@
         <if test="userId != null and userId != ''">
             and oa.apply_user_id =#{userId}
         </if>
-        <if test="status != null and status != ''">
+        <if test="status != null ">
             and oa.status =#{status}
         </if>
         <if test="productSn != null and productSn != ''">
@@ -389,7 +389,16 @@
         LEFT JOIN base_meta AS bm1 ON sr.product_home = bm1.id
         LEFT JOIN sys_project as project on project.project = su.project
         LEFT JOIN sys_user as su1 on su1.id = project.sys_user_id
-        where oa.valid_flag = 1 and (oa.status=4 or oa.status=6 or oa.status = 10)
+        where oa.valid_flag = 1 and (
+        <choose>
+            <when test="status != null and status == 10">
+                oa.status = 10
+            </when>
+            <otherwise>
+                oa.status=4 or oa.status=6
+            </otherwise>
+        </choose>
+        )
         <include refid="getOpeApplyReserveList_queryWhereSql" />
         <if test="isAllApply != null">
             <choose>
@@ -457,7 +466,7 @@
         LEFT JOIN sys_user as su1 on su1.id = project.sys_user_id
         where oa.valid_flag = 1 and (
         <choose>
-            <when test="status == @com.nanometer.smartlab.entity.enumtype.ApplyStatus@EXPIRED">
+            <when test="status != null and status == 10">
                 oa.status = 10
             </when>
             <otherwise>
@@ -474,7 +483,7 @@
         <if test="userId != null and userId != ''">
             and oa.apply_user_id =#{userId}
         </if>
-        <if test="status != null and status != ''">
+        <if test="status != null ">
             and oa.status =#{status}
         </if>
         <if test="productSn != null and productSn != ''">

--
Gitblit v1.9.2