<?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.ruoyi.personnelManagement.mapper.AttendanceMapper">
|
|
<resultMap type="Attendance" id="AttendanceResult">
|
<result property="id" column="id" />
|
<result property="employeeId" column="employee_id" />
|
<result property="employeeName" column="employee_name" />
|
<result property="employeeNo" column="employee_no" />
|
<result property="month" column="month" />
|
<result property="shouldAttendDays" column="should_attend_days" />
|
<result property="actualAttendDays" column="actual_attend_days" />
|
<result property="status" column="status" />
|
<result property="createBy" column="create_by" />
|
<result property="createTime" column="create_time" />
|
<result property="updateBy" column="update_by" />
|
<result property="updateTime" column="update_time" />
|
<result property="tenantId" column="tenant_id" />
|
</resultMap>
|
|
<sql id="selectAttendanceVo">
|
select id, employee_id, employee_name, employee_no, month, should_attend_days, actual_attend_days, status, create_by, create_time, update_by, update_time, tenant_id from attendance
|
</sql>
|
|
<select id="selectAttendanceList" parameterType="Attendance" resultMap="AttendanceResult">
|
<include refid="selectAttendanceVo"/>
|
<where>
|
<if test="employeeId != null "> and employee_id = #{employeeId}</if>
|
<if test="employeeName != null and employeeName != ''"> and employee_name like concat('%', #{employeeName}, '%')</if>
|
<if test="employeeNo != null and employeeNo != ''"> and employee_no = #{employeeNo}</if>
|
<if test="month != null and month != ''"> and month = #{month}</if>
|
<if test="shouldAttendDays != null "> and should_attend_days = #{shouldAttendDays}</if>
|
<if test="actualAttendDays != null "> and actual_attend_days = #{actualAttendDays}</if>
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
<if test="tenantId != null "> and tenant_id = #{tenantId}</if>
|
</where>
|
</select>
|
|
<select id="selectAttendanceById" parameterType="Long" resultMap="AttendanceResult">
|
<include refid="selectAttendanceVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertAttendance" parameterType="Attendance" useGeneratedKeys="true" keyProperty="id">
|
insert into attendance
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="employeeId != null">employee_id,</if>
|
<if test="employeeName != null and employeeName != ''">employee_name,</if>
|
<if test="employeeNo != null and employeeNo != ''">employee_no,</if>
|
<if test="month != null and month != ''">month,</if>
|
<if test="shouldAttendDays != null">should_attend_days,</if>
|
<if test="actualAttendDays != null">actual_attend_days,</if>
|
<if test="status != null and status != ''">status,</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>
|
<if test="tenantId != null">tenant_id,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="employeeId != null">#{employeeId},</if>
|
<if test="employeeName != null and employeeName != ''">#{employeeName},</if>
|
<if test="employeeNo != null and employeeNo != ''">#{employeeNo},</if>
|
<if test="month != null and month != ''">#{month},</if>
|
<if test="shouldAttendDays != null">#{shouldAttendDays},</if>
|
<if test="actualAttendDays != null">#{actualAttendDays},</if>
|
<if test="status != null and status != ''">#{status},</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>
|
<if test="tenantId != null">#{tenantId},</if>
|
</trim>
|
</insert>
|
|
<update id="updateAttendance" parameterType="Attendance">
|
update attendance
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="employeeId != null">employee_id = #{employeeId},</if>
|
<if test="employeeName != null and employeeName != ''">employee_name = #{employeeName},</if>
|
<if test="employeeNo != null and employeeNo != ''">employee_no = #{employeeNo},</if>
|
<if test="month != null and month != ''">month = #{month},</if>
|
<if test="shouldAttendDays != null">should_attend_days = #{shouldAttendDays},</if>
|
<if test="actualAttendDays != null">actual_attend_days = #{actualAttendDays},</if>
|
<if test="status != null and status != ''">status = #{status},</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>
|
<if test="tenantId != null">tenant_id = #{tenantId},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteAttendanceById" parameterType="Long">
|
delete from attendance where id = #{id}
|
</delete>
|
|
<delete id="deleteAttendanceByIds" parameterType="String">
|
delete from attendance where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|