using Dapper; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using XYY.Core.Standard.Data.Infrastructure; using XYY.Model.Standard.Order; namespace XYY.Data.Standard.Order { public interface IOrder_IossTestRepository : IBaseRepository { Task> GetDateUsedCountInfo(string CountryCode); Task> GetDateUsedSystemNos(List SystemNos); } public class Order_IossTestRepository : BaseRepository, IOrder_IossTestRepository { public Order_IossTestRepository(IUnitOfWork unitOfWork) : base(unitOfWork) { } public async Task> GetDateUsedCountInfo(string CountryCode) { string sql = $@" select CustomerName,ReceiverCountryCode,COUNT(Id) UsedCount from Order_IossTest(nolock) where CreateTime>='{DateTime.Now.ToString_yyyyMMdd()}' and ReceiverCountryCode='{CountryCode}' group by CustomerName,ReceiverCountryCode"; return (await _unitOfWork.QueryBySqlAsync(sql)).ToList(); } public async Task> GetDateUsedSystemNos(List SystemNos) { string sql = " select *from Order_IossTest where SystemNo in @SystemNo "; return (await _unitOfWork.QueryBySqlAsync(sql, null, new { SystemNo = SystemNos })).ToList(); } } }