package shop.alien.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import shop.alien.entity.store.LifeNotice;

@Mapper
public interface LifeNoticeMapper extends BaseMapper<LifeNotice> {

    @Select("select count(id) noReadNum from life_notice " +
            "where delete_flag = 0 and is_read = 0 " +
            "and receiver_user_type = #{receiverUserType} " +
            "and receiver_ref_id = #{receiverRefId} ")
    int selectNoReadCount(@Param("receiverUserType") Integer receiverUserType,
                          @Param("receiverRefId") Integer receiverRefId);

}
