| | |
| | | input.SearchKey = input.SearchKey?.Trim(); |
| | | var query = _wcsPlcRep.AsQueryable() |
| | | .WhereIF(!string.IsNullOrEmpty(input.SearchKey), u => |
| | | u.IP.Contains(input.SearchKey) |
| | | u.IP.Contains(input.SearchKey) && u.Text.Contains(input.SearchKey) |
| | | ) |
| | | .WhereIF(input.PLCType.HasValue, u => u.PLCType == input.PLCType) |
| | | .WhereIF(!string.IsNullOrWhiteSpace(input.IP), u => u.IP.Contains(input.IP.Trim())) |
| | | .WhereIF(input.Type.HasValue, u => u.Type == input.Type) |
| | | .WhereIF(input.Enable.HasValue, u => u.Enable == input.Enable) |
| | | .Select<WcsPlcOutput>(); |
| | | return await query.OrderBuilder(input).ToPagedListAsync(input.Page, input.PageSize); |
| | | } |