<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.attendance.dao.ibatis.AttendanceRecordDetailDaoImpl">
    <!-- 获取列表 -->
    <select id="getListByWhere" parameterType="com.mortals.xhx.module.attendance.model.AttendanceRecordQuery"
            resultMap="AttendanceRecordDetailEntity-Map">
        select a.id,

        a.recordId,

        a.shiftsId,

        a.shiftsName,

        a.goWorkDate,

        a.goWorkResult,

        a.offWorkDate,
        a.offWorkResult,
        a.orderNum
        from mortals_xhx_attendance_record_detail as a,mortals_xhx_attendance_record r
        where a.recordId = r.id
        and r.staffId = #{staffId}
        AND r.attendanceDate <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{attendanceDateStart},' 00:00:00'),19),'%Y-%m-%d
        %k:%i:%s')
        AND r.attendanceDate <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{attendanceDateEnd},' 23:59:59'),19),'%Y-%m-%d
        %k:%i:%s')
    </select>
</mapper>