2022-05-17 17:04:30 +08:00
|
|
|
<?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.hisense.monitormanage.mapper.BuildingRecordsMapper">
|
|
|
|
|
|
|
|
<insert id="batchSave" parameterType="java.util.List">
|
|
|
|
insert into t_building_records
|
|
|
|
(
|
|
|
|
project_name,build_license,push_time,appid,pm10,noice
|
|
|
|
)
|
|
|
|
values
|
|
|
|
<foreach collection="list" item="item" index="index" separator=",">
|
|
|
|
(
|
|
|
|
#{item.projectName},#{item.buildLicense},#{item.pushTime},#{item.appid},
|
|
|
|
#{item.pm10},#{item.noice}
|
|
|
|
)
|
|
|
|
</foreach>
|
|
|
|
</insert>
|
|
|
|
|
2022-06-01 14:27:34 +08:00
|
|
|
<update id="batchUpdate" parameterType="java.util.List">
|
|
|
|
<foreach collection="list" item="item" index="index" separator=";">
|
|
|
|
update t_building_records
|
|
|
|
<set>
|
|
|
|
project_name = #{item.projectName},
|
|
|
|
push_time = #{item.pushTime},
|
|
|
|
appid = #{item.appid},
|
|
|
|
pm10 = #{item.pm10},
|
|
|
|
noice = #{item.noice}
|
|
|
|
</set>
|
|
|
|
where build_license = #{item.buildLicense}
|
|
|
|
</foreach>
|
|
|
|
</update>
|
|
|
|
|
2022-06-27 09:18:23 +08:00
|
|
|
<select id="selectRaise" resultType="com.hisense.monitormanage.dto.BuildingRecordsDto">
|
|
|
|
select * from t_building_records br JOIN t_building_new_site bs
|
2022-07-04 16:19:51 +08:00
|
|
|
ON br.project_name = bs.gdmc where br.pm10 > 80
|
2022-06-27 09:18:23 +08:00
|
|
|
<bind name="page" value="(page-1)*pageSize"/>
|
|
|
|
limit #{page},#{pageSize}
|
|
|
|
</select>
|
|
|
|
|
2022-07-05 13:58:02 +08:00
|
|
|
<select id="selectNoiceEvent" resultType="com.hisense.monitormanage.dto.BuildingRecordsDto">
|
|
|
|
SELECT a.* 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
|
|
|
|
WHERE (hour(br.push_time)>=22 or 6 > hour(br.push_time)) AND br.noice > 55
|
|
|
|
UNION
|
|
|
|
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
|
|
|
|
WHERE DATE_FORMAT(br.push_time,'%H')>=6 AND DATE_FORMAT(br.push_time,'%H') <22 AND br.noice > 70) a
|
|
|
|
<bind name="page" value="(page-1)*pageSize"/>
|
|
|
|
limit #{page},#{pageSize}
|
|
|
|
</select>
|
|
|
|
|
2022-05-17 17:04:30 +08:00
|
|
|
</mapper>
|