|
@@ -2,6 +2,62 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="org.jeecg.modules.viewClockIn.mapper.viewClockInMapper">
|
|
|
|
|
|
+ <select id="selectByPage" resultType="org.jeecg.modules.viewClockIn.entity.ViewClockIn">
|
|
|
+
|
|
|
+ select a.date view_date1,
|
|
|
+ case
|
|
|
+ when DAYOFWEEK(a.date) = '1' then '星期日'
|
|
|
+ when DAYOFWEEK(a.date) = '2' then '星期一'
|
|
|
+ when DAYOFWEEK(a.date) = '3' then '星期二'
|
|
|
+ when DAYOFWEEK(a.date) = '4' then '星期三'
|
|
|
+ when DAYOFWEEK(a.date) = '5' then '星期四'
|
|
|
+ when DAYOFWEEK(a.date) = '6' then '星期五'
|
|
|
+ when DAYOFWEEK(a.date) = '7' then '星期六'
|
|
|
+ end as week_date1,
|
|
|
+ b.*,
|
|
|
+ case when (latetime_s < 0 or latetime_x > 0
|
|
|
+ or (rule_type = 1 and ifwork > 0 and attendance_count < 2 and shift_real_time_s is not null)
|
|
|
+ or (rule_type = 1 and ifwork > 0 and shift_real_time_s is not null and goto_time is null)
|
|
|
+ or (rule_type = 2 and attendance_count < 2 and shift_real_time_s is not null)
|
|
|
+ or (rule_type = 2 and shift_real_time_s is not null and goto_time is null)
|
|
|
+ or (duration is not null and (work_overtime > 0 or work_overtime is null))
|
|
|
+ or (shift_type = 1 and (latetime1_s < 0 or latetime1_x > 0 or latetime2_s < 0 or latetime2_x > 0))
|
|
|
+ and set_info > 0 ) and error_state is null
|
|
|
+
|
|
|
+ then '1'
|
|
|
+
|
|
|
+ when shift_real_time_s is null and goto_time is not null and (set_info > 0 or set_info is null ) and error_state is null
|
|
|
+
|
|
|
+ then '2'
|
|
|
+
|
|
|
+ else '0'
|
|
|
+
|
|
|
+ end as show_state
|
|
|
+
|
|
|
+ from temp_date a
|
|
|
+ left join view_clock_in_0 b ON a.date = b.view_date and b.realname = a.temp_realname
|
|
|
+
|
|
|
+ where DATE_FORMAT(date,'%Y-%m') = #{map.mDate}
|
|
|
+ and b.realname = #{map.userName}
|
|
|
+ and date <= date_format(IFNULL(b.term_date,NOW()),'%Y-%m-%d')
|
|
|
+
|
|
|
+ <if test="map.duration != null and map.duration != ''">
|
|
|
+ and b.duration is not null
|
|
|
+ </if>
|
|
|
+ <if test="map.showState != null and map.showState != ''">
|
|
|
+ and (latetime_s < 0 or latetime_x > 0
|
|
|
+ or (rule_type = 1 and ifwork > 0 and attendance_count < 2 and shift_real_time_s is not null)
|
|
|
+ or (rule_type = 1 and ifwork > 0 and shift_real_time_s is not null and goto_time is null)
|
|
|
+ or (rule_type = 2 and attendance_count < 2 and shift_real_time_s is not null)
|
|
|
+ or (rule_type = 2 and shift_real_time_s is not null and goto_time is null)
|
|
|
+ or (duration is not null and (work_overtime > 0 or work_overtime is null))
|
|
|
+ or (shift_type = 1 and (latetime1_s < 0 or latetime1_x > 0 or latetime2_s < 0 or latetime2_x > 0))
|
|
|
+ and set_info > 0 ) and error_state is null
|
|
|
+ </if>
|
|
|
+ group by date
|
|
|
+ order by date asc
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="exportErrotInfo" resultType = "org.jeecg.modules.viewClockIn.entity.ExportClockInfo">
|
|
|
select CONCAT(shift_real_time_s,'-',shift_real_time_x) shiftTime,#{userType} as category,
|
|
|
case a.show_state
|
|
@@ -9,7 +65,23 @@
|
|
|
else '正常'
|
|
|
end as state
|
|
|
,
|
|
|
- a.* from view_clock_in_1 a where a.realname = #{realname} and a.head_month = #{headMonth}
|
|
|
+ b.date view_date,
|
|
|
+ case
|
|
|
+ when DAYOFWEEK(b.date) = '1' then '星期日'
|
|
|
+ when DAYOFWEEK(b.date) = '2' then '星期一'
|
|
|
+ when DAYOFWEEK(b.date) = '3' then '星期二'
|
|
|
+ when DAYOFWEEK(b.date) = '4' then '星期三'
|
|
|
+ when DAYOFWEEK(b.date) = '5' then '星期四'
|
|
|
+ when DAYOFWEEK(b.date) = '6' then '星期五'
|
|
|
+ when DAYOFWEEK(b.date) = '7' then '星期六'
|
|
|
+ end as week_date,
|
|
|
+ a.* from temp_date b
|
|
|
+ left join view_clock_in_1 a on b.date = a.view_date
|
|
|
+ and a.realname = #{realname}
|
|
|
+ where DATE_FORMAT(date,'%Y-%m') = #{headMonth}
|
|
|
+ and date <= date_format(IFNULL(a.term_date,NOW()),'%Y-%m-%d')
|
|
|
+ group by date
|
|
|
+ order by date
|
|
|
</select>
|
|
|
|
|
|
<select id="exportXlsDay" resultType = "org.jeecg.modules.viewClockIn.entity.ExportClockDay">
|