我的通知来源分类

This commit is contained in:
wangliwen 2022-06-22 09:49:17 +08:00
parent 1c9a83fcd2
commit c81aaa34b0
2 changed files with 13 additions and 3 deletions

View File

@ -44,10 +44,17 @@ public class SysNoticeServiceImpl extends CrudServiceImpl<SysNoticeDao, SysNotic
@Override
public QueryWrapper<SysNoticeEntity> getWrapper(Map<String, Object> params) {
String type = (String) params.get("type");
QueryWrapper<SysNoticeEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(type), "type", type);
params.keySet().stream().filter(index -> null != params.get(index)).forEach(index -> {
switch (index) {
case "type":
wrapper.eq(StringUtils.isNotBlank((String) params.get("type")), "type", (String) params.get("type"));
break;
case "from":
wrapper.eq(StringUtils.isNotBlank((String) params.get("from")), "from", (String) params.get("from"));
break;
}
});
wrapper.orderByDesc(Constant.CREATE_DATE);
return wrapper;
}

View File

@ -16,6 +16,9 @@
<if test="readStatus != null">
AND read_status = #{readStatus}
</if>
<if test="from != null">
AND from = #{from}
</if>
order by t2.create_date desc
</select>
</mapper>