using Dapper; using NetCore.Common; using NetCore.Model; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Data; namespace NetCore.BLL { public class sync_push_bll { public bool InserPush(List list) { using (IDbConnection con = ConnectionFactory.CreatePushConnection()) { string dbtype = con.GetType().Name.ToLower(); bool ismysql = false; if (dbtype.Contains("mysql")) { ismysql = true; } foreach (var model in list) { try { if (ismysql) { con.Execute(@"insert into sync_push(jsontext, isbatch, ctime, bidatatype, deptcode) values(@jsontext, @isbatch, now(), @bidatatype, @deptcode)", model); } else { con.Execute(@"insert into sync_push(pkid,jsontext, isbatch, ctime, bidatatype, deptcode) values(pack_base.Seq_largeid_get,:jsontext, :isbatch, sysdate, :bidatatype, :deptcode)", model);//oracle写法 } } catch (Exception e) { LogHelper.Error("入库推送表失败:" + JsonConvert.SerializeObject(model)); } } return true; } } } }