From a3202d4c62be404247d23f0676e95f8c5d146983 Mon Sep 17 00:00:00 2001
From: 刘小明 <liuxm_a@163.com>
Date: 星期六, 06 七月 2024 09:49:17 +0800
Subject: [PATCH] 添加根据设备号查询生产日志,生命周期,和相关信息;限制上传文档类型

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

diff --git a/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLastMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLastMapper.xml
index bb8d7bc..66f08c4 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLastMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLastMapper.xml
@@ -23,6 +23,13 @@
             <result property="outTime" column="out_time" jdbcType="TIMESTAMP"/>
             <result property="memo" column="memo" jdbcType="VARCHAR"/>
     </resultMap>
+    <resultMap id="joinResultMap" type="com.dy.pmsGlobal.pojoSta.StaDeviceLife" extends="BaseResultMap">
+        <result property="planName" column="plan_name" jdbcType="VARCHAR"/>
+        <result property="stationName" column="station_name" jdbcType="VARCHAR"/>
+        <result property="updateUserName" column="update_user_name" jdbcType="VARCHAR"/>
+        <association property="assistantNames" jdbcType="VARCHAR" column="assistants"
+                     select="com.dy.pmsGlobal.daoBa.BaUserMapper.selectNamesByAssistants" fetchType="eager" />
+    </resultMap>
 
     <sql id="Base_Column_List">
         id,equip_no,work_id,
@@ -33,6 +40,17 @@
         updated_by,in_time,out_time,
         memo
     </sql>
+    <select id="selectByEquipNo" parameterType="java.lang.String" resultMap="joinResultMap">
+        select
+            t.* ,p.`name` plan_name,s.`name` station_name,u.`name` update_user_name
+        FROM
+            sta_device_last 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
+        where  t.equip_no = #{equipNo,jdbcType=VARCHAR}
+        ORDER BY t.id DESC
+    </select>
 
     <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
         select

--
Gitblit v1.8.0