79 lines
2.1 KiB
C#
79 lines
2.1 KiB
C#
using Infrastructure.Attribute;
|
|
using Infrastructure.Extensions;
|
|
using DOAN.Model.PBL.Dto;
|
|
using DOAN.Model.PBL;
|
|
using DOAN.Repository;
|
|
using DOAN.Service.PBL.IPBLService;
|
|
|
|
namespace DOAN.Service.PBL
|
|
{
|
|
/// <summary>
|
|
/// Service业务层处理
|
|
/// </summary>
|
|
[AppService(ServiceType = typeof(ILightLogService), ServiceLifetime = LifeTime.Transient)]
|
|
public class LightLogService : BaseService<LightLog>, ILightLogService
|
|
{
|
|
/// <summary>
|
|
/// 查询列表
|
|
/// </summary>
|
|
/// <param name="parm"></param>
|
|
/// <returns></returns>
|
|
public PagedInfo<LightLogDto> GetList(LightLogQueryDto parm)
|
|
{
|
|
var predicate = QueryExp(parm);
|
|
|
|
var response = Queryable()
|
|
.Where(predicate.ToExpression())
|
|
.ToPage<LightLog, LightLogDto>(parm);
|
|
|
|
return response;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取详情
|
|
/// </summary>
|
|
/// <param name="Id"></param>
|
|
/// <returns></returns>
|
|
public LightLog GetInfo(string Id)
|
|
{
|
|
var response = Queryable()
|
|
.Where(x => x.Id == Id)
|
|
.First();
|
|
|
|
return response;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public LightLog AddLightLog(LightLog model)
|
|
{
|
|
return Insertable(model).ExecuteReturnEntity();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public int UpdateLightLog(LightLog model)
|
|
{
|
|
return Update(model, true);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询导出表达式
|
|
/// </summary>
|
|
/// <param name="parm"></param>
|
|
/// <returns></returns>
|
|
private static Expressionable<LightLog> QueryExp(LightLogQueryDto parm)
|
|
{
|
|
var predicate = Expressionable.Create<LightLog>();
|
|
|
|
return predicate;
|
|
}
|
|
}
|
|
} |