diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/support/constants/Order.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/support/constants/Order.java new file mode 100644 index 0000000..67e68c4 --- /dev/null +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/support/constants/Order.java @@ -0,0 +1,5 @@ +package com.hnac.hzims.common.support.constants; + +public enum Order { + ASC,DESC; +} diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/support/utils/Condition.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/support/utils/Condition.java new file mode 100644 index 0000000..27819a6 --- /dev/null +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/support/utils/Condition.java @@ -0,0 +1,112 @@ +package com.hnac.hzims.common.support.utils; + + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.google.common.collect.Lists; +import com.hnac.hzims.common.support.constants.Order; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.support.QueryField; +import org.springblade.core.mp.support.SqlCondition; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springframework.util.Assert; + +import java.lang.reflect.Field; +import java.util.*; +import java.util.function.Function; + +public class Condition extends org.springblade.core.mp.support.Condition { + + public static List getFieldList(Object object) { + Class clazz = object.getClass(); + List fields = Lists.newArrayList(); + while (null != clazz){ + fields.addAll(Arrays.asList(clazz.getDeclaredFields())); + clazz = clazz.getSuperclass(); + } + return fields; + } + + public static LambdaQueryWrapper getQueryWrapper(Object query, Class clazz, Map> orderFields) { + QueryWrapper queryWrapper = getQueryWrapper(query,clazz); + List fields = getFieldList(query); + // 填充排序字段 + orderFields.forEach((fieldNames,order) -> { + Func.toStrList(",",fieldNames).stream().forEach(fieldName -> { + Optional existField = fields.stream().filter(field -> camel2under(fieldName).equals(camel2under(field.getName()))).findAny(); + if(existField.isPresent()) { + if(Order.ASC.equals(order)) { + queryWrapper.orderByAsc(fieldName); + } + else if(Order.DESC.equals(order)) { + queryWrapper.orderByDesc(fieldName); + } + } + }); + }); + return queryWrapper.lambda(); + } + + private static String camel2under(String c) { + String separator = "_"; + c = c.replaceAll("([a-z])([A-Z])", "$1" + separator + "$2").toUpperCase(); + return c; + } + + private static QueryWrapper getQueryWrapper(Object query, Class clazz) { + QueryWrapper qw = new QueryWrapper(); + qw.setEntityClass(clazz); + List fieldList = getFieldList(query); + for(Field field:fieldList){ + field.setAccessible(true); + QueryField queryField = field.getAnnotation(QueryField.class); + if(queryField==null) { + continue; + } + Object value; + try { + value = field.get(query); + } catch (Exception e) { + throw new ServiceException("获取属性性出错"); + } + if(value == null) { + continue; + } + List list = null; + if(value instanceof List){ + list = (List)value; + if(list.size() == 0) { + continue; + } + } + String condition = queryField.condition(); + if(Func.isBlank(condition)) { + continue; + } + String fileName = camel2under(field.getName()); + if(SqlCondition.EQUAL.equals(condition)) { + qw.eq(fileName, value); + }else if(SqlCondition.LIKE.equals(condition)){ + qw.like(fileName,value); + }else if(SqlCondition.LIKE_LEFT.equals(condition)){ + qw.likeLeft(fileName,value); + }else if(SqlCondition.LIKE_RIGHT.equals(condition)){ + qw.likeRight(fileName,value); + }else if(SqlCondition.NOT_IN.equals(condition)){ + String columnName = queryField.columnName(); + Assert.isTrue(Func.isBlank(columnName),() -> { + throw new ServiceException("查询不包含条件时需要指定列名"); + }); + qw.notIn(camel2under(columnName),list); + }else if(SqlCondition.IN.equals(condition)){ + String columnName = queryField.columnName(); + Assert.isTrue(Func.isBlank(columnName), () -> { + throw new ServiceException("查询包含条件时需要指定列名"); + }); + qw.in(camel2under(columnName),list); + } + } + return qw; + } +} diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/emParam/entity/ParamBackupsDetailEntity.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/emParam/entity/ParamBackupsDetailEntity.java index 269580c..7dbd983 100644 --- a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/emParam/entity/ParamBackupsDetailEntity.java +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/emParam/entity/ParamBackupsDetailEntity.java @@ -20,6 +20,12 @@ public class ParamBackupsDetailEntity extends TenantEntity implements Serializab @ApiModelProperty("备份主表ID") private Long backupsId; + @ApiModelProperty("参数分组") + private Long modelClassifyId; + + @ApiModelProperty("参数分组名称") + private String modelClassifyName; + @ApiModelProperty("参数名称") @QueryField(condition = SqlCondition.LIKE) private String name; diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/vo/InspectTaskExportVO.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/vo/InspectTaskExportVO.java index 09ebb52..8dcb112 100644 --- a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/vo/InspectTaskExportVO.java +++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/vo/InspectTaskExportVO.java @@ -71,5 +71,9 @@ public class InspectTaskExportVO { @ExcelProperty(value = "巡检状态", index = 9) @ColumnWidth(value = 20) private String status; + @ApiModelProperty("巡检类型") + @ExcelProperty(value = "巡检类型", index = 10) + @ColumnWidth(value = 20) + private String type; } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/DictConstants.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/DictConstants.java index e829c5b..a01b53e 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/DictConstants.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/DictConstants.java @@ -1,5 +1,11 @@ package com.hnac.hzims.safeproduct.constants; +import lombok.AllArgsConstructor; +import lombok.Getter; + +import java.util.Arrays; +import java.util.Optional; + /** * @author xiashandong * @created 2021/5/27 10:09 @@ -11,4 +17,19 @@ public interface DictConstants { String DANGER_TYPE = "dangerType"; /**危险等级**/ String RISK_LEVEL = "riskLevel"; + + @AllArgsConstructor + enum DangerSourceTypeEnum { + OPERATION(1,"作业活动"), + EQUIPMENT(2,"设备"), + ; + @Getter + private Integer type; + @Getter + private String typeName; + public static String getTypeNameByType(Integer type) { + Optional first = Arrays.stream(DangerSourceTypeEnum.class.getEnumConstants()).filter(e -> type.equals(e.getType())).findFirst(); + return first.map(DangerSourceTypeEnum::getTypeName).orElse(null); + } + } } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/DangerSourceEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/DangerSourceEntity.java index ebca8f7..f40f1a0 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/DangerSourceEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/DangerSourceEntity.java @@ -1,5 +1,7 @@ package com.hnac.hzims.safeproduct.entity; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.NullSerializer; @@ -7,6 +9,8 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +import org.springblade.core.mp.support.QueryField; +import org.springblade.core.mp.support.SqlCondition; import org.springblade.core.tenant.mp.TenantEntity; @@ -23,12 +27,14 @@ public class DangerSourceEntity extends TenantEntity { private static final long serialVersionUID = 1L; @ApiModelProperty("所属机构") + @QueryField(condition = SqlCondition.EQUAL) private Long refDept; @ApiModelProperty("所属机构名称") private String refDeptName; @ApiModelProperty(value = "危险源库ID") + @QueryField(condition = SqlCondition.EQUAL) private Long libraryId; /** @@ -36,15 +42,18 @@ public class DangerSourceEntity extends TenantEntity { */ @ApiModelProperty(value = "危险源类型 1=作业活动 2=设备") @JsonSerialize(nullsUsing = NullSerializer.class) + @QueryField(condition = SqlCondition.EQUAL) private Integer type; /** * 设备ID */ @ApiModelProperty(value = "设备ID") @JsonSerialize(nullsUsing = NullSerializer.class) + @QueryField(condition = SqlCondition.EQUAL) private Long eqId; @ApiModelProperty("设备编号") + @QueryField(condition = SqlCondition.LIKE) private String emCode; @ApiModelProperty("设备名称") @@ -53,17 +62,20 @@ public class DangerSourceEntity extends TenantEntity { * 危险源名称 */ @ApiModelProperty(value = "危险源名称") + @QueryField(condition = SqlCondition.LIKE) private String name; /** * 危险因素 */ @ApiModelProperty(value = "危险因素") + @QueryField(condition = SqlCondition.LIKE) private String dangerEle; /** * 应用类型 */ @ApiModelProperty(value = "应用类型") + @QueryField(condition = SqlCondition.EQUAL) private String applyType; /** * 可能导致的事故 @@ -80,6 +92,7 @@ public class DangerSourceEntity extends TenantEntity { */ @ApiModelProperty(value = "风险等级 10=稍有危险 20=一般危险 30=显著危险 40=高度危险") @JsonSerialize(nullsUsing = NullSerializer.class) + @QueryField(condition = SqlCondition.EQUAL) private Integer level; } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/vo/DangerSourceVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/vo/DangerSourceVO.java index edab947..a212b4b 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/vo/DangerSourceVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/vo/DangerSourceVO.java @@ -1,5 +1,7 @@ package com.hnac.hzims.safeproduct.hazard.vo; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; import com.hnac.hzims.safeproduct.entity.DangerSourceEntity; import com.hnac.hzims.safeproduct.hazard.enums.DangerSourceLevelEnum; import com.hnac.hzims.safeproduct.hazard.vo.DangerSourcePositionVO; @@ -23,6 +25,9 @@ public class DangerSourceVO extends DangerSourceEntity { @ApiModelProperty(value = "危险等级Name") private String applyTypeName; + @ApiModelProperty(value = "危险源类型名称") + private String typeName; + @ApiModelProperty("创建人名称") private String createUserName; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordDetailVO.java index 1aeae76..52bee71 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordDetailVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordDetailVO.java @@ -47,4 +47,10 @@ public class HygieneRecordDetailVO { @ApiModelProperty("检查信息列表") private List checkList; + + @ApiModelProperty("年份") + private String year; + + @ApiModelProperty("月份") + private String month; } diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/controller/ParamBackupsController.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/controller/ParamBackupsController.java index c6ccb84..d27ff95 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/controller/ParamBackupsController.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/controller/ParamBackupsController.java @@ -64,4 +64,11 @@ public class ParamBackupsController extends BladeController { return R.status(paramBackupsService.updateById(request)); } + @GetMapping("/reductionParam") + @ApiOperation("根据备份ID还原参数") + @ApiOperationSupport(order = 6) + public R reductionParam(@RequestParam @ApiParam(value = "备份ID",required = true) Long id) { + return R.status(paramBackupsService.reductionParam(id)); + } + } diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/service/IParamBackupsService.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/service/IParamBackupsService.java index 4e73022..787b06e 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/service/IParamBackupsService.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/service/IParamBackupsService.java @@ -5,10 +5,12 @@ import com.hnac.hzims.common.utils.Condition; import com.hnac.hzims.emParam.dto.ParamBackupsDTO; import com.hnac.hzims.emParam.entity.ParamBackupsEntity; import com.hnac.hzims.emParam.vo.ParamBackupsVO; +import io.swagger.annotations.ApiParam; import org.springblade.core.mp.base.BaseService; import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.Func; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; public interface IParamBackupsService extends BaseService { @@ -18,6 +20,8 @@ public interface IParamBackupsService extends BaseService { Boolean updateById(ParamBackupsDTO request); + Boolean reductionParam(Long id); + default LambdaQueryWrapper getQueryWrapper(ParamBackupsDTO request) { ParamBackupsEntity paramBackupsEntity = BeanUtil.copy(request, ParamBackupsEntity.class); LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(ParamBackupsEntity.class, paramBackupsEntity); diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/service/impl/ParamBackupsServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/service/impl/ParamBackupsServiceImpl.java index b1af8de..b9e8f0b 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/service/impl/ParamBackupsServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/service/impl/ParamBackupsServiceImpl.java @@ -1,5 +1,6 @@ package com.hnac.hzims.emParam.service.impl; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.hnac.hzims.emParam.dto.ParamBackupsDTO; @@ -9,12 +10,19 @@ import com.hnac.hzims.emParam.mapper.ParamBackupsDetailMapper; import com.hnac.hzims.emParam.mapper.ParamBackupsMapper; import com.hnac.hzims.emParam.service.IParamBackupsDetailService; import com.hnac.hzims.emParam.service.IParamBackupsService; +import com.hnac.hzims.emParam.vo.ParamBackupsDetailVO; import com.hnac.hzims.emParam.vo.ParamBackupsVO; import com.hnac.hzims.emParam.wrapper.ParamBackupsDetailWrapper; +import com.hnac.hzinfo.sdk.core.response.Result; +import com.hnac.hzinfo.sdk.v5.control.ControlClient; +import com.hnac.hzinfo.sdk.v5.control.dto.ControlBatchDTO; +import com.hnac.hzinfo.sdk.v5.control.dto.Ctrl; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.log.logger.BladeLogger; import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.Func; @@ -24,7 +32,9 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; import javax.sql.rowset.serial.SerialException; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -34,6 +44,8 @@ import java.util.stream.Collectors; public class ParamBackupsServiceImpl extends BaseServiceImpl implements IParamBackupsService { private final IParamBackupsDetailService detailService; + private final ControlClient controlClient; + private final BladeLogger logger; @Override @Transactional @@ -86,5 +98,42 @@ public class ParamBackupsServiceImpl extends BaseServiceImpl paramList = backup.getDetailList(); + Assert.isTrue(CollectionUtil.isNotEmpty(paramList),() -> { + throw new ServiceException("备份参数不能为空!"); + }); + Map> detailMap = paramList.stream().collect(Collectors.groupingBy(ParamBackupsDetailVO::getModelClassifyId)); + detailMap.forEach((classifyId,list) -> { + ControlBatchDTO controlBatchDTO = new ControlBatchDTO(); + controlBatchDTO.setProjectId(backup.getStationCode()); + controlBatchDTO.setDeviceCode(backup.getEmCode()); + controlBatchDTO.setDelay(backup.getDelay()); + controlBatchDTO.setOperator(String.valueOf(AuthUtil.getUserId())); + controlBatchDTO.setMachineCode(backup.getMachineCode()); + List ctrl = paramList.stream().map(this::convert).collect(Collectors.toList()); + controlBatchDTO.setCtrls(ctrl); + log.info("{}", JSON.toJSONString(controlBatchDTO)); + Result result = controlClient.batchSendToDevice(controlBatchDTO); + if(!result.isSuccess()) { + logger.error("equipment:ParamServiceImpl:distribute", "下发参数传参为:" + JSON.toJSONString(controlBatchDTO) + ";下发结果为:" + JSON.toJSONString(result)); + throw new ServiceException("参数还原调用下发接口失败,返回结果为:"+result.getMsg()); + } + }); + return true; + } + + private Ctrl convert(ParamBackupsDetailVO param) { + Ctrl result = new Ctrl(); + result.setSignage(param.getSignage()); + Map params = new HashMap(1){{ + put(param.getSignage(),param.getValue()); + }}; + result.setParams(params); + return result; + } + } diff --git a/hzims-service/equipment/src/main/resources/db/1.0.2.sql b/hzims-service/equipment/src/main/resources/db/1.0.2.sql new file mode 100644 index 0000000..5e91c65 --- /dev/null +++ b/hzims-service/equipment/src/main/resources/db/1.0.2.sql @@ -0,0 +1,3 @@ +-- 参数分组还原添加字段 +alter table `HZIMS_PARAM_BACKUPS_DETAIL` add column `model_classify_id` BIGINT(20) COMMENT '参数分组'; +alter table `HZIMS_PARAM_BACKUPS_DETAIL` add column `model_classify_name` BIGINT(20) COMMENT '参数分组名称'; \ No newline at end of file diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java index 314dff3..c82d332 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java @@ -120,7 +120,7 @@ public class TaskController extends BladeController { @PostMapping("/listPage") @ApiOperation(value = "巡检任务分页查询-站长级", notes = "传入task") @ApiOperationSupport(order = 1) - public R> listPage(@RequestBody TaskDTO taskDTO) { + public R> listPage(@RequestBody TaskDTO taskDTO) { return R.data(taskService.page(taskDTO)); } @@ -158,12 +158,12 @@ public class TaskController extends BladeController { @ApiOperation(value = "巡检任务导出", notes = "传入计划id") public void exportTaskList(HttpServletResponse response,@RequestBody TaskDTO task) { try { - if(ObjectUtils.isEmpty(task.getStartTime())&&ObjectUtils.isEmpty(task.getEndTime())){ - LocalDateTime date = LocalDateTime.now(); - LocalDateTime firstDay = date.with(TemporalAdjusters.firstDayOfMonth()).withHour(0).withMinute(0).withSecond(0); - task.setStartTime(firstDay); - task.setEndTime(date); - } +// if(ObjectUtils.isEmpty(task.getStartTime())&&ObjectUtils.isEmpty(task.getEndTime())){ +// LocalDateTime date = LocalDateTime.now(); +// LocalDateTime firstDay = date.with(TemporalAdjusters.firstDayOfMonth()).withHour(0).withMinute(0).withSecond(0); +// task.setStartTime(firstDay); +// task.setEndTime(date); +// } response.setContentType("application/vnd.ms-excel"); response.setCharacterEncoding("UTF-8"); // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系 diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.java index c2a70ef..b540c27 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.java @@ -1,5 +1,6 @@ package com.hnac.hzinfo.inspect.task.mapper; +import com.hnac.hzinfo.inspect.task.dto.TaskDTO; import com.hnac.hzinfo.inspect.task.vo.TaskCountVO; import com.hnac.hzinfo.inspect.task.vo.TaskOfflineVO; import org.springblade.core.datascope.annotation.UserDataAuth; @@ -27,6 +28,9 @@ public interface TaskMapper extends UserDataScopeBaseMapper { */ List getListPage(@Param("page") IPage page, @Param("task") TaskListQuery task); + List getAllPageList(@Param("page") IPage page, @Param("task") TaskDTO taskDTO); + List getAllExportList(@Param("task") TaskDTO taskDTO); + List mainQueryPage(@Param("page") IPage page, @Param("task") TaskListQuery task); /** diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.xml b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.xml index 6197bb8..21fdb28 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.xml +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.xml @@ -173,6 +173,32 @@ order by t.UPDATE_TIME desc + + - SELECT P.DEFECT_GRADING as defectLevel,P.HANDLE_STATUS,COUNT(P.ID) AS DEFECT_NUM from + SELECT P.DEFECT_LEVEL 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} @@ -13,16 +13,16 @@ #{item} - and P.DEFECT_GRADING IS NOT NULL + and P.DEFECT_LEVEL 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 + GROUP BY P.DEFECT_LEVEL,P.HANDLE_STATUS + ORDER BY P.DEFECT_LEVEL