水库-图片信息
parent
ce25fdfc76
commit
7b198a7ffd
|
|
@ -1,15 +1,18 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.annotation.Get;
|
||||
import com.gunshi.core.annotation.Post;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.xyt.entity.so.DataQueryCommonSo;
|
||||
import com.gunshi.project.xyt.entity.so.PicQuerySo;
|
||||
import com.gunshi.project.xyt.entity.so.ReservoirWaterCommonSo;
|
||||
import com.gunshi.project.xyt.entity.vo.AttResBaseVo;
|
||||
import com.gunshi.project.xyt.entity.vo.AttResMonitorVo;
|
||||
import com.gunshi.project.xyt.entity.vo.AttRvMonitorDetailVo;
|
||||
import com.gunshi.project.xyt.entity.vo.StRsvrVo;
|
||||
import com.gunshi.project.xyt.model.StImgR;
|
||||
import com.gunshi.project.xyt.model.StImgRReal;
|
||||
import com.gunshi.project.xyt.model.StStbprpB;
|
||||
import com.gunshi.project.xyt.service.ReservoirWaterService;
|
||||
|
|
@ -55,6 +58,11 @@ public class ReservoirWaterController {
|
|||
return R.ok(reservoirWaterService.channel(resCode));
|
||||
}
|
||||
|
||||
@Post(path = "/image/info", summary = "图片信息")
|
||||
public R<Page<StImgR>> imageInfo(@RequestBody @Validated PicQuerySo picQuerySo) {
|
||||
return R.ok(reservoirWaterService.imageInfo(picQuerySo));
|
||||
}
|
||||
|
||||
@Post(path = "/real/img", summary = "水库实时图像")
|
||||
public R<List<StImgRReal>> realImg(@RequestBody ReservoirWaterCommonSo reservoirWaterCommonSo) {
|
||||
return R.ok(reservoirWaterService.realImg(reservoirWaterCommonSo));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,41 @@
|
|||
package com.gunshi.project.xyt.entity.so;
|
||||
|
||||
import com.gunshi.db.dto.PageSo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* Created by wanyan on 2024/2/2.
|
||||
*
|
||||
* @author wanyan
|
||||
* @version 1.0
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "查询条件")
|
||||
public class PicQuerySo {
|
||||
|
||||
@Schema(description="水库编码")
|
||||
@NotEmpty(message = "水库编码不可为空")
|
||||
private String resCode;
|
||||
|
||||
@Schema(description="测站编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
@NotEmpty(message = "开始时间不能为空")
|
||||
@Pattern(regexp = "^[1-9]\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\\s+(20|21|22|23|[0-1]\\d):[0-5]\\d:[0-5]\\d$", message = "时间格式应为:yyyy-MM-dd HH:mm:ss")
|
||||
private String stm;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
@NotEmpty(message = "结束时间不能为空")
|
||||
@Pattern(regexp = "^[1-9]\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\\s+(20|21|22|23|[0-1]\\d):[0-5]\\d:[0-5]\\d$", message = "时间格式应为:yyyy-MM-dd HH:mm:ss")
|
||||
private String etm;
|
||||
|
||||
@Schema(description="分页参数")
|
||||
private PageSo pageSo;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,13 +1,12 @@
|
|||
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.DataQueryCommonSo;
|
||||
import com.gunshi.project.xyt.entity.so.PicQuerySo;
|
||||
import com.gunshi.project.xyt.entity.vo.AttResBaseVo;
|
||||
import com.gunshi.project.xyt.entity.vo.AttResMonitorVo;
|
||||
import com.gunshi.project.xyt.model.AttResBase;
|
||||
import com.gunshi.project.xyt.model.StImgRReal;
|
||||
import com.gunshi.project.xyt.model.StRsvrR;
|
||||
import com.gunshi.project.xyt.model.StStbprpB;
|
||||
import com.gunshi.project.xyt.model.*;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
|
@ -118,4 +117,21 @@ public interface AttResBaseMapper extends BaseMapper<AttResBase> {
|
|||
</script>
|
||||
""")
|
||||
List<StStbprpB> channel(@Param("resCode") String resCode);
|
||||
|
||||
@Select("""
|
||||
<script>
|
||||
select t.stcd,t.tm,t.img_path from public.st_img_r t
|
||||
where t.tm <![CDATA[>=]]> to_timestamp(#{obj.stm},'YYYY-MM-DD HH24:MI:SS')
|
||||
and t.tm <![CDATA[<=]]> to_timestamp(#{obj.etm},'YYYY-MM-DD HH24:MI:SS')
|
||||
<if test="obj.stcd != null and obj.stcd !=''">
|
||||
AND t.stcd = #{obj.stcd}
|
||||
</if>
|
||||
<if test="obj.stcd == null or obj.stcd == ''">
|
||||
and t.stcd in (select stcd from st_stbprp_b where res_code = #{obj.resCode}
|
||||
and sttp = 'TX')
|
||||
</if>
|
||||
order by t.tm desc
|
||||
</script>
|
||||
""")
|
||||
Page<StImgR> imageInfo(@Param("page") Page<StImgR> page ,@Param("obj") PicQuerySo picQuerySo);
|
||||
}
|
||||
|
|
@ -3,15 +3,14 @@ package com.gunshi.project.xyt.service;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.project.xyt.entity.so.DataQueryCommonSo;
|
||||
import com.gunshi.project.xyt.entity.so.PicQuerySo;
|
||||
import com.gunshi.project.xyt.entity.so.ReservoirWaterCommonSo;
|
||||
import com.gunshi.project.xyt.entity.vo.*;
|
||||
import com.gunshi.project.xyt.mapper.AttResBaseMapper;
|
||||
import com.gunshi.project.xyt.mapper.StZvarlBMapper;
|
||||
import com.gunshi.project.xyt.model.AttResBase;
|
||||
import com.gunshi.project.xyt.model.StImgRReal;
|
||||
import com.gunshi.project.xyt.model.StStbprpB;
|
||||
import com.gunshi.project.xyt.model.StZvarlB;
|
||||
import com.gunshi.project.xyt.model.*;
|
||||
import com.gunshi.project.xyt.util.DataHandleUtil;
|
||||
import com.gunshi.project.xyt.util.DateUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
|
|
@ -218,4 +217,8 @@ public class ReservoirWaterService {
|
|||
public List<StStbprpB> channel(String resCode) {
|
||||
return attResBaseMapper.channel(resCode);
|
||||
}
|
||||
|
||||
public Page<StImgR> imageInfo(PicQuerySo picQuerySo) {
|
||||
return attResBaseMapper.imageInfo(picQuerySo.getPageSo().toPage(),picQuerySo);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue