AI告警查询
parent
271b236a6f
commit
a8685d7cb1
|
|
@ -1,6 +1,8 @@
|
||||||
package com.gunshi.project.xyt.controller;
|
package com.gunshi.project.xyt.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.gunshi.core.result.R;
|
import com.gunshi.core.result.R;
|
||||||
|
import com.gunshi.project.xyt.entity.so.ImgWarnPageSo;
|
||||||
import com.gunshi.project.xyt.model.StImgWarnR;
|
import com.gunshi.project.xyt.model.StImgWarnR;
|
||||||
import com.gunshi.project.xyt.service.StImgWarnRService;
|
import com.gunshi.project.xyt.service.StImgWarnRService;
|
||||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||||
|
|
@ -56,8 +58,8 @@ public class StImgWarnRController {
|
||||||
|
|
||||||
@Operation(summary = "分页")
|
@Operation(summary = "分页")
|
||||||
@PostMapping("/page")
|
@PostMapping("/page")
|
||||||
public R<List<StImgWarnR>> page() {
|
public R<Page<StImgWarnR>> page(@RequestBody ImgWarnPageSo imgWarnPageSo) {
|
||||||
return R.ok(service.page(null,null));
|
return R.ok(service.pageQuery(imgWarnPageSo));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
package com.gunshi.project.xyt.entity.so;
|
||||||
|
|
||||||
|
import com.gunshi.db.dto.DateTimeRangeSo;
|
||||||
|
import com.gunshi.db.dto.PageSo;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Created by wanyan on 2024/3/19
|
||||||
|
*
|
||||||
|
* @author wanyan
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "AI告警分页查询对象")
|
||||||
|
public class ImgWarnPageSo {
|
||||||
|
|
||||||
|
@NotNull(message = "分页参数不能为空")
|
||||||
|
@Schema(description = "分页参数")
|
||||||
|
private PageSo pageSo;
|
||||||
|
|
||||||
|
@Schema(description = "告警时间")
|
||||||
|
private DateTimeRangeSo dateTimeRangeSo;
|
||||||
|
|
||||||
|
@Schema(description="index_code")
|
||||||
|
private String indexCode;
|
||||||
|
|
||||||
|
@Schema(description="告警类型(1人员闯入 2工程车辆识别 3漂浮物识别 4游泳识别)")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,8 +1,12 @@
|
||||||
package com.gunshi.project.xyt.mapper;
|
package com.gunshi.project.xyt.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.gunshi.project.xyt.entity.so.ImgWarnPageSo;
|
||||||
import com.gunshi.project.xyt.model.StImgWarnR;
|
import com.gunshi.project.xyt.model.StImgWarnR;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 描述: AI告警表
|
* 描述: AI告警表
|
||||||
|
|
@ -12,4 +16,27 @@ import org.apache.ibatis.annotations.Mapper;
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface StImgWarnRMapper extends BaseMapper<StImgWarnR> {
|
public interface StImgWarnRMapper extends BaseMapper<StImgWarnR> {
|
||||||
|
|
||||||
|
@Select("""
|
||||||
|
<script>
|
||||||
|
select t.*,s.name
|
||||||
|
from public.st_img_warn_r t
|
||||||
|
left join public.att_cctv_base s on t.index_code = s.index_code
|
||||||
|
<where>
|
||||||
|
<if test="obj.indexCode != null and obj.indexCode !=''">
|
||||||
|
t.index_code =#{obj.indexCode}
|
||||||
|
</if>
|
||||||
|
<if test="obj.type != null">
|
||||||
|
t.type =#{obj.type}
|
||||||
|
</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 desc
|
||||||
|
</script>
|
||||||
|
""")
|
||||||
|
Page<StImgWarnR> pageQuery(Page<StImgWarnR> page,@Param("obj") ImgWarnPageSo imgWarnPageSo);
|
||||||
}
|
}
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
package com.gunshi.project.xyt.model;
|
package com.gunshi.project.xyt.model;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||||
import com.gunshi.core.dateformat.DateFormatString;
|
import com.gunshi.core.dateformat.DateFormatString;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
|
@ -31,7 +30,8 @@ public class StImgWarnR implements Serializable {
|
||||||
/**
|
/**
|
||||||
* index_code
|
* index_code
|
||||||
*/
|
*/
|
||||||
@TableId(value="index_code", type= IdType.AUTO)
|
@MppMultiId
|
||||||
|
@TableField(value="index_code")
|
||||||
@Schema(description="index_code")
|
@Schema(description="index_code")
|
||||||
@Size(max = 150,message = "index_code最大长度要小于 150")
|
@Size(max = 150,message = "index_code最大长度要小于 150")
|
||||||
@NotBlank(message = "index_code不能为空")
|
@NotBlank(message = "index_code不能为空")
|
||||||
|
|
@ -40,6 +40,7 @@ public class StImgWarnR implements Serializable {
|
||||||
/**
|
/**
|
||||||
* tm
|
* tm
|
||||||
*/
|
*/
|
||||||
|
@MppMultiId
|
||||||
@TableField(value="tm")
|
@TableField(value="tm")
|
||||||
@Schema(description="tm")
|
@Schema(description="tm")
|
||||||
@NotBlank(message = "tm不能为空")
|
@NotBlank(message = "tm不能为空")
|
||||||
|
|
@ -61,4 +62,8 @@ public class StImgWarnR implements Serializable {
|
||||||
@Schema(description="告警类型(1人员闯入 2工程车辆识别 3漂浮物识别 4游泳识别)")
|
@Schema(description="告警类型(1人员闯入 2工程车辆识别 3漂浮物识别 4游泳识别)")
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@Schema(description = "摄像头名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
package com.gunshi.project.xyt.service;
|
package com.gunshi.project.xyt.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gunshi.project.xyt.entity.so.ImgWarnPageSo;
|
||||||
import com.gunshi.project.xyt.mapper.StImgWarnRMapper;
|
import com.gunshi.project.xyt.mapper.StImgWarnRMapper;
|
||||||
import com.gunshi.project.xyt.model.StImgWarnR;
|
import com.gunshi.project.xyt.model.StImgWarnR;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 描述: AI告警表
|
* 描述: AI告警表
|
||||||
* author: xusan
|
* author: xusan
|
||||||
|
|
@ -20,6 +20,9 @@ import java.util.Date;
|
||||||
public class StImgWarnRService extends ServiceImpl<StImgWarnRMapper, StImgWarnR>
|
public class StImgWarnRService extends ServiceImpl<StImgWarnRMapper, StImgWarnR>
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public Page<StImgWarnR> pageQuery(ImgWarnPageSo imgWarnPageSo) {
|
||||||
|
return this.baseMapper.pageQuery(imgWarnPageSo.getPageSo().toPage(),imgWarnPageSo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue