| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449 |
- <?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.welampiot.dao.VideoMonitorDao">
- <select id="getLampPoleCountByVO" resultType="int" parameterType="com.welampiot.vo.VideoMonitorVO">
- select count(*) from video_monitor
- where lamp_pole_id != 0
- <if test="sectionList != null and !sectionList.isEmpty()">
- and sectionid in
- <foreach item="vo" collection="sectionList" open="(" separator="," close=")">
- #{vo}
- </foreach>
- </if>
- </select>
- <select id="getLampPoleListByVO" resultType="com.welampiot.dto.VideoMonitorDTO" parameterType="com.welampiot.vo.VideoMonitorVO">
- select a.id,a.name,a.image,b.name as section,a.gb_address as gbAddress,b.pid as areaId
- <choose>
- <when test="version == 1">
- ,c.english_name as area
- ,d.english_name as city
- </when>
- <when test="version == 2">
- ,c.ru_name as area
- ,d.ru_name as city
- </when>
- <otherwise>
- ,c.chinese_name as area
- ,d.chinese_name as city
- </otherwise>
- </choose>
- from video_monitor a
- left join section b on a.sectionid = b.id
- left join global_location as c on c.id = b.pid
- left join global_location as d on d.id = c.pid
- where a.lamp_pole_id != 0
- <if test="sectionList != null and !sectionList.isEmpty()">
- and a.sectionid in
- <foreach item="vo" collection="sectionList" open="(" separator="," close=")">
- #{vo}
- </foreach>
- </if>
- <if test="netStatus != null">
- and a.netStatus = #{netStatus}
- </if>
- order by a.id desc
- <if test="offset != null and limit != null">
- limit #{offset},#{limit}
- </if>
- </select>
- <update id="setAIStatus" parameterType="VideoMonitorDTO">
- update
- video_monitor v
- set
- v.status = #{isInspect}
- where v.lamp_pole_id = #{lampPoleId}
- </update>
- <select id="getOneById" resultType="com.welampiot.dto.VideoMonitorDTO" parameterType="int">
- select a.gb_address as gbAddress,a.netStatus,id,name,status,deviceType,longitude,latitude,devid as devId,password from video_monitor a
- where a.id = #{id}
- </select>
- <select id="getListByVO" resultType="com.welampiot.dto.VideoMonitorDTO" parameterType="com.welampiot.vo.VideoMonitorVO">
- select id,name,image from video_monitor
- where lamp_pole_id = 0
- <if test="sectionList != null and !sectionList.isEmpty()">
- and sectionid in
- <foreach item="vo" collection="sectionList" open="(" separator="," close=")">
- #{vo}
- </foreach>
- </if>
- order by id desc
- <if test="offset != null and limit != null">
- limit #{offset},#{limit}
- </if>
- </select>
- <select id="getVideoListBySectionList" resultType="com.welampiot.dto.VideoMonitorDTO">
- select v.id,v.name,v.latitude,v.longitude,v.image
- from video_monitor v
- where 1=1
- <if test="sectionList != null and !sectionList.isEmpty()">
- and v.sectionid in
- <foreach collection="sectionList" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </select>
- <update id="changeVideoMonitorLocationById" parameterType="VideoMonitorDTO">
- update
- video_monitor v
- set
- v.longitude = #{longitude},
- v.latitude = #{latitude}
- where v.id = #{id}
- </update>
-
- <select id="getVideoInfoListByVO" resultType="VideoMonitorDTO">
- select
- v.id,v.lamp_pole_id as lampPoleId,v.name,v.netStatus,v.status,v.devid as devId,
- v.password,v.day_personCountTotal as dayPersonCountTotal,v.peopleCountTotal,
- v.`day_ carCountTotal` as dayCarCountTotal,v.carCountTotal,v.deviceType,
- v.type,v.net_type as netType,v.rtmp,v.rtmpHd,v.hlsHd,v.channel,v.lastTime,
- v.gb_address as gbAddress,v.gb_address2 as gbAddress2,v.install_date as installDate,
- v.expiration_date as expirationDate,lp.name as lampPoleName
- from video_monitor v
- left join lamp_pole lp on lp.id = v.lamp_pole_id
- where 1=1
- <if test="sectionList != null and !sectionList.isEmpty()">
- and v.sectionid in
- <foreach collection="sectionList" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="areaId != null and areaId != 0">
- and v.areaid = #{areaId}
- </if>
- <if test="sectionId != null and sectionId != 0">
- and v.sectionid = #{sectionId}
- </if>
- <if test="limit >= 0 and offset > 0">
- limit #{limit},#{offset}
- </if>
- </select>
- <select id="getVideoTotal" resultType="Integer">
- select
- count(*)
- from video_monitor v
- where 1=1
- <if test="sectionList != null and !sectionList.isEmpty()">
- and v.sectionid in
- <foreach collection="sectionList" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="areaId != null and areaId != 0">
- and v.areaid = #{areaId}
- </if>
- <if test="sectionId != null and sectionId != 0">
- and v.sectionid = #{sectionId}
- </if>
- </select>
- <select id="getVideoOnlineTotal" resultType="Integer">
- select
- count(*)
- from video_monitor v
- where v.netStatus = 1
- <if test="sectionList != null and !sectionList.isEmpty()">
- and v.sectionid in
- <foreach collection="sectionList" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="areaId != null and areaId != 0">
- and v.areaid = #{areaId}
- </if>
- <if test="sectionId != null and sectionId != 0">
- and v.sectionid = #{sectionId}
- </if>
- </select>
- <select id="getVideoUsableTotal" resultType="Integer">
- select
- count(*)
- from video_monitor v
- where v.netStatus = 1 and v.status = 0
- <if test="sectionList != null and !sectionList.isEmpty()">
- and v.sectionid in
- <foreach collection="sectionList" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="areaId != null and areaId != 0">
- and v.areaid = #{areaId}
- </if>
- <if test="sectionId != null and sectionId != 0">
- and v.sectionid = #{sectionId}
- </if>
- </select>
- <delete id="deleteVideoMonitorById">
- delete
- from video_monitor
- where id = #{id};
- </delete>
- <select id="getLampPoleIdByVideoMonitorId" resultType="Integer">
- select v.lamp_pole_id
- from video_monitor v
- where v.id = #{id}
- </select>
- <select id="getVideoCountByLampPoleId" resultType="Integer">
- select count(*)
- from video_monitor v
- where v.lamp_pole_id = #{lampPoleId}
- </select>
- <select id="getOneByDbAddress" resultType="com.welampiot.dto.VideoMonitorDTO" parameterType="String">
- select back_address as backAddress
- from video_monitor v
- where v.gb_address = #{gbAddress}
- </select>
- <update id="updateBackAddress" parameterType="VideoMonitorDTO">
- update
- video_monitor v
- set
- v.back_address = #{backAddress}
- where v.gb_address = #{gbAddress}
- </update>
- <select id="getVideoListBySectionId" resultType="VideoMonitorDTO">
- select v.id,v.name
- from video_monitor v
- where v.sectionid = #{sectionId}
- </select>
-
- <select id="getVideoListByVO" resultType="VideoMonitorDTO">
- select
- v.id,
- v.name,
- v.image,
- v.deviceType,
- v.devid as devId,
- v.netStatus,
- v.rtmp,
- v.rtmpHd,
- v.hlsHd,
- v.channel
- from video_monitor v
- where 1=1
- <if test="sectionList != null and !sectionList.isEmpty()">
- and v.sectionid in
- <foreach collection="sectionList" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="keyword != null and keyword != ''">
- and v.name like '%${keyword}%'
- </if>
- <if test="areaId != null and areaId != 0">
- and v.areaid = #{areaId}
- </if>
- <if test="sectionId != null and sectionId != 0">
- and v.sectionid = #{sectionId}
- </if>
- <if test="limit >= 0 and offset > 0">
- limit #{limit},#{offset}
- </if>
- </select>
- <select id="getOneByDevId" resultType="VideoMonitorDTO">
- select devid as devId,channel,deviceType,gb_address as gbAddress,net_type as netType,type
- from video_monitor
- where devid = #{devId}
- </select>
- <select id="getVideoMonitorDetailsById" resultType="VideoMonitorDTO">
- select
- v.id,
- v.name,
- v.longitude,
- v.latitude,
- v.deviceType,
- v.net_type as netType,
- v.areaid as areaId,
- v.sectionid as sectionId,
- v.devid as devId,
- v.password,
- v.channel,
- v.type,
- v.hls,
- v.hlsHd,
- v.rtmp,
- v.rtmpHd,
- v.install_date as installDate,
- v.expiration_date as expirationDate,
- s.name as section
- <choose>
- <when test="version == 0">
- ,gl.chinese_name as area
- </when>
- <when test="version == 1">
- ,gl.english_name as area
- </when>
- <otherwise>
- ,gl.ru_name as area
- </otherwise>
- </choose>
- from video_monitor v
- left join section s on s.id = v.sectionid
- left join global_location gl on s.pid = gl.id
- where v.id = #{id}
- </select>
- <insert id="addVideoMonitorData" parameterType="VideoMonitorDTO" keyProperty="id" useGeneratedKeys="true">
- insert into video_monitor(`name`,
- sectionid,
- areaid,
- createtime,
- devid,
- `password`,
- <if test="channel != null and channel != ''">
- `channel`,
- </if>
- type,
- <if test="longitude != null and longitude != ''">
- longitude,
- </if>
- <if test="latitude != null and latitude != ''">
- latitude,
- </if>
- <if test="netType != null">
- net_type,
- </if>
- <if test="installDate != null and installDate != ''">
- install_date,
- </if>
- <if test="expirationDate != null and expirationDate != ''">
- expiration_date,
- </if>
- deviceType)
- values (#{name},
- #{sectionId},
- #{areaId},
- #{createTime},
- #{devId},
- #{password},
- <if test="channel != null and channel != ''">
- #{channel},
- </if>
- #{type},
- <if test="longitude != null and longitude != ''">
- #{longitude},
- </if>
- <if test="latitude != null and latitude != ''">
- #{latitude},
- </if>
- <if test="netType != null">
- #{netType},
- </if>
- <if test="installDate != null and installDate != ''">
- #{installDate},
- </if>
- <if test="expirationDate != null and expirationDate != ''">
- #{expirationDate},
- </if>
- #{deviceType}
- )
- </insert>
- <update id="updateVideoMonitorData" parameterType="VideoMonitorDTO">
- update
- video_monitor v
- set
- v.name = #{name},
- <if test="longitude != null and longitude != ''">
- v.longitude = #{longitude},
- </if>
- <if test="latitude != null and latitude != ''">
- v.latitude = #{latitude},
- </if>
- <if test="netType != null">
- v.net_type = #{netType},
- </if>
- v.deviceType = #{deviceType}
- where
- v.id = #{id}
- </update>
- <select id="checkVideoDevId" resultType="Integer">
- select
- count(*)
- from video_monitor v
- where 1=1
- <if test="devId != null and devId != ''">
- and v.devid = #{devId}
- </if>
- <if test="id != null and id != 0">
- and v.id != #{id}
- </if>
- </select>
- <!-- 智诺云信息概览车流量,人流量 -->
- <select id="getTotalCarAndPeople" resultType="VideoMonitorDTO">
- select
- sum(v.peopleCountTotal) as peopleCountTotal,
- sum(v.carCountTotal) as carCountTotal
- from video_monitor v
- where 1=1
- <if test="sectionList != null and !sectionList.isEmpty()">
- and v.sectionid in
- <foreach collection="sectionList" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="areaId != null and areaId != 0">
- and v.areaid = #{areaId}
- </if>
- <if test="sectionId != null and sectionId != 0">
- and v.sectionid = #{sectionId}
- </if>
- </select>
- <select id="getVideoMonitorByLampPoleId" resultType="VideoMonitorDTO">
- select
- v.id as videoId,v.is_auto as isAuto,v.rtmpHd,v.rtmp,v.hls,v.hlsHd,
- v.deviceType,v.net_type as netType,v.devid as devId,v.channel,v.manCount,
- v.womanCount,v.peopleCountTotal,v.day_personCountTotal as personCountToday,
- v.age1Count,v.age2Count,v.age3Count,v.age4Count,v.age5Count,v.age6Count,
- v.age7Count,v.carCountTotal,v.`day_ carCountTotal` as carCountToday,v.image
- from video_monitor v
- where v.lamp_pole_id = #{lampPoleId}
- </select>
- <update id="updateIsAutoStatus" parameterType="VideoMonitorDTO">
- update
- video_monitor v
- set
- v.is_auto = #{isAuto}
- where v.id = #{id}
- </update>
- <select id="getDataList" resultType="VideoMonitorDTO" parameterType="EmergencyDTO">
- select id,name
- from video_monitor
- where lamp_pole_id != 0 and lamp_pole_id is not null and sectionid = #{sectionId}
- </select>
- <select id="getOneMonitor" resultType="VideoMonitorDTO" parameterType="HashMap">
- select id
- from video_monitor
- where areaid = #{areaId} and sectionid = #{sectionId}
- <choose>
- <when test="name != null and number == null">
- and name = #{name}
- </when>
- <when test="name == null and number != null">
- and name = #{number}
- </when>
- <otherwise>
- and (name = #{name} or name = #{number})
- </otherwise>
- </choose>
- </select>
- </mapper>
|