From 58579a382615c0f9bd03b52ae7227a2ca64f43f3 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期三, 23 八月 2023 16:43:21 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 chart-server/src/main/resources/mapper/WorkMapper.xml |  165 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 165 insertions(+), 0 deletions(-)

diff --git a/chart-server/src/main/resources/mapper/WorkMapper.xml b/chart-server/src/main/resources/mapper/WorkMapper.xml
new file mode 100644
index 0000000..7da6829
--- /dev/null
+++ b/chart-server/src/main/resources/mapper/WorkMapper.xml
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.yuanchu.limslaboratory.mapper.WorkMapper">
+    <!--璐d换浜洪」鐩暟缁熻-->
+    <select id="dutyMater" resultType="java.util.Map">
+        select n.name, 鏈畬鎴�, 宸插畬鎴�
+        from (select distinct user.name, count(inspection_product.id) '鏈畬鎴�'
+              from lims_laboratory.inspection_product
+                       left join lims_laboratory.user on inspection_product.user_pro_id = user.id
+              where state = 1
+                and test_state is null
+                and inspection_product.inspection_material_id in
+                    (select id
+                     from lims_laboratory.inspection_material
+                     where inspection_material.state = 1
+                       and inspection_id in
+                           (select id
+                            from lims_laboratory.inspection
+                            where inspection.state = 1
+                              and type = #{type}
+                              and start_time between #{startTime} and #{endTime}))
+              group by user.name) n,
+             (select distinct user.name, count(inspection_product.id) '宸插畬鎴�'
+              from lims_laboratory.inspection_product
+                       left join lims_laboratory.user on inspection_product.user_pro_id = user.id
+              where state = 1
+                and test_state is not null
+                and inspection_product.inspection_material_id in
+                    (select id
+                     from lims_laboratory.inspection_material
+                     where inspection_material.state = 1
+                       and inspection_id in
+                           (select id
+                            from lims_laboratory.inspection
+                            where inspection.state = 1
+                              and type = #{type}
+                              and start_time between #{startTime} and #{endTime}))
+              group by user.name) y
+        where n.name = y.name
+    </select>
+
+    <!--鎵ц浜洪」鐩暟缁熻-->
+    <select id="executeMater" resultType="java.util.Map">
+        select n.name, 鏈畬鎴�, 宸插畬鎴�
+        from (select distinct user.name, count(inspection_product.id) '鏈畬鎴�'
+              from lims_laboratory.inspection_product
+                       left join lims_laboratory.user on inspection_product.user_id = user.id
+              where state = 1
+                and test_state is null
+                and inspection_product.inspection_material_id in
+                    (select id
+                     from lims_laboratory.inspection_material
+                     where inspection_material.state = 1
+                       and inspection_id in
+                           (select id
+                            from lims_laboratory.inspection
+                            where inspection.state = 1
+                              and type = #{type}
+                              and start_time between #{startTime} and #{endTime}))
+              group by user.name) n,
+             (select distinct user.name, count(inspection_product.id) '宸插畬鎴�'
+              from lims_laboratory.inspection_product
+                       left join lims_laboratory.user on inspection_product.user_id = user.id
+              where state = 1
+                and test_state is not null
+                and inspection_product.inspection_material_id in
+                    (select id
+                     from lims_laboratory.inspection_material
+                     where inspection_material.state = 1
+                       and inspection_id in
+                           (select id
+                            from lims_laboratory.inspection
+                            where inspection.state = 1
+                              and type = #{type}
+                              and start_time between #{startTime} and #{endTime}))
+              group by user.name) y
+        where n.name = y.name
+    </select>
+
+    <!--璐d换浜烘墽琛岀巼-->
+    <select id="dutytimely" resultType="java.util.Map">
+        select n.name, 椤圭洰鎬绘暟, 鍙婃椂瀹屾垚鏁� / 椤圭洰鎬绘暟 * 100 '鍙婃椂鐜�'
+        from (select distinct user.name, count(inspection_product.id) '椤圭洰鎬绘暟'
+              from lims_laboratory.inspection_product
+                       left join lims_laboratory.user on inspection_product.user_pro_id = user.id
+              where state = 1
+                and inspection_product.inspection_material_id in
+                    (select id
+                     from lims_laboratory.inspection_material
+                     where inspection_material.state = 1
+                       and inspection_id in
+                           (select id
+                            from lims_laboratory.inspection
+                            where inspection.state = 1
+                              and type = #{type}
+                              and start_time between #{startTime} and #{endTime}))
+              group by user.name) n,
+             (select distinct user.name, count(inspection_product.id) '鍙婃椂瀹屾垚鏁�'
+              from lims_laboratory.inspection_product
+                       left join lims_laboratory.user
+                                 on inspection_product.user_pro_id = user.id
+                       left join lims_laboratory.inspection_material im
+                                 on inspection_product.inspection_material_id = im.id
+                       left join lims_laboratory.inspection
+                                 on im.inspection_id = inspection.id
+              where inspection_product.state = 1
+                and test_state is not null
+                and inspection_product.update_time between start_time and end_time
+                and inspection_product.inspection_material_id in
+                    (select id
+                     from lims_laboratory.inspection_material
+                     where inspection_material.state = 1
+                       and inspection_id in
+                           (select id
+                            from inspection
+                            where inspection.state = 1
+                              and type = #{type}
+                              and start_time between #{startTime} and #{endTime}))
+              group by user.name) y
+        where n.name = y.name
+    </select>
+
+    <!--鎵ц浜哄強鏃剁巼-->
+    <select id="executetimely" resultType="java.util.Map">
+        select n.name, 椤圭洰鎬绘暟, 鍙婃椂瀹屾垚鏁� / 椤圭洰鎬绘暟 * 100 '鍙婃椂鐜�'
+        from (select distinct user.name, count(inspection_product.id) '椤圭洰鎬绘暟'
+              from lims_laboratory.inspection_product
+                       left join lims_laboratory.user on inspection_product.user_id = user.id
+              where state = 1
+                and inspection_product.inspection_material_id in
+                    (select id
+                     from lims_laboratory.inspection_material
+                     where inspection_material.state = 1
+                       and inspection_id in
+                           (select id
+                            from lims_laboratory.inspection
+                            where inspection.state = 1
+                              and type = #{type}
+                              and start_time between #{startTime} and #{endTime}))
+              group by user.name) n,
+             (select distinct user.name, count(inspection_product.id) '鍙婃椂瀹屾垚鏁�'
+              from lims_laboratory.inspection_product
+                       left join lims_laboratory.user
+                                 on inspection_product.user_id = user.id
+                       left join lims_laboratory.inspection_material im
+                                 on inspection_product.inspection_material_id = im.id
+                       left join lims_laboratory.inspection
+                                 on im.inspection_id = inspection.id
+              where inspection_product.state = 1
+                and test_state is not null
+                and inspection_product.update_time between start_time and end_time
+                and inspection_product.inspection_material_id in
+                    (select id
+                     from lims_laboratory.inspection_material
+                     where inspection_material.state = 1
+                       and inspection_id in
+                           (select id
+                            from inspection
+                            where inspection.state = 1
+                              and type = #{type}
+                              and start_time between #{startTime} and #{endTime}))
+              group by user.name) y
+        where n.name = y.name
+    </select>
+</mapper>
\ No newline at end of file

--
Gitblit v1.9.3