|
@@ -58,7 +58,7 @@
|
|
|
select /*+ GROUP_OPT_FLAG(1)*/ id, camera_code, max(create_time) as createTime from skynet_heartbeat_log where camera_code = #{cameraCode}
|
|
|
</select>
|
|
|
<select id="cameraMangemnetList" resultType="com.ozs.entity.BaseCameraManagement" parameterType="com.ozs.entity.response.BaseCameraManagementReq">
|
|
|
- SELECT b1.id, b1.camera_code, b1.railway_code, b1.channel, b1.dept_id, b1.station_name, b1.line_dir,
|
|
|
+ SELECT /*+ GROUP_OPT_FLAG(1)*/ b1.id, b1.camera_code, b1.railway_code, b1.channel, b1.dept_id, b1.station_name, b1.line_dir,
|
|
|
b1.install_mile, b1.begin_mile, b1.end_mile, b1.install_longitude, b1.install_latitude, b1.task_id,
|
|
|
b1.monitoring_direction, b1.start_recording, b1.online, b1.url, b1.enable_or_not, b1.rtsp_url, b1.grou, b1.sort,
|
|
|
b1.graphics_card, b1.train_num, b1.ab_section, b1.create_by, b1.create_time, b1.update_by, b1.update_time,
|
|
@@ -68,11 +68,7 @@
|
|
|
WHERE b1.install_mile >= #{distance} AND b1.INSTALL_MILE <= #{installMile} AND b1.monitoring_direction
|
|
|
IN (1, 3) AND b1.railway_code = #{railwayCode}
|
|
|
AND b1.online = 2 AND b1.enable_or_not = 1
|
|
|
- AND NOT EXISTS (
|
|
|
- SELECT 1
|
|
|
- FROM base_camera_management b2
|
|
|
- WHERE b1.grou = b2.grou AND b1.sort > b2.sort
|
|
|
- )
|
|
|
+ GROUP BY b1.grou
|
|
|
ORDER BY b1.grou ASC, b1.sort ASC
|
|
|
LIMIT 2;
|
|
|
</if>
|
|
@@ -80,11 +76,7 @@
|
|
|
WHERE b1.install_mile >= #{installMile} AND b1.INSTALL_MILE <= #{distance} AND b1.monitoring_direction
|
|
|
IN (2, 3) AND b1.railway_code = #{railwayCode}
|
|
|
AND b1.online = 2 AND b1.enable_or_not = 1
|
|
|
- AND NOT EXISTS (
|
|
|
- SELECT 1
|
|
|
- FROM base_camera_management b2
|
|
|
- WHERE b1.grou = b2.grou AND b1.sort > b2.sort
|
|
|
- )
|
|
|
+ GROUP BY b1.grou
|
|
|
ORDER BY b1.grou desc, b1.sort desc
|
|
|
LIMIT 2;
|
|
|
</if>
|