using HH.WMS.Entitys.Basic;
using HW.DAL;
using HW.Utility.Data;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataAynchronization.HW.DAL
{
public class TN_AB_B_ADDRESS_INFODAL : BaseDAL
{
#region 获取客户地址集合
///
/// 根据表名获取客户地址集合
///
/// 表名
/// 获取客户地址集合
public List GetAddressInfoList(string tableName)
{
string sql = @"SELECT CN_GUID
,CN_S_CODE
,CN_S_COUNTRY
,CN_S_PROVINCE
,CN_S_CITY
,CN_S_AREA_COUNTY
,CN_S_TOWNSHIP_STREET
,CN_S_ADDRESS
,CN_S_RECEIVE
,CN_S_TYPE
,CN_S_CONTACTS
,CN_S_PHONE
,CN_C_IS_DEFAULT
,CN_S_CREATOR
,CN_S_CREATOR_BY
,S.CN_T_CREATE
,CN_S_MODIFY
,CN_S_MODIFY_BY
,CN_T_MODIFY
FROM TN_AB_B_SYNCH_LOG L LEFT JOIN TN_AB_B_ADDRESS_INFO S
ON L.CN_S_GUID=S.CN_GUID
WHERE L.CN_S_TABLE_NAME='" + tableName + "' AND L.CN_N_OP_FLAG IN (1,2)";
DbCommand cmd = DataAccess.GetSqlStringCommand(sql);
List list = DataAccessExtensive.ExecuteListEntity(this.DataAccess, cmd, SetEntity);
return list;
}
///
/// 设置实体的各列
///
private void SetEntity(TN_AB_B_ADDRESS_INFOEntity entity, IDataReader reader)
{
SetEntityUti(entity, "CN_GUID", "CN_GUID", reader);
SetEntityUti(entity, "CN_S_CODE", "CN_S_CODE", reader);
SetEntityUti(entity, "CN_S_COUNTRY", "CN_S_COUNTRY", reader);
SetEntityUti(entity, "CN_S_PROVINCE", "CN_S_PROVINCE", reader);
SetEntityUti(entity, "CN_S_CITY", "CN_S_CITY", reader);
SetEntityUti(entity, "CN_S_AREA_COUNTY", "CN_S_AREA_COUNTY", reader);
SetEntityUti(entity, "CN_S_TOWNSHIP_STREET", "CN_S_TOWNSHIP_STREET", reader);
SetEntityUti(entity, "CN_S_ADDRESS", "CN_S_ADDRESS", reader);
SetEntityUti(entity, "CN_S_RECEIVE", "CN_S_RECEIVE", reader);
SetEntityUti(entity, "CN_S_TYPE", "CN_S_TYPE", reader);
SetEntityUti(entity, "CN_S_CONTACTS", "CN_S_CONTACTS", reader);
SetEntityUti(entity, "CN_S_PHONE", "CN_S_PHONE", reader);
SetEntityUti(entity, "CN_C_IS_DEFAULT", "CN_C_IS_DEFAULT", reader);
SetEntityUti(entity, "CN_S_CREATOR", "CN_S_CREATOR", reader);
SetEntityUti(entity, "CN_S_CREATOR_BY", "CN_S_CREATOR_BY", reader);
SetEntityUti(entity, "CN_T_CREATE", "CN_T_CREATE", reader);
SetEntityUti(entity, "CN_S_MODIFY", "CN_S_MODIFY", reader);
SetEntityUti(entity, "CN_S_MODIFY_BY", "CN_S_MODIFY_BY", reader);
SetEntityUti(entity, "CN_T_MODIFY", "CN_T_MODIFY", reader);
}
#endregion
}
}