From 4f45f29e6b53f4c01b414409c5000ff4e212b3d9 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期五, 05 六月 2026 13:36:54 +0800
Subject: [PATCH] 增加eip
---
report-server/src/main/resources/mapper/SpcChartMapper.xml | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 57 insertions(+), 0 deletions(-)
diff --git a/report-server/src/main/resources/mapper/SpcChartMapper.xml b/report-server/src/main/resources/mapper/SpcChartMapper.xml
new file mode 100644
index 0000000..82ae654
--- /dev/null
+++ b/report-server/src/main/resources/mapper/SpcChartMapper.xml
@@ -0,0 +1,57 @@
+<?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.ruoyi.report.mapper.SpcChartMapper">
+
+ <!-- 鏌ヨ妫�娴嬮」鏁版嵁 -->
+ <select id="getItemData" resultType="java.util.Map">
+ SELECT
+ s.sample_code AS sampleCode,
+ s.sample AS sampleName,
+ p.inspection_item AS itemName,
+ p.last_value AS lastValue,
+ o.ins_time AS insTime
+ FROM ins_product p
+ LEFT JOIN ins_sample s ON p.ins_sample_id = s.id
+ LEFT JOIN ins_order o ON s.ins_order_id = o.id
+ WHERE p.ins_result IS NOT NULL AND p.last_value IS NOT NULL
+ <if test="dto.itemName != null and dto.itemName != ''">
+ AND p.inspection_item = #{dto.itemName}
+ </if>
+ <if test="dto.sampleName != null and dto.sampleName != ''">
+ AND s.sample LIKE CONCAT('%', #{dto.sampleName}, '%')
+ </if>
+ <if test="dto.startDate != null and dto.startDate != ''">
+ AND o.ins_time >= #{dto.startDate}
+ </if>
+ <if test="dto.endDate != null and dto.endDate != ''">
+ AND o.ins_time <= #{dto.endDate}
+ </if>
+ ORDER BY o.ins_time ASC
+ </select>
+
+ <!-- 鏌ヨ鍙�夋娴嬮」 -->
+ <select id="getItemNames" resultType="java.lang.String">
+ SELECT DISTINCT p.inspection_item
+ FROM ins_product p
+ LEFT JOIN ins_sample s ON p.ins_sample_id = s.id
+ WHERE p.ins_result IS NOT NULL AND p.last_value IS NOT NULL
+ <if test="dto.sampleName != null and dto.sampleName != ''">
+ AND s.sample LIKE CONCAT('%', #{dto.sampleName}, '%')
+ </if>
+ ORDER BY p.inspection_item ASC
+ </select>
+
+ <!-- 鏌ヨ鍙�夋牱鍝佸悕绉板垪琛� -->
+ <select id="getSampleNames" resultType="java.lang.String">
+ SELECT DISTINCT s.sample
+ FROM ins_product p
+ LEFT JOIN ins_sample s ON p.ins_sample_id = s.id
+ LEFT JOIN ins_order o ON s.ins_order_id = o.id
+ WHERE p.ins_result IS NOT NULL AND p.last_value IS NOT NULL
+ <if test="dto.itemName != null and dto.itemName != ''">
+ AND p.inspection_item = #{dto.itemName}
+ </if>
+ ORDER BY s.sample ASC
+ </select>
+
+</mapper>
\ No newline at end of file
--
Gitblit v1.9.3