|
@@ -0,0 +1,102 @@
|
|
|
+<?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.jjt.wkEmp.mapper.TwinWkEmpRotaMapper">
|
|
|
+
|
|
|
+ <resultMap type="TwinWkEmpRota" id="TwinWkEmpRotaResult">
|
|
|
+ <result property="shiftId" column="SHIFT_ID" />
|
|
|
+ <result property="empDate" column="EMP_DATE" />
|
|
|
+ <result property="empId" column="EMP_ID" />
|
|
|
+ <result property="empName" column="EMP_NAME" />
|
|
|
+ <result property="empTeam" column="EMP_TEAM" />
|
|
|
+ <result property="devices" column="DEVICES" />
|
|
|
+ <result property="createdBy" column="CREATED_BY" />
|
|
|
+ <result property="createdTime" column="CREATED_TIME" />
|
|
|
+ <result property="updatedBy" column="UPDATED_BY" />
|
|
|
+ <result property="updatedTime" column="UPDATED_TIME" />
|
|
|
+ <result property="remark" column="REMARK" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectTwinWkEmpRotaVo">
|
|
|
+ select SHIFT_ID, EMP_DATE, EMP_ID, EMP_NAME, EMP_TEAM, DEVICES, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, REMARK from TWIN_WK_EMP_ROTA
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectTwinWkEmpRotaList" parameterType="TwinWkEmpRota" resultMap="TwinWkEmpRotaResult">
|
|
|
+ <include refid="selectTwinWkEmpRotaVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="empDate != null "> and EMP_DATE = #{empDate}</if>
|
|
|
+ <if test="empId != null and empId != ''"> and EMP_ID = #{empId}</if>
|
|
|
+ <if test="empName != null and empName != ''"> and EMP_NAME like concat('%', #{empName}, '%')</if>
|
|
|
+ <if test="empTeam != null and empTeam != ''"> and EMP_TEAM = #{empTeam}</if>
|
|
|
+ <if test="devices != null and devices != ''"> and DEVICES = #{devices}</if>
|
|
|
+ <if test="createdBy != null and createdBy != ''"> and CREATED_BY = #{createdBy}</if>
|
|
|
+ <if test="createdTime != null "> and CREATED_TIME = #{createdTime}</if>
|
|
|
+ <if test="updatedBy != null and updatedBy != ''"> and UPDATED_BY = #{updatedBy}</if>
|
|
|
+ <if test="updatedTime != null "> and UPDATED_TIME = #{updatedTime}</if>
|
|
|
+ <if test="remark != null and remark != ''"> and REMARK = #{remark}</if>
|
|
|
+ </where>
|
|
|
+ order by emp_date desc,updated_time desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectTwinWkEmpRotaByShiftId" parameterType="Long" resultMap="TwinWkEmpRotaResult">
|
|
|
+ <include refid="selectTwinWkEmpRotaVo"/>
|
|
|
+ where SHIFT_ID = #{shiftId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertTwinWkEmpRota" parameterType="TwinWkEmpRota" useGeneratedKeys="true" keyProperty="shiftId">
|
|
|
+ insert into TWIN_WK_EMP_ROTA
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="empDate != null">EMP_DATE,</if>
|
|
|
+ <if test="empId != null">EMP_ID,</if>
|
|
|
+ <if test="empName != null">EMP_NAME,</if>
|
|
|
+ <if test="empTeam != null">EMP_TEAM,</if>
|
|
|
+ <if test="devices != null">DEVICES,</if>
|
|
|
+ <if test="createdBy != null">CREATED_BY,</if>
|
|
|
+ <if test="createdTime != null">CREATED_TIME,</if>
|
|
|
+ <if test="updatedBy != null">UPDATED_BY,</if>
|
|
|
+ <if test="updatedTime != null">UPDATED_TIME,</if>
|
|
|
+ <if test="remark != null">REMARK,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="empDate != null">#{empDate},</if>
|
|
|
+ <if test="empId != null">#{empId},</if>
|
|
|
+ <if test="empName != null">#{empName},</if>
|
|
|
+ <if test="empTeam != null">#{empTeam},</if>
|
|
|
+ <if test="devices != null">#{devices},</if>
|
|
|
+ <if test="createdBy != null">#{createdBy},</if>
|
|
|
+ <if test="createdTime != null">#{createdTime},</if>
|
|
|
+ <if test="updatedBy != null">#{updatedBy},</if>
|
|
|
+ <if test="updatedTime != null">#{updatedTime},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateTwinWkEmpRota" parameterType="TwinWkEmpRota">
|
|
|
+ update TWIN_WK_EMP_ROTA
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="empDate != null">EMP_DATE = #{empDate},</if>
|
|
|
+ <if test="empId != null">EMP_ID = #{empId},</if>
|
|
|
+ <if test="empName != null">EMP_NAME = #{empName},</if>
|
|
|
+ <if test="empTeam != null">EMP_TEAM = #{empTeam},</if>
|
|
|
+ <if test="devices != null">DEVICES = #{devices},</if>
|
|
|
+ <if test="createdBy != null">CREATED_BY = #{createdBy},</if>
|
|
|
+ <if test="createdTime != null">CREATED_TIME = #{createdTime},</if>
|
|
|
+ <if test="updatedBy != null">UPDATED_BY = #{updatedBy},</if>
|
|
|
+ <if test="updatedTime != null">UPDATED_TIME = #{updatedTime},</if>
|
|
|
+ <if test="remark != null">REMARK = #{remark},</if>
|
|
|
+ </trim>
|
|
|
+ where SHIFT_ID = #{shiftId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteTwinWkEmpRotaByShiftId" parameterType="Long">
|
|
|
+ delete from TWIN_WK_EMP_ROTA where SHIFT_ID = #{shiftId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteTwinWkEmpRotaByShiftIds" parameterType="String">
|
|
|
+ delete from TWIN_WK_EMP_ROTA where SHIFT_ID in
|
|
|
+ <foreach item="shiftId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{shiftId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|