104 lines
5.6 KiB
XML
104 lines
5.6 KiB
XML
<?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.evo.attendance.mapper.RzSpecialAttendanceMapper">
|
|
|
|
<resultMap type="RzSpecialAttendance" id="RzSpecialAttendanceResult">
|
|
<result property="id" column="id" />
|
|
<result property="staffId" column="staff_id" />
|
|
<result property="name" column="name" />
|
|
<result property="deptId" column="dept_id" />
|
|
<result property="attendanceDate" column="attendance_date" />
|
|
<result property="workStartTime" column="work_start_time" />
|
|
<result property="workEndTime" column="work_end_time" />
|
|
<result property="workHours" column="work_hours" />
|
|
<result property="remarks" column="remarks" />
|
|
<result property="delFlag" column="del_flag" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
</resultMap>
|
|
|
|
<sql id="selectRzSpecialAttendanceVo">
|
|
select id, staff_id, name, dept_id, attendance_date, work_start_time, work_end_time, work_hours, remarks, del_flag, create_by, create_time, update_by, update_time from rz_special_attendance
|
|
</sql>
|
|
|
|
<select id="selectRzSpecialAttendanceList" parameterType="RzSpecialAttendance" resultMap="RzSpecialAttendanceResult">
|
|
<include refid="selectRzSpecialAttendanceVo"/>
|
|
<where>
|
|
del_flag = '0'
|
|
<if test="staffId != null "> and staff_id = #{staffId}</if>
|
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
<if test="attendanceDate != null "> and date_format(attendance_date,'%y%m%d') = date_format(#{attendanceDate},'%y%m%d')</if>
|
|
<if test="workStartTime != null "> and date_format(attendance_date,'%y%m') = date_format(#{workStartTime},'%y%m')</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectRzSpecialAttendanceById" parameterType="Long" resultMap="RzSpecialAttendanceResult">
|
|
<include refid="selectRzSpecialAttendanceVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertRzSpecialAttendance" parameterType="RzSpecialAttendance" useGeneratedKeys="true" keyProperty="id">
|
|
insert into rz_special_attendance
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="staffId != null">staff_id,</if>
|
|
<if test="name != null and name != ''">name,</if>
|
|
<if test="deptId != null">dept_id,</if>
|
|
<if test="attendanceDate != null">attendance_date,</if>
|
|
<if test="workStartTime != null">work_start_time,</if>
|
|
<if test="workEndTime != null">work_end_time,</if>
|
|
<if test="workHours != null">work_hours,</if>
|
|
<if test="remarks != null">remarks,</if>
|
|
<if test="delFlag != null">del_flag,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="staffId != null">#{staffId},</if>
|
|
<if test="name != null and name != ''">#{name},</if>
|
|
<if test="deptId != null">#{deptId},</if>
|
|
<if test="attendanceDate != null">#{attendanceDate},</if>
|
|
<if test="workStartTime != null">#{workStartTime},</if>
|
|
<if test="workEndTime != null">#{workEndTime},</if>
|
|
<if test="workHours != null">#{workHours},</if>
|
|
<if test="remarks != null">#{remarks},</if>
|
|
<if test="delFlag != null">#{delFlag},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateRzSpecialAttendance" parameterType="RzSpecialAttendance">
|
|
update rz_special_attendance
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="staffId != null">staff_id = #{staffId},</if>
|
|
<if test="name != null and name != ''">name = #{name},</if>
|
|
<if test="deptId != null">dept_id = #{deptId},</if>
|
|
<if test="attendanceDate != null">attendance_date = #{attendanceDate},</if>
|
|
<if test="workStartTime != null">work_start_time = #{workStartTime},</if>
|
|
<if test="workEndTime != null">work_end_time = #{workEndTime},</if>
|
|
<if test="workHours != null">work_hours = #{workHours},</if>
|
|
<if test="remarks != null">remarks = #{remarks},</if>
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<select id="selectRzSpecialAttendanceByuserIdAndDate" resultMap="RzSpecialAttendanceResult">
|
|
<include refid="selectRzSpecialAttendanceVo"/>
|
|
where del_flag = '0' and staff_id = #{staffId} and date_format(attendance_date,'%y%M%d') = date_format(#{date},'%y%M%d')
|
|
</select>
|
|
|
|
</mapper>
|