enable public report
This commit is contained in:
parent
8f563d1058
commit
41c3093754
21 changed files with 307 additions and 19 deletions
|
@ -58,6 +58,26 @@ export default abstract class EquipmentService {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description get equipment by code
|
||||
* @returns {Promise<Array<equipment>>}
|
||||
*/
|
||||
static async getAllByCode(code: string): Promise<Array<equipment>> {
|
||||
return await dataSource
|
||||
.getRepository(equipment)
|
||||
.createQueryBuilder("equipment")
|
||||
.leftJoinAndSelect("equipment.equipmentType", "equipmenttype")
|
||||
.where({ code: Like(`%${code}%`) })
|
||||
.orderBy("name", "ASC")
|
||||
.getMany()
|
||||
.then((res) => {
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
throw new DatabaseActionException("SELECT", "equipment", err);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description get equipment by id
|
||||
* @returns {Promise<equipment>}
|
||||
|
|
|
@ -58,6 +58,26 @@ export default abstract class VehicleService {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description get vehicle by code
|
||||
* @returns {Promise<Array<vehicle>>}
|
||||
*/
|
||||
static async getAllByCode(code: string): Promise<Array<vehicle>> {
|
||||
return await dataSource
|
||||
.getRepository(vehicle)
|
||||
.createQueryBuilder("vehicle")
|
||||
.leftJoinAndSelect("vehicle.vehicleType", "vehicletype")
|
||||
.where({ code: Like(`%${code}%`) })
|
||||
.orderBy("name", "ASC")
|
||||
.getMany()
|
||||
.then((res) => {
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
throw new DatabaseActionException("SELECT", "vehicle", err);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description get vehicle by id
|
||||
* @returns {Promise<vehicle>}
|
||||
|
|
|
@ -59,6 +59,26 @@ export default abstract class WearableService {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description get wearable by code
|
||||
* @returns {Promise<Array<wearable>>}
|
||||
*/
|
||||
static async getAllByCode(code: string): Promise<Array<wearable>> {
|
||||
return await dataSource
|
||||
.getRepository(wearable)
|
||||
.createQueryBuilder("wearable")
|
||||
.leftJoinAndSelect("wearable.wearableType", "wearabletype")
|
||||
.where({ code: Like(`%${code}%`) })
|
||||
.orderBy("name", "ASC")
|
||||
.getMany()
|
||||
.then((res) => {
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
throw new DatabaseActionException("SELECT", "wearable", err);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description get wearable by id
|
||||
* @returns {Promise<wearable>}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue