|
@@ -1,46 +1,59 @@
|
|
|
<?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">
|
|
|
+ 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="inTime" column="IN_TIME" />
|
|
|
- <result property="outTime" column="OUT_TIME" />
|
|
|
- <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" />
|
|
|
+ <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="inTime" column="IN_TIME"/>
|
|
|
+ <result property="outTime" column="OUT_TIME"/>
|
|
|
+ <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, IN_TIME, OUT_TIME, DEVICES, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, REMARK from TWIN_WK_EMP_ROTA
|
|
|
+ select SHIFT_ID,
|
|
|
+ EMP_DATE,
|
|
|
+ EMP_ID,
|
|
|
+ EMP_NAME,
|
|
|
+ EMP_TEAM,
|
|
|
+ IN_TIME,
|
|
|
+ OUT_TIME,
|
|
|
+ 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="inTime != null "> and IN_TIME = #{inTime}</if>
|
|
|
- <if test="outTime != null "> and OUT_TIME = #{outTime}</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>
|
|
|
+ <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="inTime != null ">and IN_TIME = #{inTime}</if>
|
|
|
+ <if test="outTime != null ">and OUT_TIME = #{outTime}</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
|
|
|
+ order by emp_date desc,CREATED_TIME desc,updated_time desc
|
|
|
</select>
|
|
|
|
|
|
<select id="selectTwinWkEmpRotaByShiftId" parameterType="Long" resultMap="TwinWkEmpRotaResult">
|
|
@@ -63,7 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="updatedBy != null">UPDATED_BY,</if>
|
|
|
<if test="updatedTime != null">UPDATED_TIME,</if>
|
|
|
<if test="remark != null">REMARK,</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="empDate != null">#{empDate},</if>
|
|
|
<if test="empId != null">#{empId},</if>
|
|
@@ -77,7 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="updatedBy != null">#{updatedBy},</if>
|
|
|
<if test="updatedTime != null">#{updatedTime},</if>
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateTwinWkEmpRota" parameterType="TwinWkEmpRota">
|
|
@@ -100,7 +113,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteTwinWkEmpRotaByShiftId" parameterType="Long">
|
|
|
- delete from TWIN_WK_EMP_ROTA where SHIFT_ID = #{shiftId}
|
|
|
+ delete
|
|
|
+ from TWIN_WK_EMP_ROTA
|
|
|
+ where SHIFT_ID = #{shiftId}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteTwinWkEmpRotaByShiftIds" parameterType="String">
|