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>
|
/// RepairTaskLog
|
/// </summary>
|
public partial class RepairTaskLog : CorpDAL<Entity.RepairTaskLog>
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public override ConnectionConfig ConnectionConfig
|
{
|
get
|
{
|
return ConfigHelper.DefaultConnectionConfig;
|
}
|
}
|
|
/// <summary>
|
/// 通过 FormID 获取
|
/// </summary>
|
public List<Entity.RepairTaskLog> GetByFormID(long CorpID, long FormID)
|
{
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Queryable<Entity.RepairTaskLog>()
|
.Where(x => x.CorpID == CorpID && x.FormID == FormID).OrderBy(x=>x.OperateTime).ToList();
|
}
|
}
|
|
/// <summary>
|
/// 通过 FormID 获取最后一条
|
/// </summary>
|
public Entity.RepairTaskLog GetLastByFormID(long CorpID, long FormID)
|
{
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Queryable<Entity.RepairTaskLog>()
|
.Where(x => x.CorpID == CorpID && x.FormID == FormID).OrderBy(x => x.OperateTime,OrderByType.Desc).First();
|
}
|
}
|
|
/// <summary>
|
/// 通过 FormIds 获取
|
/// </summary>
|
public List<Entity.RepairTaskLog> GetByFormIds(long CorpID, List<long> FormIds)
|
{
|
if (FormIds == null || FormIds.Count < 1)
|
return default;
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Queryable<Entity.RepairTaskLog>()
|
.Where(x => x.CorpID == CorpID &&FormIds.Contains(x.FormID)).OrderBy(x => x.OperateTime).ToList();
|
}
|
}
|
|
|
}
|
}
|