diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/EquFaultType.java b/op-modules/op-device/src/main/java/com/op/device/domain/EquFaultType.java index 064a7dfb3..1aff0c837 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/EquFaultType.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/EquFaultType.java @@ -5,6 +5,9 @@ import org.apache.commons.lang3.builder.ToStringStyle; import com.op.common.core.annotation.Excel; import com.op.common.core.web.domain.BaseEntity; +import java.util.Date; +import java.util.List; + /** * 故障类型维护对象 equ_fault_type * @@ -53,6 +56,72 @@ public class EquFaultType extends BaseEntity { @Excel(name = "删除标志") private String delFlag; + // 创建日期范围list + private List createTimeArray; + + // 更新日期范围list + private List updateTimeArray; + + // 更新日期开始 + private String updateTimeStart; + + // 更新日期结束 + private String updateTimeEnd; + + // 创建日期开始 + private String createTimeStart; + + // 创建日期结束 + private String createTimeEnd; + + public List getCreateTimeArray() { + return createTimeArray; + } + + public void setCreateTimeArray(List createTimeArray) { + this.createTimeArray = createTimeArray; + } + + public List getUpdateTimeArray() { + return updateTimeArray; + } + + public void setUpdateTimeArray(List updateTimeArray) { + this.updateTimeArray = updateTimeArray; + } + + public String getUpdateTimeStart() { + return updateTimeStart; + } + + public void setUpdateTimeStart(String updateTimeStart) { + this.updateTimeStart = updateTimeStart; + } + + public String getUpdateTimeEnd() { + return updateTimeEnd; + } + + public void setUpdateTimeEnd(String updateTimeEnd) { + this.updateTimeEnd = updateTimeEnd; + } + + public String getCreateTimeStart() { + return createTimeStart; + } + + public void setCreateTimeStart(String createTimeStart) { + this.createTimeStart = createTimeStart; + } + + public String getCreateTimeEnd() { + return createTimeEnd; + } + + public void setCreateTimeEnd(String createTimeEnd) { + this.createTimeEnd = createTimeEnd; + } + public void setFaultId(String faultId) { this.faultId = faultId; } diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquFaultTypeServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquFaultTypeServiceImpl.java index 71a71ebcd..e375ca969 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquFaultTypeServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquFaultTypeServiceImpl.java @@ -1,5 +1,6 @@ package com.op.device.service.impl; +import java.text.SimpleDateFormat; import java.util.List; import com.baomidou.dynamic.datasource.annotation.DS; @@ -52,6 +53,22 @@ public class EquFaultTypeServiceImpl implements IEquFaultTypeService { @Override @DS("#header.poolName") public List selectEquFaultTypeList(EquFaultType equFaultType) { + if (equFaultType.getCreateTimeArray() != null) { + // 设置创建日期开始和结束值 + if (equFaultType.getCreateTimeArray().size() == 2) { + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + equFaultType.setCreateTimeStart(formatter.format(equFaultType.getCreateTimeArray().get(0))); + equFaultType.setCreateTimeEnd(formatter.format(equFaultType.getCreateTimeArray().get(1))); + } + } + if (equFaultType.getUpdateTimeArray() != null) { + // 设置更新日期开始和结束 + if (equFaultType.getUpdateTimeArray().size() == 2) { + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + equFaultType.setUpdateTimeStart(formatter.format(equFaultType.getUpdateTimeArray().get(0))); + equFaultType.setUpdateTimeEnd(formatter.format(equFaultType.getUpdateTimeArray().get(1))); + } + } return equFaultTypeMapper.selectEquFaultTypeList(equFaultType); } diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquFaultTypeMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquFaultTypeMapper.xml index 415cda84d..4945af13d 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquFaultTypeMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquFaultTypeMapper.xml @@ -37,12 +37,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and attr2 = #{attr2} and attr3 = #{attr3} and del_flag = #{delFlag} - and create_by = #{createBy} - and create_time = #{createTime} - and update_by = #{updateBy} - and update_time = #{updateTime} + and CONVERT(date,create_time) >= #{createTimeStart} + and #{createTimeEnd} >= CONVERT(date,create_time) + and create_by like concat('%', #{createBy}, '%') + and CONVERT(date,update_time) >= #{updateTimeStart} + and #{updateTimeEnd} >= CONVERT(date,update_time) + and update_by like concat('%', #{updateBy}, '%') and del_flag = '0' + ORDER BY create_time DESC