From affabbd21802dacbf943692912a83e63106670e4 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期二, 22 八月 2023 11:47:55 +0800
Subject: [PATCH] 改动

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

diff --git a/inspection-server/src/main/resources/mapper/InspectionMapper.xml b/inspection-server/src/main/resources/mapper/InspectionMapper.xml
index 41ca226..5314b40 100644
--- a/inspection-server/src/main/resources/mapper/InspectionMapper.xml
+++ b/inspection-server/src/main/resources/mapper/InspectionMapper.xml
@@ -1,15 +1,45 @@
-<?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">
+<?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.InspectionMapper">
-    <select id="selectAllInspection" resultType="com.yuanchu.limslaboratory.pojo.dto.InspectionDto">
-        select i.id, type, inspection_status, qualified_state, i.state, i.create_time, user_name, inspect_user_id,
-        inspect_start_time, inspect_end_time, u.name inspectUserName
-        from lims_laboratory.inspection i left join lims_laboratory.user u
-        on i.inspect_user_id = u.id
-        <if test="state!=null">
-            where state = #{state}
+    <select id="selectInspectsList" resultType="map">
+        select i.id,
+        i.code icode,
+        type,
+        DATE_FORMAT(`form_time`,'%Y-%m-%d'),
+        supplier,
+        im.code mcode,
+        im.name,
+        specifications,
+        unit,
+        num,
+        DATE_FORMAT(i.`create_time`,'%Y-%m-%d'),
+        u.name userName,
+        inspection_status,
+        DATE_FORMAT(i.`start_time`,'%Y-%m-%d'),
+        DATE_FORMAT(i.`end_time`,'%Y-%m-%d')
+        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
+        where i.state=1
+        <if test="message!=null">
+            and i.code like concat('%', #{message}, '%')
+            or im.name like concat('%', #{message}, '%')
         </if>
-        order by i.create_time desc
-        limit #{pageSize},#{countSize}
     </select>
-</mapper>
+
+    <!--璁$畻妫�楠岀殑妫�楠屽崟鏁伴噺-->
+    <select id="seleCountIns" resultType="java.lang.Integer">
+        select count(id)
+        from lims_laboratory.inspection
+        where state = 1
+          and inspection_status in (0, 1)
+    </select>
+
+    <!--璁$畻鏈楠岀殑妫�楠屽崟鏁伴噺-->
+    <select id="seleCountUnIns" resultType="java.lang.Integer">
+        select count(id)
+        from lims_laboratory.inspection
+        where state = 1
+          and inspection_status is null
+    </select>
+</mapper>
\ No newline at end of file

--
Gitblit v1.9.3