From 56f89b4a45a561ff017ffd1e611e542130d046a0 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期二, 15 八月 2023 09:15:19 +0800
Subject: [PATCH] 合并

---
 inspect-server/src/main/resources/mapper/FinishedInspectMapper.xml |   51 ++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 38 insertions(+), 13 deletions(-)

diff --git a/inspect-server/src/main/resources/mapper/FinishedInspectMapper.xml b/inspect-server/src/main/resources/mapper/FinishedInspectMapper.xml
index 40924a7..bd34643 100644
--- a/inspect-server/src/main/resources/mapper/FinishedInspectMapper.xml
+++ b/inspect-server/src/main/resources/mapper/FinishedInspectMapper.xml
@@ -1,21 +1,46 @@
 <?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.mom.mapper.FinishedInspectMapper">
-
     <select id="selectFinishedInspectPage" resultType="map">
-        SELECT f.`id`, f.`order_number`, f.`customer_name`, f.`project_name`, f.`quality_traceability`, f.`material_code`, f.`material`, f.`specifications_model`, f.`unit`,
-               f.`quantity`, u.`name`, DATE_FORMAT(f.`create_time`, '%Y-%m-%d') detectionPeriod, f.`result`
+        SELECT f.`id`, f.`order_number`, f.`customer_name`, f.`project_name`, f.`quality_traceability`,
+        f.`material_code`, f.`material`, f.`specifications_model`, f.`unit`,
+        f.`quantity`, u.`name`, DATE_FORMAT(f.`create_time`, '%Y-%m-%d') detectionPeriod, f.`result`
         FROM finished_inspect f, `user` u
         WHERE f.`user_id` = u.`id`
-          AND f.`state` = 1
-            <if test="inspectResult != null and inspectResult != ''">
-                AND f.result = #{inspectResult}
-            </if>
-            <if test="inspectDate != null and inspectDate != ''">
-                AND DATE_FORMAT(f.`create_time`, '%Y-%m-%d') = #{inspectDate}
-            </if>
-            <if test="inspectUsername != null and inspectUsername != ''">
-                AND u.`name` LIKE CONCAT('%',#{inspectUsername},'%')
-            </if>
+        AND f.`state` = 1
+        <if test="inspectResult != null and inspectResult != ''">
+            AND f.result = #{inspectResult}
+        </if>
+        <if test="inspectDate != null and inspectDate != ''">
+            AND DATE_FORMAT(f.`create_time`, '%Y-%m-%d') = #{inspectDate}
+        </if>
+        <if test="inspectUsername != null and inspectUsername != ''">
+            AND u.`name` LIKE CONCAT('%',#{inspectUsername},'%')
+        </if>
+    </select>
+    <select id="selCountFin" resultType="java.lang.Integer">
+        select count(id)
+        from mom_ocean.finished_inspect
+        where state=1
+        and result=#{result}
+        and type=#{type}
+        <if test="begin != null and begin!=''">
+            and finished_inspect.create_time &gt;= #{begin}
+        </if>
+        <if test="end != null and end!=''">
+            and finished_inspect.create_time &lt;= #{end}
+        </if>
+    </select>
+    <select id="seAllCount" resultType="java.lang.Long">
+        select count(id)
+        from mom_ocean.finished_inspect
+        where state=1
+        and type=#{type}
+        <if test="begin != null and begin!=''">
+            and finished_inspect.create_time &gt;= #{begin}
+        </if>
+        <if test="end != null and end!=''">
+            and finished_inspect.create_time &lt;= #{end}
+        </if>
     </select>
 </mapper>

--
Gitblit v1.9.3