huanghongfa
2021-09-02 177249c76aeea0b4bf8d8816d4994e3b445b45ce
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/SysUserNoticeDAO.java
@@ -1,10 +1,11 @@
package com.panzhihua.service_user.dao;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.panzhihua.common.model.vos.user.NoticeUnReadVO;
import com.panzhihua.service_user.model.dos.SysUserNoticeDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
@@ -15,14 +16,10 @@
@Mapper
public interface SysUserNoticeDAO extends BaseMapper<SysUserNoticeDO> {
    @Select("SELECT \n" +
            "COUNT(case WHEN type=1 then id else null end )activityUnread,\n" +
            "COUNT(case WHEN type=2 then id else null end )serviceUnread,\n" +
            "COUNT(case WHEN type=3 then id else null end )systemUnread,\n" +
            "COUNT(case WHEN type=4 then id else null end )scoreUnread\n" +
            "FROM\n" +
            "sys_user_notice \n" +
            "WHERE\n" +
            "user_id =#{userId} and `status`=0")
    @Select("SELECT \n" + "COUNT(case WHEN type=1 then id else null end )activityUnread,\n"
        + "COUNT(case WHEN type=2 then id else null end )serviceUnread,\n"
        + "COUNT(case WHEN type=3 then id else null end )systemUnread,\n"
        + "COUNT(case WHEN type=4 then id else null end )scoreUnread\n" + "FROM\n" + "sys_user_notice \n" + "WHERE\n"
        + "user_id =#{userId} and `status`=0")
    NoticeUnReadVO noticeUnreadNum(Long userId);
}