zhangf
2024-05-08 0414ddb0b2b3a7199ae6181a770f97ac140dbd73
incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/service/baseService/impl/AccidentReportInfoServiceImpl.java
@@ -2,10 +2,10 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gkhy.safePlatform.incidentManage.entity.AccidentReportCount;
import com.gkhy.safePlatform.incidentManage.entity.AccidentReportInfo;
import com.gkhy.safePlatform.incidentManage.entity.AccidentReportInfoDetailDO;
import com.gkhy.safePlatform.incidentManage.entity.AccidentReportInfoPageDO;
import com.gkhy.safePlatform.commons.utils.StringUtils;
import com.gkhy.safePlatform.incidentManage.entity.*;
import com.gkhy.safePlatform.incidentManage.enums.AccidentResultCodes;
import com.gkhy.safePlatform.incidentManage.exception.AccidentException;
import com.gkhy.safePlatform.incidentManage.query.db.AccidentReportDBQuery;
import com.gkhy.safePlatform.incidentManage.query.db.AccidentReportCountDBQuery;
import com.gkhy.safePlatform.incidentManage.repository.AccidentReportInfoRepository;
@@ -51,4 +51,35 @@
        return accidentReportInfoRepository.selectByTimeAndType(dbQuery);
    }
    @Override
    public List<AccidentReportCountRPC> getCountForRPCByDeptIdAndMonth(String startTime, String endTime, Long deptId) {
        return accidentReportInfoRepository.getCountForRPCByDeptIdAndMonth(startTime,endTime,deptId);
    }
    @Override
    public List<AccidentReportCountRPC> getCountForRPCByDeptIdAndDay(String startTime, String endTime, Long deptId) {
        return accidentReportInfoRepository.getCountForRPCByDeptIdAndDay(startTime,endTime,deptId);
    }
    @Override
    public List<AccidentResultCountDO> getAccidentCountByDeptIdsAndTime(String startTime, String endTime, List<Long> deptIds) {
        if(StringUtils.isBlank(startTime) || StringUtils.isBlank(endTime) || null == deptIds || deptIds.size() == 0){
            throw new AccidentException(AccidentResultCodes.SERVE_PARAM_NULL);
        }
        return accidentReportInfoRepository.getAccidentCountByDeptIdsAndTime(startTime,endTime,deptIds);
    }
    @Override
    public List<AccidentResultCountDO> getAccidentCountByDeptIdAndTime(String startTime, String endTime, Long deptId) {
        if(StringUtils.isBlank(startTime) || StringUtils.isBlank(endTime) || null == deptId ){
            throw new AccidentException(AccidentResultCodes.SERVE_PARAM_NULL);
        }
        return accidentReportInfoRepository.getAccidentCountByDeptIdAndTime(startTime,endTime,deptId);
    }
    @Override
    public List<AccidentStatisticCountDO> getCountByAccidentGrade(Integer year, Integer month) {
        return accidentReportInfoRepository.getCountByAccidentGrade(year,month);
    }
}