<?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="org.springblade.jfpt.attendance.mapper.AttendanceMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="attendanceResultMap" type="org.springblade.jfpt.attendance.entity.Attendance">
|
<id column="id" property="id"/>
|
<result column="name" property="name"/>
|
<result column="number" property="number"/>
|
<result column="department" property="department"/>
|
<result column="weather" property="weather"/>
|
<result column="clockTime" property="clocktime"/>
|
<result column="jd" property="jd"/>
|
<result column="wd" property="wd"/>
|
<result column="clockType" property="clocktype"/>
|
<result column="attendanceType" property="attendancetype"/>
|
<result column="tenant_id" property="tenantId"/>
|
<result column="week" property="week"/>
|
<result column="address" property="address"/>
|
</resultMap>
|
|
|
<select id="selectAttendancePage" resultMap="attendanceResultMap">
|
select * from sys_attendance where is_deleted = 0
|
<if test="attendance.name!=null and attendance.name != ''">
|
and name = #{attendance.name}
|
</if>
|
<if test="attendance.department!=null and attendance.department != ''">
|
and department = #{department}
|
</if>
|
<if test="attendance.attendancetype!=null and attendance.attendancetype != ''">
|
and attendancetype = #{attendance.attendancetype}
|
</if>
|
<if test="attendance.beginTime!=null and attendance.beginTime!=''">
|
and clockTime>=#{attendance.beginTime}
|
</if>
|
<if test="attendance.endTime!=null and attendance.endTime!=''">
|
and clockTime<=#{attendance.endTime}
|
</if>
|
</select>
|
|
<select id="exportAttendane" resultType="org.springblade.jfpt.attendance.excel.AttendanceExcel">
|
SELECT id, name, number, department, weather, clockTime, clockType, attendanceType,week,address FROM sys_attendance where is_deleted = 0
|
<if test="name!=null and name != ''">
|
and name = #{name}
|
</if>
|
<if test="beginTimes!=null and beginTimes!=''">
|
and clockTime>=#{beginTimes}
|
</if>
|
<if test="endTimes!=null and endTimes!=''">
|
and clockTime<=#{endTimes}
|
</if>
|
<if test="attendancetypes!=null and attendancetypes!=''">
|
and attendancetype=#{attendancetypes}
|
</if>
|
</select>
|
|
<!--查询当前考勤人员当天的考勤信息-->
|
<select id="selAttendanceListNow" resultType="org.springblade.jfpt.attendance.entity.Attendance">
|
select * from sys_attendance
|
where
|
number = #{number}
|
and
|
to_days(now())=to_days(clockTime)
|
and
|
is_deleted=0
|
</select>
|
|
<!--查询当前时间之前最新的一条数据-->
|
<select id="selAttendanceNewNow" resultType="org.springblade.jfpt.attendance.entity.Attendance">
|
select * from sys_attendance
|
where
|
number = #{number}
|
and
|
to_days(now())=to_days(clockTime)
|
and
|
is_deleted=0
|
order by clockTime desc
|
limit 1
|
</select>
|
|
|
</mapper>
|