using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using XYY.Core.Standard.Data.Infrastructure;
using XYY.Model.Standard.Finance;
using System.Linq;
namespace XYY.Data.Standard.Finance
{
    public interface IVCustomerLadingBillCostRepository : IViewRepository<View_Customer_LadingBill_Cost>
    {
        Task<List<View_Customer_LadingBill_Cost>> QueryLadingBillCosts(List<string> ladingBillNumbers);
    }

    public class VCustomerLadingBillCostRepository : ViewRepository<View_Customer_LadingBill_Cost>, IVCustomerLadingBillCostRepository
    {

        public VCustomerLadingBillCostRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
        {

        }

        public async Task<List<View_Customer_LadingBill_Cost>> QueryLadingBillCosts(List<string> ladingBillNumbers)
        {
            var list =
                 (await QueryMultipleAsync("select * from V_Customer_LadingBill_Cost(nolock) where BillNumber in @billNumbers", new { billNumbers = ladingBillNumbers }))
                 .Read<View_Customer_LadingBill_Cost>().ToList();
            return list;
        }
    }
}
