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,
|
||||
e.vehicleStateFk,
|
||||
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
|
||||
LEFT JOIN vehicleState s ON e.vehicleStateFk = s.id
|
||||
) sub ON sub.vehicleFk = v.id AND sub.rn = 1
|
||||
|
|
|
@ -47,6 +47,9 @@
|
|||
"VehicleEvent": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"VehicleNotes": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"VehicleState": {
|
||||
"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