using Dapper;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using XYY.Core.Standard.Data.Infrastructure;
using XYY.Model.Standard.Channel;

namespace XYY.Data.Standard.Channel
{
    public interface ILogistics_BoxDetailRepository : IBaseRepository<Logistics_BoxDetail>
    {
        Task<int> SetConfirmStatus(IEnumerable<int> boxDetailIds);
    }

    public class Logistics_BoxDetailRepository : BaseRepository<Logistics_BoxDetail>, ILogistics_BoxDetailRepository
    {
        public Logistics_BoxDetailRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
        {

        }

        public async Task<int> SetConfirmStatus(IEnumerable<int> boxDetailIds)
        {
            string sql = "update Logistics_BoxDetail set IsConfim=1 where Id in @Ids";
            return await base._unitOfWork.Connection.ExecuteAsync(sql, new { Ids = boxDetailIds }, transaction: _unitOfWork.Transaction);
        }
    }
}
