IFinance_OrderRangeSearchResultRepository.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using SMP.Model;
  2. using SMP.Model.Order;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using XYY.Core.Standard.Data.Infrastructure;
  9. using Dapper;
  10. namespace SMP.Data
  11. {
  12. public interface IFinance_OrderRangeSearchResultRepository : IBaseRepository<Finance_OrderRangeSearchResult>
  13. {
  14. Task<IEnumerable<OrderNumberInfo>> GetOrderSystemNoByTransferNumber(IEnumerable<string> transferNumbers);
  15. Task<IEnumerable<OrderNumberInfo>> GetOrderSystemNoByTrackingNumberNumber(IEnumerable<string> trackingNumbers);
  16. }
  17. public class Finance_OrderRangeSearchResultRepository : BaseRepository<Finance_OrderRangeSearchResult>, IFinance_OrderRangeSearchResultRepository
  18. {
  19. public Finance_OrderRangeSearchResultRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
  20. {
  21. }
  22. public Task<IEnumerable<OrderNumberInfo>> GetOrderSystemNoByTrackingNumberNumber(IEnumerable<string> trackingNumbers)
  23. {
  24. string sql = "select SystemNo,TrackingNumber from Logistisc_Order where TrackingNumber in @TrackingNumbers";
  25. var result = _unitOfWork.Connection.QueryAsync<OrderNumberInfo>(sql, new { TrackingNumbers = trackingNumbers }, transaction: _unitOfWork.Transaction);
  26. return result;
  27. }
  28. public Task<IEnumerable<OrderNumberInfo>> GetOrderSystemNoByTransferNumber(IEnumerable<string> transferNumbers)
  29. {
  30. string sql = "select SystemNo,TransferNumber from Logistisc_Order where TransferNumber in @TransferNumbers";
  31. var result = _unitOfWork.Connection.QueryAsync<OrderNumberInfo>(sql, new { TransferNumbers = transferNumbers },transaction:_unitOfWork.Transaction);
  32. return result;
  33. }
  34. }
  35. }