Merge branch 'develop' of github.com:Frappet/bma-ehr-salary into develop
This commit is contained in:
commit
426583bcdb
1 changed files with 17 additions and 16 deletions
|
|
@ -227,16 +227,20 @@ export class SalaryFormulaEmployeeController extends Controller {
|
|||
@Query("pageSize") pageSize: number = 10,
|
||||
@Query("keyword") keyword?: string,
|
||||
) {
|
||||
let whereClause: any = {};
|
||||
if (keyword != undefined && keyword !== "") {
|
||||
whereClause = {
|
||||
where: [
|
||||
{ details: Like(`%${keyword}%`) },
|
||||
{ position: Like(`%${keyword}%`) },
|
||||
{ posType: { posTypeName: Like(`%${keyword}%`)} },
|
||||
{ posLevel: { posLevelName: Like(`%${keyword}%`)} },
|
||||
],
|
||||
};
|
||||
}
|
||||
const [getFormula, total] = await this.salaryFormulaEmployeeRepository.findAndCount({
|
||||
relations: ["salaryEmployee", "posType", "posLevel", "salaryEmployeeMins"],
|
||||
where: {
|
||||
details: Like(`%${keyword}%`),
|
||||
position: Like(`%${keyword}%`),
|
||||
// posLevel: { posLevelName: keyword },
|
||||
posType: { posTypeName: Like(`%${keyword}%`) },
|
||||
// salaryEmployeeMins: { group: keyword },
|
||||
// salaryEmployee: { group: keyword },
|
||||
},
|
||||
...whereClause,
|
||||
order: {
|
||||
lastUpdatedAt: "DESC",
|
||||
},
|
||||
|
|
@ -245,16 +249,13 @@ export class SalaryFormulaEmployeeController extends Controller {
|
|||
|
||||
const mapFormula = getFormula.map((item) => ({
|
||||
id: item.id,
|
||||
// posLevelId: item.posLevelId,
|
||||
posLevel: item.posLevel != null ? item.posLevel.posLevelName : null,
|
||||
position: item.position, ////
|
||||
// posTypeId: item.posTypeId,
|
||||
position: item.position,
|
||||
posType: item.posType != null ? item.posType.posTypeName : null,
|
||||
details: item.details, ////
|
||||
salaryMin: item.salaryMin, //
|
||||
salary: item.salary, //
|
||||
salaryMax: item.salaryMax, //
|
||||
// salaryEmployeeId: item.salaryEmployeeId,
|
||||
details: item.details,
|
||||
salaryMin: item.salaryMin,
|
||||
salary: item.salary,
|
||||
salaryMax: item.salaryMax,
|
||||
group: item.salaryEmployee != null ? item.salaryEmployee.group : null,
|
||||
salaryEmployeeMin:
|
||||
item.salaryEmployeeMins != null ? item.salaryEmployeeMins.map((x) => x.group) : null,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue