From c78f1542edbd296f7aa68af390a60f73bb215dc1 Mon Sep 17 00:00:00 2001 From: A0010407 Date: Wed, 18 Oct 2023 14:31:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E5=93=81=E5=A4=87=E4=BB=B6=E9=A2=86?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/op/device/domain/EquSpareApply.java | 35 +++++++++++++++++++ .../impl/EquSpareApplyServiceImpl.java | 9 +++++ .../mapper/device/EquSpareApplyMapper.xml | 22 +++++++----- 3 files changed, 57 insertions(+), 9 deletions(-) diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/EquSpareApply.java b/op-modules/op-device/src/main/java/com/op/device/domain/EquSpareApply.java index 183bf6a8..fc645678 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/EquSpareApply.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/EquSpareApply.java @@ -1,6 +1,8 @@ package com.op.device.domain; import java.util.Date; +import java.util.List; + import com.fasterxml.jackson.annotation.JsonFormat; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -79,6 +81,39 @@ public class EquSpareApply extends BaseEntity { @Excel(name = "工厂号") private String factoryCode; + // 创建日期范围list + private List applyTimeArray; + + // 创建日期开始 + private String applyTimeStart; + + // 创建日期结束 + private String applyTimeEnd; + + public List getApplyTimeArray() { + return applyTimeArray; + } + + public void setApplyTimeArray(List applyTimeArray) { + this.applyTimeArray = applyTimeArray; + } + + public String getApplyTimeStart() { + return applyTimeStart; + } + + public void setApplyTimeStart(String createTimeStart) { + this.applyTimeStart = createTimeStart; + } + + public String getApplyTimeEnd() { + return applyTimeEnd; + } + + public void setApplyTimeEnd(String applyTimeEnd) { + this.applyTimeEnd = applyTimeEnd; + } + public void setApplyId(String applyId) { this.applyId = applyId; } diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquSpareApplyServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquSpareApplyServiceImpl.java index 277254c8..11a3b01d 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquSpareApplyServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquSpareApplyServiceImpl.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; @@ -44,6 +45,14 @@ public class EquSpareApplyServiceImpl implements IEquSpareApplyService { @Override @DS("#header.poolName") public List selectEquSpareApplyList(EquSpareApply equSpareApply) { + if (equSpareApply.getApplyTimeArray() != null) { + // 设置创建日期开始和结束值 + if (equSpareApply.getApplyTimeArray().size() == 2) { + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + equSpareApply.setApplyTimeStart(formatter.format(equSpareApply.getApplyTimeArray().get(0))); + equSpareApply.setApplyTimeEnd(formatter.format(equSpareApply.getApplyTimeArray().get(1))); + } + } return equSpareApplyMapper.selectEquSpareApplyList(equSpareApply); } diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquSpareApplyMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquSpareApplyMapper.xml index 3ba31375..c2f28cb4 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquSpareApplyMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquSpareApplyMapper.xml @@ -34,26 +34,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"