This commit is contained in:
wuweida 2022-08-16 11:00:12 +08:00
parent c9768455d2
commit 04ed4b710c
6 changed files with 107 additions and 107 deletions

View File

@ -3,11 +3,11 @@
<mapper namespace="com.hisense.monitormanage.mapper.BuildingRecordsMapper"> <mapper namespace="com.hisense.monitormanage.mapper.BuildingRecordsMapper">
<insert id="batchSave" parameterType="java.util.List"> <insert id="batchSave" parameterType="java.util.List">
insert into t_building_records INSERT INTO t_building_records
( (
project_name,build_license,push_time,appid,pm10,noice project_name,build_license,push_time,appid,pm10,noice
) )
values VALUES
<foreach collection="list" item="item" index="index" separator=","> <foreach collection="list" item="item" index="index" separator=",">
( (
#{item.projectName},#{item.buildLicense},#{item.pushTime},#{item.appid}, #{item.projectName},#{item.buildLicense},#{item.pushTime},#{item.appid},
@ -18,7 +18,7 @@
<update id="batchUpdate" parameterType="java.util.List"> <update id="batchUpdate" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" separator=";"> <foreach collection="list" item="item" index="index" separator=";">
update t_building_records UPDATE t_building_records
<set> <set>
project_name = #{item.projectName}, project_name = #{item.projectName},
push_time = #{item.pushTime}, push_time = #{item.pushTime},
@ -26,13 +26,13 @@
pm10 = #{item.pm10}, pm10 = #{item.pm10},
noice = #{item.noice} noice = #{item.noice}
</set> </set>
where build_license = #{item.buildLicense} WHERE build_license = #{item.buildLicense}
</foreach> </foreach>
</update> </update>
<select id="selectRaise" resultType="com.hisense.monitormanage.dto.BuildingRecordsDto"> <select id="selectRaise" resultType="com.hisense.monitormanage.dto.BuildingRecordsDto">
select * from t_building_records br JOIN t_building_new_site bs SELECT * FROM t_building_records br JOIN t_building_new_site bs
ON br.project_name = bs.gdmc where br.pm10 > 80 ORDER BY br.push_time DESC ON br.project_name = bs.gdmc WHERE br.pm10 > 80 ORDER BY br.push_time DESC
<bind name="page" value="(page-1)*pageSize"/> <bind name="page" value="(page-1)*pageSize"/>
limit #{page},#{pageSize} limit #{page},#{pageSize}
</select> </select>
@ -41,7 +41,7 @@
SELECT a.* FROM SELECT a.* FROM
(SELECT br.noice,br.push_time,br.project_name,bs.jd,bs.wd,bs.channel_name,bs.sgwz,bs.ssdq FROM (SELECT br.noice,br.push_time,br.project_name,bs.jd,bs.wd,bs.channel_name,bs.sgwz,bs.ssdq FROM
t_building_records br JOIN t_building_new_site bs ON br.project_name = bs.gdmc t_building_records br JOIN t_building_new_site bs ON br.project_name = bs.gdmc
WHERE (hour(br.push_time)>=22 or 6 > hour(br.push_time)) AND br.noice > 55 WHERE (HOUR(br.push_time)>=22 OR 6 > HOUR(br.push_time)) AND br.noice > 55
UNION UNION
SELECT br.noice,br.push_time,br.project_name,bs.jd,bs.wd,bs.channel_name,bs.sgwz,bs.ssdq FROM SELECT br.noice,br.push_time,br.project_name,bs.jd,bs.wd,bs.channel_name,bs.sgwz,bs.ssdq FROM
t_building_records br JOIN t_building_new_site bs ON br.project_name = bs.gdmc t_building_records br JOIN t_building_new_site bs ON br.project_name = bs.gdmc
@ -51,7 +51,7 @@
</select> </select>
<select id="selectByAllEvent" resultType="com.hisense.monitormanage.dto.EventDto"> <select id="selectByAllEvent" resultType="com.hisense.monitormanage.dto.EventDto">
select * from t_event te SELECT * FROM t_event te
JOIN t_scene_event tse ON te.camera_name = tse.channel_name JOIN t_scene_event tse ON te.camera_name = tse.channel_name
WHERE te.track_event = 'START' WHERE te.track_event = 'START'
<bind name="page" value="(page-1)*pageSize"/> <bind name="page" value="(page-1)*pageSize"/>
@ -59,98 +59,98 @@
</select> </select>
<select id="selectWeekPmAndNoice" resultType="com.hisense.monitormanage.dto.BuildingRecordsDtos"> <select id="selectWeekPmAndNoice" resultType="com.hisense.monitormanage.dto.BuildingRecordsDtos">
select a.pushTime,b.pm10,b.noice SELECT a.pushTime,b.pm10,b.noice
from ( FROM (
SELECT date_sub(curdate(), interval 1 day) as pushTime SELECT date_sub(curdate(), INTERVAL 1 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 2 day) as pushTime SELECT date_sub(curdate(), INTERVAL 2 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 3 day) as pushTime SELECT date_sub(curdate(), INTERVAL 3 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 4 day) as pushTime SELECT date_sub(curdate(), INTERVAL 4 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 5 day) as pushTime SELECT date_sub(curdate(), INTERVAL 5 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 6 day) as pushTime SELECT date_sub(curdate(), INTERVAL 6 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 7 day) as pushTime SELECT date_sub(curdate(), INTERVAL 7 DAY) AS pushTime
) a ) a
LEFT JOIN ( LEFT JOIN (
select DATE_FORMAT(br.push_time,'%Y%-%m-%d') pushTime,ROUND(AVG(br.pm10)) pm10,ROUND(AVG(br.noice)) noice SELECT DATE_FORMAT(br.push_time,'%Y%-%m-%d') pushTime,ROUND(AVG(br.pm10)) pm10,ROUND(AVG(br.noice)) noice
from t_building_records br JOIN t_building_new_site bns ON br.project_name = bns.gdmc FROM t_building_records br JOIN t_building_new_site bns ON br.project_name = bns.gdmc
WHERE br.build_license = #{buildLicense} WHERE br.build_license = #{buildLicense}
AND DATE_SUB(CURDATE(), INTERVAL 7 DAY) &lt; date(br.push_time) group by pushTime) b AND DATE_SUB(CURDATE(), INTERVAL 7 DAY) &lt; DATE(br.push_time) GROUP BY pushTime) b
ON a.pushTime = b.pushTime ORDER BY a.pushTime ON a.pushTime = b.pushTime ORDER BY a.pushTime
</select> </select>
<select id="selectMonthPmAndNoice" resultType="com.hisense.monitormanage.dto.BuildingRecordsDtos"> <select id="selectMonthPmAndNoice" resultType="com.hisense.monitormanage.dto.BuildingRecordsDtos">
select a.pushTime,b.pm10,b.noice SELECT a.pushTime,b.pm10,b.noice
from ( FROM (
SELECT date_sub(curdate(), interval 1 day) as pushTime SELECT date_sub(curdate(), INTERVAL 1 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 2 day) as pushTime SELECT date_sub(curdate(), INTERVAL 2 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 3 day) as pushTime SELECT date_sub(curdate(), INTERVAL 3 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 4 day) as pushTime SELECT date_sub(curdate(), INTERVAL 4 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 5 day) as pushTime SELECT date_sub(curdate(), INTERVAL 5 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 6 day) as pushTime SELECT date_sub(curdate(), INTERVAL 6 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 7 day) as pushTime SELECT date_sub(curdate(), INTERVAL 7 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 8 day) as pushTime SELECT date_sub(curdate(), INTERVAL 8 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 9 day) as pushTime SELECT date_sub(curdate(), INTERVAL 9 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 10 day) as pushTime SELECT date_sub(curdate(), INTERVAL 10 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 11 day) as pushTime SELECT date_sub(curdate(), INTERVAL 11 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 12 day) as pushTime SELECT date_sub(curdate(), INTERVAL 12 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 13 day) as pushTime SELECT date_sub(curdate(), INTERVAL 13 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 14 day) as pushTime SELECT date_sub(curdate(), INTERVAL 14 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 15 day) as pushTime SELECT date_sub(curdate(), INTERVAL 15 day) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 16 day) as pushTime SELECT date_sub(curdate(), INTERVAL 16 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 17 day) as pushTime SELECT date_sub(curdate(), INTERVAL 17 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 18 day) as pushTime SELECT date_sub(curdate(), INTERVAL 18 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 19 day) as pushTime SELECT date_sub(curdate(), INTERVAL 19 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 20 day) as pushTime SELECT date_sub(curdate(), INTERVAL 20 DAY) as pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 21 day) as pushTime SELECT date_sub(curdate(), INTERVAL 21 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 22 day) as pushTime SELECT date_sub(curdate(), INTERVAL 22 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 23 day) as pushTime SELECT date_sub(curdate(), INTERVAL 23 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 24 day) as pushTime SELECT date_sub(curdate(), INTERVAL 24 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 25 day) as pushTime SELECT date_sub(curdate(), INTERVAL 25 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 26 day) as pushTime SELECT date_sub(curdate(), INTERVAL 26 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 27 day) as pushTime SELECT date_sub(curdate(), INTERVAL 27 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 28 day) as pushTime SELECT date_sub(curdate(), INTERVAL 28 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 29 day) as pushTime SELECT date_sub(curdate(), INTERVAL 29 DAY) AS pushTime
union all UNION ALL
SELECT date_sub(curdate(), interval 30 day) as pushTime SELECT date_sub(curdate(), INTERVAL 30 DAY) AS pushTime
) a ) a
LEFT JOIN ( LEFT JOIN (
select DATE_FORMAT(br.push_time,'%Y%-%m-%d') pushTime,ROUND(AVG(br.pm10)) pm10,ROUND(AVG(br.noice)) noice SELECT DATE_FORMAT(br.push_time,'%Y%-%m-%d') pushTime,ROUND(AVG(br.pm10)) pm10,ROUND(AVG(br.noice)) noice
from t_building_records br JOIN t_building_new_site bns ON br.project_name = bns.gdmc FROM t_building_records br JOIN t_building_new_site bns ON br.project_name = bns.gdmc
WHERE br.build_license = #{buildLicense} WHERE br.build_license = #{buildLicense}
AND DATE_SUB(CURDATE(), INTERVAL 30 DAY) &lt; date(br.push_time) group by pushTime) b AND DATE_SUB(CURDATE(), INTERVAL 30 DAY) &lt; DATE(br.push_time) GROUP BY pushTime) b
ON a.pushTime = b.pushTime ORDER BY a.pushTime ON a.pushTime = b.pushTime ORDER BY a.pushTime
</select> </select>

View File

@ -3,22 +3,22 @@
<mapper namespace="com.hisense.monitormanage.mapper.CameraChannelMapper"> <mapper namespace="com.hisense.monitormanage.mapper.CameraChannelMapper">
<select id="selectAll" resultType="com.hisense.monitormanage.dto.CameraChannelDto"> <select id="selectAll" resultType="com.hisense.monitormanage.dto.CameraChannelDto">
select c.* from t_camera_channel c SELECT c.* FROM t_camera_channel c
where (c.gps_x NOT IN('0.0','0','','-1000.0') OR c.gps_y NOT IN('0.0','0','','-1000.0')) WHERE (c.gps_x NOT IN('0.0','0','','-1000.0') OR c.gps_y NOT IN('0.0','0','','-1000.0'))
AND c.status != 0 AND c.check_status != 0 AND c.status != 0 AND c.check_status != 0
</select> </select>
<update id="updateCameraStatus" parameterType="java.util.List"> <update id="updateCameraStatus" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" separator=";"> <foreach collection="list" item="item" index="index" separator=";">
update t_camera_channel set check_status = 0 UPDATE t_camera_channel SET check_status = 0
where channel_code = #{item,jdbcType=VARCHAR} WHERE channel_code = #{item,jdbcType=VARCHAR}
</foreach> </foreach>
</update> </update>
<select id="selectNLAll" resultType="com.hisense.monitormanage.dto.CameraChannelNLDto"> <select id="selectNLAll" resultType="com.hisense.monitormanage.dto.CameraChannelNLDto">
SELECT a.label_name,d.* from t_label a RIGHT JOIN (select b.label_code,c.* from t_camera_channel c SELECT a.label_name,d.* FROM t_label a RIGHT JOIN (SELECT b.label_code,c.* FROM t_camera_channel c
LEFT JOIN t_channel_mtm_label b on c.channel_code = b.channel_code) d LEFT JOIN t_channel_mtm_label b ON c.channel_code = b.channel_code) d
on d.label_code = a.label_code ON d.label_code = a.label_code
<bind name="page" value="(page-1)*pageSize"/> <bind name="page" value="(page-1)*pageSize"/>
limit #{page},#{pageSize} limit #{page},#{pageSize}
</select> </select>

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hisense.monitormanage.mapper.EventMapper"> <mapper namespace="com.hisense.monitormanage.mapper.EventMapper">
<select id="selectEvent" resultType="com.hisense.monitormanage.dto.EventDto"> <select id="selectEvent" resultType="com.hisense.monitormanage.dto.EventDto">
SELECT * FROM t_event where track_event = 'START' ORDER BY capture_time DESC SELECT * FROM t_event WHERE track_event = 'START' ORDER BY capture_time DESC
<if test="page!=null and '' != page and pageSize != null and '' != pageSize"> <if test="page!=null and '' != page and pageSize != null and '' != pageSize">
<bind name="page" value="(page-1)*pageSize"/> <bind name="page" value="(page-1)*pageSize"/>
limit #{page},#{pageSize} limit #{page},#{pageSize}
@ -10,7 +10,7 @@
</select> </select>
<select id="selectByName" resultType="com.hisense.monitormanage.dto.EventDto"> <select id="selectByName" resultType="com.hisense.monitormanage.dto.EventDto">
select * from t_event where track_event = 'START' and event_cn_name in (${eventNewName}) ORDER BY capture_time DESC SELECT * FROM t_event WHERE track_event = 'START' AND event_cn_name IN (${eventNewName}) ORDER BY capture_time DESC
<if test="page!=null and '' != page and pageSize != null and '' != pageSize"> <if test="page!=null and '' != page and pageSize != null and '' != pageSize">
<bind name="page" value="(page-1)*pageSize"/> <bind name="page" value="(page-1)*pageSize"/>
limit #{page},#{pageSize} limit #{page},#{pageSize}

View File

@ -15,11 +15,11 @@
</insert> </insert>
<select id="getByMaxId" resultType="com.hisense.monitormanage.entity.PassengerFlow"> <select id="getByMaxId" resultType="com.hisense.monitormanage.entity.PassengerFlow">
select * from t_passenger_flow ORDer by id desc limit 1 SELECT * FROM t_passenger_flow ORDER BY id DESC limit 1
</select> </select>
<select id="selectByTime" resultType="com.hisense.monitormanage.entity.PassengerFlow"> <select id="selectByTime" resultType="com.hisense.monitormanage.entity.PassengerFlow">
select * from t_passenger_flow where time_id = #{timeId} SELECT * FROM t_passenger_flow WHERE time_id = #{timeId}
</select> </select>
</mapper> </mapper>

View File

@ -17,13 +17,13 @@
</insert> </insert>
<select id="selectRoadData" resultType="com.hisense.monitormanage.entity.RoadData"> <select id="selectRoadData" resultType="com.hisense.monitormanage.entity.RoadData">
select * from t_road_data where pm10 > 150 order by dt desc SELECT * FROM t_road_data WHERE pm10 > 150 ORDER BY dt DESC
<bind name="page" value="(page-1)*pageSize"/> <bind name="page" value="(page-1)*pageSize"/>
limit #{page},#{pageSize} limit #{page},#{pageSize}
</select> </select>
<select id="getByMaxId" resultType="com.hisense.monitormanage.entity.RoadData"> <select id="getByMaxId" resultType="com.hisense.monitormanage.entity.RoadData">
select * from t_road_data ORDER BY id DESC limit 1 SELECT * FROM t_road_data ORDER BY id DESC limit 1
</select> </select>
</mapper> </mapper>

View File

@ -2,13 +2,13 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hisense.monitormanage.mapper.SanitationMapper"> <mapper namespace="com.hisense.monitormanage.mapper.SanitationMapper">
<insert id="batchSaveSanitationRoad" parameterType="java.util.List"> <insert id="batchSaveSanitationRoad" parameterType="java.util.List">
insert into t_sanitation_road INSERT INTO t_sanitation_road
(bh,dlmc,qdlkdlmc,zdlkdlmc,zcgdlxzc,bjdj,dlzd,dlkd,dlzmj,cxdmj,rxdmj,jsmj,ssmj, (bh,dlmc,qdlkdlmc,zdlkdlmc,zcgdlxzc,bjdj,dlzd,dlkd,dlzmj,cxdmj,rxdmj,jsmj,ssmj,
gycxmj,bjysl,gpxsl,ssqybh,ssjdbsc,sshwgsbh,zbjh,sfqy,bh1,dtdlhzkd, gycxmj,bjysl,gpxsl,ssqybh,ssjdbsc,sshwgsbh,zbjh,sfqy,bh1,dtdlhzkd,
zcgd,jsqz,cxqz,jj,tplj,zbdfxbz0zx1fx,fxzbxxid,ys,btmx,jsts,jspc, zcgd,jsqz,cxqz,jj,tplj,zbdfxbz0zx1fx,fxzbxxid,ys,btmx,jsts,jspc,
sfjs0bjs1js,sfss0bss1ss,sfcx0bcx1cx,sspc,cxpc,ssts,cxts,sfkh,updatetime sfjs0bjs1js,sfss0bss1ss,sfcx0bcx1cx,sspc,cxpc,ssts,cxts,sfkh,updatetime
) )
values VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
#{item.BH},#{item.DLMC},#{item.QDLKDLMC},#{item.ZDLKDLMC},#{item.ZCGDLXZC},#{item.BJDJ},#{item.DLZD}, #{item.BH},#{item.DLMC},#{item.QDLKDLMC},#{item.ZDLKDLMC},#{item.ZCGDLXZC},#{item.BJDJ},#{item.DLZD},
@ -23,11 +23,11 @@
</insert> </insert>
<insert id="batchSaveSanitationTask" parameterType="java.util.List"> <insert id="batchSaveSanitationTask" parameterType="java.util.List">
insert into t_sanitation_task INSERT INTO t_sanitation_task
(dlmc,ksdl,zzdl,ssqs,cph,zywcl,zyrq,zylx,zysj,zyts,zypc,zyzd, (dlmc,ksdl,zzdl,ssqs,cph,zywcl,zyrq,zylx,zysj,zyts,zypc,zyzd,
zykd,zymj,wzyds,zycsds,zygpsds,updatetime zykd,zymj,wzyds,zycsds,zygpsds,updatetime
) )
values VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
#{item.DLMC},#{item.KSDL},#{item.ZZDL},#{item.SSQS},#{item.CPH},#{item.ZYWCL}, #{item.DLMC},#{item.KSDL},#{item.ZZDL},#{item.SSQS},#{item.CPH},#{item.ZYWCL},