From e3e2c148cf591ab0864b69d2fc9a187b4a820402 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 19 Jul 2022 17:05:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BD=E4=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/IcPolicyDTO.java | 5 +++++ .../src/main/resources/mapper/IcPolicyDao.xml | 14 ++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java index e3822ddf27..8c7fc33767 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPolicyDTO.java @@ -60,6 +60,11 @@ public class IcPolicyDTO implements Serializable { */ private String content; + /** + * 是否过期;1:已过期;0:未过期 + */ + private String expiredFlag; + //以下三个详情接口返回 private List categoryList; private List attachmentList; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml index 6727f2cb81..9ab37dc06a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml @@ -51,7 +51,12 @@ ip.START_DATE, ip.END_DATE, ip.TITLE, - ip.CONTENT + ip.CONTENT, + ( + case when ip.END_DATE < now() then '1' + when ip.END_DATE >= now() then '0' + end + )as expiredFlag FROM ic_policy ip WHERE @@ -64,11 +69,12 @@ and ip.CONTENT like concat('%',#{content},'%') - + and ip.END_DATE < now() - + and ip.END_DATE >= now() - + order by ip.CREATED_TIME desc + \ No newline at end of file