add new: examination_detail and examination_type

This commit is contained in:
avicenan
2026-02-18 13:53:39 +07:00
parent 4e72bff842
commit b072985693
7 changed files with 606 additions and 2 deletions

View File

@ -0,0 +1,23 @@
import { ExaminationDetail } from "entity";
import { SelectQueryBuilder } from "typeorm";
import CommonHelper from "../helpers/common";
import { OrmHelper } from "../helpers/orm";
export class ExaminationDetailModel {
static async list(filter = {}): Promise<SelectQueryBuilder<any>> {
const repo = OrmHelper.DB.getRepository(ExaminationDetail);
let whereAttr: string[] = [];
let whereVal: any = {};
if (filter && Object.keys(filter).length > 0) {
whereAttr = [...whereAttr, ...CommonHelper.handleQueryFilter(filter).whereAttr];
whereVal = { ...whereVal, ...CommonHelper.handleQueryFilter(filter).whereVal };
}
var query = repo.createQueryBuilder("ExaminationDetail");
if (whereAttr.length != 0) {
query = query.where(whereAttr.join(" and "), whereVal);
}
return query;
}
}

View File

@ -0,0 +1,23 @@
import { ExaminationType } from "entity";
import { SelectQueryBuilder } from "typeorm";
import CommonHelper from "../helpers/common";
import { OrmHelper } from "../helpers/orm";
export class ExaminationTypeModel {
static async list(filter = {}): Promise<SelectQueryBuilder<any>> {
const repo = OrmHelper.DB.getRepository(ExaminationType);
let whereAttr: string[] = [];
let whereVal: any = {};
if (filter && Object.keys(filter).length > 0) {
whereAttr = [...whereAttr, ...CommonHelper.handleQueryFilter(filter).whereAttr];
whereVal = { ...whereVal, ...CommonHelper.handleQueryFilter(filter).whereVal };
}
var query = repo.createQueryBuilder("ExaminationType");
if (whereAttr.length != 0) {
query = query.where(whereAttr.join(" and "), whereVal);
}
return query;
}
}