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 ProductInspectionTemplateGrp : CorpTraceDAL_Sorter { /// /// /// public override ConnectionConfig ConnectionConfig { get { return ConfigHelper.DefaultConnectionConfig; } } /// /// 通过ProductType获取 /// /// /// public List GetByProductType(IEnumerable ProductType) { if(ProductType == null || ProductType.Count() == 0) return null; using (var db = new SqlSugarClient(ConnectionConfig)) { return db.Queryable() .Where(x => ProductType.Contains( x.ProductType)).ToList(); } } /// /// ProductType /// /// /// public List GetByProductType(long ProductType) { using (var db = new SqlSugarClient(ConnectionConfig)) { return db.Queryable() .Where(x => ProductType == x.ProductType ).ToList(); } } /// /// 更新使用状态 /// public virtual bool UpdateUseStatus(long CorpID, long ID, int UseStatus, long UpdateUserID, DateTime UpdateTime) { using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig)) { return db.Updateable() .SetColumns(x => x.UseStatus == UseStatus) .SetColumns(x => x.UpdateUserID == UpdateUserID) .SetColumns(x => x.UpdateTime == UpdateTime) .Where(x => x.CorpID == CorpID && x.ID == ID) .ExecuteCommandHasChange(); } } } }