You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
1.2 KiB
27 lines
1.2 KiB
using FreeSql;
|
|
using Znyc.CloudCar.Auth.HttpContextUser;
|
|
using Znyc.CloudCar.IRepository.Audit;
|
|
using Znyc.CloudCar.Model.Entities;
|
|
|
|
namespace Znyc.CloudCar.Repository.Audit
|
|
{
|
|
public class AuditRepository : RepositoryBase<AuditEntity>, IAuditRepository
|
|
{
|
|
public AuditRepository(UnitOfWorkManager uowm, IHttpContextUser user) : base(uowm, user)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// 审核失败列表
|
|
/// </summary>
|
|
/// <param name="userId"></param>
|
|
/// <returns></returns>
|
|
public async Task<List<AuditEntity>> GetAuditFailListAsync(long userId)
|
|
{
|
|
return await Orm.Ado.QueryAsync<AuditEntity>(@"SELECT t.EquipmentId,t.EquipmentTitle,t.HandleStatus,t.Note,t.ModifiedTime,t.CreatedTime FROM
|
|
(SELECT EquipmentId,max(CreatedTime) as CreatedTime FROM audit WHERE HandleStatus = 4 AND (EquipmentId in
|
|
(SELECT Id FROM equipment WHERE UserId =?userId AND `State`= 30 AND IsDeleted = 0)) GROUP BY EquipmentId) a
|
|
INNER JOIN audit t ON t.EquipmentId = a.EquipmentId AND t.CreatedTime = a.CreatedTime", new { userId });
|
|
}
|
|
}
|
|
}
|
|
|