From bea49667b0a34a17490c4b47f6a14857a737f647 Mon Sep 17 00:00:00 2001 From: 刘小明 <liuxm_a@163.com> Date: 星期三, 17 七月 2024 08:47:31 +0800 Subject: [PATCH] 新增生产日志历史表,每天00:05把生产日志表中的数据移动到历史表中 --- pms-parent/pms-global/src/main/resources/mapper/StaDeviceLifeLastMapper.xml | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLifeLastMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLifeLastMapper.xml index aadffd9..e5b4514 100644 --- a/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLifeLastMapper.xml +++ b/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLifeLastMapper.xml @@ -22,6 +22,7 @@ <result property="updatedBy" column="updated_by" jdbcType="BIGINT"/> <result property="memo" column="memo" jdbcType="VARCHAR"/> </resultMap> + <resultMap id="joinResultMap" type="com.dy.pmsGlobal.pojoSta.StaDeviceLifeLast" extends="BaseResultMap"> <result property="planName" column="plan_name" jdbcType="VARCHAR"/> <result property="stationName" column="station_name" jdbcType="VARCHAR"/> @@ -38,11 +39,12 @@ in_time,out_time,updated_by, memo </sql> + <select id="selectByDeviceNo" parameterType="java.lang.String" resultMap="joinResultMap"> select t.* ,p.`name` plan_name,s.`name` station_name,u.`name` update_user_name FROM - sta_device_life t + sta_device_life_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 @@ -54,12 +56,12 @@ select <include refid="Base_Column_List" /> from sta_device_life_last - where id = #{id,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} </select> <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> delete from sta_device_life_last - where id = #{id,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} </delete> <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoSta.StaDeviceLifeLast" useGeneratedKeys="true"> insert into sta_device_life_last @@ -164,11 +166,11 @@ memo = #{memo,jdbcType=VARCHAR}, </if> </set> - where id = #{id,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} </update> <update id="updateByPrimaryKey" parameterType="com.dy.pmsGlobal.pojoSta.StaDeviceLifeLast"> update sta_device_life_last - set + set device_no = #{deviceNo,jdbcType=VARCHAR}, work_id = #{workId,jdbcType=BIGINT}, repair_id = #{repairId,jdbcType=BIGINT}, @@ -184,7 +186,7 @@ out_time = #{outTime,jdbcType=TIMESTAMP}, updated_by = #{updatedBy,jdbcType=BIGINT}, memo = #{memo,jdbcType=VARCHAR} - where id = #{id,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} </update> <update id="updateByDeviceNo"> update sta_device_life_last -- Gitblit v1.8.0