using AutoTurnOver.Models;
using Dapper;
using System;
using System.Collections.Generic;
using System.Linq;
using AutoTurnOver.Models.ApiDto;
using MySql.Data.MySqlClient;
using System.Text;
using AutoTurnOver.Utility;
using AutoTurnOver.Models.Report;

namespace AutoTurnOver.DB
{
   public  class dc_base_stock_dao : connectionHelper
    {
        public static void AddData(dc_base_stock data)
        {
            data.owner_code = (data.owner_code ?? "");
            data.id = _connection.QueryFirstOrDefault<int?>(" select id from dc_base_stock where  bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ",new {
                bailun_sku = data.bailun_sku,
                warehouse_code = data.warehouse_code
            }) ?? 0;
            if (data.id <= 0)
            {
                _connection.Insert(data);
            }
        }
    }
}
