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