using IStation.Entity; using SqlSugar; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; namespace IStation.DAL { /// /// /// public partial class BaseTraceDAL_Sorter : BaseTraceDAL where T : Entity.BaseTraceEntity, ISorter, new() { /// /// 更新排序码 /// public virtual bool UpdateSortCode(long ID, int SortCode,long UpdateUserID,DateTime UpdateTime) { using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig)) { return db.Updateable() .SetColumns(x => x.SortCode == SortCode) .SetColumns(x => x.UpdateUserID == UpdateUserID) .SetColumns(x => x.UpdateTime == UpdateTime) .Where(x => x.ID == ID) .ExecuteCommandHasChange(); } } /// /// 更新排序 /// public virtual bool UpdateSorter(List 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(Sorters) .UpdateColumns(nameof(Entity.ISorter.SortCode),nameof(Entity.TraceSorter.UpdateUserID),nameof(Entity.TraceSorter.UpdateTime)) .ExecuteCommandHasChange(); } } } }