using DataSharing.Province.SendTask;
using DataSharing.Province.SendTask.ProvinceOther;
using DataSharing.Province.SendTask.SubmitCaseInfo;
using DataSharing.Share.Dtos.Statistics;
using SqlSugar;
using XF.Domain.Dependency;

namespace DataSharing.Repository
{
    public class WaitSendTaskRepository : BaseRepository<DsWaitSendTaskProvinceOther>, IWaitSendTaskRepository, IScopeDependency
    {
        public WaitSendTaskRepository(ISugarUnitOfWork<DataSharingDbContext> uow) : base(uow)
        {

        }

        public ISugarQueryable<T> UnionAll<T>(params ISugarQueryable<T>[] queryables) where T : class
        {
            return Db.UnionAll(queryables);
        }

        /// <summary>
        /// 汇聚数据查询
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        public List<DataAggregationSituationDto> GetDataAggregationSituation(string sql)
        {
            return Db.Ado.SqlQuery<DataAggregationSituationDto>(sql);

        }

        /// <summary>
        /// 根据sql查询分页数据
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        public ISugarQueryable<DsSendTaskSubmitCaseInfo> GetDataBySql(string sql)
        {
            return Db.SqlQueryable<DsSendTaskSubmitCaseInfo>(sql);

        }

        /// <summary>
        /// 根据sql查询分页数据
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        public ISugarQueryable<GetOverdueDetailsDto> GetGetOverdueDetailsBySql(string sql)
        {
            return Db.SqlQueryable<GetOverdueDetailsDto>(sql);

        }
    }
}
