|
@@ -50,6 +50,7 @@
|
|
|
select A.depart_name,count(b.username) errornum ,A.id from sys_depart A left join (
|
|
|
select b.username,b.depart_names from view_clock_in_1 b
|
|
|
where DATE_FORMAT(b.view_date,'%Y-%m') = #{viewDate}
|
|
|
+ and (b.employment_status = 10 or date_format(b.term_date,'%Y-%m') >= #{viewDate} or b.term_date is null )
|
|
|
<!--and (
|
|
|
b.lateTime_s < 0 or b.lateTime_x > 0
|
|
|
|| (b.ifwork !=0 and attendance_Count < 2 and b.name is not null)
|
|
@@ -81,31 +82,32 @@
|
|
|
|
|
|
<select id="selectUserError" resultType="Map">
|
|
|
|
|
|
- select a.username,a.realname,a.depart_ids departids,a.category,b.errornum from sys_user A left join (
|
|
|
- select b.user_id,count(1) as errornum from view_clock_in_1 b
|
|
|
- where DATE_FORMAT(b.view_date,'%Y-%m') = #{viewDate}
|
|
|
- <!--and (
|
|
|
- b.lateTime_s < 0 or b.lateTime_x > 0
|
|
|
- || (b.ifwork !=0 and attendance_Count < 2 and b.name is not null)
|
|
|
- || ((b.ifwork is null or b.ifwork !=0) and b.name is not null and b.name != '' and (b.goto_time is null || b.goto_time = '' || b.goto_time = null))
|
|
|
- || b.duration is not null
|
|
|
- and (b.set_info > 0 ) and (b.error_State != 0 or b.error_State is null)
|
|
|
- )
|
|
|
--->
|
|
|
- and (b.latetime_s < 0 or b.latetime_x > 0 <!-- 是否迟到早退-->
|
|
|
- or (b.rule_type = 1 and b.ifwork > 0 and b.attendance_count < 2 and b.shift_real_time_s is not null) <!-- 固定班,需要打卡(固定班时休息日),打卡次数不足,当天有排班-->
|
|
|
- or (b.rule_type = 1 and b.ifwork > 0 and b.shift_real_time_s is not null and b.goto_time is null) <!-- 固定班,需要打卡,当天有排班,没有打卡记录-->
|
|
|
- or (b.rule_type = 2 and b.attendance_count < 2 and b.shift_real_time_s is not null) <!-- 班次上下班,需要打卡(固定班时休息日),打卡次数不足,当天有排班-->
|
|
|
- or (b.rule_type = 2 and b.shift_real_time_s is not null and b.goto_time is null) <!-- 班次上下班,需要打卡,当天有排班,没有打卡记录-->
|
|
|
- or (b.duration is not null and b.work_overtime > 0) <!-- 有加班信息,打卡时间早于加班申请时间-->
|
|
|
- and b.set_info > 0 ) and b.error_state is null
|
|
|
-
|
|
|
-
|
|
|
- group by b.username
|
|
|
- ) B
|
|
|
- on a.id = b.user_id
|
|
|
+ select a.username,a.realname,a.depart_ids departids,a.category,b.errornum from sys_user A
|
|
|
+ left join (
|
|
|
+ select b.user_id,count(1) as errornum from view_clock_in_1 b
|
|
|
+ where DATE_FORMAT(b.view_date,'%Y-%m') = #{viewDate}
|
|
|
+ <!--and (
|
|
|
+ b.lateTime_s < 0 or b.lateTime_x > 0
|
|
|
+ || (b.ifwork !=0 and attendance_Count < 2 and b.name is not null)
|
|
|
+ || ((b.ifwork is null or b.ifwork !=0) and b.name is not null and b.name != '' and (b.goto_time is null || b.goto_time = '' || b.goto_time = null))
|
|
|
+ || b.duration is not null
|
|
|
+ and (b.set_info > 0 ) and (b.error_State != 0 or b.error_State is null)
|
|
|
+ )
|
|
|
+ -->
|
|
|
+ and (b.latetime_s < 0 or b.latetime_x > 0 <!-- 是否迟到早退-->
|
|
|
+ or (b.rule_type = 1 and b.ifwork > 0 and b.attendance_count < 2 and b.shift_real_time_s is not null) <!-- 固定班,需要打卡(固定班时休息日),打卡次数不足,当天有排班-->
|
|
|
+ or (b.rule_type = 1 and b.ifwork > 0 and b.shift_real_time_s is not null and b.goto_time is null) <!-- 固定班,需要打卡,当天有排班,没有打卡记录-->
|
|
|
+ or (b.rule_type = 2 and b.attendance_count < 2 and b.shift_real_time_s is not null) <!-- 班次上下班,需要打卡(固定班时休息日),打卡次数不足,当天有排班-->
|
|
|
+ or (b.rule_type = 2 and b.shift_real_time_s is not null and b.goto_time is null) <!-- 班次上下班,需要打卡,当天有排班,没有打卡记录-->
|
|
|
+ or (b.duration is not null and b.work_overtime > 0) <!-- 有加班信息,打卡时间早于加班申请时间-->
|
|
|
+ and b.set_info > 0 ) and b.error_state is null
|
|
|
+
|
|
|
+ group by b.username
|
|
|
+ ) B on a.id = b.user_id
|
|
|
+
|
|
|
+ where (a.employment_status = 10 or date_format(a.term_date,'%Y-%m') >= #{viewDate} or a.term_date is null )
|
|
|
<if test="deptCode != null and deptCode != ''">
|
|
|
- where find_in_set(#{deptCode} , a.depart_ids)
|
|
|
+ and find_in_set(#{deptCode} , a.depart_ids)
|
|
|
</if>
|
|
|
|
|
|
</select>
|