Merge branch 'master_系统信息增加条件' into 'master'

系统信息

See merge request eshop/biz_service_ebtp_extend!42
This commit is contained in:
jl-zhangqb
2024-03-15 08:13:25 +00:00
4 changed files with 39 additions and 3 deletions

View File

@ -2,6 +2,7 @@ package com.chinaunicom.mall.ebtp.extend.bizmessage.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
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.BizMessageAuthorize;
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<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);

View File

@ -19,10 +19,21 @@
</select>
<select id="findMessageVo" resultType="com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessageVo">
SELECT biz_message.*,biz_message_template.type as templatetype,'1' as authorizestate
FROM biz_message
left join biz_message_template on biz_message.templatecode = biz_message_template.code
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 ">
and biz_message.templatecode in
<foreach item="item" collection="templatecodes" separator="," open="(" close=")" index="">
@ -36,6 +47,12 @@
FROM biz_message
left join biz_message_template on biz_message.templatecode = biz_message_template.code
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 ">
and biz_message.templatecode in
<foreach item="item" collection="templatecodes" separator="," open="(" close=")" index="">
@ -46,7 +63,10 @@
INNER JOIN
( SELECT * FROM biz_message_authorize WHERE user_id = #{userId}) b ON a.id = b.message_id
</if>
where 1 = 1
<if test="po.state !=null and po.state !=''">
and state = #{po.state}
</if>
ORDER BY createtime DESC
</select>

View File

@ -31,4 +31,16 @@ public class PageDTO {
@ApiModelProperty(required = false, value = "指定消息类型,null 查全部")
private List<String> templatecodes;
/**
* 标题
*/
private String title;
/**
* 类型
*/
private String templatetype;
/**
* 0 未读取 1 已读取
*/
private String state;
}

View File

@ -44,7 +44,7 @@ public class BizMessageConsumerServiceImpl implements BizMessageConsumerService
page = createPageCondition(page);
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 转换
IBizMessagePage<DescribeSiteMsgVO> result = new BizMessagePage<>();