|
|
|
@ -879,17 +879,17 @@ export class AppController {
|
|
|
|
throw new BadRequestException("无权限, 请联系管理员")
|
|
|
|
throw new BadRequestException("无权限, 请联系管理员")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const where: any = {};
|
|
|
|
const where: any = {};
|
|
|
|
const query = this.areaRepository.createQueryBuilder('area');
|
|
|
|
const query = this.deviceRepository.createQueryBuilder('device');
|
|
|
|
query.where(where);
|
|
|
|
query.where(where);
|
|
|
|
if (query_data.search) {
|
|
|
|
if (query_data.search) {
|
|
|
|
const string = `%${query_data.search}%`;
|
|
|
|
const string = `%${query_data.search}%`;
|
|
|
|
const fields = ['name'];
|
|
|
|
const fields = ['name'];
|
|
|
|
const searchString = fields.join(' like :search OR area.');
|
|
|
|
const searchString = fields.join(' like :search OR device.');
|
|
|
|
query.where(`area.${searchString} like :search`, {
|
|
|
|
query.where(`device.${searchString} like :search`, {
|
|
|
|
search: string,
|
|
|
|
search: string,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const order_key = 'area.created_date';
|
|
|
|
const order_key = 'device.created_date';
|
|
|
|
let order_value: any = 'DESC';
|
|
|
|
let order_value: any = 'DESC';
|
|
|
|
const [list, count] = await query
|
|
|
|
const [list, count] = await query
|
|
|
|
.skip(query_data.skip)
|
|
|
|
.skip(query_data.skip)
|
|
|
|
|