Stringsql="SELECT ID, TRACCAR_DEVICE_ID, DEVICE_ID, TENANT_ID, STATUS FROM DM_EXT_DEVICE_MAPPING WHERE " +
"DEVICE_ID = ? AND TENANT_ID = ? ORDER BY ID DESC LIMIT 1";
Stringsql="SELECT DM_EXT_DEVICE_MAPPING.ID, DM_EXT_DEVICE_MAPPING.TRACCAR_DEVICE_ID, DM_EXT_DEVICE_MAPPING.DEVICE_ID, DM_EXT_DEVICE_MAPPING.TENANT_ID, DM_EXT_DEVICE_MAPPING.STATUS FROM DM_EXT_DEVICE_MAPPING JOIN DM_DEVICE ON DM_EXT_DEVICE_MAPPING.DEVICE_ID=DM_DEVICE.ID WHERE " +
"DM_EXT_DEVICE_MAPPING.DEVICE_ID = ? AND DM_EXT_DEVICE_MAPPING.TENANT_ID = ? ORDER BY DM_EXT_DEVICE_MAPPING.ID DESC LIMIT 1";