using Admin.Core.IRepository; using Admin.Core.IService; using Admin.Core.Model; using Admin.Core.Model.Model_New; using Admin.Core.Model.ViewModels; using Microsoft.IdentityModel.Logging; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace Admin.Core.Service { public class OffLineInfoServices : BaseServices, IOffLineInfoServices { private readonly IBaseRepository _dal; public OffLineInfoServices(IBaseRepository dal) { this._dal = dal; base.BaseDal = dal; } /// /// 图表统计,按白夜班时间 /// public async Task> QueryCharts(DateTime startTime, DateTime endTime) { try { List list = null; var _db = this.BaseDal.Db; list = await _db.Ado.SqlQueryAsync("SELECT * FROM GET_OFFLINE_HOURAMOUNT"); return list; } catch (Exception) { return null; } } /// /// 图表统计,按白夜班时间 /// public List QueryCharts1(string stationCode) { List result = null; try { var _db = this.BaseDal.Db; result = _db.Queryable().AS("GET_OFFLINE_HOURAMOUNT").Where("PRODUCTLINE_CODE = @stationCode", new { stationCode = stationCode }).ToList(); } catch (Exception ex) { } return result; } } }