66 lines
2.2 KiB
C#
66 lines
2.2 KiB
C#
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;
|
|
}
|
|
/// <summary>
|
|
/// 获取需要补充的关键字数据
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public List<hg_make_up> GetList()
|
|
{
|
|
using (IDbConnection con = ConnectionFactory.CreateConnection(ContextType.qwContext, comcode))
|
|
{
|
|
return con.Query<hg_make_up>("select corpid,keyword,seq,maxseq,status,tablename,pici from hg_make_up where status=90", null, buffered: false).ToList();
|
|
}
|
|
}
|
|
|
|
///// <summary>
|
|
///// 修改生成位置数据
|
|
///// </summary>
|
|
///// <param name="model"></param>
|
|
///// <returns></returns>
|
|
//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;
|
|
// }
|
|
//}
|
|
|
|
/// <summary>
|
|
/// 修改生成位置数据
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public bool update(List<hg_make_up> 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;
|
|
}
|
|
}
|
|
}
|