36 lines
1.4 KiB
C#
36 lines
1.4 KiB
C#
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_Wx_Message_IMP : Interfaces.IDataImportSvr<Server_Hg_Wx_Message>
|
||
{
|
||
public bool GenerateBusinessOne(Server_Hg_Wx_Message t)
|
||
{
|
||
try
|
||
{
|
||
using (var db = ZxdStore.GetConnection())
|
||
{
|
||
int count = db.ExecuteScalar<int>("select count(*) from hg_wx_message where id=@id and detpcode=@detpcode", new { id = t.id, detpcode = t.detpcode });
|
||
var sql = @"insert into hg_wx_message(id,pkid,msgsvrid,msgtype,issend,talker,username,nickname,msgcontent,imgpath,voiceUrl,ctime,hgstatus,hgtime,kefuname,word,detpcode,synctime,iswg,eid,eidname,checkdate)values
|
||
(@id,@pkid,@msgsvrid,@msgtype,@issend,@talker,@username,@nickname,@msgcontent,@imgpath,@voiceUrl,@ctime,@hgstatus,@hgtime,@kefuname,@word,@detpcode,now(),0,@eid,@eidname,@checkdate)";
|
||
if (count == 0)//有数据不做插入操作
|
||
{
|
||
db.Execute(sql, t);
|
||
}
|
||
}
|
||
return true;
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.Error("Server_Hg_Wx_Message_IMP:" + ex.ToString());
|
||
return false;
|
||
}
|
||
}
|
||
}
|
||
|
||
}
|