|
@@ -26,6 +26,7 @@
|
|
|
<result property="locationTime" column="location_time" />
|
|
|
<result property="longitude" column="longitude" />
|
|
|
<result property="latitude" column="latitude" />
|
|
|
+ <result property="location" column="location" />
|
|
|
<result property="kwh" column="kwh"/>
|
|
|
</resultMap>
|
|
|
|
|
@@ -106,13 +107,21 @@
|
|
|
|
|
|
|
|
|
<select id="selectShipArchivesList" parameterType="shipArchivesREQ" resultMap="ShipResult">
|
|
|
- select archives.*,(CASE sta.is_online WHEN 'ONLINE' THEN 1 WHEN 'OFFLINE' THEN 2 WHEN 'MARK' THEN 3 END) as status,
|
|
|
- <!--dispose_temp.dispose_type as device_status,-->
|
|
|
- dept.pscmc as dept_name,location.longitude,location.latitude
|
|
|
- from ax_beidou_ship_archives archives
|
|
|
+ SELECT
|
|
|
+ archives.*,
|
|
|
+ ( CASE sta.is_online WHEN 'ONLINE' THEN 1 WHEN 'OFFLINE' THEN 2 WHEN 'MARK' THEN 3 ELSE 1 END ) AS STATUS,
|
|
|
+ ( CASE ISNULL(disp.dispose_type) WHEN 0 THEN disp.dispose_type WHEN 1 THEN 1 END) AS device_status,
|
|
|
+ dept.pscmc AS dept_name,
|
|
|
+ location.longitude,
|
|
|
+ location.latitude,
|
|
|
+ location.location,
|
|
|
+ location.kwh
|
|
|
+ FROM
|
|
|
+ ax_beidou_ship_archives archives
|
|
|
LEFT JOIN ax_beidou_ship_status sta ON archives.devide_no = sta.device_id
|
|
|
INNER JOIN ax_beidou_dept dept ON archives.police_station_id = dept.pscbh
|
|
|
- LEFT JOIN ax_beidou_ship_location location on archives.devide_no = location.device_id
|
|
|
+ LEFT JOIN ax_beidou_ship_location location ON archives.devide_no = location.device_id
|
|
|
+ LEFT JOIN ax_beidou_ship_dispose disp ON archives.devide_no = disp.devide_no
|
|
|
<!--LEFT JOIN (select devide_no,max(id) as id from ax_beidou_ship_dispose GROUP BY devide_no) as dispose on dispose.devide_no = archives.devide_no
|
|
|
LEFT JOIN ax_beidou_ship_dispose dispose_temp on dispose.id = dispose_temp.id-->
|
|
|
where
|