From e39d9bfeee0b62a60dc08e2dc93e0a05f3d6b503 Mon Sep 17 00:00:00 2001
From: Fancy <Fancy.fx@outlook.com>
Date: 星期四, 15 八月 2024 14:41:20 +0800
Subject: [PATCH] add report

---
 pms-parent/pms-global/src/main/resources/mapper/StaDeviceProductionLogMapper.xml |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/pms-parent/pms-global/src/main/resources/mapper/StaDeviceProductionLogMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/StaDeviceProductionLogMapper.xml
index 17450de..0ef9802 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/StaDeviceProductionLogMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/StaDeviceProductionLogMapper.xml
@@ -62,6 +62,43 @@
         ORDER BY t.id DESC
     </select>
 
+    <select id="selectProductLog"  resultMap="joinResultMap">
+        select
+        t.* ,p.`name` plan_name,s.`name` station_name,u.`name` update_user_name
+        FROM
+        (
+        select <include refid="Base_Column_List" /> from sta_device_production_log_past
+        <where>
+            <if test="deviceNo != null and deviceNo !=''">
+                and device_no = #{deviceNo,jdbcType=VARCHAR}
+            </if>
+            <if test="startTime != null">
+                and out_time <![CDATA[ > ]]> #{startTime,jdbcType=TIMESTAMP}
+            </if>
+            <if test="endTime != null">
+                and out_time <![CDATA[ < ]]> #{endTime,jdbcType=TIMESTAMP}
+            </if>
+        </where>
+        union
+        select <include refid="Base_Column_List" /> from sta_device_production_log
+        <where>
+            <if test="deviceNo != null and deviceNo !=''">
+                and device_no = #{deviceNo,jdbcType=VARCHAR}
+            </if>
+            <if test="startTime != null">
+                and out_time <![CDATA[ > ]]> #{startTime,jdbcType=TIMESTAMP}
+            </if>
+            <if test="endTime != null">
+                and out_time <![CDATA[ < ]]> #{endTime,jdbcType=TIMESTAMP}
+            </if>
+        </where>
+        ) t
+        left join pr_assembly_plan p on t.plan_id=p.id
+        left join plt_station s on s.id = t.station_id
+        left JOIN ba_user u on u.id=t.updated_by
+        ORDER BY t.id DESC
+    </select>
+
     <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
         delete from sta_device_production_log
         where  id = #{id,jdbcType=BIGINT} 

--
Gitblit v1.8.0