2024-09-02 09:39:27 +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">
|
2025-07-17 15:26:39 +08:00
|
|
|
<mapper namespace="com.gunshi.project.hsz.mapper.StPptnRHMapper">
|
2024-09-02 09:39:27 +08:00
|
|
|
|
2025-07-17 15:26:39 +08:00
|
|
|
<select id="queryList" resultType="com.gunshi.project.hsz.model.StPptnRH">
|
2024-09-02 14:50:33 +08:00
|
|
|
select tm,drp from public.st_pptn_r_h where tm <![CDATA[>]]> #{start} and tm <![CDATA[<=]]> #{end}
|
2025-07-31 09:18:52 +08:00
|
|
|
and stcd = (select stcd from public.att_res_base where res_code = '42118130001')
|
2024-09-02 14:50:33 +08:00
|
|
|
order by tm asc
|
|
|
|
|
</select>
|
|
|
|
|
|
2025-07-17 15:26:39 +08:00
|
|
|
<select id="queryRzList" resultType="com.gunshi.project.hsz.entity.vo.StRzVo">
|
2024-09-02 14:50:33 +08:00
|
|
|
select tm,rz from public.st_rsvr_r where tm <![CDATA[>=]]> #{start} and tm <![CDATA[<]]> #{end}
|
|
|
|
|
and TRIM(TO_CHAR(tm, 'MI:SS')) = '00:00'
|
2025-07-31 09:18:52 +08:00
|
|
|
and stcd = (select stcd from public.att_res_base where res_code = '42118130001')
|
2024-09-02 14:50:33 +08:00
|
|
|
order by tm asc
|
|
|
|
|
</select>
|
2024-09-03 11:22:34 +08:00
|
|
|
|
2025-07-17 15:26:39 +08:00
|
|
|
<select id="queryDayDrp" resultType="com.gunshi.project.hsz.model.StPptnRD">
|
2024-09-03 11:22:34 +08:00
|
|
|
select tm,drp,TO_CHAR(tm, 'DD') as day,TO_CHAR(tm, 'MM') as month from public.st_pptn_r_d where year = #{year}
|
2025-07-31 09:18:52 +08:00
|
|
|
and stcd = (select stcd from public.att_res_base where res_code = '42118130001')
|
2024-09-03 11:22:34 +08:00
|
|
|
order by tm asc
|
|
|
|
|
</select>
|
2024-09-03 11:24:04 +08:00
|
|
|
|
2025-07-17 15:26:39 +08:00
|
|
|
<select id="reorganizePptnRHData" resultType="com.gunshi.project.hsz.model.StPptnRH">
|
2024-09-02 16:26:32 +08:00
|
|
|
SELECT h.stcd, h.hour_tm tm, h.drp
|
|
|
|
|
from (SELECT r.stcd,
|
|
|
|
|
DATE_TRUNC('hour', r.tm - INTERVAL '1 second') + INTERVAL '1 hour' AS hour_tm, SUM ( r.drp ) AS drp
|
|
|
|
|
FROM
|
|
|
|
|
st_pptn_r r
|
|
|
|
|
WHERE
|
|
|
|
|
r.stcd = #{stcd}
|
|
|
|
|
AND r.tm >= #{maxData.tm}
|
|
|
|
|
GROUP BY
|
|
|
|
|
r.stcd,
|
|
|
|
|
hour_tm
|
|
|
|
|
ORDER BY
|
|
|
|
|
hour_tm) h
|
|
|
|
|
</select>
|
|
|
|
|
|
2025-07-17 15:26:39 +08:00
|
|
|
<select id="getMaxData" resultType="com.gunshi.project.hsz.model.StPptnRH">
|
2024-09-23 13:52:16 +08:00
|
|
|
SELECT #{stcd} stcd, COALESCE(max(tm), '2021-01-01 00:00:00') tm, MAX ( chtm ) chtm FROM st_pptn_r_h WHERE stcd = #{stcd}
|
2024-09-02 16:26:32 +08:00
|
|
|
</select>
|
2024-09-03 15:43:05 +08:00
|
|
|
|
2025-07-17 15:26:39 +08:00
|
|
|
<select id="queryDayRz" resultType="com.gunshi.project.hsz.model.StPptnRD">
|
2024-09-03 15:43:05 +08:00
|
|
|
select tm,rz as drp,TO_CHAR(tm, 'DD') as day,TO_CHAR(tm, 'MM') as month from public.st_rsvr_r where TO_CHAR(tm, 'YYYY') = #{year}
|
|
|
|
|
and TRIM(TO_CHAR(tm, 'HH24:MI')) = '08:00'
|
2025-07-31 09:18:52 +08:00
|
|
|
and stcd = (select stcd from public.att_res_base where res_code = '42118130001')
|
2024-09-03 15:43:05 +08:00
|
|
|
order by tm asc
|
|
|
|
|
</select>
|
2024-09-02 09:39:27 +08:00
|
|
|
</mapper>
|