using ASHermed.AdminInterface.Api.ContractModel;
using ASHermed.SinoInterface.Api.ContractModel.App;
using ASHermed.SinoInterface.Api.IRepository;
using ASHermed.SinoInterface.Repository.MySql;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ASHermed.SinoInterface.Api.MySqlRepository.App
{
    public class OnlineBillDetailRepository : BaseRepositoryToASHermed_SinoInterface<Online_Bill>, IOnlineBillDetailRepository
    {
        public List<Online_Bill_Detail> GetOnlineBillDetail(List<string> billNo)
        {
            var sql = @" SELECT * from online_bill_detail WHERE BillNo IN @BillNo ";
            return Query<Online_Bill_Detail>(sql, new { BillNo = billNo }).ToList();
        }

        public int InsertOnlineBillDetail(List<Online_Bill_Detail> model)
        {
            var sql = @" INSERT INTO `online_bill_detail`(`BillNo`, `BillPayType`, `BillDetailType`, `BillDetailPrice`, `Remark`, `CreateTime`, `CreateUser`) VALUES (@BillNo, @BillPayType, @BillDetailType, @BillDetailPrice, @Remark, @CreateTime, @CreateUser) ";
            return Execute(sql, model);
        }
    }
}
