using Yw.DAL.SQLite;
|
|
namespace HStation.DAL.SQLite
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public partial class TransferRevitFile : BaseDAL<Entity.TransferRevitFile>, ITransferRevitFile
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public override ConnectionConfig ConnectionConfig
|
{
|
get { return ConfigHelper.SQLiteConnectionConfig; }
|
}
|
|
|
/// <summary>
|
/// 获取模糊列表
|
/// </summary>
|
public List<Entity.TransferRevitFile> GetFluzzyList
|
(
|
string fileName,
|
string fileCode,
|
string fileSuffix,
|
string uploadUserName,
|
DateTime? startTime,
|
DateTime? endTime
|
)
|
{
|
var exp = Expressionable.Create<Entity.TransferRevitFile>();
|
exp.AndIF(!string.IsNullOrEmpty(fileName), x => x.FileName.Contains(fileName));
|
exp.AndIF(!string.IsNullOrEmpty(fileCode), x => x.FileCode.Contains(fileCode));
|
exp.AndIF(!string.IsNullOrEmpty(fileSuffix), x => x.FileSuffix.Contains(fileSuffix));
|
exp.AndIF(!string.IsNullOrEmpty(uploadUserName), x => x.UploadUserName.Contains(uploadUserName));
|
exp.AndIF(startTime.HasValue, x => x.UploadTime >= startTime.Value);
|
exp.AndIF(endTime.HasValue, x => x.UploadTime <= endTime.Value);
|
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Queryable<Entity.TransferRevitFile>()
|
.Where(exp.ToExpression())
|
.OrderBy(x => x.UploadTime, OrderByType.Desc)
|
.ToList();
|
}
|
}
|
|
/// <summary>
|
/// 获取模糊分页列表
|
/// </summary>
|
public List<Entity.TransferRevitFile> GetFluzzyPageList
|
(
|
string fileName,
|
string fileCode,
|
string fileSuffix,
|
string uploadUserName,
|
DateTime? startTime,
|
DateTime? endTime,
|
int PageIndex,
|
int PageSize,
|
ref int Total
|
)
|
{
|
if (PageIndex < 1)
|
{
|
PageIndex = 1;
|
}
|
if (PageSize < 1)
|
{
|
PageSize = 1;
|
}
|
var exp = Expressionable.Create<Entity.TransferRevitFile>();
|
exp.AndIF(!string.IsNullOrEmpty(fileName), x => x.FileName.Contains(fileName));
|
exp.AndIF(!string.IsNullOrEmpty(fileCode), x => x.FileCode.Contains(fileCode));
|
exp.AndIF(!string.IsNullOrEmpty(fileSuffix), x => x.FileSuffix.Contains(fileSuffix));
|
exp.AndIF(!string.IsNullOrEmpty(uploadUserName), x => x.UploadUserName.Contains(uploadUserName));
|
exp.AndIF(startTime.HasValue, x => x.UploadTime >= startTime.Value);
|
exp.AndIF(endTime.HasValue, x => x.UploadTime <= endTime.Value);
|
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Queryable<Entity.TransferRevitFile>()
|
.Where(exp.ToExpression())
|
.OrderBy(x => x.UploadTime, OrderByType.Desc)
|
.ToPageList(PageIndex, PageSize, ref Total);
|
}
|
}
|
|
/// <summary>
|
///
|
/// </summary>
|
public bool IsExistFileCode(string FileCode)
|
{
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Queryable<Entity.TransferRevitFile>()
|
.Where(x => x.FileCode == FileCode)
|
.Count() > 0;
|
}
|
}
|
|
/// <summary>
|
///
|
/// </summary>
|
public bool IsExistFileCodeExceptID(string FileCode, long ExceptID)
|
{
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Queryable<Entity.TransferRevitFile>()
|
.Where(x => x.FileCode == FileCode && x.ID != ExceptID)
|
.Count() > 0;
|
}
|
}
|
|
|
|
|
|
}
|
}
|