1234567891011121314151617181920212223242526272829303132333435 |
- 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<Order_IossTest>
- {
- Task<List<UsedCountInfo>> GetDateUsedCountInfo(string CountryCode);
- Task<List<Order_IossTest>> GetDateUsedSystemNos(List<string> SystemNos);
- }
- public class Order_IossTestRepository : BaseRepository<Order_IossTest>, IOrder_IossTestRepository
- {
- public Order_IossTestRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
- {
- }
- public async Task<List<UsedCountInfo>> 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<UsedCountInfo>(sql)).ToList();
- }
- public async Task<List<Order_IossTest>> GetDateUsedSystemNos(List<string> SystemNos)
- {
- string sql = " select *from Order_IossTest where SystemNo in @SystemNo ";
- return (await _unitOfWork.QueryBySqlAsync<Order_IossTest>(sql, null, new { SystemNo = SystemNos })).ToList();
- }
- }
- }
|