| | |
| | | @Override |
| | | public R serviceStatic(ServiceStaticDTO serviceStaticDTO) { |
| | | ServiceStaticsVO serviceStaticsVO = new ServiceStaticsVO(); |
| | | if (serviceStaticDTO.getCheckUnitId() != null) |
| | | if (serviceStaticDTO.getCheckUnitId() != null && serviceStaticDTO.getCheckUnitId()> 0) |
| | | { |
| | | //单位服务统计 |
| | | serviceStaticsVO = |
| | |
| | | { |
| | | //个人服务统计 |
| | | |
| | | |
| | | ComPbMemberDO comPbMemberDO = comPbMemberDAO.selectOne(new QueryWrapper<ComPbMemberDO>().lambda() |
| | | .eq(ComPbMemberDO::getPhone, serviceStaticDTO.getPhone()).last("limit 1")); |
| | | Long checkUnitId = null; |
| | | if (comPbMemberDO != null) { |
| | | checkUnitId = comPbMemberDO.getCheckUnitId(); |
| | | } |
| | | |
| | | serviceStaticsVO = this.baseMapper.selectStatsUser(serviceStaticDTO.getPhone(),checkUnitId+"", serviceStaticDTO.getYear()); |
| | | |
| | | List<ServiceDetailStaticsVO> serviceDetailStaticsVOList=this.baseMapper.selectServiceDetailListForPersonal(checkUnitId, serviceStaticDTO.getPhone(), |
| | |
| | | AND su1.phone = #{phone} |
| | | AND canc.order_time BETWEEN concat( #{date}, '-01-01 00:00:00' ) |
| | | AND concat( #{date}, '-12-31 23:59:59' ) |
| | | <if test="checkUnitId != null"> |
| | | <if test="checkUnitId != null and checkUnitId != '' "> |
| | | UNION ALL |
| | | SELECT |
| | | a.id AS serviceId, |
| | |
| | | WHERE |
| | | s.end_time IS NOT NULL |
| | | AND a.check_unit_id IS NOT NULL |
| | | AND s.sign_identity != 2 |
| | | AND su.phone = #{phone} |
| | | AND s.start_time BETWEEN concat( #{date}, '-01-01 00:00:00' ) |
| | | AND concat( #{date}, '-12-31 23:59:59' ) |
| | |
| | | LEFT JOIN sys_user su ON su.user_id = s.user_id |
| | | WHERE |
| | | s.end_time IS NOT NULL |
| | | AND a.check_unit_id IS NULL |
| | | AND s.check_unit_id IS NULL |
| | | AND s.sign_identity = 2 |
| | | AND su.phone = #{phone} |
| | | AND s.start_time BETWEEN concat( #{date}, '-01-01 00:00:00' ) |