|  |  |  | 
|---|
|  |  |  | <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"/> | 
|---|
|  |  |  | 
|---|
|  |  |  | 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 | 
|---|
|  |  |  | 
|---|
|  |  |  | 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 | 
|---|
|  |  |  | 
|---|
|  |  |  | 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}, | 
|---|
|  |  |  | 
|---|
|  |  |  | 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 | 
|---|