123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.ozs.service.mapper.BaseCameraManagementMapper">
- <select id="selectCameraManagementList" resultType="com.ozs.service.entity.BaseCameraManagement" parameterType="com.ozs.service.entity.vo.BaseCameraManagementVo">
- SELECT
- a.id AS id,
- a.camera_code AS cameraCode,
- a.railway_code AS railwayCode,
- a.channel AS channel,
- a.dept_id AS deptId,
- a.line_dir AS lineDir,
- a.install_mile AS installMile,
- a.begin_mile AS beginMile,
- a.end_mile AS endMile,
- a.install_longitude AS installLongitude,
- a.install_latitude AS installLatitude,
- a.card_num AS cardNum,
- a.start_recording AS startRecording,
- a.task_id AS taskId,
- a.create_time AS createTime
- FROM
- base_camera_management a
- <where>
- <if test="railwayCode != null and railwayCode != ''">
- and a.railway_code=#{railwayCode}
- </if>
- <if test="lineDir != null and lineDir != 0">
- and a.line_dir =#{lineDir}
- </if>
- <if test="deptId != null and deptId != 0">
- and a.dept_id =#{deptId}
- </if>
- <if test="beginMile != null and beginMile != 0">
- and a.begin_mile >=#{beginMile}
- </if>
- <if test="endMile != null and endMile != 0">
- and a.end_mile <=#{endMile}
- </if>
- <if test="installMile != null and installMile != 0">
- and a.install_mile =#{installMile}
- </if>
- <if test="!dsFlay">
- and
- <trim prefix="(" prefixOverrides="or" suffix=")">
- <if test="dsUserId != null and dsUserId != ''">
- or a.create_by=#{dsUserId}
- </if>
- <if test="dsDeptId != null and dsDeptId != 0">
- or a.dept_id=#{dsDeptId}
- </if>
- <if test="dsDeptIds != null">
- or a.dept_id in
- <foreach item="item" collection="dsDeptIds" separator="," open="(" close=")" index="">
- #{item}
- </foreach>
- </if>
- </trim>
- </if>
- </where>
- </select>
- <select id="countCamera" parameterType="com.ozs.service.entity.vo.MsgAlarmVo" resultType="java.lang.Integer">
- select count(id) from base_camera_management
- <where>
- <if test="!dsFlay">
- and
- <trim prefix="(" prefixOverrides="or" suffix=")">
- <if test="dsUserId != null and dsUserId != ''">
- or create_by = #{dsUserId}
- </if>
- <if test="dsDeptId != null and dsDeptId != 0">
- or dept_id = #{dsDeptId}
- </if>
- <if test="dsDeptIds != null">
- or dept_id in
- <foreach item="item" collection="dsDeptIds" separator="," open="(" close=")" index="">
- #{item}
- </foreach>
- </if>
- </trim>
- </if>
- </where>
- </select>
- <select id="getCameraChannelByAlarmId" resultType="java.util.Map">
- select b.channel,
- b.camera_code as cameraCode,
- ma.is_lock as isLock,
- ma.released_time as releasedTime,
- ma.alarm_time as alarmTime
- from msg_alarm ma
- left join
- base_camera_management b on ma.camera_code = b.camera_code
- where ma.alarm_id = #{alarmId}
- </select>
- </mapper>
|