using Dapper; using System; using WX.CRM.Common; using WX.CRM.DataSynFactory.Dao; using WX.CRM.DataSynFactory.Templates; namespace WX.CRM.DataSynFactory.Cmd { public class Server_WwextUserResid_IMP : Interfaces.IDataImportSvr { public bool GenerateBusinessOne(Server_WwextUserResid t) { try { if (string.IsNullOrWhiteSpace(t.deptcode)) { LogHelper.Error($"{t.ToJson()}事业部为空"); return true; } using (var db = ZxdStore.GetConnection()) { var sql = @" INSERT INTO ww_extuser_resid(resid,userid,deptcode) values(@resid,@userid,@deptcode) on duplicate key update putnum = putnum+1; "; if (t.type == "unbind") { sql = "delete from ww_extuser_resid where resid=@resid and userid=@userid and deptcode=@deptcode"; } db.Execute(sql, t); } return true; } catch (Exception ex) { LogHelper.Error("Server_WwextUserResid_IMP:" + ex.ToString()); return false; } } } }