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>}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue