Remove SCUM sqlite user projections

This commit is contained in:
npc0-hue
2026-09-14 13:41:44 +08:00
parent b1f102bafb
commit ecdca8e28b
76 changed files with 2264 additions and 1558 deletions
@@ -1,25 +0,0 @@
SELECT
CAST(spawner.vehicle_entity_id AS TEXT) AS vehicleId,
CAST(spawner.vehicle_entity_id AS TEXT) AS entityId,
entity.class AS className,
spawner.vehicle_alias AS label,
entity.location_x AS x,
entity.location_y AS y,
entity.location_z AS z,
strftime('%Y-%m-%dT%H:%M:%SZ', spawner.vehicle_last_access_time, 'unixepoch') AS lastAccessTime,
spawner.is_vehicle_functional AS isFunctional,
1 AS existsInGame,
group_concat(DISTINCT CAST(mount.prisoner_id AS TEXT)) AS mountedPrisonerIds,
group_concat(DISTINCT CAST(mounted_profile.id AS TEXT)) AS mountedUserProfileIds,
group_concat(DISTINCT mounted_profile.user_id) AS mountedSteamIds
FROM vehicle_spawner spawner
JOIN entity ON entity.id = spawner.vehicle_entity_id
LEFT JOIN prisoner_vehicle_mountee_info mount ON mount.vehicle_entity_id = spawner.vehicle_entity_id
LEFT JOIN prisoner mounted_prisoner ON mounted_prisoner.id = mount.prisoner_id
LEFT JOIN user_profile mounted_profile ON mounted_profile.prisoner_id = mounted_prisoner.id
WHERE (:vehicleId IS NULL OR CAST(spawner.vehicle_entity_id AS TEXT) = :vehicleId)
AND (:search IS NULL OR spawner.vehicle_alias LIKE '%' || :search || '%' OR entity.class LIKE '%' || :search || '%')
AND (:activeWithinSeconds IS NULL OR spawner.vehicle_last_access_time >= CAST(strftime('%s', 'now') AS INTEGER) - :activeWithinSeconds)
GROUP BY spawner.vehicle_entity_id
ORDER BY spawner.vehicle_last_access_time DESC
LIMIT COALESCE(:limit, 500)