IOrder_IossTestRepository.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using Dapper;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Threading.Tasks;
  6. using XYY.Core.Standard.Data.Infrastructure;
  7. using XYY.Model.Standard.Order;
  8. namespace XYY.Data.Standard.Order
  9. {
  10. public interface IOrder_IossTestRepository : IBaseRepository<Order_IossTest>
  11. {
  12. Task<List<UsedCountInfo>> GetDateUsedCountInfo(string CountryCode);
  13. Task<List<Order_IossTest>> GetDateUsedSystemNos(List<string> SystemNos);
  14. }
  15. public class Order_IossTestRepository : BaseRepository<Order_IossTest>, IOrder_IossTestRepository
  16. {
  17. public Order_IossTestRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
  18. {
  19. }
  20. public async Task<List<UsedCountInfo>> GetDateUsedCountInfo(string CountryCode)
  21. {
  22. string sql = $@" select CustomerName,ReceiverCountryCode,COUNT(Id) UsedCount from Order_IossTest(nolock)
  23. where CreateTime>='{DateTime.Now.ToString_yyyyMMdd()}' and ReceiverCountryCode='{CountryCode}'
  24. group by CustomerName,ReceiverCountryCode";
  25. return (await _unitOfWork.QueryBySqlAsync<UsedCountInfo>(sql)).ToList();
  26. }
  27. public async Task<List<Order_IossTest>> GetDateUsedSystemNos(List<string> SystemNos)
  28. {
  29. string sql = " select *from Order_IossTest where SystemNo in @SystemNo ";
  30. return (await _unitOfWork.QueryBySqlAsync<Order_IossTest>(sql, null, new { SystemNo = SystemNos })).ToList();
  31. }
  32. }
  33. }