feat: refs #7119 add VehicleState model with data source configuration #3328

Merged
jorgep merged 37 commits from 7119-createVehicle into dev 2025-02-06 09:24:11 +00:00
2 changed files with 9 additions and 5 deletions
Showing only changes of commit 3fba81b41e - Show all commits

View File

@ -69,13 +69,14 @@ module.exports = Self => {
switch (param) {
case 'search':
return {or: [{'v.id': value}, {numberPlate: {like: `%${value}%`}}]};
case 'id':
return {'v.id': value};
case 'description':
case 'tradeMark':
case 'numberPlate':
case 'chassis':
case 'leasing':
return {[param]: {like: `%${value}%`}};
case 'id':
case 'companyFk':
case 'warehouseFk':
case 'countryCodeFk':
@ -83,9 +84,9 @@ module.exports = Self => {
case 'vehicleTypeFk':
return {[param]: value};
}
}) || {};
});
const myFilter = mergeFilters(filter, {where});
filter = mergeFilters(filter, {where});
const stmt = new ParameterizedSQL(`
SELECT v.id,
@ -116,9 +117,9 @@ module.exports = Self => {
) sub ON sub.vehicleFk = v.id AND sub.rn = 1
`);
const sqlWhere = conn.makeWhere(myFilter.where);
const sqlWhere = conn.makeWhere(filter.where);
stmt.merge(sqlWhere);
stmt.merge(conn.makePagination(myFilter));
stmt.merge(conn.makePagination(filter));
const sql = ParameterizedSQL.join([stmt], ';');

View File

@ -13,6 +13,9 @@
},
"ref": {
"type": "string"
},
"dmsFk": {
"type": "number"
}
}
}