/// <summary> /// 获取预警记录分页列表 /// </summary> /// <param name="requestDto"></param> /// <param name="healthManagerId"></param> /// <returns></returns> public async Task <GetIndicatorWarningPageListResponseDto> GetIndicatorWarningPageListAsync(GetIndicatorWarningPageListRequestDto requestDto, string healthManagerId) { var sqlWhere = string.Empty; if (requestDto.Status.HasValue) { sqlWhere = $"AND a.`status` = @Status "; } if (!string.IsNullOrWhiteSpace(requestDto.Keyword)) { sqlWhere = $"{sqlWhere} AND (a.phone like CONCAT('%',@Keyword,'%') or a.`name` like CONCAT('%',@Keyword,'%')) "; } var sql = $@"SELECT a.warning_guid, a.`name`, a.age, a.creation_date AS warning_date, a.phone, CONCAT(c.base_path,c.relative_path) as portrait, a.description, a.`status` FROM t_consumer_indicator_warning a inner join t_utility_user b on a.consumer_guid=b.user_guid left join t_utility_accessory c on c.accessory_guid=b.portrait_guid WHERE a.health_manager_guid = '{healthManagerId}' AND a.`enable` = 1 {sqlWhere} ORDER BY a.creation_date DESC" ; var result = await MySqlHelper.QueryByPageAsync <GetIndicatorWarningPageListRequestDto, GetIndicatorWarningPageListResponseDto, GetIndicatorWarningPageListItemDto>(sql, requestDto); return(result); }
public async Task <IActionResult> GetIndicatorWarningPageListAsync(GetIndicatorWarningPageListRequestDto requestDto) { var result = await new IndicatorWarningBiz().GetIndicatorWarningPageListAsync(requestDto, UserID); return(Success(result)); }