From a92b6f6175b1401071e5fb3bd9fab8a2a3b72011 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期五, 01 九月 2023 14:34:28 +0800
Subject: [PATCH] version
---
inspection-server/src/main/resources/mapper/InspectionMapper.xml | 86 ++++++++++++++++++++++++++++++++++++++++--
1 files changed, 81 insertions(+), 5 deletions(-)
diff --git a/inspection-server/src/main/resources/mapper/InspectionMapper.xml b/inspection-server/src/main/resources/mapper/InspectionMapper.xml
index 737fb6b..a8421e2 100644
--- a/inspection-server/src/main/resources/mapper/InspectionMapper.xml
+++ b/inspection-server/src/main/resources/mapper/InspectionMapper.xml
@@ -4,19 +4,19 @@
<select id="selectInspectsList" resultType="map">
select i.id,
i.code icode,
- type,
- DATE_FORMAT(`form_time`,'%Y-%m-%d'),
+ i.type type,
+ DATE_FORMAT(`form_time`,'%Y-%m-%d') form_time,
supplier,
im.code mcode,
im.name,
specifications,
unit,
num,
- DATE_FORMAT(i.`create_time`,'%Y-%m-%d'),
+ DATE_FORMAT(i.`create_time`,'%Y-%m-%d') as create_time,
u.name userName,
inspection_status,
- DATE_FORMAT(i.`start_time`,'%Y-%m-%d'),
- DATE_FORMAT(i.`end_time`,'%Y-%m-%d')
+ DATE_FORMAT(i.`start_time`,'%Y-%m-%d') as start_time,
+ DATE_FORMAT(i.`end_time`,'%Y-%m-%d') as end_time
from lims_laboratory.inspection i
join lims_laboratory.user u on i.user_id = u.id
join lims_laboratory.inspection_material im on i.id = im.inspection_id
@@ -103,4 +103,80 @@
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