Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/Robotaxi
| | |
| | | @Param("appUserId") Long appUserId, |
| | | @Param("startTime") String startTime, |
| | | @Param("endTime") String endTime); |
| | | |
| | | |
| | | Long getClockInStatisticsDetailsCount(@Param("state") Integer state, @Param("appUserId") Long appUserId, |
| | | @Param("startTime") String startTime, |
| | | @Param("endTime") String endTime); |
| | | } |
| | |
| | | clockInStatistic.setRoleName(roleName); |
| | | } |
| | | } |
| | | Integer shouldClockInDays = clockInStatistic.getShouldClockInDays(); |
| | | Integer clockInDays = clockInStatistic.getClockInDays(); |
| | | Integer lateEarly = clockInStatistic.getLateEarly(); |
| | | clockInStatistic.setNotClockInDays(shouldClockInDays - clockInDays - lateEarly); |
| | | } |
| | | pageInfo.setRecords(clockInStatistics); |
| | | return pageInfo; |
| | |
| | | clockInStatistic.setRoleName(roleName); |
| | | } |
| | | } |
| | | Integer shouldClockInDays = clockInStatistic.getShouldClockInDays(); |
| | | Integer clockInDays = clockInStatistic.getClockInDays(); |
| | | Integer lateEarly = clockInStatistic.getLateEarly(); |
| | | clockInStatistic.setNotClockInDays(shouldClockInDays - clockInDays - lateEarly); |
| | | } |
| | | |
| | | ExcelUtil<ClockInStatisticsDto> excel = new ExcelUtil<ClockInStatisticsDto>(ClockInStatisticsDto.class); |
| | |
| | | XpOperationsUser xpOperationsUser = xpOperationUserClient.queryById(query.getAppUserId()).getData(); |
| | | List<Long> longList = fleetOperationsClient.getFleetIdsByUserId(xpOperationsUser.getId()).getData(); |
| | | List<XpSchedulingDetail> list = xpSchedulingDetailService.list(new QueryWrapper<XpSchedulingDetail>().eq("fleet_id", longList.get(0)).between(StringUtils.isNotEmpty(startTime), "plan_time", startTime, endTime)); |
| | | QueryWrapper<XpClockIn> last1 = new QueryWrapper<XpClockIn>().eq("app_user_id", query.getAppUserId()).last(" and (clock_in_result = 1 or clock_out_result = 1)" |
| | | + (StringUtils.isNotEmpty(startTime) ? " and (DATE_FORMAT(clock_in_time, '%Y-%m-%d') between '" + startTime + "' and '" + endTime + "' or DATE_FORMAT(clock_out_time, '%Y-%m-%d') between '" + startTime + "' and '" + endTime + "'))" : "")); |
| | | QueryWrapper<XpClockIn> last2 = new QueryWrapper<XpClockIn>().eq("app_user_id", query.getAppUserId()).last(" and (clock_in_result = 2 or clock_out_result = 2)" |
| | | + (StringUtils.isNotEmpty(startTime) ? " and (DATE_FORMAT(clock_in_time, '%Y-%m-%d') between '" + startTime + "' and '" + endTime + "' or DATE_FORMAT(clock_out_time, '%Y-%m-%d') between '" + startTime + "' and '" + endTime + "'))" : "")); |
| | | QueryWrapper<XpClockIn> last3 = new QueryWrapper<XpClockIn>().eq("app_user_id", query.getAppUserId()).last(" and (clock_in_result = 3 or clock_out_result = 3)" |
| | | + (StringUtils.isNotEmpty(startTime) ? " and (DATE_FORMAT(clock_in_time, '%Y-%m-%d') between '" + startTime + "' and '" + endTime + "' or DATE_FORMAT(clock_out_time, '%Y-%m-%d') between '" + startTime + "' and '" + endTime + "'))" : "")); |
| | | dto.setShouldClockInCount(list.size() * 2); |
| | | dto.setNormalClockInCount(this.count(last1)); |
| | | dto.setLateClockInCount(this.count(last2)); |
| | | dto.setMissingClockInCount(this.count(last3)); |
| | | dto.setNormalClockInCount(this.baseMapper.getClockInStatisticsDetailsCount(1, query.getAppUserId(), startTime, endTime)); |
| | | dto.setLateClockInCount(this.baseMapper.getClockInStatisticsDetailsCount(2, query.getAppUserId(), startTime, endTime)); |
| | | dto.setMissingClockInCount(this.baseMapper.getClockInStatisticsDetailsCount(3, query.getAppUserId(), startTime, endTime)); |
| | | return dto; |
| | | } |
| | | |
| | |
| | | cc.fleet_name as teamName, |
| | | ifnull(sum(aa.num1), 0) as clockInDays, |
| | | ifnull(sum(aa.num2), 0) as lateEarly, |
| | | ifnull(sum(aa.num3), 0) as notClockInDays, |
| | | ifnull(dd.num1, 0) as shouldClockInDays |
| | | from ( |
| | | select app_user_id, count(id) as num1, 0 as num2 from xp_clock_in where is_deleted = 0 and |
| | | select app_user_id, count(id) as num1, 0 as num2, 0 as num3 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 |
| | |
| | | </if> |
| | | group by app_user_id |
| | | union all |
| | | 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) |
| | | select app_user_id, 0 as num1, count(id) as num2, 0 as num3 from xp_clock_in where is_deleted = 0 and |
| | | (clock_in_result = 2 or clock_out_result = 2) |
| | | <if test="null != appUserIds and appUserIds.size() > 0"> |
| | | and app_user_id in |
| | | <foreach item="item" collection="appUserIds" separator="," open="(" close=")" index="index"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="null != startTime and '' != startTime and null != endTime and '' != endTime"> |
| | | and DATE_FORMAT(clock_in_time, '%Y-%m-%d') between #{startTime} and #{endTime} |
| | | </if> |
| | | group by app_user_id |
| | | union all |
| | | select app_user_id, 0 as num1, 0 as num2, count(id) as num3 from xp_clock_in where is_deleted = 0 and |
| | | (clock_in_result = 3 or clock_out_result = 3) |
| | | <if test="null != appUserIds and appUserIds.size() > 0"> |
| | | and app_user_id in |
| | | <foreach item="item" collection="appUserIds" separator="," open="(" close=")" index="index"> |
| | |
| | | left join xp_fleet_operations b on (a.app_user_id = b.operations_user_id) |
| | | left join xp_fleet c on (b.fleet_id = c.id) |
| | | left join xp_shift d on (a.shift_id = d.id) |
| | | WHERE a.app_user_id = #{appUserId} |
| | | WHERE a.app_user_id = #{appUserId} and a.is_deleted = 0 |
| | | <if test="null != startTime and '' != startTime and null != endTime and '' != endTime"> |
| | | and DATE_FORMAT(clock_in_time, '%Y-%m-%d') between #{startTime} and #{endTime} |
| | | </if> |
| | | order by a.clock_in_time desc |
| | | </select> |
| | | |
| | | <select id="getClockInStatisticsDetailsCount" resultType="long"> |
| | | select count(id) from ( |
| | | select id from xp_clock_in where is_deleted = 0 and app_user_id = #{appUserId} and clock_out_result = #{state} |
| | | <if test="null != startTime and '' != startTime and null != endTime and '' != endTime"> |
| | | and DATE_FORMAT(clock_out_time, '%Y-%m-%d') between #{startTime} and #{endTime} |
| | | </if>union ALL |
| | | select id from xp_clock_in where is_deleted = 0 and app_user_id = #{appUserId} and clock_in_result = #{state} |
| | | <if test="null != startTime and '' != startTime and null != endTime and '' != endTime"> |
| | | and DATE_FORMAT(clock_in_time, '%Y-%m-%d') between #{startTime} and #{endTime} |
| | | </if> |
| | | ) as aa |
| | | </select> |
| | | </mapper> |