流量数据查询接口

master
wany 2024-01-30 19:03:33 +08:00
parent 35baafdfb2
commit d350eb591a
8 changed files with 72 additions and 10 deletions

View File

@ -3,11 +3,10 @@ package com.gunshi.project.xyt.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gunshi.core.result.R;
import com.gunshi.project.xyt.entity.vo.GateHistoryInfoVo;
import com.gunshi.project.xyt.model.StWaterQualityR;
import com.gunshi.project.xyt.service.GateService;
import com.gunshi.project.xyt.entity.vo.GateInfoVo;
import com.gunshi.project.xyt.entity.vo.StFlowRVo;
import com.gunshi.project.xyt.service.GateService;
import com.gunshi.project.xyt.so.GateHistoryPageSo;
import com.gunshi.project.xyt.so.WaterQualityPageSo;
import com.gunshi.project.xyt.validate.markers.QueryPage;
import com.gunshi.project.xyt.validate.markers.QueryTimeRange;
import io.swagger.v3.oas.annotations.Operation;
@ -50,4 +49,10 @@ public class GateController {
return R.ok(gateService.page(gateHistoryPageSo));
}
@Operation(summary = "流量计列表")
@GetMapping("/flow/list")
public R<List<StFlowRVo>> flowList() {
return R.ok(gateService.queryFlowList());
}
}

View File

@ -1,9 +1,6 @@
package com.gunshi.project.xyt.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gunshi.addressbook.entity.so.UamsOrgPageSo;
import com.gunshi.addressbook.entity.vo.UamsOrgFullInfoVo;
import com.gunshi.addressbook.model.UamsOrgB;
import com.gunshi.core.result.R;
import com.gunshi.project.xyt.entity.dto.StGateRepairRecordDto;
import com.gunshi.project.xyt.entity.vo.GateRepairDetailVo;
@ -58,7 +55,7 @@ public class GateRepairRecordController {
@Operation(summary = "根据recordId删除检修记录")
@Parameter(name = "recordId", description = "检修记录id")
@DeleteMapping("/delete")
@GetMapping("/delete")
public R<String> delete(@RequestParam("recordId") Long recordId){
return R.ok(gateRepairRecordService.deleteRecord(recordId));
}

View File

@ -1,6 +1,8 @@
package com.gunshi.project.xyt.entity.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@ -17,6 +19,7 @@ import java.util.Date;
public class GateInfoVo {
@Schema(description = "闸阀ID")
@JsonSerialize(using = ToStringSerializer.class)
private Long gateId;
@Schema(description = "闸阀名称")

View File

@ -0,0 +1,37 @@
package com.gunshi.project.xyt.entity.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gunshi.core.dateformat.DateFormatString;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
*
* Created by wanyan on 2024/1/26
*
* @author wanyan
* @version 1.0
*/
@Data
public class StFlowRVo {
@Schema(description = "测站编码")
private String stcd;
@Schema(description="测站名称")
private String stnm;
@Schema(description = "采集时间")
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
private Date tm;
@Schema(description = "通道")
private String chid;
@Schema(description = "小时流量")
private BigDecimal hq;
}

View File

@ -3,13 +3,14 @@ package com.gunshi.project.xyt.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gunshi.db.dao.IMapper;
import com.gunshi.project.xyt.entity.vo.GateHistoryInfoVo;
import com.gunshi.project.xyt.model.StGateB;
import java.util.List;
import com.gunshi.project.xyt.entity.vo.GateInfoVo;
import com.gunshi.project.xyt.entity.vo.StFlowRVo;
import com.gunshi.project.xyt.model.StGateB;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface StGateBMapper extends IMapper<StGateB> {
int batchInsert(@Param("list") List<StGateB> list);
@ -18,4 +19,6 @@ public interface StGateBMapper extends IMapper<StGateB> {
List<GateInfoVo> queryGateList();
Page<GateHistoryInfoVo> gateHistory(Page<Object> page,@Param("gateId") Long gateId,@Param("startTime") String startTime,@Param("endTime") String endTime);
List<StFlowRVo> queryFlowList();
}

View File

@ -3,6 +3,7 @@ package com.gunshi.project.xyt.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gunshi.project.xyt.entity.vo.GateHistoryInfoVo;
import com.gunshi.project.xyt.entity.vo.GateInfoVo;
import com.gunshi.project.xyt.entity.vo.StFlowRVo;
import com.gunshi.project.xyt.so.GateHistoryPageSo;
import java.util.List;
@ -28,4 +29,10 @@ public interface GateService {
* @return
*/
Page<GateHistoryInfoVo> page(GateHistoryPageSo gateHistoryPageSo);
/**
*
* @return
*/
List<StFlowRVo> queryFlowList();
}

View File

@ -5,6 +5,7 @@ import com.gunshi.db.dao.BaseOrderDao;
import com.gunshi.db.dto.DateTimeRangeSo;
import com.gunshi.project.xyt.entity.vo.GateHistoryInfoVo;
import com.gunshi.project.xyt.entity.vo.GateInfoVo;
import com.gunshi.project.xyt.entity.vo.StFlowRVo;
import com.gunshi.project.xyt.mapper.StGateBMapper;
import com.gunshi.project.xyt.model.StGateB;
import com.gunshi.project.xyt.service.GateService;
@ -55,4 +56,9 @@ public class GateServiceImpl extends BaseOrderDao<StGateBMapper, StGateB> implem
return stGateBMapper.gateHistory(gateHistoryPageSo.getPageSo().toPage(),gateHistoryPageSo.getGateId(),startTime,endTime);
}
@Override
public List<StFlowRVo> queryFlowList() {
return stGateBMapper.queryFlowList();
}
}

View File

@ -56,4 +56,8 @@
and a.TM <![CDATA[ <= ]]> #{endTime}
</if>
</select>
<select id="queryFlowList" resultType="com.gunshi.project.xyt.entity.vo.StFlowRVo">
select a.stcd,a.tm,a.chid,a.hq,b.stnm from ST_FLOW_R a
left join ST_STBPRP_B b on a.stcd = b.stcd
</select>
</mapper>