|
|
@@ -3,10 +3,12 @@ package cn.iocoder.yudao.module.system.dal.mysql.notify;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
|
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
|
|
+import cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX;
|
|
|
import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
|
|
|
import cn.iocoder.yudao.module.system.controller.admin.notify.vo.message.NotifyMessageMyPageReqVO;
|
|
|
import cn.iocoder.yudao.module.system.controller.admin.notify.vo.message.NotifyMessagePageReqVO;
|
|
|
import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyMessageDO;
|
|
|
+import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyTemplateDO;
|
|
|
import org.apache.ibatis.annotations.Mapper;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
@@ -26,13 +28,26 @@ public interface NotifyMessageMapper extends BaseMapperX<NotifyMessageDO> {
|
|
|
.orderByDesc(NotifyMessageDO::getId));
|
|
|
}
|
|
|
|
|
|
- default PageResult<NotifyMessageDO> selectPage(NotifyMessageMyPageReqVO reqVO, Long userId, Integer userType) {
|
|
|
+ /*default PageResult<NotifyMessageDO> selectPage(NotifyMessageMyPageReqVO reqVO, Long userId, Integer userType) {
|
|
|
return selectPage(reqVO, new LambdaQueryWrapperX<NotifyMessageDO>()
|
|
|
.eqIfPresent(NotifyMessageDO::getReadStatus, reqVO.getReadStatus())
|
|
|
.betweenIfPresent(NotifyMessageDO::getCreateTime, reqVO.getCreateTime())
|
|
|
.eq(NotifyMessageDO::getUserId, userId)
|
|
|
.eq(NotifyMessageDO::getUserType, userType)
|
|
|
.orderByDesc(NotifyMessageDO::getId));
|
|
|
+ }*/
|
|
|
+
|
|
|
+ default PageResult<NotifyMessageDO> selectPage(NotifyMessageMyPageReqVO reqVO, Long userId, Integer userType) {
|
|
|
+ return selectPage(reqVO, new MPJLambdaWrapperX<NotifyMessageDO>()
|
|
|
+ .eqIfPresent(NotifyMessageDO::getReadStatus, reqVO.getReadStatus())
|
|
|
+ .betweenIfPresent(NotifyMessageDO::getCreateTime, reqVO.getCreateTime())
|
|
|
+ .eq(NotifyMessageDO::getUserId, userId)
|
|
|
+ .eq(NotifyMessageDO::getUserType, userType)
|
|
|
+ .orderByDesc(NotifyMessageDO::getId)
|
|
|
+ .leftJoin(NotifyTemplateDO.class, NotifyTemplateDO::getCode, NotifyMessageDO::getTemplateCode)
|
|
|
+ .likeIfPresent(NotifyTemplateDO::getName, reqVO.getTitle())
|
|
|
+ .selectAll(NotifyMessageDO.class)
|
|
|
+ .selectAs(NotifyTemplateDO::getName, "title"));
|
|
|
}
|
|
|
|
|
|
default int updateListRead(Collection<Long> ids, Long userId, Integer userType) {
|