系统信息
This commit is contained in:
@ -2,6 +2,7 @@ package com.chinaunicom.mall.ebtp.extend.bizmessage.dao;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.chinaunicom.mall.ebtp.extend.bizmessage.dto.PageDTO;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessage;
|
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessage;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessageAuthorize;
|
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessageAuthorize;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessageVo;
|
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessageVo;
|
||||||
@ -13,7 +14,10 @@ public interface BizMessageMapper extends BaseMapper<BizMessage> {
|
|||||||
|
|
||||||
IPage<BizMessage> findMessage(@Param("param") IPage<BizMessage> page, @Param("userId") String userId);
|
IPage<BizMessage> findMessage(@Param("param") IPage<BizMessage> page, @Param("userId") String userId);
|
||||||
|
|
||||||
IPage<BizMessageVo> findMessageVo(@Param("param") IPage<BizMessageVo> page, @Param("userId") String userId,@Param("templatecodes") List<String> templatecodes);
|
IPage<BizMessageVo> findMessageVo(@Param("param") IPage<BizMessageVo> page,
|
||||||
|
@Param("userId") String userId,
|
||||||
|
@Param("templatecodes") List<String> templatecodes,
|
||||||
|
@Param("po") PageDTO pageDTO);
|
||||||
|
|
||||||
Boolean updateState(@Param("userId") String userId,@Param("messageId") String messageId);
|
Boolean updateState(@Param("userId") String userId,@Param("messageId") String messageId);
|
||||||
|
|
||||||
|
@ -19,10 +19,21 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="findMessageVo" resultType="com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessageVo">
|
<select id="findMessageVo" resultType="com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessageVo">
|
||||||
|
|
||||||
SELECT biz_message.*,biz_message_template.type as templatetype,'1' as authorizestate
|
SELECT biz_message.*,biz_message_template.type as templatetype,'1' as authorizestate
|
||||||
FROM biz_message
|
FROM biz_message
|
||||||
left join biz_message_template on biz_message.templatecode = biz_message_template.code
|
left join biz_message_template on biz_message.templatecode = biz_message_template.code
|
||||||
WHERE authorize = 0
|
WHERE authorize = 0
|
||||||
|
<if test="po.title !=null and po.title !=''">
|
||||||
|
and title like CONCAT('%',#{po.title},'%')
|
||||||
|
</if>
|
||||||
|
<if test="po.templatetype !=null and po.templatetype !=''">
|
||||||
|
and biz_message_template.type = #{po.templatetype}
|
||||||
|
</if>
|
||||||
|
<if test="po.state !=null and po.state !='' and po.state != 1 ">
|
||||||
|
and biz_message.id = -1
|
||||||
|
</if>
|
||||||
|
|
||||||
<if test="templatecodes!=null and templatecodes.size()>0 ">
|
<if test="templatecodes!=null and templatecodes.size()>0 ">
|
||||||
and biz_message.templatecode in
|
and biz_message.templatecode in
|
||||||
<foreach item="item" collection="templatecodes" separator="," open="(" close=")" index="">
|
<foreach item="item" collection="templatecodes" separator="," open="(" close=")" index="">
|
||||||
@ -36,6 +47,12 @@
|
|||||||
FROM biz_message
|
FROM biz_message
|
||||||
left join biz_message_template on biz_message.templatecode = biz_message_template.code
|
left join biz_message_template on biz_message.templatecode = biz_message_template.code
|
||||||
WHERE authorize = 1
|
WHERE authorize = 1
|
||||||
|
<if test="po.title !=null and po.title !=''">
|
||||||
|
and title like CONCAT('%',#{po.title},'%')
|
||||||
|
</if>
|
||||||
|
<if test="po.templatetype !=null and po.templatetype !=''">
|
||||||
|
and biz_message_template.type = #{po.templatetype}
|
||||||
|
</if>
|
||||||
<if test="templatecodes!=null and templatecodes.size()>0 ">
|
<if test="templatecodes!=null and templatecodes.size()>0 ">
|
||||||
and biz_message.templatecode in
|
and biz_message.templatecode in
|
||||||
<foreach item="item" collection="templatecodes" separator="," open="(" close=")" index="">
|
<foreach item="item" collection="templatecodes" separator="," open="(" close=")" index="">
|
||||||
@ -46,7 +63,10 @@
|
|||||||
INNER JOIN
|
INNER JOIN
|
||||||
( SELECT * FROM biz_message_authorize WHERE user_id = #{userId}) b ON a.id = b.message_id
|
( SELECT * FROM biz_message_authorize WHERE user_id = #{userId}) b ON a.id = b.message_id
|
||||||
</if>
|
</if>
|
||||||
|
where 1 = 1
|
||||||
|
<if test="po.state !=null and po.state !=''">
|
||||||
|
and state = #{po.state}
|
||||||
|
</if>
|
||||||
ORDER BY createtime DESC
|
ORDER BY createtime DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -31,4 +31,16 @@ public class PageDTO {
|
|||||||
@ApiModelProperty(required = false, value = "指定消息类型,null 查全部")
|
@ApiModelProperty(required = false, value = "指定消息类型,null 查全部")
|
||||||
private List<String> templatecodes;
|
private List<String> templatecodes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标题
|
||||||
|
*/
|
||||||
|
private String title;
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
private String templatetype;
|
||||||
|
/**
|
||||||
|
* 0 未读取 1 已读取
|
||||||
|
*/
|
||||||
|
private String state;
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ public class BizMessageConsumerServiceImpl implements BizMessageConsumerService
|
|||||||
page = createPageCondition(page);
|
page = createPageCondition(page);
|
||||||
IPage<BizMessageVo> pageEntity = new Page<BizMessageVo>(page.getPageNo(), page.getPageSize());
|
IPage<BizMessageVo> pageEntity = new Page<BizMessageVo>(page.getPageNo(), page.getPageSize());
|
||||||
|
|
||||||
pageEntity = mapper.findMessageVo(pageEntity,service.getCacheUser().getUserId(),page.getTemplatecodes());
|
pageEntity = mapper.findMessageVo(pageEntity,service.getCacheUser().getUserId(),page.getTemplatecodes(),page);
|
||||||
|
|
||||||
// DAT -> VO 转换
|
// DAT -> VO 转换
|
||||||
IBizMessagePage<DescribeSiteMsgVO> result = new BizMessagePage<>();
|
IBizMessagePage<DescribeSiteMsgVO> result = new BizMessagePage<>();
|
||||||
|
Reference in New Issue
Block a user