wushunjie
parent
6d38844948
commit
5a464028f2
@ -0,0 +1,68 @@
|
||||
package com.ruoyi.page.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.yingji.entity.Fire;
|
||||
import com.yingji.entity.dto.request.FireFindRequest;
|
||||
import com.yingji.service.FireService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 119数据(Fire)表控制层
|
||||
*
|
||||
* @author wu
|
||||
* @since 2024-06-05 09:24:14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("algorithms/fire")
|
||||
@Api(tags = "119数据")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class FireController extends BaseController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Resource
|
||||
private FireService fireService;
|
||||
|
||||
/**
|
||||
* 分页条件查询所有数据
|
||||
*
|
||||
* @param page 分页条件
|
||||
* @param fire 查询条件
|
||||
* @return 所有数据
|
||||
*/
|
||||
@GetMapping
|
||||
@ApiOperation(value = "分页条件查询119数据", response = Fire.class)
|
||||
public AjaxResult page(Page<Fire> page, FireFindRequest fire) {
|
||||
if (page.getSize() > 1000) {
|
||||
page.setSize(1000);
|
||||
}
|
||||
return success(fireService.page(page, fire));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 单条数据
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
@ApiOperation(value = "通过主键查询单条119数据", response = Fire.class)
|
||||
public AjaxResult getById(@PathVariable Serializable id) {
|
||||
return success(fireService.getById(id));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,117 @@
|
||||
package com.yingji.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 119数据(Fire)表实体类
|
||||
*
|
||||
* @author wu
|
||||
* @since 2024-06-05 09:24:14
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("119数据实体类")
|
||||
@TableName(value = "fire")
|
||||
public class Fire implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -96682169109217319L;
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ApiModelProperty(value = "主键id")
|
||||
private String id;
|
||||
/**
|
||||
* 行政区划
|
||||
*/
|
||||
@ApiModelProperty(value = "行政区划")
|
||||
private String xzqh;
|
||||
/**
|
||||
* 案件编号
|
||||
*/
|
||||
@ApiModelProperty(value = "案件编号")
|
||||
private String ajbh;
|
||||
/**
|
||||
* 案件描述
|
||||
*/
|
||||
@ApiModelProperty(value = "案件描述")
|
||||
private String ajms;
|
||||
/**
|
||||
* 归队时间
|
||||
*/
|
||||
@ApiModelProperty(value = "归队时间")
|
||||
private Date gdsj;
|
||||
private String jjyxm;
|
||||
/**
|
||||
* 时间戳
|
||||
*/
|
||||
@ApiModelProperty(value = "时间戳")
|
||||
private Date sjc;
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@ApiModelProperty(value = "纬度")
|
||||
private String wd;
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@ApiModelProperty(value = "经度")
|
||||
private String jd;
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
@ApiModelProperty(value = "备注信息")
|
||||
private String bcxx;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
private Date jssj;
|
||||
/**
|
||||
* 案发地址
|
||||
*/
|
||||
@ApiModelProperty(value = "案发地址")
|
||||
private String afdz;
|
||||
/**
|
||||
* 出动时间
|
||||
*/
|
||||
@ApiModelProperty(value = "出动时间")
|
||||
private Date cdsj;
|
||||
/**
|
||||
* 立案方式代码
|
||||
*/
|
||||
@ApiModelProperty(value = "立案方式代码")
|
||||
private String lafsdm;
|
||||
/**
|
||||
* topic
|
||||
*/
|
||||
@ApiModelProperty(value = "topic")
|
||||
private String topic;
|
||||
private Date xdsj;
|
||||
/**
|
||||
* 立案时间
|
||||
*/
|
||||
@ApiModelProperty(value = "立案时间")
|
||||
private Date lasj;
|
||||
/**
|
||||
* 行政区划名称
|
||||
*/
|
||||
@ApiModelProperty(value = "行政区划名称")
|
||||
private String xzqhmc;
|
||||
/**
|
||||
* 到达现场时间
|
||||
*/
|
||||
@ApiModelProperty(value = "到达现场时间")
|
||||
private Date ddxcsj;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
}
|
||||
|
@ -0,0 +1,57 @@
|
||||
package com.yingji.entity.dto.request;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 119查询请求类
|
||||
*
|
||||
* @author wu
|
||||
* @since 2024/4/30 下午3:59
|
||||
*/
|
||||
@ApiModel(value = "119查询请求类")
|
||||
@Data
|
||||
public class FireFindRequest implements Serializable {
|
||||
|
||||
|
||||
private static final long serialVersionUID = -3688091864596277161L;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@ApiModelProperty("开始时间")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@ApiModelProperty("结束时间")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
* 案件编号
|
||||
*/
|
||||
@ApiModelProperty(value = "案件编号")
|
||||
private String ajbh;
|
||||
/**
|
||||
* 案件描述
|
||||
*/
|
||||
@ApiModelProperty(value = "案件描述")
|
||||
private String ajms;
|
||||
|
||||
/**
|
||||
* 案发地址
|
||||
*/
|
||||
@ApiModelProperty(value = "案发地址")
|
||||
private String afdz;
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.ruoyi.page.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yingji.entity.Fire;
|
||||
|
||||
/**
|
||||
* 119数据(Fire)表数据库访问层
|
||||
*
|
||||
* @author wu
|
||||
* @since 2024-06-05 09:24:14
|
||||
*/
|
||||
public interface FireMapper extends BaseMapper<Fire> {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,25 @@
|
||||
package com.yingji.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yingji.entity.Fire;
|
||||
import com.yingji.entity.dto.request.FireFindRequest;
|
||||
|
||||
/**
|
||||
* 119数据(Fire)表服务接口
|
||||
*
|
||||
* @author wu
|
||||
* @since 2024-06-05 09:24:14
|
||||
*/
|
||||
public interface FireService extends IService<Fire> {
|
||||
|
||||
/**
|
||||
* 分页条件查询所有数据
|
||||
*
|
||||
* @param page 分页条件
|
||||
* @param fire 查询条件
|
||||
* @return 所有数据
|
||||
*/
|
||||
Page<Fire> page(Page<Fire> page, FireFindRequest fire);
|
||||
}
|
||||
|
@ -0,0 +1,40 @@
|
||||
package com.ruoyi.page.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.page.mapper.FireMapper;
|
||||
import com.yingji.entity.Fire;
|
||||
import com.yingji.entity.dto.request.FireFindRequest;
|
||||
import com.yingji.service.FireService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 119数据(Fire)表服务实现类
|
||||
*
|
||||
* @author wu
|
||||
* @since 2024-06-05 09:24:14
|
||||
*/
|
||||
@Service("fireService")
|
||||
public class FireServiceImpl extends ServiceImpl<FireMapper, Fire> implements FireService {
|
||||
|
||||
/**
|
||||
* 分页条件查询所有数据
|
||||
*
|
||||
* @param page 分页条件
|
||||
* @param fire 查询条件
|
||||
* @return 所有数据
|
||||
*/
|
||||
@Override
|
||||
public Page<Fire> page(Page<Fire> page, FireFindRequest fire) {
|
||||
QueryWrapper<Fire> wrapper = new QueryWrapper<>();
|
||||
wrapper.like(StrUtil.isNotEmpty(fire.getAjbh()), "ajbh", fire.getAjbh())
|
||||
.ge(fire.getStartTime() != null, "create_time", fire.getStartTime())
|
||||
.le(fire.getEndTime() != null, "create_time", fire.getEndTime())
|
||||
.like(StrUtil.isNotEmpty(fire.getAjms()), "ajms", fire.getAjms())
|
||||
.like(StrUtil.isNotEmpty(fire.getAfdz()), "afdz", fire.getAfdz());
|
||||
return this.page(page, wrapper);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue