我的通知来源分类
This commit is contained in:
parent
1c9a83fcd2
commit
c81aaa34b0
|
@ -44,10 +44,17 @@ public class SysNoticeServiceImpl extends CrudServiceImpl<SysNoticeDao, SysNotic
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryWrapper<SysNoticeEntity> getWrapper(Map<String, Object> params) {
|
public QueryWrapper<SysNoticeEntity> getWrapper(Map<String, Object> params) {
|
||||||
String type = (String) params.get("type");
|
|
||||||
|
|
||||||
QueryWrapper<SysNoticeEntity> wrapper = new QueryWrapper<>();
|
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);
|
wrapper.orderByDesc(Constant.CREATE_DATE);
|
||||||
return wrapper;
|
return wrapper;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,9 @@
|
||||||
<if test="readStatus != null">
|
<if test="readStatus != null">
|
||||||
AND read_status = #{readStatus}
|
AND read_status = #{readStatus}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="from != null">
|
||||||
|
AND from = #{from}
|
||||||
|
</if>
|
||||||
order by t2.create_date desc
|
order by t2.create_date desc
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
Loading…
Reference in New Issue