refs #6667 view workerDepartment
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Satorres 2024-01-19 10:11:33 +01:00
parent ccdef0458a
commit 0f104e5410
1 changed files with 3 additions and 9 deletions

View File

@ -43,19 +43,13 @@ module.exports = Self => {
const stmt = new ParameterizedSQL(` const stmt = new ParameterizedSQL(`
SELECT * SELECT *
FROM( FROM(
SELECT w.id, w.code, u.name, u.nickname, u.active, b.departmentFk SELECT w.id, w.code, u.name, u.nickname, u.active, wd.departmentFk
FROM worker w FROM worker w
JOIN account.user u ON u.id = w.id JOIN account.user u ON u.id = w.id
LEFT JOIN business b ON b.workerFk = w.id LEFT JOIN workerDepartment wd ON wd.workerFk = w.id
ORDER BY b.id DESC
LIMIT 10000000000000000000
) w`); ) w`);
stmt.merge(conn.makeSuffix(filter.fields)); stmt.merge(conn.makeSuffix(filter));
stmt.merge(conn.makeWhere(filter.where));
stmt.merge(conn.makeGroupBy('w.id'));
stmt.merge(conn.makeOrderBy(filter.order));
stmt.merge(conn.makeLimit(filter.limit));
return conn.executeStmt(stmt); return conn.executeStmt(stmt);
}; };