| | |
| | | ifnull(sum(aa.num2), 0) as lateEarly, |
| | | ifnull(dd.num1, 0) as shouldClockInDays |
| | | from ( |
| | | select app_user_id, count(clock_in_result) as num1, 0 as num2 from xp_clock_in where is_deleted = 0 and |
| | | clock_in_result = 1 |
| | | select app_user_id, count(id) as num1, 0 as num2 from xp_clock_in where is_deleted = 0 and |
| | | clock_in_result = 1 and clock_out_result = 1 |
| | | <if test="null != appUserIds and appUserIds.size() > 0"> |
| | | and app_user_id in |
| | | <foreach item="item" collection="appUserIds" separator="," open="(" close=")" index="index"> |
| | |
| | | </if> |
| | | group by app_user_id |
| | | union all |
| | | select app_user_id, 0 as num1, count(clock_in_result) as num2 from xp_clock_in where is_deleted = 0 and |
| | | clock_in_result != 1 |
| | | select app_user_id, 0 as num1, count(id) as num2 from xp_clock_in where is_deleted = 0 and |
| | | (clock_in_result != 1 or clock_out_result != 1) |
| | | <if test="null != appUserIds and appUserIds.size() > 0"> |
| | | and app_user_id in |
| | | <foreach item="item" collection="appUserIds" separator="," open="(" close=")" index="index"> |