From 636af7d0ed40549da7182569175e69068e5e937d Mon Sep 17 00:00:00 2001
From: “zhuo” <“zhuo@itcast.cn”>
Date: 星期三, 09 八月 2023 09:24:27 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

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

diff --git a/inspection-server/src/main/resources/mapper/ReportMapper.xml b/inspection-server/src/main/resources/mapper/ReportMapper.xml
new file mode 100644
index 0000000..54d2f39
--- /dev/null
+++ b/inspection-server/src/main/resources/mapper/ReportMapper.xml
@@ -0,0 +1,52 @@
+<?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.ReportMapper">
+
+    <!--鏌ヨ妫�楠屾姤鍛�-->
+    <select id="selectAllReport" resultType="com.yuanchu.limslaboratory.pojo.vo.ReportVo">select im.code materialCode,
+        r.code reportCode,
+        i.code inspectionCode,
+        r.approver approver,
+        r.status status,
+        r.conclusion conclusion,
+        u.name name
+        from report r
+        join inspection i on r.inspection_id = i.id
+        join user u on i.user_id = u.id
+        join inspection_material im on i.id = im.inspection_id
+        <where>
+            <if test="status != null">
+                and r.status = #{status}
+            </if>
+            <if test="name != null and name != ''">
+                and im.code like concat('%', #{name}, '%')
+                or i.code like concat('%', #{name}, '%')
+                or r.code like concat('%', #{name}, '%')
+            </if>
+        </where>
+    </select>
+
+    <!--鏌ヨ鎶ュ憡瀹℃牳-->
+    <select id="selectAllReportAuditing" resultType="com.yuanchu.limslaboratory.pojo.vo.ReportAuditingVo">
+        select im.code materialCode,
+        r.code reportCode,
+        im.name materialName,
+        r.status status,
+        r.approver approver,
+        DATE_FORMAT(r.`create_time`, '%Y-%m-%d') submitTime,
+        DATE_FORMAT(r.`check_time`, '%Y-%m-%d') checkTime
+        from report r
+        join inspection i on r.inspection_id = i.id
+        join inspection_material im on i.id = im.inspection_id
+        <where>
+            <if test="status != null">
+                and r.status = #{status}
+            </if>
+            <if test="name != null and name != ''">
+                and im.code like concat('%', #{name}, '%')
+                or i.code like concat('%', #{name}, '%')
+                or im.name like concat('%', #{name}, '%')
+            </if>
+        </where>
+    </select>
+</mapper>

--
Gitblit v1.9.3