using SqlSugar;
|
using System;
|
using System.Collections.Generic;
|
using System.Data;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace IStation.DAL
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public partial class CorpDAL_Sorter<T>: CorpDAL<T> where T:Entity.CorpEntity,Entity.ISorter,new()
|
{
|
/// <summary>
|
/// 更新排序
|
/// </summary>
|
public virtual bool UpdateSortCode(long CorpID, long ID, int SortCode)
|
{
|
using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Updateable<T>().SetColumns(x => x.SortCode == SortCode).Where(x =>x.CorpID==CorpID&&x.ID==ID).ExecuteCommand() > 0;
|
}
|
}
|
|
/// <summary>
|
/// 更新排序
|
/// </summary>
|
public virtual bool UpdateSorter(long CorpID, List<Entity.Sorter> Sorters)
|
{
|
if (Sorters == null || Sorters.Count() < 1)
|
return default;
|
if (Sorters.Exists(x => x.ID < 1))
|
return default;
|
using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Updateable<T>(Sorters).UpdateColumns(nameof(Entity.ISorter.SortCode)).Where(x=>x.CorpID==CorpID).ExecuteCommand() > 0;
|
}
|
}
|
}
|
}
|