You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.7 KiB
C#

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<OffLineInfo>, IOffLineInfoServices
{
private readonly IBaseRepository<OffLineInfo> _dal;
public OffLineInfoServices(IBaseRepository<OffLineInfo> dal)
{
this._dal = dal;
base.BaseDal = dal;
}
/// <summary>
/// 图表统计,按白夜班时间
/// </summary>
public async Task<List<ChartsByTime>> QueryCharts(DateTime startTime, DateTime endTime)
{
try
{
List<ChartsByTime> list = null;
var _db = this.BaseDal.Db;
list = await _db.Ado.SqlQueryAsync<ChartsByTime>("SELECT * FROM GET_OFFLINE_HOURAMOUNT");
return list;
}
catch (Exception)
{
return null;
}
}
/// <summary>
/// 图表统计,按白夜班时间
/// </summary>
public List<dynamic> QueryCharts1(string stationCode)
{
List<dynamic> result = null;
try
{
var _db = this.BaseDal.Db;
result = _db.Queryable<dynamic>().AS("GET_OFFLINE_HOURAMOUNT").Where("PRODUCTLINE_CODE = @stationCode", new { stationCode = stationCode }).ToList();
}
catch (Exception ex)
{
}
return result;
}
}
}