|
@@ -71,12 +71,16 @@
|
|
|
<select id="selectList" parameterType="focusShipReq" resultMap="focusShipDetail">
|
|
|
select focus.user_id,focus.focus_id,focus.focus_type,focus.create_time as focus_create,dept.pscmc as dept_name,
|
|
|
(CASE st.is_online WHEN 'ONLINE' THEN 1 WHEN 'OFFLINE' THEN 2 WHEN 'MARK' THEN 3 ELSE 1 END ) AS STATUS,
|
|
|
- location.kwh,location.location,archives.*
|
|
|
+ location.kwh,location.location,
|
|
|
+ IFNULL(dispose_temp.dispose_type,'0') as device_status,
|
|
|
+ archives.*
|
|
|
from ax_beidou_ship_archives archives
|
|
|
INNER JOIN ax_beidou_focus_ship focus on archives.devide_no = focus.devide_no
|
|
|
INNER JOIN ax_beidou_dept dept on archives.police_station_id = dept.pscbh
|
|
|
LEFT JOIN ax_beidou_ship_status st on st.device_id = focus.devide_no
|
|
|
LEFT JOIN ax_beidou_ship_location location on focus.devide_no = location.device_id
|
|
|
+ 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 1=1
|
|
|
<if test="shipId != null and shipId != ''">and (archives.ship_id like concat('%', #{shipId},'%') or archives.devide_no like concat('%', #{shipId},'%'))</if>
|
|
|
<if test="deptId != null and deptId != ''">and dept.xw_dept_id like concat('%',#{deptId},'%')</if>
|
|
@@ -97,4 +101,8 @@
|
|
|
where focus.user_id = #{userId} order by focus.create_time desc
|
|
|
</select>
|
|
|
|
|
|
+ <select id="getDeviceByFocusId" parameterType="long" resultType="long">
|
|
|
+ select devide_no from ax_beidou_focus_ship where focus_id = #{focusId}
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|