feat: refs #7119 add VehicleNotes model and update vehicle filter SQL query
gitea/salix/pipeline/pr-dev This commit looks good
Details
gitea/salix/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
68e42206c8
commit
bc495ed51e
|
@ -118,7 +118,7 @@ module.exports = Self => {
|
||||||
SELECT e.vehicleFk,
|
SELECT e.vehicleFk,
|
||||||
e.vehicleStateFk,
|
e.vehicleStateFk,
|
||||||
s.state,
|
s.state,
|
||||||
ROW_NUMBER() OVER (PARTITION BY e.vehicleFk ORDER BY e.started DESC) as rn
|
ROW_NUMBER() OVER (PARTITION BY e.vehicleFk ORDER BY e.started DESC) rn
|
||||||
FROM vehicleEvent e
|
FROM vehicleEvent e
|
||||||
LEFT JOIN vehicleState s ON e.vehicleStateFk = s.id
|
LEFT JOIN vehicleState s ON e.vehicleStateFk = s.id
|
||||||
) sub ON sub.vehicleFk = v.id AND sub.rn = 1
|
) sub ON sub.vehicleFk = v.id AND sub.rn = 1
|
||||||
|
|
|
@ -47,6 +47,9 @@
|
||||||
"VehicleEvent": {
|
"VehicleEvent": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
|
"VehicleNotes": {
|
||||||
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
"VehicleState": {
|
"VehicleState": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
"name": "VehicleNotes",
|
||||||
|
"base": "VnModel",
|
||||||
|
"options": {
|
||||||
|
"mysql": {
|
||||||
|
"table": "vehicleNotes"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "number",
|
||||||
|
"id": true
|
||||||
|
},
|
||||||
|
"vehicleFk": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"created": {
|
||||||
|
"type": "date"
|
||||||
|
},
|
||||||
|
"note": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"userFk": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"acls": [
|
||||||
|
{
|
||||||
|
"accessType": "READ",
|
||||||
|
"principalType": "ROLE",
|
||||||
|
"principalId": "delivery",
|
||||||
|
"permission": "ALLOW"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in New Issue