using Dapper; using NetCore.Model.enums; using NetCore.Model.qw; using System.Collections.Generic; using System.Data; using System.Linq; namespace NetCore.BLL { public class hg_make_up_bll { private string comcode; public hg_make_up_bll(string _comcode) { comcode = _comcode; } /// /// 获取需要补充的关键字数据 /// /// public List GetList() { using (IDbConnection con = ConnectionFactory.CreateConnection(ContextType.qwContext, comcode)) { return con.Query("select corpid,keyword,seq,maxseq,status,tablename,pici from hg_make_up where status=90", null, buffered: false).ToList(); } } ///// ///// 修改生成位置数据 ///// ///// ///// //public bool update(hg_man_config model) //{ // using (IDbConnection con = ConnectionFactory.CreateConnection()) // { // return con.Execute("update hg_make_up set tablename=@tablename,seq=@seq,status=@status where corpid=@corpid and keyword=@keyword", model) > 0; // } //} /// /// 修改生成位置数据 /// /// /// public bool update(List makeuplist, int seq, string tablename) { bool result = false; using (IDbConnection con = ConnectionFactory.CreateConnection(ContextType.qwContext, comcode)) { foreach (var item in makeuplist) { item.tablename = tablename; item.seq = seq; if (item.maxseq <= seq) item.status = 200;//如果ID大则终止执行了 con.Execute("update hg_make_up set tablename=@tablename,seq=@seq,status=@status where corpid=@corpid and keyword=@keyword", item); } result = true; } return result; } } }