|
|
@ -119,3 +119,43 @@ |
|
|
|
ENDSELECT |
|
|
|
ENDQUERY |
|
|
|
ENDIF |
|
|
|
|
|
|
|
IF 输入.flag = "5" |
|
|
|
QUERY |
|
|
|
SELECT |
|
|
|
sd.create_time, |
|
|
|
mm.material_code, |
|
|
|
IF(LEFT(sd.point_code, 2) = 'YJ' ,CONCAT(sd.qty, '块'),CONCAT(sd.weight,'千克')) AS number |
|
|
|
FROM |
|
|
|
`st_ivt_vehicle_detail` sd |
|
|
|
LEFT JOIN md_me_materialbase mm ON mm.material_id = sd.material_id |
|
|
|
WHERE sd.point_code LIKE 'YJ%' OR sd.point_code LIKE 'HL%' |
|
|
|
ORDER BY sd.create_time DESC |
|
|
|
LIMIT 20 |
|
|
|
ENDSELECT |
|
|
|
ENDQUERY |
|
|
|
ENDIF |
|
|
|
IF 输入.flag = "6" |
|
|
|
QUERY |
|
|
|
SELECT |
|
|
|
dn.device_code, |
|
|
|
dn.failure_time, |
|
|
|
IF(ISNULL(dn.failure_info), '-', dn.failure_info) AS failure_info |
|
|
|
FROM |
|
|
|
`das_device_number` dn |
|
|
|
WHERE |
|
|
|
(dn.device_code, dn.failure_time) IN ( |
|
|
|
SELECT |
|
|
|
device_code, |
|
|
|
MAX(failure_time) AS latest_failure_time |
|
|
|
FROM |
|
|
|
`das_device_number` |
|
|
|
GROUP BY |
|
|
|
device_code |
|
|
|
) |
|
|
|
ORDER BY |
|
|
|
dn.failure_time DESC |
|
|
|
LIMIT 20; |
|
|
|
ENDSELECT |
|
|
|
ENDQUERY |
|
|
|
ENDIF |
|
|
|