public PageModel <TeacherQuestion> GetListAsync(int pageIndex, int pageSize, string name, EnumAccept accept) { return(_teacherQuestionRepository.GetListAsync(pageIndex, pageSize, name, accept)); }
public PageModel <MajorApply> GetListAsync(int pageIndex, int pageSize, string name, EnumAccept accept) { using (var conn = DapperFactory.GetConnection()) { #region generate condition string where = "where 1=1 "; if (!string.IsNullOrEmpty(name)) { where += string.Format(" and m.Name like '%{0}%'", name); } if (accept != EnumAccept.All) { where += string.Format(" and h.IsAccept = {0}", (int)accept); } #endregion string countSql = string.Format("select count(1) from [MajorApply] as h left join [Major] m on m.Id = h.MajorId {0};", where); int total = conn.ExecuteScalar <int>(countSql); if (total == 0) { return(new PageModel <MajorApply>()); } string sql = string.Format(@"select * from ( select h.*, m.Name as MajorName, m.NameEn as MajorNameEn, ROW_NUMBER() over (Order by h.Id desc) as RowNumber from [MajorApply] as h left join [Major] m on m.Id = h.MajorId {0} ) as b where RowNumber between {1} and {2};", where, ((pageIndex - 1) * pageSize) + 1, pageIndex * pageSize); var list = conn.Query <MajorApply>(sql); return(new PageModel <MajorApply> { Total = total, Data = list != null?list.ToList() : null }); } }
public PageModel <ProgramApply> GetListAsync(int pageIndex, int pageSize, string programName, EnumAccept accept) { return(_programApplyRepository.GetListAsync(pageIndex, pageSize, programName, accept)); }
public PageModel <CourseOrder> GetListAsync(int pageIndex, int pageSize, string courseName, EnumAccept accept) { return(_courseOrderRepository.GetListAsync(pageIndex, pageSize, courseName, accept)); }
public PageModel <SchoolApply> GetListAsync(int pageIndex, int pageSize, string schoolName, EnumAccept accept) { return(_schoolApplyRepository.GetListAsync(pageIndex, pageSize, schoolName, accept)); }
public PageModel <CompanyApply> GetListAsync(int pageIndex, int pageSize, string name, EnumAccept accept) { return(_companyApplyRepository.GetListAsync(pageIndex, pageSize, name, accept)); }
public PageModel <WorksComment> GetListAsync(int pageIndex, int pageSize, string name, EnumAccept accept) { return(_worksCommentRepository.GetListAsync(pageIndex, pageSize, name, accept)); }