diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java index 27345a2..eac70ff 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java @@ -139,4 +139,7 @@ public class OperAccessTaskEntity extends TenantEntity { @ApiModelProperty(value = "创建用户名称") private String updateUserName; + + @ApiModelProperty(value = "创建用户名称") + private Long constructionId; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperConstructionEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperConstructionEntity.java index 8c138e0..deed5fb 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperConstructionEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperConstructionEntity.java @@ -1,5 +1,6 @@ package com.hnac.hzims.operational.access.entity; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -80,4 +81,8 @@ public class OperConstructionEntity extends TenantEntity { @ApiModelProperty(value = "审核人名称") private String reviewerName; + @ApiModelProperty(value = "检修Id") + @TableField(exist = false) + private Long taskId; + } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java index ac7dd89..6fbd377 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java @@ -73,6 +73,9 @@ public interface MainConstants { // 开停机告警 String START_STOP_ALARM = "startStopAlarm"; + // 数据通讯中断 + String INTERRUPT_ALARM = "interruptAlarm"; + // realId获取 String REAL_ID_DATA = "realIdData"; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarEntity.java index 706093a..5bc6403 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarEntity.java @@ -64,12 +64,10 @@ public class CarEntity extends BaseEntity { @ApiModelProperty("下期年检时间") private Date nextAnnualInspectionTime; - @NotNull @Size(max = 50, message = "年检状态长度不能超过50") @ApiModelProperty("年检状态") private String annualInspectionStatus; - @NotNull @Size(max = 50, message = "保险状态长度不能超过50") @ApiModelProperty("保险状态") private String insuranceStatus; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceInspectionEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceInspectionEntity.java index 697de96..b4ad10a 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceInspectionEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceInspectionEntity.java @@ -33,11 +33,9 @@ public class SpecialDeviceInspectionEntity extends BaseEntity { @ApiModelProperty("检验照片") private String imgPath; - @TableField(exist = false) @ApiModelProperty("下次检验时间") private Date nextInspectionTime; - @TableField(exist = false) @ApiModelProperty("上次检验时间") private Date lastInspectionTime; } diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskPreviewVO.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskPreviewVO.java index 88110e8..f2c503f 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskPreviewVO.java +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskPreviewVO.java @@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode; import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; +import java.util.List; /** * @author ysj @@ -38,10 +39,7 @@ public class WorkTaskPreviewVO extends WorkTaskEntity { private Integer groupCount; @ApiModelProperty(value = "工作地点") - private String location; - - @ApiModelProperty(value = "工作内容") - private String content; + private List contents; @ApiModelProperty(value = "计划工作时间") private String planTimeInterval; diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensParamVo.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensParamVo.java index ebc35d5..2056c78 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensParamVo.java +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensParamVo.java @@ -18,7 +18,7 @@ public class CensParamVo { @ApiModelProperty("结束时间: yyyy-MM-dd HH:mm:ss") private String endTime; - @ApiModelProperty("状态 : 0-全部 1-完成") + @ApiModelProperty("状态 : 0-未完成 1-完成") private Integer state; @ApiModelProperty("结束") diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/AlarmScheduledTask.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/AlarmScheduledTask.java index 6f4721d..dc3f1ea 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/AlarmScheduledTask.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/AlarmScheduledTask.java @@ -12,6 +12,7 @@ import org.springframework.stereotype.Component; import java.util.Date; +import static com.hnac.hzims.operational.main.constant.MainConstants.INTERRUPT_ALARM; import static com.hnac.hzims.operational.main.constant.MainConstants.START_STOP_ALARM; @@ -39,4 +40,14 @@ public class AlarmScheduledTask { service.startStopAlarm(param); return new ReturnT<>("SUCCESS"); } + + @XxlJob(INTERRUPT_ALARM) + //@Scheduled(cron = "0/40 * * * * ? ") + public ReturnT interruptAlarm(String param) { + if (Func.isBlank(param)) { + param = DateUtil.format(new Date(), "yyyy-MM"); + } + service.interruptAlarm(param); + return new ReturnT<>("SUCCESS"); + } } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java index ba64a08..c092e7b 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java @@ -29,8 +29,10 @@ public class MonitorScheduledTask { /** * realId刷新 */ - @XxlJob(REAL_ID_DATA) - public ReturnT loadRealId(String param) { + //@XxlJob(REAL_ID_DATA) + @Scheduled(cron = "0/40 * * * * ? ") + public ReturnT loadRealId() { + String param = ""; if (Func.isBlank(param)) { param = DateUtil.format(new Date(), "yyyy-MM"); } @@ -42,9 +44,10 @@ public class MonitorScheduledTask { * 实时数据刷新 * @return ReturnT */ - @XxlJob(REAL_TIME_DATA) - //@Scheduled(cron = "0/40 * * * * ? ") - public ReturnT loadRealData( String param) { + //@XxlJob(REAL_TIME_DATA) + @Scheduled(cron = "0/40 * * * * ? ") + public ReturnT loadRealData() { + String param = ""; if (Func.isBlank(param)) { param = DateUtil.format(new Date(), "yyyy-MM"); } @@ -56,9 +59,10 @@ public class MonitorScheduledTask { * 集中监控数据处理 * @return ReturnT */ - @XxlJob(CENTRALIZED_MONITORING) - //@Scheduled(cron = "0/40 * * * * ? ") - public ReturnT loadMonitoring(String param) { + //@XxlJob(CENTRALIZED_MONITORING) + @Scheduled(cron = "0/40 * * * * ? ") + public ReturnT loadMonitoring() { + String param = ""; if (Func.isBlank(param)) { param = DateUtil.format(new Date(), "yyyy-MM"); } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java index 342847e..ed2e703 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java @@ -33,9 +33,10 @@ public class RealTargetScheduledTask { * @return * @throws Exception */ - @XxlJob(LOAD_EM_INFO) - //@Scheduled(cron = "0/40 * * * * ? ") - public ReturnT loadEmInfo(String param) { + //@XxlJob(LOAD_EM_INFO) + @Scheduled(cron = "0/40 * * * * ? ") + public ReturnT loadEmInfo() { + String param = ""; if (Func.isBlank(param)) { param = DateUtil.format(new Date(), "yyyy-MM"); } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/AlarmQueryService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/AlarmQueryService.java index 5b8f793..ff85d1c 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/AlarmQueryService.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/AlarmQueryService.java @@ -16,4 +16,6 @@ public interface AlarmQueryService extends BaseService { List bells(List codes); List aborts(List codes); + + void interruptAlarm(String param); } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmQueryServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmQueryServiceImpl.java index fd31272..a922504 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmQueryServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmQueryServiceImpl.java @@ -178,14 +178,23 @@ public class AlarmQueryServiceImpl extends BaseServiceImpl(); } - return alarms.stream().collect(Collectors.groupingBy(AlarmEntity::getStationId)).entrySet().stream().map(entry->{ + return alarms.stream().collect(Collectors.groupingBy(AlarmEntity::getStationId)).values().stream().map(alarmEntities -> { // 站点最近的一条数据中断、数据异常告警 - AlarmEntity alarm = entry.getValue().stream().sorted(Comparator.comparing(AlarmEntity::getCreateTime).reversed()).collect(Collectors.toList()).get(0); + AlarmEntity alarm = alarmEntities.stream().sorted(Comparator.comparing(AlarmEntity::getCreateTime).reversed()).collect(Collectors.toList()).get(0); // 状态为中断 - if(alarm.getAlarmStatus().equals(0)){ + if (alarm.getAlarmStatus().equals(0)) { return alarm.getStationId(); } return ""; }).filter(StringUtil::isBlank).distinct().collect(Collectors.toList()); } + + /** + * 数据中断告警 + * @param param + */ + @Override + public void interruptAlarm(String param) { + + } } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/ReportServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/ReportServiceImpl.java index 81b5dae..373edb3 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/ReportServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/ReportServiceImpl.java @@ -862,7 +862,7 @@ public class ReportServiceImpl implements ReportService { List alarms = this.hz3000Alarm(code,start,end); // FIXME 设备实例:一级告警 // FDP智能预警 - // alarms.addAll(this.intelligentEarly(code,start,end)); + alarms.addAll(this.intelligentEarly(code,start,end)); return JSONObject.toJSONString(alarms); } @@ -904,7 +904,7 @@ public class ReportServiceImpl implements ReportService { StbAnalysisDTO param = new StbAnalysisDTO(); param.setStartTime(LocalDateTime.parse(start,DateUtil.DATETIME_FORMATTER)); param.setEndTime(LocalDateTime.parse(end, DateUtil.DATETIME_FORMATTER)); - param.setStation(code); + param.setStations(Collections.singletonList(code)); param.setPage(0); param.setPageSize(100000); Result> result = soeDataClient.pageStbAnalysis(param); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/ConstructionController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/ConstructionController.java index 1653362..d8f3950 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/ConstructionController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/ConstructionController.java @@ -5,31 +5,22 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.hnac.hzims.common.logs.annotation.OperationAnnotation; import com.hnac.hzims.common.logs.enums.BusinessType; import com.hnac.hzims.common.logs.enums.OperatorType; -import com.hnac.hzims.operational.access.dto.AccessPlanV4DTO; -import com.hnac.hzims.operational.access.dto.OperAccessPlanDTO; -import com.hnac.hzims.operational.access.dto.OperAccessPlanFlowDTO; -import com.hnac.hzims.operational.access.dto.OperAccessPlanListDTO; import com.hnac.hzims.operational.access.entity.OperConstructionEntity; -import com.hnac.hzims.operational.access.service.AccessPlanV4Service; import com.hnac.hzims.operational.access.service.ConstructionService; import com.hnac.hzims.operational.access.vo.ConstructionVo; -import com.hnac.hzims.operational.access.vo.OperAccessPlanVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; -import org.springblade.core.log.annotation.ApiLog; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; -import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.Func; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import javax.validation.constraints.NotNull; -import java.util.Date; /** @@ -48,9 +39,7 @@ public class ConstructionController extends BladeController { @ApiOperationSupport(order = 1) @ApiOperation(value = "新增") public R save(@RequestBody OperConstructionEntity entity) { - entity.setCode("SGRZ" + DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME_MINI)); - entity.setConstructionTime(entity.getOverhaulTime()); - return R.status(service.save(entity)); + return R.status(service.accessSave(entity)); } @PostMapping("/remove") @@ -60,15 +49,22 @@ public class ConstructionController extends BladeController { return R.status(service.deleteLogic(Func.toLongList(ids))); } - @PostMapping("/update") + @GetMapping("/detail") @ApiOperationSupport(order = 3) + @ApiOperation(value = "详情查询") + public R detail(@ApiParam(value = "主键Id", required = true) @RequestParam Long id) { + return R.data(service.getById(id)); + } + + @PostMapping("/update") + @ApiOperationSupport(order = 4) @ApiOperation(value = "修改") public R update(@Valid @RequestBody OperConstructionEntity entity) { return R.status(service.updateById(entity)); } @GetMapping("/list") - @ApiOperationSupport(order = 4) + @ApiOperationSupport(order = 5) @OperationAnnotation(moduleName = "施工日志",title = "施工日志",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, action = "分页查询施工日志") @@ -78,7 +74,7 @@ public class ConstructionController extends BladeController { } @GetMapping("/preview") - @ApiOperationSupport(order = 5) + @ApiOperationSupport(order = 6) @ApiOperation(value = "检修施工日志预览", notes = "检修施工日志预览") public void preview(@RequestParam @ApiParam("检修施工记录Id") @NotNull @Valid Long id) { service.preview(id); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/ConstructionService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/ConstructionService.java index a70cedc..575a60a 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/ConstructionService.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/ConstructionService.java @@ -12,6 +12,7 @@ import org.springblade.core.tool.api.R; */ public interface ConstructionService extends BaseService { + boolean accessSave(OperConstructionEntity entity); IPage pageCondition(IPage page, ConstructionVo construction); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/ConstructionServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/ConstructionServiceImpl.java index 33ed9c8..b16da12 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/ConstructionServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/ConstructionServiceImpl.java @@ -4,12 +4,14 @@ import cn.afterturn.easypoi.entity.ImageEntity; import cn.afterturn.easypoi.word.WordExportUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity; import com.hnac.hzims.operational.access.entity.OperConstructionEntity; import com.hnac.hzims.operational.access.mapper.ConstructionMapper; import com.hnac.hzims.operational.access.service.ConstructionService; +import com.hnac.hzims.operational.access.service.IOperAccessTaskService; import com.hnac.hzims.operational.access.vo.ConstructionVo; import com.hnac.hzims.operational.util.PdfUtils; -import com.hnac.hzims.operational.util.WordUtils; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.IOUtils; @@ -32,6 +34,7 @@ import java.io.*; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLEncoder; +import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -43,6 +46,9 @@ import java.util.Map; @RequiredArgsConstructor public class ConstructionServiceImpl extends BaseServiceImpl implements ConstructionService { + + private final IOperAccessTaskService accessTaskService; + @Value("${hzims.operation.construction.save.img}") private String constructionSaveImgPath; @@ -55,6 +61,7 @@ public class ConstructionServiceImpl extends BaseServiceImpl pageCondition(IPage page, ConstructionVo construction) { QueryWrapper wrapper = Condition.getQueryWrapper(construction); + wrapper.orderByDesc("CREATE_TIME"); if(StringUtil.isNotBlank(construction.getStartTime())){ wrapper.ge("CREATE_TIME",construction.getStartTime()); } @@ -105,6 +112,23 @@ public class ConstructionServiceImpl extends BaseServiceImpllambdaUpdate() + .set(OperAccessTaskEntity::getConstructionId,entity.getId()) + .eq(OperAccessTaskEntity::getId,entity.getTaskId()) + ); + } + return true; + } + /** * 查询施工日志记录 * @param id diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperDefectMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperDefectMapper.java index dfe376f..cc14f7e 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperDefectMapper.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperDefectMapper.java @@ -26,6 +26,7 @@ public interface OperDefectMapper extends UserDataScopeBaseMapper getStatisticByMonth(@Param("month") String month, @Param("createDept") List createDept); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperDefectMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperDefectMapper.xml index b0a2909..ddc5640 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperDefectMapper.xml +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperDefectMapper.xml @@ -7,9 +7,14 @@ SELECT P.DEFECT_GRADING as defectLevel,P.HANDLE_STATUS,COUNT(P.ID) AS DEFECT_NUM from hzims_oper_phenomenon P WHERE DATE_FORMAT(P.CREATE_TIME,'%Y-%m') = #{month} - - AND P.CREATE_DEPT = #{createDept} + + AND P.CREATE_DEPT in + + #{item} + + and P.DEFECT_GRADING IS NOT NULL + AND P.IS_DEFECT='1' AND P.IS_DELETED = '0' GROUP BY P.DEFECT_GRADING,P.HANDLE_STATUS ORDER BY P.DEFECT_GRADING @@ -20,37 +25,46 @@ SELECT P.DEFECT_GRADING as defectLevel,P.HANDLE_STATUS,COUNT(P.ID) AS DEFECT_NUM from hzims_oper_phenomenon P WHERE P.CREATE_TIME BETWEEN #{firstMonth} AND #{endMonth} - - AND P.CREATE_DEPT = #{createDept} + + AND P.CREATE_DEPT in + + #{item} + + AND P.IS_DEFECT='1' AND P.IS_DELETED = 0 + and P.DEFECT_GRADING IS NOT NULL GROUP BY P.DEFECT_GRADING,P.HANDLE_STATUS ORDER BY P.DEFECT_GRADING