using Edu.Common.Enum;
using Edu.Model.Entity.Scroll;
using Edu.Model.ViewModel.Scroll;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Edu.Repository.Scroll
{
///
/// 滚动开班班次仓储层
///
public class RB_Scroll_ShiftRepository : BaseRepository
{
///
/// 获取列表
///
///
///
public List GetList(RB_Scroll_Shift_ViewModel demodel)
{
DynamicParameters parameters = new DynamicParameters();
string where = $@" 1=1 and r.{nameof(RB_Scroll_Shift_ViewModel.Status)} =0";
if (demodel.Group_Id > 0)
{
where += $@" and r.{nameof(RB_Scroll_Shift_ViewModel.Group_Id)} ={demodel.Group_Id}";
}
if (demodel.Id > 0)
{
where += $@" and r.{nameof(RB_Scroll_Shift_ViewModel.Id)} ={demodel.Id}";
}
if (!string.IsNullOrEmpty(demodel.Name))
{
where += $@" and r.{nameof(RB_Scroll_Shift_ViewModel.Name)} like @Name";
parameters.Add("Name", "%" + demodel.Name + "%");
}
string sql = $@"
SELECT * From RB_Scroll_Shift r
WHERE {where}
ORDER BY r.Id asc ";
return Get(sql, parameters).ToList();
}
}
}