Commit 61dc63a2 authored by wujiang's avatar wujiang

添加告警工程

parent d4ce013e
<?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.yeejoin.amos.boot.module.hygf.api.mapper.JpPersonStationMapper">
</mapper>
<?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.yeejoin.amos.boot.module.hygf.api.tdenginemapper.AllPowerMapper">
</mapper>
<?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.yeejoin.amos.boot.module.hygf.api.tdenginemapper.DayPowerMapper">
</mapper>
<?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.yeejoin.amos.boot.module.hygf.api.tdenginemapper.JpCollectorHistoryAllMapper">
</mapper>
<?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.yeejoin.amos.boot.module.hygf.api.tdenginemapper.JpCollectorHistoryMonthMapper">
</mapper>
<?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.yeejoin.amos.boot.module.hygf.api.tdenginemapper.JpCollectorHistoryYearMapper">
</mapper>
<?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.yeejoin.amos.boot.module.hygf.api.tdenginemapper.JpInvertorElecHistoryAllMapper">
</mapper>
<?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.yeejoin.amos.boot.module.hygf.api.tdenginemapper.JpInvertorElecHistoryMonthMapper">
</mapper>
<?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.yeejoin.amos.boot.module.hygf.api.tdenginemapper.JpInvertorElecHistoryYearMapper">
</mapper>
<?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.yeejoin.amos.boot.module.hygf.api.tdenginemapper.MonthPowerMapper">
<select id="getMonthPowerint" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.MonthPower">
SELECT
avg(power) power,
third_station_id thirdStationId
FROM house_pv_data.td_hygf_jp_station_power_history where created_time <![CDATA[>=]]> today()-8h and created_time <![CDATA[<]]> today()+1d-8h GROUP BY third_station_id
</select>
<select id="getSumMonthPower" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.YearPower">
SELECT
sum(power) power,
tation_id thirdStationId
FROM house_pv_data.td_hygf_month_power where year_month=#{date} GROUP BY tation_id
</select>
<select id="getSumYearPower" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.AllPower">
SELECT
sum(power) power,
tation_id thirdStationId
FROM house_pv_data.td_hygf_year_power where year=#{date} GROUP BY tation_id
</select>
<select id="getDayPower" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerCurveDto">
SELECT
sum(power)num,
`time` date
FROM house_pv_data.td_hygf_jp_station_power_history where third_station_id in
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
and `time` <![CDATA[>=]]> #{startTime} and `time` <![CDATA[<]]> #{endTime}
GROUP BY `time`
</select>
<select id="getMonthPower" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerCurveDto">
SELECT
sum(power)num,
`day` date
FROM house_pv_data.td_hygf_month_power where tation_id in
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
and year_month = #{date}
GROUP BY `day`
</select>
<select id="getYearPower" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerCurveDto">
SELECT
sum(power)num,
`month` date
FROM house_pv_data.td_hygf_year_power where tation_id in
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
and `year` = #{date}
GROUP BY `month`
</select>
<select id="getAllPower" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerCurveDto">
SELECT
sum(power)num,
`year` date
FROM house_pv_data.td_hygf_all_power where tation_id in
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
GROUP BY `year`
</select>
<select id="getDayPowercount" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerCurveDto">
SELECT
sum(power)num,
`hour` date
FROM house_pv_data.td_hygf_day_power where tation_id in
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
and year_month_day = #{date}
GROUP BY `hour`
</select>
</mapper>
<?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.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpCollectorHistoryMapper">
<select id="dayList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpCollectorHistoryDto">
SELECT * FROM house_pv_data.td_hygf_jp_collector_history
<where>
<if test="snCode!=null">
AND `sn_code` = #{snCode}
</if>
<if test="thirdStationId!=null">
AND `third_station_id` = #{thirdStationId}
</if>
<if test="startTime!=null and endTime!=null">
AND time &gt;= #{startTime} AND time &lt;= #{endTime}
</if>
</where>
</select>
<select id="monthList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorHistoryMonthDto">
SELECT * FROM house_pv_data.td_hygf_jp_collector_history_month
<where>
<if test="snCode!=null">
AND `sn_code` = #{snCode}
</if>
<if test="thirdStationId!=null">
AND `third_station_id` = #{thirdStationId}
</if>
<if test="month!=null">
AND year_month = #{month}
</if>
</where>
</select>
<select id="yearList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorHistoryYearDto">
SELECT * FROM house_pv_data.td_hygf_jp_collector_history_year
<where>
<if test="snCode!=null">
AND `sn_code` = #{snCode}
</if>
<if test="thirdStationId!=null">
AND `third_station_id` = #{thirdStationId}
</if>
<if test="year!=null">
AND year = #{year}
</if>
</where>
</select>
<select id="allList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorHistoryAllDto">
SELECT * FROM house_pv_data.td_hygf_jp_collector_history_all
<where>
<if test="snCode!=null">
AND `sn_code` = #{snCode}
</if>
<if test="thirdStationId!=null">
AND `third_station_id` = #{thirdStationId}
</if>
</where>
</select>
<select id="dayToMonth" resultType="Map">
SELECT sn_code,AVG(signal_strength) AS signal_strength,third_station_id,third_code FROM house_pv_data.td_hygf_jp_collector_history
<where>
<if test="startTime!=null and endTime!=null">
AND time &gt;= #{startTime} AND time &lt;= #{endTime}
</if>
</where>
GROUP BY sn_code,third_station_id,third_code
</select>
<select id="monthToYear" resultType="Map">
SELECT sn_code,AVG(signal_strength) AS signal_strength,third_station_id,third_code FROM house_pv_data.td_hygf_jp_collector_history_month
<where>
<if test="month!=null">
AND year_month = #{month}
</if>
</where>
GROUP BY sn_code,third_station_id,third_code
</select>
<select id="yearToAll" resultType="Map">
SELECT sn_code,AVG(signal_strength) AS signal_strength,third_station_id,third_code FROM house_pv_data.td_hygf_jp_collector_history_year
<where>
<if test="year!=null">
AND year = #{year}
</if>
</where>
GROUP BY sn_code,third_station_id,third_code
</select>
<insert id="updateMonth">
INSERT INTO house_pv_data.td_hygf_jp_collector_history_month VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{item.created_time},#{item.sn_code},#{item.signal_strength},#{item.third_station_id},#{item.third_code},#{item.day},#{item.year_month})
</foreach>
</insert>
<insert id="updateYear">
INSERT INTO house_pv_data.td_hygf_jp_collector_history_year VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{item.created_time},#{item.sn_code},#{item.signal_strength},#{item.third_station_id},#{item.third_code},#{item.month},#{item.year})
</foreach>
</insert>
<insert id="updateAll">
INSERT INTO house_pv_data.td_hygf_jp_collector_history_all VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{item.created_time},#{item.sn_code},#{item.signal_strength},#{item.third_station_id},#{item.third_code},#{item.year})
</foreach>
</insert>
</mapper>
<?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.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInverterHistoryMapper">
<select id="sum" resultType="Map">
SELECT sum(power_generation) AS power,sum(daily_return) AS dailyReturn,sum(generation_hours) AS hours FROM house_pv_data.td_hygf_jp_inverter_history
<where>
<if test="snCode!=null">
AND `sn_code` = #{snCode}
</if>
<if test="thirdStationId!=null">
AND `third_station_id` = #{thirdStationId}
</if>
<if test="date!=null">
AND `date` LIKE #{date}
</if>
</where>
</select>
</mapper>
<?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.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInverterWarnMapper">
<select id="getCountTdHygfJpInverterWarn" resultType="map">
SELECT `state`,count(`state`) num
FROM house_pv_data.td_hygf_jp_inverter_warn
<where>
<if test="dto!=null">
third_station_id in
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")">
#{item.thirdStationId}
</foreach>
</if>
and `state` in ('未处理','已处理','已恢复')
</where>
GROUP BY `state`
</select>
<select id="list" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto">
SELECT * FROM house_pv_data.td_hygf_jp_inverter_warn
<where>
<if test="param.states!=null">
AND `state` IN
<foreach collection="param.states" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.stationIds!=null">
AND third_station_id IN
<foreach collection="param.stationIds" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
<select id="getByTime" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto">
SELECT * FROM house_pv_data.td_hygf_jp_inverter_warn
<where>
<if test="createdTime!=null">
AND created_time = #{createdTime}
</if>
</where>
</select>
</mapper>
<?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.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInvertorElecHistoryMapper">
<select id="dayList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInvertorElecHistoryDto">
SELECT * FROM house_pv_data.td_hygf_jp_invertor_elec_history
<where>
<if test="snCode!=null">
AND `sn_code` = #{snCode}
</if>
<if test="thirdStationId!=null">
AND `third_station_id` = #{thirdStationId}
</if>
<if test="startTime!=null and endTime!=null">
AND time BETWEEN #{startTime} AND #{endTime}
</if>
</where>
</select>
<select id="monthList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryMonthDto">
SELECT * FROM house_pv_data.td_hygf_jp_invertor_elec_history_month
<where>
<if test="snCode!=null">
AND `sn_code` = #{snCode}
</if>
<if test="thirdStationId!=null">
AND `third_station_id` = #{thirdStationId}
</if>
<if test="month!=null">
AND year_month = #{month}
</if>
</where>
</select>
<select id="yearList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryYearDto">
SELECT * FROM house_pv_data.td_hygf_jp_invertor_elec_history_year
<where>
<if test="snCode!=null">
AND `sn_code` = #{snCode}
</if>
<if test="thirdStationId!=null">
AND `third_station_id` = #{thirdStationId}
</if>
<if test="year!=null">
AND year = #{year}
</if>
</where>
</select>
<select id="allList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryAllDto">
SELECT * FROM house_pv_data.td_hygf_jp_invertor_elec_history_all
<where>
<if test="snCode!=null">
AND `sn_code` = #{snCode}
</if>
<if test="thirdStationId!=null">
AND `third_station_id` = #{thirdStationId}
</if>
</where>
</select>
<select id="dayToMonth" resultType="Map">
SELECT sn_code,AVG(u_ac_voltage) AS u_ac_voltage,AVG(v_ac_voltage) AS v_ac_voltage,AVG(w_ac_voltage) AS w_ac_voltage,
AVG(u_ac_current) AS u_ac_current,AVG(v_ac_current) AS v_ac_current,AVG(w_ac_current) AS w_ac_current,third_station_id,third_code FROM house_pv_data.td_hygf_jp_invertor_elec_history
<where>
<if test="startTime!=null and endTime!=null">
AND time &gt;= #{startTime} AND time &lt;= #{endTime}
</if>
</where>
GROUP BY sn_code,third_station_id,third_code
</select>
<select id="monthToYear" resultType="Map">
SELECT sn_code,AVG(u_ac_voltage) AS u_ac_voltage,AVG(v_ac_voltage) AS v_ac_voltage,AVG(w_ac_voltage) AS w_ac_voltage,
AVG(u_ac_current) AS u_ac_current,AVG(v_ac_current) AS v_ac_current,AVG(w_ac_current) AS w_ac_current,third_station_id,third_code FROM house_pv_data.td_hygf_jp_invertor_elec_history_month
<where>
<if test="month!=null">
AND year_month = #{month}
</if>
</where>
GROUP BY sn_code,third_station_id,third_code
</select>
<select id="yearToAll" resultType="Map">
SELECT sn_code,AVG(u_ac_voltage) AS u_ac_voltage,AVG(v_ac_voltage) AS v_ac_voltage,AVG(w_ac_voltage) AS w_ac_voltage,
AVG(u_ac_current) AS u_ac_current,AVG(v_ac_current) AS v_ac_current,AVG(w_ac_current) AS w_ac_current,third_station_id,third_code FROM house_pv_data.td_hygf_jp_invertor_elec_history_year
<where>
<if test="year!=null">
AND year = #{year}
</if>
</where>
GROUP BY sn_code,third_station_id,third_code
</select>
<insert id="updateMonth">
INSERT INTO house_pv_data.td_hygf_jp_invertor_elec_history_month VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{item.created_time},#{item.sn_code},#{item.u_ac_voltage},#{item.v_ac_voltage},#{item.w_ac_voltage},
#{item.u_ac_current},#{item.v_ac_current},#{item.w_ac_current},#{item.third_station_id},#{item.third_code},#{item.day},#{item.year_month})
</foreach>
</insert>
<insert id="updateYear">
INSERT INTO house_pv_data.td_hygf_jp_invertor_elec_history_year VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{item.created_time},#{item.sn_code},#{item.u_ac_voltage},#{item.v_ac_voltage},#{item.w_ac_voltage},
#{item.u_ac_current},#{item.v_ac_current},#{item.w_ac_current},#{item.third_station_id},#{item.third_code},#{item.month},#{item.year})
</foreach>
</insert>
<insert id="updateAll">
INSERT INTO house_pv_data.td_hygf_jp_invertor_elec_history_all VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{item.created_time},#{item.sn_code},#{item.u_ac_voltage},#{item.v_ac_voltage},#{item.w_ac_voltage},
#{item.u_ac_current},#{item.v_ac_current},#{item.w_ac_current},#{item.third_station_id},#{item.third_code},#{item.year})
</foreach>
</insert>
</mapper>
<?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.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpStationPowerHistoryMapper">
<select id="getCountTdHygfJpInverterWarn" resultType="map">
SELECT AVG(power) acgNum FROM house_pv_data.td_hygf_jp_station_power_history WHERE created_time > #{date} INTERVAL(1d);
</select>
</mapper>
<?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.yeejoin.amos.boot.module.hygf.api.tdenginemapper.YearPowerMapper">
</mapper>
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment