83 lines
3.7 KiB
Java
83 lines
3.7 KiB
Java
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.GateHisPageSo;
|
|
import com.gunshi.project.xyt.entity.vo.GateStautsVo;
|
|
import com.gunshi.project.xyt.entity.vo.GateValveOplogVo;
|
|
import com.gunshi.project.xyt.model.GateValveReal;
|
|
import org.apache.ibatis.annotations.Mapper;
|
|
import org.apache.ibatis.annotations.Param;
|
|
import org.apache.ibatis.annotations.Select;
|
|
|
|
import java.math.BigDecimal;
|
|
import java.util.List;
|
|
|
|
/**
|
|
* 描述: 闸阀开关表
|
|
* author: xusan
|
|
* date: 2024-07-08 15:44:07
|
|
*/
|
|
@Mapper
|
|
public interface GateValveRealMapper extends BaseMapper<GateValveReal> {
|
|
|
|
@Select("""
|
|
<script>
|
|
SELECT t.valve_code,t.valve_name,t.manual_operation,case when s.status = '100%' then '全开' when s.status = '0%' then '关' else s.status end as status,s.tm
|
|
FROM public.att_gate_valve t
|
|
LEFT JOIN public.gate_valve_real s ON t.valve_code = s.valve_code
|
|
order by t._order asc nulls last
|
|
</script>
|
|
""")
|
|
List<GateStautsVo> gateStatusList();
|
|
|
|
@Select("""
|
|
<script>
|
|
SELECT t.q FROM public.st_water_r_real t
|
|
where stcd = (select stcd from public.gate_valve_stbprp_rel where valve_code = #{valveCode})
|
|
</script>
|
|
""")
|
|
BigDecimal realQ(@Param("valveCode") String valveCode);
|
|
|
|
@Select("""
|
|
<script>
|
|
select t.valve_code,t.tm,t.op_content,t.op_user_name,
|
|
s.valve_name,case when t.status = '100%' then '全开' when t.status = '0%' then '关' else t.status end as status,
|
|
case when t.before_status = '100%' then '全开' when t.before_status = '0%' then '关' else t.before_status end as beforeStatus
|
|
from public.gate_valve_oplog t
|
|
left join public.att_gate_valve s on t.valve_code = s.valve_code
|
|
where 1=1
|
|
<if test="obj.valveCode != null">
|
|
and t.valve_code = #{obj.valveCode}
|
|
</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>
|
|
order by t.tm desc nulls last
|
|
</script>
|
|
""")
|
|
Page<GateValveOplogVo> logPage(Page<GateValveOplogVo> page,@Param("obj") GateHisPageSo so);
|
|
|
|
@Select("""
|
|
<script>
|
|
select t.valve_code,t.tm,t.op_content,t.op_user_name,
|
|
s.valve_name,case when t.status = '100%' then '全开' when t.status = '0%' then '关' else t.status end as status,
|
|
case when t.before_status = '100%' then '全开' when t.before_status = '0%' then '关' else t.before_status end as beforeStatus
|
|
from public.gate_valve_oplog t
|
|
left join public.att_gate_valve s on t.valve_code = s.valve_code
|
|
where t.valve_code = #{obj.valveCode}
|
|
<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 nulls last
|
|
</script>
|
|
""")
|
|
List<GateValveOplogVo> logList(@Param("obj") GateHisPageSo so);
|
|
} |