using MWS.Data.InterFace;
using MWS.Model;
using System;
using System.Collections.Generic;
using System.Linq;

namespace MWS.Data.Manager
{
    public class EntranceManager : DapperHelper<T_Entrance>, IEntrance
    {
        public List<T_Entrance> GetAll(string kewWord)
        {
            List<T_Entrance> teams;
            try
            {
                string sql = "Select * From  entrance WHERE 1 = 1 ";
                string sqlWhe = "";
                if (!string.IsNullOrEmpty(kewWord))
                {
                    sqlWhe += " and Name like '%" + kewWord + "%' ";
                }

                sql += sqlWhe;
                // 查询条件
                sql += " order by Id ";
                //pd.TotalCount = Query<int>(countsql).SingleOrDefault();
                //string pageSql = sql + " Offset " + (pageIndex - 1) * pageSize + " row FETCH NEXT " + pageSize + " ROWS ONLY ";
                teams = Query<T_Entrance>(sql).ToList();
                return teams;
            }
            catch (Exception ex)
            {

                return null;
            }
        }
    }
}
