| | |
| | | } |
| | | } |
| | | |
| | | //找出所有数据 |
| | | public List<Model.WaterPredictRecord> GetAll() |
| | | { |
| | | var ConnectionConfig = ConnectionFactory.MainConnection(DateTime.Now.Year); |
| | | using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig)) |
| | | { |
| | | var entitys = db.Queryable<Entity.WaterPredictRecord>().ToList(); |
| | | return Entity2Models(entitys); |
| | | } |
| | | } |
| | | |
| | | //找出所有数据 |
| | | public List<Model.WaterPredictRecord> GetEndData(int num) |
| | | { |
| | | var ConnectionConfig = ConnectionFactory.MainConnection(DateTime.Now.Year); |
| | | using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig)) |
| | | { |
| | | int totalRecords = db.Queryable<Entity.WaterPredictRecord>().Count(); |
| | | var entitys = db.Queryable<Entity.WaterPredictRecord>() |
| | | .Skip(totalRecords - num) |
| | | .Take(num) |
| | | .ToList(); |
| | | return Entity2Models(entitys); |
| | | } |
| | | } |
| | | |
| | | #endregion Get |
| | | |
| | | /// <summary> |