diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/domain/bo/EqpEquipmentInspectionRecordBo.java b/klp-mes/src/main/java/com/klp/mes/eqp/domain/bo/EqpEquipmentInspectionRecordBo.java index d7ca53a3..21c77417 100644 --- a/klp-mes/src/main/java/com/klp/mes/eqp/domain/bo/EqpEquipmentInspectionRecordBo.java +++ b/klp-mes/src/main/java/com/klp/mes/eqp/domain/bo/EqpEquipmentInspectionRecordBo.java @@ -7,6 +7,7 @@ import javax.validation.constraints.*; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; /** * 设备巡检记录业务对象 eqp_equipment_inspection_record @@ -64,5 +65,19 @@ public class EqpEquipmentInspectionRecordBo extends BaseEntity { */ private String photo; + /** + * 巡检时间开始 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date startInspectTime; + + /** + * 巡检时间结束 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date endInspectTime; + } diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/domain/vo/EqpEquipmentInspectionRecordVo.java b/klp-mes/src/main/java/com/klp/mes/eqp/domain/vo/EqpEquipmentInspectionRecordVo.java index 07cf066d..3dde7ddc 100644 --- a/klp-mes/src/main/java/com/klp/mes/eqp/domain/vo/EqpEquipmentInspectionRecordVo.java +++ b/klp-mes/src/main/java/com/klp/mes/eqp/domain/vo/EqpEquipmentInspectionRecordVo.java @@ -74,5 +74,15 @@ public class EqpEquipmentInspectionRecordVo { */ private String photo; + /** + * 检验内容 + */ + private String checkContent; + + /** + * 检验标准 + */ + private String checkStandard; + } diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/mapper/EqpEquipmentInspectionRecordMapper.java b/klp-mes/src/main/java/com/klp/mes/eqp/mapper/EqpEquipmentInspectionRecordMapper.java index 64fab8d4..b0cc276f 100644 --- a/klp-mes/src/main/java/com/klp/mes/eqp/mapper/EqpEquipmentInspectionRecordMapper.java +++ b/klp-mes/src/main/java/com/klp/mes/eqp/mapper/EqpEquipmentInspectionRecordMapper.java @@ -1,8 +1,11 @@ package com.klp.mes.eqp.mapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.klp.mes.eqp.domain.EqpEquipmentInspectionRecord; import com.klp.mes.eqp.domain.vo.EqpEquipmentInspectionRecordVo; import com.klp.common.core.mapper.BaseMapperPlus; +import org.apache.ibatis.annotations.Param; /** * 设备巡检记录Mapper接口 @@ -12,4 +15,5 @@ import com.klp.common.core.mapper.BaseMapperPlus; */ public interface EqpEquipmentInspectionRecordMapper extends BaseMapperPlus { + Page selectVoPagePlus(Page build, @Param("ew") QueryWrapper lqw); } diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/service/impl/EqpEquipmentInspectionRecordServiceImpl.java b/klp-mes/src/main/java/com/klp/mes/eqp/service/impl/EqpEquipmentInspectionRecordServiceImpl.java index 4fd4bd25..91c04f05 100644 --- a/klp-mes/src/main/java/com/klp/mes/eqp/service/impl/EqpEquipmentInspectionRecordServiceImpl.java +++ b/klp-mes/src/main/java/com/klp/mes/eqp/service/impl/EqpEquipmentInspectionRecordServiceImpl.java @@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil; import com.klp.common.core.page.TableDataInfo; import com.klp.common.core.domain.PageQuery; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.klp.common.utils.StringUtils; @@ -44,11 +45,25 @@ public class EqpEquipmentInspectionRecordServiceImpl implements IEqpEquipmentIns */ @Override public TableDataInfo queryPageList(EqpEquipmentInspectionRecordBo bo, PageQuery pageQuery) { - LambdaQueryWrapper lqw = buildQueryWrapper(bo); - Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + QueryWrapper qw = buildQueryWrapperPlus(bo); + Page result = baseMapper.selectVoPagePlus(pageQuery.build(), qw); return TableDataInfo.build(result); } + private QueryWrapper buildQueryWrapperPlus(EqpEquipmentInspectionRecordBo bo) { + QueryWrapper qw = new QueryWrapper<>(); + qw.eq(bo.getCheckId() != null, "r.check_id", bo.getCheckId()); + qw.eq(StringUtils.isNotBlank(bo.getPhoto()), "r.photo", bo.getPhoto()); + qw.eq(bo.getShift() != null, "r.shift", bo.getShift()); + qw.eq(bo.getRunStatus() != null, "r.run_status", bo.getRunStatus()); + qw.eq(StringUtils.isNotBlank(bo.getInspector()), "r.inspector", bo.getInspector()); + qw.eq(StringUtils.isNotBlank(bo.getAbnormalDesc()), "r.abnormal_desc", bo.getAbnormalDesc()); + qw.ge(bo.getStartInspectTime() != null, "r.inspect_time", bo.getStartInspectTime()); + qw.le(bo.getEndInspectTime() != null, "r.inspect_time", bo.getEndInspectTime()); + qw.eq("r.del_flag", 0); + return qw; + } + /** * 查询设备巡检记录列表 */ diff --git a/klp-mes/src/main/resources/mapper/eqp/EqpEquipmentInspectionRecordMapper.xml b/klp-mes/src/main/resources/mapper/eqp/EqpEquipmentInspectionRecordMapper.xml index 1f5c97ad..59ef145f 100644 --- a/klp-mes/src/main/resources/mapper/eqp/EqpEquipmentInspectionRecordMapper.xml +++ b/klp-mes/src/main/resources/mapper/eqp/EqpEquipmentInspectionRecordMapper.xml @@ -21,5 +21,22 @@ +