闸阀关联所有视频点查询;根据闸阀编码查询实时流量
parent
b1ebf1b9ed
commit
a435775ffc
|
|
@ -74,8 +74,8 @@ public class GateValveCctvRelController {
|
|||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<GateValveCctvRel>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
public R<List<GateValveCctvRelVo>> list() {
|
||||
return R.ok(service.queryList());
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.gunshi.project.xyt.service.GateValveRealService;
|
|||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -14,6 +15,7 @@ import org.springframework.validation.annotation.Validated;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 闸阀开关表
|
||||
|
|
@ -55,6 +57,12 @@ public class GateValveRealController {
|
|||
return R.ok(service.gateStatusList());
|
||||
}
|
||||
|
||||
@Operation(summary = "通过闸阀查询实时流量")
|
||||
@GetMapping("/realQ")
|
||||
public R<BigDecimal> realQ(@RequestParam("valveCode") @Parameter(description = "闸阀编码") String valveCode) {
|
||||
return R.ok(service.realQ(valveCode));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<List<GateValveReal>> page() {
|
||||
|
|
|
|||
|
|
@ -34,4 +34,7 @@ public class GateValveCctvRelVo extends GateValveCctvRel {
|
|||
@Schema(description="摄像头名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description="类型(1球机 2枪机)")
|
||||
private Integer type;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 描述: 闸阀关联视频点
|
||||
* author: xusan
|
||||
|
|
@ -37,4 +39,14 @@ public interface GateValveCctvRelMapper extends BaseMapper<GateValveCctvRel> {
|
|||
</script>
|
||||
""")
|
||||
Page<GateValveCctvRelVo> pages(@Param("page") Page<GateValveCctvRel> page,@Param("obj") GateValveCctvRelPage obj);
|
||||
|
||||
@Select("""
|
||||
<script>
|
||||
select t.*,s.valve_name,m.name,m.type
|
||||
from public.gate_valve_cctv_rel t
|
||||
LEFT JOIN public.att_gate_valve s ON t.valve_code = s.valve_code
|
||||
LEFT JOIN public.att_cctv_base m ON t.index_code = m.index_code
|
||||
</script>
|
||||
""")
|
||||
List<GateValveCctvRelVo> queryList();
|
||||
}
|
||||
|
|
@ -4,8 +4,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
import com.gunshi.project.xyt.entity.vo.GateStautsVo;
|
||||
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;
|
||||
|
||||
/**
|
||||
|
|
@ -25,4 +27,12 @@ public interface GateValveRealMapper extends BaseMapper<GateValveReal> {
|
|||
</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);
|
||||
}
|
||||
|
|
@ -10,6 +10,8 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 描述: 闸阀关联视频点
|
||||
* author: xusan
|
||||
|
|
@ -24,6 +26,10 @@ public class GateValveCctvRelService extends ServiceImpl<GateValveCctvRelMapper,
|
|||
public Page<GateValveCctvRelVo> pages(GateValveCctvRelPage page){
|
||||
return getBaseMapper().pages(page.getPageSo().toPage(), page);
|
||||
}
|
||||
|
||||
public List<GateValveCctvRelVo> queryList() {
|
||||
return baseMapper.queryList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -32,6 +33,10 @@ public class GateValveRealService extends ServiceImpl<GateValveRealMapper, GateV
|
|||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public BigDecimal realQ(String valveCode) {
|
||||
return baseMapper.realQ(valveCode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue