From 617f8add00cefbad4c2701e01a9287640a56ea2c Mon Sep 17 00:00:00 2001 From: A0010407 Date: Fri, 2 Aug 2024 17:36:13 +0800 Subject: [PATCH] =?UTF-8?q?2024-08-02=20=E8=AE=BE=E5=A4=87-=E7=82=B9?= =?UTF-8?q?=E6=A3=80=E5=B7=A1=E6=A3=80=E4=BF=9D=E5=85=BB=E5=8A=A0=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E6=97=B6=E9=97=B4=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/op/device/domain/EquOrder.java | 35 +++++++++++++++++++ .../service/impl/EquOrderServiceImpl.java | 11 ++++++ .../mapper/device/EquOrderMapper.xml | 3 +- 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/EquOrder.java b/op-modules/op-device/src/main/java/com/op/device/domain/EquOrder.java index eaa4faa1..18d5d64a 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/EquOrder.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/EquOrder.java @@ -280,6 +280,15 @@ public class EquOrder extends BaseEntity { //工具 private String itemTools; + // 创建日期范围list + private List createTimeArray; + + // 创建日期开始 + private String createTimeStart; + + // 创建日期结束 + private String createTimeEnd; + public String getPicturePath() { return picturePath; } @@ -790,6 +799,32 @@ public class EquOrder extends BaseEntity { this.itemTools = itemTools; } + public List getCreateTimeArray() { + return createTimeArray; + } + + public void setCreateTimeArray(List createTimeArray) { + this.createTimeArray = createTimeArray; + } + + + //创建时间 + 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; + } + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOrderServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOrderServiceImpl.java index c405621d..4419651d 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOrderServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOrderServiceImpl.java @@ -154,6 +154,16 @@ public class EquOrderServiceImpl implements IEquOrderService { @DS("#header.poolName") public List selectEquOrderList(EquOrder equOrder) { + // 创建时间列表不为空 + if (equOrder.getCreateTimeArray() != null) { + // 设置创建日期开始和结束值 + if (equOrder.getCreateTimeArray().size() == 2) { + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + equOrder.setCreateTimeStart(formatter.format(equOrder.getCreateTimeArray().get(0))); + equOrder.setCreateTimeEnd(formatter.format(equOrder.getCreateTimeArray().get(1))); + } + } + // 循环开始时间列表不为空 if (equOrder.getLoopStartArray() != null) { equOrder.setLoopStart(equOrder.getLoopStartArray().get(0)); @@ -202,6 +212,7 @@ public class EquOrderServiceImpl implements IEquOrderService { @DS("#header.poolName") public AjaxResult insertEquOrder(EquOrder equOrder) { equOrder.setCreateTime(DateUtils.getNowDate()); + equOrder.setCreateBy(SecurityUtils.getUsername()); return success(); } diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml index 27598cf6..a15708eb 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml @@ -130,7 +130,8 @@ and eo.attr3 = #{attr3} and eo.del_flag = #{delFlag} and eo.create_by like concat('%', #{createBy}, '%') - and CONVERT(date,eo.create_time) = #{createTime} + and CONVERT(date,eo.create_time) >= #{createTimeStart} + and #{createTimeEnd} >= CONVERT(date,eo.create_time) and eo.update_by like concat('%', #{updateBy}, '%') and CONVERT(date,eo.update_time) = #{updateTime} and eo.upkeep = #{upkeep}