From e3bac98f092a10c0e897143bece3abbcc59469f2 Mon Sep 17 00:00:00 2001
From: cjl <276999030@qq.com>
Date: Fri, 27 Oct 2023 10:06:24 +0800
Subject: [PATCH] fix:小程序提交

---
 screen-api/src/main/resources/mapper/AllocationMapper.xml |   44 ++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/screen-api/src/main/resources/mapper/AllocationMapper.xml b/screen-api/src/main/resources/mapper/AllocationMapper.xml
index 32c9a32..6460447 100644
--- a/screen-api/src/main/resources/mapper/AllocationMapper.xml
+++ b/screen-api/src/main/resources/mapper/AllocationMapper.xml
@@ -59,6 +59,7 @@
         </where>
     </select>
 
+
     <select id="extPage" resultType="com.moral.api.pojo.ext.allocation.AllocationPageExt">
         SELECT
         <include refid="Allocation_Column_List"/>,t1.id as applyState
@@ -66,7 +67,7 @@
         left join allocation_extension t1 on t1.allocation_id = allocation.allocation_id and t1.is_del =0 and t1.is_invalid = 0 and t1.state = 30
         <where>
             1 = 1 and allocation.is_del = 0
-            <if test="allocation.unitId != null and allocation.unitId != 0">
+            <if test="allocation.unitId != null">
                 and allocation.unit_id = #{allocation.unitId}
             </if>
             <if test="allocation.polluteType != null and allocation.polluteType != 0">
@@ -81,7 +82,7 @@
             <if test="allocation.changeType != null and allocation.changeType != 0">
                 and allocation.change_type = #{allocation.changeType}
             </if>
-            <if test="allocation.isInvalid != null and allocation.isInvalid != 0">
+            <if test="allocation.isInvalid != null">
                 and allocation.is_invalid = #{allocation.isInvalid}
             </if>
             <if test="allocation.startTime != null and allocation.startTime != '' ">
@@ -90,6 +91,45 @@
             <if test="allocation.endTime != null and allocation.endTime !='' ">
                 and date(allocation.escalation_time) <![CDATA[<=]]>  #{allocation.endTime}
             </if>
+            <if test="allocation.allocationNum != null and allocation.allocationNum !='' ">
+                and allocation.allocation_num LIKE CONCAT('%',#{allocation.allocationNum},'%')
+            </if>
+            <if test="allocation.unitList != null and allocation.unitList.size !=0">
+                and allocation.state in
+                <foreach collection="allocation.unitList" item="id" index="index" open="(" close=")" separator=",">
+                    #{id}
+                </foreach>
+
+            </if>
+        </where>
+        order by allocation.escalation_time desc,allocation.allocation_id desc
+    </select>
+
+    <select id="extAppPage" resultType="com.moral.api.pojo.ext.allocation.AllocationPageExt">
+        SELECT
+        <include refid="Allocation_Column_List"/>
+        FROM allocation allocation
+        <where>
+        1 = 1 and allocation.is_del = 0
+            <if test="allocation.startTime != null and allocation.startTime != '' ">
+                and date(allocation.escalation_time) <![CDATA[>=]]> #{allocation.startTime}
+            </if>
+            <if test="allocation.endTime != null and allocation.endTime !='' ">
+                and date(allocation.escalation_time) <![CDATA[<=]]>  #{allocation.endTime}
+            </if>
+            <if test="allocation.stateList != null and allocation.stateList.size !=0">
+                and allocation.state in
+                <foreach collection="allocation.stateList" item="id" index="index" open="(" close=")" separator=",">
+                    #{id}
+                </foreach>
+
+            </if>
+            <if test="allocation.unitList != null and allocation.unitList.size !=0">
+                and allocation.unit_id in
+                <foreach collection="allocation.unitList" item="id" index="index" open="(" close=")" separator=",">
+                    #{id}
+                </foreach>
+            </if>
         </where>
         order by allocation.escalation_time desc,allocation.allocation_id desc
     </select>

--
Gitblit v1.8.0