gunshi-project-ss/src/main/java/com/gunshi/project/xyt/mapper/OsmoticPressRMapper.java

153 lines
6.6 KiB
Java
Raw Normal View History

2024-07-08 17:47:02 +08:00
package com.gunshi.project.xyt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gunshi.project.xyt.entity.so.OsmoticQueryPageSo;
2024-07-10 16:28:20 +08:00
import com.gunshi.project.xyt.entity.so.OsmoticQuerySo;
import com.gunshi.project.xyt.entity.vo.OsmoticValueVo;
import com.gunshi.project.xyt.entity.vo.StRzVo;
2024-07-08 17:47:02 +08:00
import com.gunshi.project.xyt.model.OsmoticPressR;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
2024-07-08 17:47:02 +08:00
2024-07-10 16:28:20 +08:00
import java.util.List;
2024-07-08 17:47:02 +08:00
/**
* :
* author: xusan
* date: 2024-07-08 15:44:07
*/
@Mapper
public interface OsmoticPressRMapper extends BaseMapper<OsmoticPressR> {
@Select("""
<script>
2024-07-10 13:16:22 +08:00
select t.*,m.profile_name
from public.osmotic_press_r t
2024-07-10 13:16:22 +08:00
left join public.osmotic_press_device s on t.station_code = s.station_code
left join public.att_dam_profile m on s.profile_code = m.profile_code
<where>
<if test="obj.stationCode != null and obj.stationCode !=''">
t.station_code =#{obj.stationCode}
</if>
<if test="obj.profileCode != null and obj.profileCode !=''">
2024-07-10 13:16:22 +08:00
s.profile_code =#{obj.profileCode}
</if>
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.start != null">
and t.tm <![CDATA[>=]]> #{obj.dateTimeRangeSo.start}
</if>
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.end != null">
and t.tm <![CDATA[<=]]> #{obj.dateTimeRangeSo.end}
</if>
</where>
order by t.tm,t.station_code desc
</script>
""")
Page<OsmoticPressR> queryPage(Page<OsmoticPressR> page,@Param("obj") OsmoticQueryPageSo osmoticQueryPageSo);
2024-07-10 16:28:20 +08:00
@Select("""
<script>
select to_char(t.tm,'YYYY-MM-DD') as tm,t.rz
from public.st_rsvr_r t
where to_char(t.tm, 'HH24:MI:SS') = '08:00:00'
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.start != null">
and t.tm <![CDATA[>=]]> #{obj.dateTimeRangeSo.start}
</if>
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.end != null">
and t.tm <![CDATA[<=]]> #{obj.dateTimeRangeSo.end}
</if>
order by t.tm desc
</script>
""")
List<StRzVo> queryRz(@Param("obj") OsmoticQuerySo osmoticQuerySo);
@Select("""
<script>
2024-07-12 14:32:30 +08:00
select t.station_code as stationCode,to_char(t.tm,'YYYY-MM-DD') as tm,
<if test = "obj.type == 1">
t.value from public.osmotic_press_r t
</if>
<if test = "obj.type == 2">
t.q as value from public.osmotic_flow_r t
</if>
where to_char(t.tm, 'HH24:MI:SS') = '08:00:00' and t.station_code in
2024-07-10 16:28:20 +08:00
<foreach collection="obj.stationCodes" item="code" separator="," open="(" close=")">
#{code}
</foreach>
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.start != null">
and t.tm <![CDATA[>=]]> #{obj.dateTimeRangeSo.start}
</if>
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.end != null">
and t.tm <![CDATA[<=]]> #{obj.dateTimeRangeSo.end}
</if>
order by t.tm desc
</script>
""")
List<OsmoticValueVo> queryValue(@Param("obj") OsmoticQuerySo osmoticQuerySo);
2024-07-11 10:58:35 +08:00
@Select("""
<script>
select to_char(t.tm,'YYYY-MM-DD HH24:MI:SS') as tm,t.rz
from public.st_rsvr_r t
<where>
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.start != null">
t.tm <![CDATA[>=]]> #{obj.dateTimeRangeSo.start}
</if>
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.end != null">
and t.tm <![CDATA[<=]]> #{obj.dateTimeRangeSo.end}
</if>
</where>
order by t.tm desc
</script>
""")
2024-07-12 11:21:22 +08:00
List<StRzVo> queryLineRz(@Param("obj") OsmoticQuerySo osmoticQuerySo);
2024-07-11 10:58:35 +08:00
@Select("""
<script>
select t.station_code as stationCode,to_char(t.tm,'YYYY-MM-DD HH24:MI:SS') as tm,t.value
from public.osmotic_press_r t
where station_code in
2024-07-12 11:21:22 +08:00
<foreach collection="obj.stationCodes" item="code" separator="," open="(" close=")">
2024-07-11 10:58:35 +08:00
#{code}
</foreach>
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.start != null">
and t.tm <![CDATA[>=]]> #{obj.dateTimeRangeSo.start}
</if>
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.end != null">
and t.tm <![CDATA[<=]]> #{obj.dateTimeRangeSo.end}
</if>
order by t.tm desc
</script>
""")
2024-07-12 11:21:22 +08:00
List<OsmoticValueVo> queryLineValue(@Param("obj") OsmoticQuerySo osmoticQuerySo);
2024-07-11 10:58:35 +08:00
@Select("""
<script>
select t.station_code as stationCode,to_char(t.tm,'YYYY-MM-DD HH24:MI:SS') as tm
from public.osmotic_warn_r t
where station_code in
2024-07-12 11:21:22 +08:00
<foreach collection="obj.stationCodes" item="code" separator="," open="(" close=")">
2024-07-11 10:58:35 +08:00
#{code}
</foreach>
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.start != null">
and t.tm <![CDATA[>=]]> #{obj.dateTimeRangeSo.start}
</if>
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.end != null">
and t.tm <![CDATA[<=]]> #{obj.dateTimeRangeSo.end}
</if>
order by t.tm desc
</script>
""")
2024-07-12 11:21:22 +08:00
List<OsmoticValueVo> queryWarn(@Param("obj") OsmoticQuerySo osmoticQuerySo);
@Select("""
<script>
select to_char(t.tm,'YYYY-MM-DD') as tm,t.drp as rz
from public.st_pptn_r_d t
where t.year = #{year} and t.stcd = '2'
order by t.tm desc
</script>
""")
List<StRzVo> queryDrp(@Param("year") Integer year);
2024-07-08 17:47:02 +08:00
}