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_Hg_Qw_Message_IMP : Interfaces.IDataImportSvr { public bool GenerateBusinessOne(Server_Hg_Qw_Message t) { try { using (var db = ZxdStore.GetConnection()) { int count = db.ExecuteScalar("select count(*) from hg_qw_message where id=@id and detpcode=@detpcode", new { id = t.id, detpcode = t.detpcode }); var sql = @"insert into hg_qw_message(id,seq,msgid,msgtype,action,fromer,tolist,roomid,ext,content,nfile,msgtime,ctime,hgstatus,issend,kehuname,cusname,corpid,word,voiceUrl,detpcode,synctime,iswg,eid,eidname,checkdate)values (@id,@seq,@msgid,@msgtype,@action,@fromer,@tolist,@roomid,@ext,@content,@nfile,@msgtime,@ctime,@hgstatus,@issend,@kehuname,@cusname,@corpid,@word,@voiceUrl,@detpcode,now(),0,@eid,@eidname,@checkdate)"; if (count == 0)//有数据不做插入操作 { db.Execute(sql, t); } } return true; } catch (Exception ex) { LogHelper.Error("Server_Hg_Qw_Message_IMP:" + ex.ToString()); return false; } } } }