using System;
using System.Collections.Generic;
using System.Text;
using XYY.Core.Standard.Data.Infrastructure;
using XYY.Model.Standard.First;
using Dapper;
using System.Threading.Tasks;
using System.Linq;

namespace XYY.Data.Standard.First
{
    public interface ILogistics_LadingBillRepository : IBaseRepository<Logistics_LadingBill>
    {
        [NonTrans]
        Task<List<Logistics_LadingBill>> QueryBill(string[] laddingBills);
    }
    public class Logistics_LadingBillRepository : BaseRepository<Logistics_LadingBill>, ILogistics_LadingBillRepository
    {
        public Logistics_LadingBillRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
        {
        }

        public async Task<List<Logistics_LadingBill>> QueryBill(string[] laddingBills)
        {
            string sql = "select CreateTime,CustomsClearanceTime,DepartTime,DepartRemark,ArrivalTime,ArrivalRemark,ClearanceTime,LadingBillNumber,LeaveWarehouseTime from Logistics_LadingBill(nolock) where LadingBillNumber in @LadingBillNumber and IsDeleted = 0";
            return (await _unitOfWork.QueryBySqlAsync<Logistics_LadingBill>(sql, param: new { LadingBillNumber = laddingBills })).ToList();
        }
    }
}