using Edu.Common.Enum; using Edu.Model.Entity.User; using Edu.Model.ViewModel.User; using System; using System.Collections.Generic; using System.Linq; using System.Text; using VT.FW.DB.Dapper; namespace Edu.Repository.User { /// /// 公告阅读仓储层 /// public class RB_Notice_ReadRepository : BaseRepository { public List GetList(RB_Notice_Read_ViewModel demodel) { string where = $@" 1=1 "; if (demodel.NoticeId > 0) { where += $@" and {nameof(RB_Notice_Read.NoticeId)} ={demodel.NoticeId}"; } if (demodel.AccountId > 0) { where += $@" and {nameof(RB_Notice_Read.AccountId)} ={demodel.AccountId}"; } string sql = $@" select * from RB_Notice_Read where {where}"; return Get(sql).ToList(); } /// /// 获取阅读数量列表 /// /// /// public List GetNoticeReadNumList(string noticeIds) { string sql = $@" select NoticeId,count(0) as ReadNum from RB_Notice_Read where NoticeId in ({noticeIds}) group by NoticeId "; return Get(sql).ToList(); } } }