From f4a214473d2f39accb06f5cf98da5e051ce5e895 Mon Sep 17 00:00:00 2001
From: 刘小明 <liuxm_a@163.com>
Date: 星期二, 09 七月 2024 13:59:51 +0800
Subject: [PATCH] 名称统一
---
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoSta/StaDeviceLifeLastMapper.java | 31 +++++
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLifeLast.java | 103 +++++++++++++++++
pms-parent/pms-global/src/main/resources/mapper/StaDeviceLifeLastMapper.xml | 209 ++++++++++++++++++++++++++++++++++
3 files changed, 343 insertions(+), 0 deletions(-)
diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoSta/StaDeviceLifeLastMapper.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoSta/StaDeviceLifeLastMapper.java
new file mode 100644
index 0000000..0fdee49
--- /dev/null
+++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoSta/StaDeviceLifeLastMapper.java
@@ -0,0 +1,31 @@
+package com.dy.pmsGlobal.daoSta;
+
+import com.dy.pmsGlobal.pojoSta.StaDeviceLifeLast;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+* @author User
+* @description 閽堝琛ㄣ�恠ta_device_life_last(鏈�鏂拌澶囩敓鍛藉懆鏈熻〃)銆戠殑鏁版嵁搴撴搷浣淢apper
+* @createDate 2024-07-06 10:41:09
+* @Entity com.dy.pmsGlobal.pojoSta.StaDeviceLifeLast
+*/
+@Mapper
+public interface StaDeviceLifeLastMapper {
+
+ int deleteByPrimaryKey(Long id);
+
+ int insert(StaDeviceLifeLast record);
+
+ int insertSelective(StaDeviceLifeLast record);
+
+ StaDeviceLifeLast selectByPrimaryKey(Long id);
+ List<StaDeviceLifeLast> selectByDeviceNo(String deviceNo);
+
+ int updateByPrimaryKeySelective(StaDeviceLifeLast record);
+
+ int updateByPrimaryKey(StaDeviceLifeLast record);
+
+ int updateByDeviceNo(StaDeviceLifeLast lastLife);
+}
diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLifeLast.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLifeLast.java
new file mode 100644
index 0000000..5335a6f
--- /dev/null
+++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLifeLast.java
@@ -0,0 +1,103 @@
+package com.dy.pmsGlobal.pojoSta;
+
+import com.alibaba.fastjson2.annotation.JSONField;
+import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.dy.common.po.BaseEntity;
+import jakarta.validation.constraints.NotBlank;
+import lombok.*;
+
+import java.util.Date;
+
+/**
+* 鏈�鏂拌澶囩敓鍛藉懆鏈熻〃
+* @TableName sta_device_life_last
+*/
+@TableName(value="sta_device_life_last", autoResultMap = true)
+@Data
+@Builder
+@ToString
+@NoArgsConstructor
+@AllArgsConstructor
+public class StaDeviceLifeLast implements BaseEntity {
+
+ @JSONField(serializeUsing= ObjectWriterImplToString.class)
+ public Long id;
+ /**
+ * 璁惧鐮�
+ */
+ @NotBlank(message="璁惧鐮佷笉鑳戒负绌�")
+ public String deviceNo;
+ /**
+ * 鐢熶骇鐧诲綍id
+ */
+ @JSONField(serializeUsing= ObjectWriterImplToString.class)
+ public Long workId;
+ /**
+ * 缁翠慨id
+ */
+ @JSONField(serializeUsing= ObjectWriterImplToString.class)
+ public Long repairId;
+ /**
+ * 璁″垝id
+ */
+ @JSONField(serializeUsing= ObjectWriterImplToString.class)
+ public Long planId;
+ /**
+ * 宸ョ珯id
+ */
+ @JSONField(serializeUsing= ObjectWriterImplToString.class)
+ public Long stationId;
+ /**
+ * 褰撳墠鑺傜偣
+ */
+ @JSONField(serializeUsing= ObjectWriterImplToString.class)
+ public Long currNode;
+ /**
+ * 鑺傜偣浣滀笟鍐呭
+ */
+ public String nodeContent;
+ /**
+ * 璁板綍璁惧鍛ㄦ湡鍐呭
+ */
+ public String deviceCycleContent;
+ /**
+ * 鐘舵��: 1:缁勮涓�,2:瀹屾垚,3:缁翠慨,4:鎶ュ簾
+ */
+ public Integer status;
+ /**
+ * 缁翠慨鑺傜偣杩斿洖鐨勯敊璇俊鎭�
+ */
+ public String errorMsg;
+ /**
+ * 杈呭姪浜哄憳:杈呭姪鍛樺伐id,浠ラ�楀彿闅斿紑
+ */
+ public String assistants;
+ /**
+ * 鍏ョ珯鏃堕棿
+ */
+ public Date inTime;
+ /**
+ * 鍑虹珯鏃堕棿
+ */
+ public Date outTime;
+ /**
+ * 鎿嶄綔鍛榠d
+ */
+ @JSONField(serializeUsing= ObjectWriterImplToString.class)
+ public Long updatedBy;
+ /**
+ * 澶囨敞
+ */
+ public String memo;
+
+ @TableField(exist = false)
+ public String planName;
+ @TableField(exist = false)
+ public String stationName;
+ @TableField(exist = false)
+ public String updateUserName;
+ @TableField(exist = false)
+ public String assistantNames;
+}
diff --git a/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLifeLastMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLifeLastMapper.xml
new file mode 100644
index 0000000..8197478
--- /dev/null
+++ b/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLifeLastMapper.xml
@@ -0,0 +1,209 @@
+<?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.dy.pmsGlobal.daoSta.StaDeviceLifeLastMapper">
+
+ <resultMap id="BaseResultMap" type="com.dy.pmsGlobal.pojoSta.StaDeviceLifeLast">
+ <id property="id" column="id" jdbcType="BIGINT"/>
+ <result property="deviceNo" column="device_no" jdbcType="VARCHAR"/>
+ <result property="workId" column="work_id" jdbcType="BIGINT"/>
+ <result property="repairId" column="repair_id" jdbcType="BIGINT"/>
+ <result property="planId" column="plan_id" jdbcType="BIGINT"/>
+ <result property="stationId" column="station_id" jdbcType="BIGINT"/>
+ <result property="currNode" column="curr_node" jdbcType="BIGINT"/>
+ <result property="nodeContent" column="node_content" jdbcType="VARCHAR"/>
+ <result property="deviceCycleContent" column="device_cycle_content" jdbcType="VARCHAR"/>
+ <result property="status" column="status" jdbcType="TINYINT"/>
+ <result property="errorMsg" column="error_msg" jdbcType="VARCHAR"/>
+ <result property="assistants" column="assistants" jdbcType="VARCHAR"/>
+ <result property="inTime" column="in_time" jdbcType="TIMESTAMP"/>
+ <result property="outTime" column="out_time" jdbcType="TIMESTAMP"/>
+ <result property="updatedBy" column="updated_by" jdbcType="BIGINT"/>
+ <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,device_no,work_id,
+ repair_id,plan_id,station_id,
+ curr_node,node_content,device_cycle_content,
+ status,error_msg,assistants,
+ 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
+ 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.device_no = #{deviceNo,jdbcType=VARCHAR}
+ ORDER BY t.id DESC
+ </select>
+
+ <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+ select
+ <include refid="Base_Column_List" />
+ from sta_device_life_last
+ where id = #{id,jdbcType=BIGINT}
+ </select>
+
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+ delete from sta_device_life_last
+ 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
+ ( id,device_no,work_id
+ ,repair_id,plan_id,station_id
+ ,curr_node,node_content,device_cycle_content
+ ,status,error_msg,assistants
+ ,in_time,out_time,updated_by
+ ,memo)
+ values (#{id,jdbcType=BIGINT},#{deviceNo,jdbcType=VARCHAR},#{workId,jdbcType=BIGINT}
+ ,#{repairId,jdbcType=BIGINT},#{planId,jdbcType=BIGINT},#{stationId,jdbcType=BIGINT}
+ ,#{currNode,jdbcType=BIGINT},#{nodeContent,jdbcType=VARCHAR},#{deviceCycleContent,jdbcType=VARCHAR}
+ ,#{status,jdbcType=TINYINT},#{errorMsg,jdbcType=VARCHAR},#{assistants,jdbcType=VARCHAR}
+ ,#{inTime,jdbcType=TIMESTAMP},#{outTime,jdbcType=TIMESTAMP},#{updatedBy,jdbcType=BIGINT}
+ ,#{memo,jdbcType=VARCHAR})
+ </insert>
+ <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoSta.StaDeviceLifeLast" useGeneratedKeys="true">
+ insert into sta_device_life_last
+ <trim prefix="(" suffix=")" suffixOverrides=",">
+ <if test="id != null">id,</if>
+ <if test="deviceNo != null">device_no,</if>
+ <if test="workId != null">work_id,</if>
+ <if test="repairId != null">repair_id,</if>
+ <if test="planId != null">plan_id,</if>
+ <if test="stationId != null">station_id,</if>
+ <if test="currNode != null">curr_node,</if>
+ <if test="nodeContent != null">node_content,</if>
+ <if test="deviceCycleContent != null">device_cycle_content,</if>
+ <if test="status != null">status,</if>
+ <if test="errorMsg != null">error_msg,</if>
+ <if test="assistants != null">assistants,</if>
+ <if test="inTime != null">in_time,</if>
+ <if test="outTime != null">out_time,</if>
+ <if test="updatedBy != null">updated_by,</if>
+ <if test="memo != null">memo,</if>
+ </trim>
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
+ <if test="id != null">#{id,jdbcType=BIGINT},</if>
+ <if test="deviceNo != null">#{deviceNo,jdbcType=VARCHAR},</if>
+ <if test="workId != null">#{workId,jdbcType=BIGINT},</if>
+ <if test="repairId != null">#{repairId,jdbcType=BIGINT},</if>
+ <if test="planId != null">#{planId,jdbcType=BIGINT},</if>
+ <if test="stationId != null">#{stationId,jdbcType=BIGINT},</if>
+ <if test="currNode != null">#{currNode,jdbcType=BIGINT},</if>
+ <if test="nodeContent != null">#{nodeContent,jdbcType=VARCHAR},</if>
+ <if test="deviceCycleContent != null">#{deviceCycleContent,jdbcType=VARCHAR},</if>
+ <if test="status != null">#{status,jdbcType=TINYINT},</if>
+ <if test="errorMsg != null">#{errorMsg,jdbcType=VARCHAR},</if>
+ <if test="assistants != null">#{assistants,jdbcType=VARCHAR},</if>
+ <if test="inTime != null">#{inTime,jdbcType=TIMESTAMP},</if>
+ <if test="outTime != null">#{outTime,jdbcType=TIMESTAMP},</if>
+ <if test="updatedBy != null">#{updatedBy,jdbcType=BIGINT},</if>
+ <if test="memo != null">#{memo,jdbcType=VARCHAR},</if>
+ </trim>
+ </insert>
+ <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoSta.StaDeviceLifeLast">
+ update sta_device_life_last
+ <set>
+ <if test="deviceNo != null">
+ device_no = #{deviceNo,jdbcType=VARCHAR},
+ </if>
+ <if test="workId != null">
+ work_id = #{workId,jdbcType=BIGINT},
+ </if>
+ <if test="repairId != null">
+ repair_id = #{repairId,jdbcType=BIGINT},
+ </if>
+ <if test="planId != null">
+ plan_id = #{planId,jdbcType=BIGINT},
+ </if>
+ <if test="stationId != null">
+ station_id = #{stationId,jdbcType=BIGINT},
+ </if>
+ <if test="currNode != null">
+ curr_node = #{currNode,jdbcType=BIGINT},
+ </if>
+ <if test="nodeContent != null">
+ node_content = #{nodeContent,jdbcType=VARCHAR},
+ </if>
+ <if test="deviceCycleContent != null">
+ device_cycle_content = #{deviceCycleContent,jdbcType=VARCHAR},
+ </if>
+ <if test="status != null">
+ status = #{status,jdbcType=TINYINT},
+ </if>
+ <if test="errorMsg != null">
+ error_msg = #{errorMsg,jdbcType=VARCHAR},
+ </if>
+ <if test="assistants != null">
+ assistants = #{assistants,jdbcType=VARCHAR},
+ </if>
+ <if test="inTime != null">
+ in_time = #{inTime,jdbcType=TIMESTAMP},
+ </if>
+ <if test="outTime != null">
+ out_time = #{outTime,jdbcType=TIMESTAMP},
+ </if>
+ <if test="updatedBy != null">
+ updated_by = #{updatedBy,jdbcType=BIGINT},
+ </if>
+ <if test="memo != null">
+ memo = #{memo,jdbcType=VARCHAR},
+ </if>
+ </set>
+ where id = #{id,jdbcType=BIGINT}
+ </update>
+ <update id="updateByPrimaryKey" parameterType="com.dy.pmsGlobal.pojoSta.StaDeviceLifeLast">
+ update sta_device_life_last
+ set
+ device_no = #{deviceNo,jdbcType=VARCHAR},
+ work_id = #{workId,jdbcType=BIGINT},
+ repair_id = #{repairId,jdbcType=BIGINT},
+ plan_id = #{planId,jdbcType=BIGINT},
+ station_id = #{stationId,jdbcType=BIGINT},
+ curr_node = #{currNode,jdbcType=BIGINT},
+ node_content = #{nodeContent,jdbcType=VARCHAR},
+ device_cycle_content = #{deviceCycleContent,jdbcType=VARCHAR},
+ status = #{status,jdbcType=TINYINT},
+ error_msg = #{errorMsg,jdbcType=VARCHAR},
+ assistants = #{assistants,jdbcType=VARCHAR},
+ in_time = #{inTime,jdbcType=TIMESTAMP},
+ out_time = #{outTime,jdbcType=TIMESTAMP},
+ updated_by = #{updatedBy,jdbcType=BIGINT},
+ memo = #{memo,jdbcType=VARCHAR}
+ where id = #{id,jdbcType=BIGINT}
+ </update>
+ <update id="updateByDeviceNo">
+ update sta_device_life_last
+ set
+ work_id = #{workId,jdbcType=BIGINT},
+ repair_id = #{repairId,jdbcType=BIGINT},
+ plan_id = #{planId,jdbcType=BIGINT},
+ station_id = #{stationId,jdbcType=BIGINT},
+ curr_node = #{currNode,jdbcType=BIGINT},
+ node_content = #{nodeContent,jdbcType=VARCHAR},
+ device_cycle_content = #{deviceCycleContent,jdbcType=VARCHAR},
+ status = #{status,jdbcType=TINYINT},
+ error_msg = #{errorMsg,jdbcType=VARCHAR},
+ assistants = #{assistants,jdbcType=VARCHAR},
+ in_time = #{inTime,jdbcType=TIMESTAMP},
+ out_time = #{outTime,jdbcType=TIMESTAMP},
+ updated_by = #{updatedBy,jdbcType=BIGINT},
+ memo = #{memo,jdbcType=VARCHAR}
+ where device_no = #{deviceNo,jdbcType=VARCHAR}
+
+ </update>
+</mapper>
--
Gitblit v1.8.0