From 0afd6c073589d5221774dab5cf4a9d21415ec0e8 Mon Sep 17 00:00:00 2001
From: value <z1292839451@163.com>
Date: 星期四, 31 八月 2023 18:00:44 +0800
Subject: [PATCH] 修改bug

---
 inspection-server/src/main/resources/mapper/QualificationRateStatisticsMapper.xml |   24 +++++++++++-------------
 1 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/inspection-server/src/main/resources/mapper/QualificationRateStatisticsMapper.xml b/inspection-server/src/main/resources/mapper/QualificationRateStatisticsMapper.xml
index bb63097..a9a3d21 100644
--- a/inspection-server/src/main/resources/mapper/QualificationRateStatisticsMapper.xml
+++ b/inspection-server/src/main/resources/mapper/QualificationRateStatisticsMapper.xml
@@ -11,7 +11,7 @@
         i.end_time endTime
         FROM inspection i
         INNER JOIN inspection_material im ON i.id = im.inspection_id
-        where (i.state = 1 AND i.inspection_status is NOT NULL and im.state=1)
+        where (i.state = 1  and im.state=1)
         <if test="dto.beginDate!=null and dto.endDate!=null">
             DATE_FORMAT( i.end_time, '%Y-%m-%d' ) BETWEEN #{dto.beginDate}
             AND #{dto.endDate}
@@ -27,7 +27,7 @@
             and im.name=#{dto.sample}
         </if>
         <if test="dto.code!=null and dto.code!=''">
-            and i.code=#{dto.code}
+            and im.code=#{dto.code}
         </if>
     </select>
     <select id="selectProjectionsByCondition" resultMap="ImInfoMap">
@@ -40,7 +40,7 @@
         ipr.id iprId,
         ipr.`name` iprName,
         ipr.test_state testState,
-        i.code iCode,
+        im.code imCode,
         i.type type
         FROM
         inspection i,
@@ -70,7 +70,7 @@
             and im.name=#{dto.sample}
         </if>
         <if test="dto.code!=null and dto.code!=''">
-            and i.code=#{dto.code}
+            and im.code=#{dto.code}
         </if>
     </select>
     <select id="selectProjection" resultMap="ImInfoMap">
@@ -86,8 +86,6 @@
         AND  i.state = 1
         AND im.state = 1
         AND ipr.state = 1
-        AND i.inspection_status is NOT NULL
-        AND ipr.test_state is not null
         <if test="dto.beginDate!=null and dto.endDate!=null">
             DATE_FORMAT( i.end_time, '%Y-%m-%d' ) BETWEEN #{dto.beginDate}
             AND #{dto.endDate}
@@ -103,9 +101,9 @@
             and im.name=#{dto.sample}
         </if>
         <if test="dto.code!=null and dto.code!=''">
-            and i.code=#{dto.code}
+            and im.code=#{dto.code}
         </if>
-        and i.code in
+        and im.code in
         <foreach collection="list" item="l" open="(" close=")" separator="," >
             #{l.code}
         </foreach>
@@ -124,7 +122,7 @@
         i.end_time endTime
         FROM inspection i
         INNER JOIN inspection_material im ON i.id = im.inspection_id
-        where (i.state = 1 AND i.inspection_status is NOT NULL and im.state=1)
+        where (i.state = 1 and im.state=1)
         <if test="dto.beginDate!=null and dto.endDate!=null">
             DATE_FORMAT( i.end_time, '%Y-%m-%d' ) BETWEEN #{dto.beginDate}
             AND #{dto.endDate}
@@ -140,7 +138,7 @@
             and im.name=#{dto.sample}
         </if>
         <if test="dto.code!=null and dto.code!=''">
-            and i.code=#{dto.code}
+            and im.code=#{dto.code}
         </if>
     </select>
     <select id="getSampleOptions" resultType="java.util.Map">
@@ -152,17 +150,17 @@
             i.inspection_status inspectionStatus,
             i.start_time startTime,
             i.end_time endTime,
-            i.`code`
+            im.`code` code
         FROM
             inspection i
                 INNER JOIN inspection_material im ON i.id = im.inspection_id
         WHERE
-            ( i.state = 1 AND i.inspection_status IS NOT NULL AND im.state = 1 )
+            ( i.state = 1  AND im.state = 1 )
     </select>
 
     <resultMap id="ImInfoMap" type="com.yuanchu.limslaboratory.pojo.ImInfo">
         <result property="imId" column="imId"/>
-        <result property="iCode" column="iCode"/>
+        <result property="imCode" column="imCode"/>
         <result property="imName" column="imName"/>
         <result property="startTime" column="startTime"/>
         <result property="endTime" column="endTime"/>

--
Gitblit v1.9.3