From 15e31c6e6550f9e8bf6fb1df5ca5ad4cc726b64f Mon Sep 17 00:00:00 2001
From: XiaoRuby <3114200645@qq.com>
Date: 星期六, 26 八月 2023 13:30:13 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 inspection-server/src/main/resources/mapper/InspectionMapper.xml |  122 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 121 insertions(+), 1 deletions(-)

diff --git a/inspection-server/src/main/resources/mapper/InspectionMapper.xml b/inspection-server/src/main/resources/mapper/InspectionMapper.xml
index d324cf1..711a5fe 100644
--- a/inspection-server/src/main/resources/mapper/InspectionMapper.xml
+++ b/inspection-server/src/main/resources/mapper/InspectionMapper.xml
@@ -51,12 +51,132 @@
     </select>
 
     <!--妫�楠岀粨璁�,妫�楠屾暟閲�-->
+    <select id="qualified" resultType="java.lang.Long">
+        select count(id)
+        from lims_laboratory.inspection
+        where state = 1
+        and type = 0
+        <if test="b!=null ">
+            and inspection_status = #{b}
+        </if>
+        <if test="b==null">
+            and inspection_status is null
+        </if>
+    </select>
+
+    <!--璁$畻鍘熸潗鏂欎笌鎴愬搧鐨勫悎鏍肩巼-->
     <select id="getResultNum" resultType="java.util.Map">
         select inspection_status result,
                count(id)         num
         from lims_laboratory.inspection
-        where state=1
+        where state = 1
         group by result
         order by num desc
     </select>
+
+    <!--璁$畻鍘熸潗鏂欐楠屽崟鎬绘暟-->
+    <select id="getallmater" resultType="java.lang.Integer">
+        select count(id)
+        from lims_laboratory.inspection
+        where state = 1
+          and type = 0
+    </select>
+
+    <!--璁$畻鎴愬搧妫�楠屽崟鎬绘暟-->
+    <select id="getallfin" resultType="java.lang.Integer">
+        select count(id)
+        from lims_laboratory.inspection
+        where state = 1
+          and type in (1, 2)
+    </select>
+
+    <!--璁$畻鍘熸潗鏂欏悎鏍肩巼-->
+    <select id="qualifiedfin" resultType="java.lang.Long">
+        select count(id)
+        from lims_laboratory.inspection
+        where state = 1
+        and type in (1, 2)
+        <if test="i!=null ">
+            and inspection_status = #{i}
+        </if>
+        <if test="i==null">
+            and inspection_status is null
+        </if>
+    </select>
+
+    <!--鏌ヨ璇ユ棩鏈熺殑鍘熸潗鏂欐楠屾暟閲�-->
+    <select id="getMaterByDay" resultType="java.lang.Integer">
+        select count(id)
+        from lims_laboratory.inspection
+        where state = 1
+          and type = 0
+          and create_time = #{time}
+    </select>
+
+    <!--鏌ヨ璇ユ棩鏈熺殑鎴愬搧妫�楠屾暟閲�-->
+    <select id="getFinByDay" resultType="java.lang.Integer">
+        select count(id)
+        from lims_laboratory.inspection
+        where state = 1
+          and type in (1, 2)
+          and create_time = #{time}
+    </select>
+
+    <!--鏌ヨ璇ユ棩鏈熺殑鍘熸潗鏂欏悎鏍兼暟閲�-->
+    <select id="getOkMaterByDay" resultType="java.lang.Long">
+        select count(id)
+        from lims_laboratory.inspection
+        where state = 1
+          and type = 0
+          and inspection_status = 1
+          and end_time = #{time}
+    </select>
+
+    <!--鏌ヨ璇ユ棩鏈熺殑鎴愬搧鍚堟牸鏁伴噺-->
+    <select id="getOkFinByDay" resultType="java.lang.Long">
+        select count(id)
+        from lims_laboratory.inspection
+        where state = 1
+          and type in (1, 2)
+          and inspection_status = 1
+          and end_time = #{time}
+    </select>
+
+    <!--鏌ヨ璇ユ湀鐨勫師鏉愭枡妫�楠屾暟閲�-->
+    <select id="getMaterByMonth" resultType="java.lang.Integer">
+        select count(id)
+        from lims_laboratory.inspection
+        where state = 1
+          and type = 0
+          and DATE_FORMAT(create_time, '%Y-%m') = #{monthofYear}
+    </select>
+
+    <!--鏌ヨ璇ユ湀鐨勬垚鍝佹楠屾暟閲�-->
+    <select id="getFinByMonth" resultType="java.lang.Integer">
+        select count(id)
+        from lims_laboratory.inspection
+        where state = 1
+          and type in (1, 2)
+          and DATE_FORMAT(create_time, '%Y-%m') = #{monthofYear}
+    </select>
+
+    <!--鏌ヨ璇ユ湀鐨勫師鏉愭枡鍚堟牸鐜�-->
+    <select id="getOkMaterByMonth" resultType="java.lang.Long">
+        select count(id)
+        from lims_laboratory.inspection
+        where state = 1
+          and type = 0
+          and inspection_status = 1
+          and DATE_FORMAT(end_time, '%Y-%m') = #{monthofYear}
+    </select>
+
+    <!--鏌ヨ璇ユ湀鐨勬垚鍝佸悎鏍肩巼-->
+    <select id="getOkFinByMonth" resultType="java.lang.Long">
+        select count(id)
+        from lims_laboratory.inspection
+        where state = 1
+          and type in (1, 2)
+          and inspection_status = 1
+          and DATE_FORMAT(end_time, '%Y-%m') = #{monthofYear}
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3