using Models; using System; using System.Collections.Generic; using System.Data.SqlClient; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DAL { public class PositionService { List excuteSql(string sql, params SqlParameter[] param) { return ServiceBase.excuteSql(new Position(), "Position", sql, CommandType.Text, param); } Position excuteType(string sql, params SqlParameter[] param) { //查询结果放入对象集合 List hdList = excuteSql(sql, param); Position position = new Position(); //判断集合是否为空 if (hdList == null || hdList.Count == 0) { return position; } //返回单个对象 return hdList[0]; } public List GetAll() { return excuteSql("select * from Position where isdel = 0"); } } }