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