From d0a6fc23f31f924cb1744397478dc4c7c57c04e1 Mon Sep 17 00:00:00 2001
From: XiaoRuby <3114200645@qq.com>
Date: 星期六, 19 八月 2023 09:58:40 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 inspection-server/src/main/resources/mapper/PlanMapper.xml |   40 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/inspection-server/src/main/resources/mapper/PlanMapper.xml b/inspection-server/src/main/resources/mapper/PlanMapper.xml
new file mode 100644
index 0000000..ed990c0
--- /dev/null
+++ b/inspection-server/src/main/resources/mapper/PlanMapper.xml
@@ -0,0 +1,40 @@
+<?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.PlanMapper">
+
+    <!--鏌ヨ妫�楠岃鍒�-->
+    <select id="selectAllPlan" resultType="com.yuanchu.limslaboratory.pojo.vo.PlanVo">
+        select i.equipment_name device,
+        im.name samplename,
+        im.code sampleid,
+        im.specifications modelandspecification,
+        im.unit unit,
+        im.num amount,
+        ip.name checkproject,
+        u.name checker,
+        ip.start_time starttime,
+        ip.end_time finishtime,
+        ip.test_state state
+        from instrument i
+        left join (select ip.*
+        from inspection_product ip
+        right join (select instrument_id, max(ip.end_time) t
+        from inspection_product ip
+        group by instrument_id) it
+        on ip.instrument_id = it.instrument_id and ip.end_time = it.t) ip
+        on i.id = ip.instrument_id
+        left join inspection_material im on im.id = ip.inspection_material_id
+        left join user u on u.id = ip.user_id
+        <where>
+            <if test="device != null and device != null">
+                and i.equipment_name = #{device}
+            </if>
+            <if test="user != null and user != null">
+                and u.name = #{user}
+            </if>
+            <if test="beginTime != null and endTime != null">
+                and ip.start_time between #{beginTime} and #{endTime}
+            </if>
+        </where>
+    </select>
+</mapper>

--
Gitblit v1.9.3