TG.WXCRM.V4/WX.CRM.DataSynFactory/Cmd/Server_Hg_Qw_Message_IMP.cs

36 lines
1.4 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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<Server_Hg_Qw_Message>
{
public bool GenerateBusinessOne(Server_Hg_Qw_Message t)
{
try
{
using (var db = ZxdStore.GetConnection())
{
int count = db.ExecuteScalar<int>("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;
}
}
}
}