glj-代码提交

This commit is contained in:
管李杰 2024-07-09 18:16:07 +08:00
parent 1c87d2825f
commit 9f16d23abe
28 changed files with 1009 additions and 152 deletions

View File

@ -0,0 +1,367 @@
package com.kening.vordm.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import lombok.Data;
/**
* 其他上传的实体数据
* @TableName entity_data_all
*/
@TableName(value ="entity_data_all")
@Data
public class EntityDataAll implements Serializable {
/**
* 数据自增列
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
* 数据名称
*/
private String title;
/**
* 数据产品的大小byte
*/
private Long size;
/**
* 数据类型
0-基础数据(Basic data)
1-减灾产品(Responded report)
2-制图产品(Cartographic product)
3-Social media 社会化媒体
4遥感数据(Remote sensing data)
5-Other data 其他数据
*/
private String type;
/**
* 数据下载链接网站上对象存储路径
*/
private String link;
/**
* 数据备注
*/
private String remark;
/**
* 上传时间
*/
private Date uploadTime;
/**
* 灾害id
*/
private Long disasterId;
/**
* 可视化可视化标志0-不可可视化1-表示可以可视化
*/
private Integer visualFlag;
/**
* 可视化跳转中心经度
*/
private Double visualLon;
/**
* 可视化跳转中心纬度
*/
private Double visualLat;
/**
* 审核状态0-B2管理添加未审核/1-B2管理发起审核/2-B1管理发起审核或审核完B2管理的状态/3审核未通过)
*/
private Integer status;
/**
* 上传人
*/
private Long uploaderId;
/**
* 管理人/审核人
*/
private Long managerId;
/**
* 审核时间
*/
private Date reviewTime;
/**
* 来源机构
*/
private String sourceOrganization;
/**
* 上传类型 1.guest上传 2.manager上传用来区分uploader_id字段
*/
private Integer uploadType;
/**
* 是否删除 0未删除 1已删除
*/
private Integer isDeleted;
/**
* 是否发布0未发布/1已发布
*/
private Integer isPublish;
/**
* 是否下载0 未下载/1已下载
*/
private Integer isDownload;
/**
* 账号
*/
private String account;
/**
* 密码
*/
private String password;
/**
* 信息来源
*/
private String sourceLink;
/**
* 1-Optical satellite, 2-Night light satellite, 3-Video satellite, 4-Hyperspectral satellite, 5-Radar satellite
*/
private Integer satelliteTypeSelect;
/**
* 卫星代号
*/
private String satelliteCode;
/**
* 产品序列号
*/
private String productSerialNum;
/**
* 产品分辨率
*/
private String productResolution;
/**
* 云层覆盖量
*/
private Integer cloudCover;
/**
* 生产时间
*/
private Date productTime;
/**
* 产品波段树
*/
private String productBandsNum;
/**
* 审核失败原因
*/
private String reason;
/**
* Personal/Other 信息来源
*/
private String source;
/**
* 1-Optical, 2-Radar , 3-Luminous 传感器类型
*/
private String sensorType;
/**
* 下载地址
*/
private String downloadLink;
/**
* 产品级别
*/
private String productLevel;
/**
* 原始数据条带号
*/
private Integer rawDataStripeNum;
/**
* 投影带号
*/
private Integer projectBandNum;
/**
* 覆盖区域
*/
private String coverageArea;
/**
*
*/
private Date receivingTime;
/**
*
*/
private String upperLeftLat;
/**
*
*/
private String upperLeftLon;
/**
*
*/
private String upperRightLat;
/**
*
*/
private String upperRightLon;
/**
*
*/
private String viewCenterLat;
/**
*
*/
private String viewCenterLon;
/**
*
*/
private String lowerRightLat;
/**
*
*/
private String lowerRightLon;
/**
*
*/
private String lowerLeftLat;
/**
*
*/
private String lowerLeftLon;
/**
*
*/
private Date createTime;
/**
* 0-sentinel,1-landsat,2-searchone
*/
private String satelliteType;
/**
* 影像缩略图名称 用户批量添加缩略图区分
*/
private String pictureName;
/**
* 是否是管理0不是/1是
*/
private Integer isAdministration;
/**
* 查询枚举
*/
@TableField(exist = false)
private List<String> typeList;
/**
* 审核状态0-B2管理添加未审核/1-B2管理发起审核/2-B1管理发起审核或审核完B2管理的状态/3审核未通过)
*/
@TableField(exist = false)
private String stateListNew;
/**
* 查询枚举
*/
@TableField(exist = false)
private List<String> stateList;
//标志灾前灾后字段 0-灾前1-灾后
@TableField(exist = false)
private Integer beforeOrAfter;
/**
* 用户邮件
*/
@TableField(exist = false)
private String email;
/**
* 用户组织机构
*/
@TableField(exist = false)
private String organization;
/**
* 研究范围
*/
@TableField(exist = false)
private String researchField;
/**
* 职业
*/
@TableField(exist = false)
private String occupation;
/**
* 职称
*/
@TableField(exist = false)
private String professionalTitle;
/**
* 来源机构
*/
@TableField(exist = false)
private String sourceOrganizationUser;
/**
* 用户名称
*/
@TableField(exist = false)
private String username;
/**
* 国家
*/
@TableField(exist = false)
private String country;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,93 @@
package com.kening.vordm.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 灾害响应表每一个灾害可能有多个用户响应-申请
* @TableName guest_apply_disaster_ref
*/
@TableName(value ="guest_apply_disaster_ref")
@Data
public class GuestApplyDisasterRef implements Serializable {
/**
* 主键
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
* 灾害id
*/
private Long disasterId;
/**
* 用户状态0-B1/1-B2
*/
private Integer userStatus;
/**
* 申请管理员时间
*/
private Date applyTime;
/**
* B2_管理人 balde_user_id
*/
private Long adminId;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
GuestApplyDisasterRef other = (GuestApplyDisasterRef) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getDisasterId() == null ? other.getDisasterId() == null : this.getDisasterId().equals(other.getDisasterId()))
&& (this.getUserStatus() == null ? other.getUserStatus() == null : this.getUserStatus().equals(other.getUserStatus()))
&& (this.getApplyTime() == null ? other.getApplyTime() == null : this.getApplyTime().equals(other.getApplyTime()))
&& (this.getAdminId() == null ? other.getAdminId() == null : this.getAdminId().equals(other.getAdminId()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getDisasterId() == null) ? 0 : getDisasterId().hashCode());
result = prime * result + ((getUserStatus() == null) ? 0 : getUserStatus().hashCode());
result = prime * result + ((getApplyTime() == null) ? 0 : getApplyTime().hashCode());
result = prime * result + ((getAdminId() == null) ? 0 : getAdminId().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", disasterId=").append(disasterId);
sb.append(", userStatus=").append(userStatus);
sb.append(", applyTime=").append(applyTime);
sb.append(", adminId=").append(adminId);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

View File

@ -29,16 +29,6 @@ public class DataUploadController {
private DataUploadService service;
/**
* 灾害分页列表查询
* @param query
* @param params
* @return
*/
@GetMapping("/queryDisasterPage")
public R<IPage<DataUpload>> queryDisasterPage(Query query, @RequestParam Map<String,Object> params){
return R.data(service.queryDisasterPage(Condition.getPage(query),params));
}
/**
* 分页列表查询

View File

@ -0,0 +1,122 @@
package com.kening.vordm.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.kening.vordm.entity.EntityDataAll;
import com.kening.vordm.service.EntityDataAllService;
import com.kening.vordm.vo.UserTenantVo;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@RestController
@AllArgsConstructor
@RequestMapping("/ui/EntityDataAll")
public class EntityDataAllController {
//实体数据服务层
private final EntityDataAllService entityDataAllService;
/**
* 实体数据列表信息
* @param entityData 实体数据条件信息
* @param query current当前页 size 每页数据量
* @return
*/
@GetMapping("/getList")
public R<IPage<EntityDataAll>> getEntityDataList(EntityDataAll entityData, Query query) {
return R.data(entityDataAllService.getEntityDataList(Condition.getPage(query), entityData));
}
/**
* 获取所有实体信息下机构信息
* @return
*/
@GetMapping("/getEntityDataSourceOrganization")
public R<List<UserTenantVo>> getEntityDataSourceOrganization(Long disasterId) {
return R.data(entityDataAllService.getEntityDataSourceOrganization(disasterId));
}
/**
* Resource upload 上传实体信息
* @return
*/
@PostMapping("/saveEntityData")
public R saveEntityData(EntityDataAll entityData) {
return entityDataAllService.saveEntityData(entityData);
}
@GetMapping("/updateByIdEntityDataStatus")
public R updateByIdEntityDataStatus(Long id,Integer status,Long managerId) {
EntityDataAll entityData = new EntityDataAll();
entityData.setId(id);
entityData.setStatus(status);
entityData.setManagerId(managerId);
entityData.setReviewTime(new Date());
return R.data(entityDataAllService.updateById(entityData));
}
//批量修改
@GetMapping("/updateByIdEntityDataStatusBatch")
public R updateByIdEntityDataStatusBatch(Integer status,String ids) {
List<String> strings = Arrays.asList(ids.split(","));
strings.stream().forEach(id->{
EntityDataAll entityData = new EntityDataAll();
entityData.setId(Long.parseLong(id));
entityData.setStatus(status);
entityData.setReviewTime(new Date());
entityDataAllService.updateById(entityData);
});
return R.data(true);
}
//批量删除
@GetMapping("/deleteByIdEntityDataBatch")
public R deleteByIdEntityDataBatch(String ids) {
List<String> strings = Arrays.asList(ids.split(","));
return R.data(entityDataAllService.removeByIds(strings));
}
/**
* 修改实体数据
* @param entityData
* @return
*/
@PostMapping("/updateEntityData")
public R updateEntityData(EntityDataAll entityData) {
return R.data(entityDataAllService.updateById(entityData));
}
/**
* 删除
* @param id
* @return
*/
@GetMapping("/removeByIdEntityData")
public R removeByIdEntityData(Long id) {
return R.data(entityDataAllService.removeById(id));
}
/**
* 上传信息
* @param fileDataOne
* @param fileDataTwo
* @param type
* @param disasterId
* @return
*/
@PostMapping({"/importTemplate"})
public R fileExcelUpload(@RequestParam("fileDataOne") MultipartFile fileDataOne, @RequestParam("fileDataTwo") MultipartFile fileDataTwo, @RequestParam("type") Integer type, @RequestParam("disasterId") Long disasterId) {
return R.data(null);
}
}

View File

@ -0,0 +1,66 @@
package com.kening.vordm.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.kening.vordm.entity.GuestApplyDisasterRef;
import com.kening.vordm.service.GuestApplyDisasterRefService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
@RestController
@AllArgsConstructor
@RequestMapping("/ui/guestApply")
public class GuestApplyDisasterRefController {
private final GuestApplyDisasterRefService guestApplyDisasterRefService;
@GetMapping("/list")
public R<IPage<GuestApplyDisasterRef>> list(GuestApplyDisasterRef guestApplyDisasterRef, Query query) {
IPage<GuestApplyDisasterRef> pages = guestApplyDisasterRefService.page(Condition.getPage(query), Condition.getQueryWrapper(guestApplyDisasterRef));
return R.data(pages);
}
@ApiOperationSupport(order = 2)
@ApiOperation(value = "新增", notes = "传入Influence")
@PostMapping("/save")
public R save(@ApiParam(value = "Influence对象", required = true) @RequestBody GuestApplyDisasterRef guestApplyDisasterRef) {
return R.status(guestApplyDisasterRefService.save(guestApplyDisasterRef));
}
@ApiOperationSupport(order = 3)
@ApiOperation(value = "修改", notes = "传入Influence")
@PostMapping("/update")
public R update(@ApiParam(value = "Influence对象", required = true) @RequestBody GuestApplyDisasterRef guestApplyDisasterRef) {
return R.status(guestApplyDisasterRefService.updateById(guestApplyDisasterRef));
}
@ApiOperationSupport(order = 4)
@ApiOperation(value = "删除", notes = "传入id")
@PostMapping("/remove")
public R remove(@ApiParam(value = "主键", required = true) @RequestParam String ids) {
return R.status(guestApplyDisasterRefService.removeByIds(Arrays.asList(ids.split(","))));
}
@ApiOperationSupport(order = 5)
@ApiOperation(value = "详情", notes = "传入id")
@GetMapping("/detail")
public R<GuestApplyDisasterRef> detail(@ApiParam(value = "主键", required = true) @RequestParam String id) {
GuestApplyDisasterRef detail = guestApplyDisasterRefService.getById(id);
return R.data(detail);
}
@GetMapping("/detailByDisasterInfoId")
public R<GuestApplyDisasterRef> detailByDisasterInfoId(@ApiParam(value = "主键", required = true) @RequestParam String id) {
LambdaQueryWrapper<GuestApplyDisasterRef> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(GuestApplyDisasterRef::getDisasterId,id);
GuestApplyDisasterRef detail = guestApplyDisasterRefService.getOne(queryWrapper);
return R.data(detail);
}
}

View File

@ -24,17 +24,6 @@ public class OtherDataController {
private OtherDataService service;
/**
* 灾害分页列表查询
* @param query
* @param params
* @return
*/
@GetMapping("/queryDisasterPage")
public R<IPage<DataUpload>> queryDisasterPage(Query query, @RequestParam Map<String,Object> params){
return R.data(service.queryDisasterPage(Condition.getPage(query),params));
}
/**
* 分页列表查询
* @param query

View File

@ -29,17 +29,6 @@ public class VisualDataController {
private HotspotService hotspotService;
/**
* 灾害分页列表查询
* @param query
* @param params
* @return
*/
@GetMapping("/queryDisasterPage")
public R<IPage<DataUpload>> queryDisasterPage(Query query, @RequestParam Map<String,Object> params){
return R.data(service.queryDisasterPage(Condition.getPage(query),params));
}
/**
* 词云分页列表查询

View File

@ -16,14 +16,6 @@ import java.util.Map;
*/
public interface DataUploadMapper extends BaseMapper<EntityData> {
/**
* 灾害分页列表查询
* @param page
* @param params
* @return
*/
List<DataUpload> queryDisasterPage(IPage page,@Param("params") Map<String, Object> params);
/**
* 分页列表查询
* @param page

View File

@ -16,23 +16,6 @@
</where>
</select>
<select id="queryDisasterPage" resultType="com.kening.vordm.entity.DataUpload">
select
di.disaster_keyword,
bdb.dict_value as disasterType,
di.id as disasterId,
di.vordm_id AS vordmId,
di.disaster_time as disasterTime,
di.disaster_country as disasterCountry
from entity_data ed
left join blade_user bu on bu.id = ed.uploader_id
left join disaster_info di on di.id = ed.disaster_id
left join blade_dict_biz bdb on di.disaster_type = dict_key
where ed.disaster_id is not null
AND di.disaster_keyword IS NOT NUll
group by di.id,bdb.dict_value
</select>
<select id="queryPage" resultType="com.kening.vordm.entity.DataUpload">
select
ed.id,ed.title,ed.size,

View File

@ -589,7 +589,7 @@
select
<include refid="Base_Column_List"/>
from disaster_info di
left join entity_data ed on ed.disaster_id = di.id
left join entity_data_all ed on ed.disaster_id = di.id
where
ed.uploader_id = #{userId}
GROUP BY di.id

View File

@ -0,0 +1,26 @@
package com.kening.vordm.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.kening.vordm.entity.EntityDataAll;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kening.vordm.vo.UserTenantVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author G
* @description 针对表entity_data_all(其他上传的实体数据)的数据库操作Mapper
* @createDate 2024-07-09 15:13:50
* @Entity com.kening.vordm.entity.EntityDataAll
*/
public interface EntityDataAllMapper extends BaseMapper<EntityDataAll> {
IPage<EntityDataAll> getEntityDataList(@Param("entityData") EntityDataAll entityData, IPage<Object> page);
List<UserTenantVo> getEntityDataSourceOrganization(@Param("disasterId") Long disasterId);
}

View File

@ -0,0 +1,149 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.kening.vordm.mapper.EntityDataAllMapper">
<resultMap id="BaseResultMap" type="com.kening.vordm.entity.EntityDataAll">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="title" column="title" jdbcType="VARCHAR"/>
<result property="size" column="size" jdbcType="BIGINT"/>
<result property="type" column="type" jdbcType="VARCHAR"/>
<result property="link" column="link" jdbcType="VARCHAR"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
<result property="uploadTime" column="upload_time" jdbcType="TIMESTAMP"/>
<result property="disasterId" column="disaster_id" jdbcType="BIGINT"/>
<result property="visualFlag" column="visual_flag" jdbcType="INTEGER"/>
<result property="visualLon" column="visual_lon" jdbcType="DOUBLE"/>
<result property="visualLat" column="visual_lat" jdbcType="DOUBLE"/>
<result property="status" column="status" jdbcType="INTEGER"/>
<result property="uploaderId" column="uploader_id" jdbcType="BIGINT"/>
<result property="managerId" column="manager_id" jdbcType="BIGINT"/>
<result property="reviewTime" column="review_time" jdbcType="TIMESTAMP"/>
<result property="sourceOrganization" column="source_organization" jdbcType="VARCHAR"/>
<result property="uploadType" column="upload_type" jdbcType="INTEGER"/>
<result property="isDeleted" column="is_deleted" jdbcType="INTEGER"/>
<result property="isPublish" column="is_publish" jdbcType="INTEGER"/>
<result property="isDownload" column="is_download" jdbcType="INTEGER"/>
<result property="account" column="account" jdbcType="VARCHAR"/>
<result property="password" column="password" jdbcType="VARCHAR"/>
<result property="sourceLink" column="source_link" jdbcType="VARCHAR"/>
<result property="satelliteTypeSelect" column="satellite_type_select" jdbcType="INTEGER"/>
<result property="satelliteCode" column="satellite_code" jdbcType="VARCHAR"/>
<result property="productSerialNum" column="product_serial_num" jdbcType="VARCHAR"/>
<result property="productResolution" column="product_resolution" jdbcType="VARCHAR"/>
<result property="cloudCover" column="cloud_cover" jdbcType="INTEGER"/>
<result property="productTime" column="product_time" jdbcType="TIMESTAMP"/>
<result property="productBandsNum" column="product_bands_num" jdbcType="VARCHAR"/>
<result property="reason" column="reason" jdbcType="VARCHAR"/>
<result property="source" column="source" jdbcType="VARCHAR"/>
<result property="sensorType" column="sensor_type" jdbcType="VARCHAR"/>
<result property="downloadLink" column="download_link" jdbcType="VARCHAR"/>
<result property="productLevel" column="product_level" jdbcType="VARCHAR"/>
<result property="rawDataStripeNum" column="raw_data_stripe_num" jdbcType="INTEGER"/>
<result property="projectBandNum" column="project_band_num" jdbcType="INTEGER"/>
<result property="coverageArea" column="coverage_area" jdbcType="VARCHAR"/>
<result property="receivingTime" column="receiving_time" jdbcType="TIMESTAMP"/>
<result property="upperLeftLat" column="upper_left_lat" jdbcType="VARCHAR"/>
<result property="upperLeftLon" column="upper_left_lon" jdbcType="VARCHAR"/>
<result property="upperRightLat" column="upper_right_lat" jdbcType="VARCHAR"/>
<result property="upperRightLon" column="upper_right_lon" jdbcType="VARCHAR"/>
<result property="viewCenterLat" column="view_center_lat" jdbcType="VARCHAR"/>
<result property="viewCenterLon" column="view_center_lon" jdbcType="VARCHAR"/>
<result property="lowerRightLat" column="lower_right_lat" jdbcType="VARCHAR"/>
<result property="lowerRightLon" column="lower_right_lon" jdbcType="VARCHAR"/>
<result property="lowerLeftLat" column="lower_left_lat" jdbcType="VARCHAR"/>
<result property="lowerLeftLon" column="lower_left_lon" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="satelliteType" column="satellite_type" jdbcType="VARCHAR"/>
<result property="pictureName" column="picture_name" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
ed.id, ed.title, ed.size,
ed.type, ed.link, ed.remark,
ed.upload_time, ed.disaster_id, ed.visual_flag,
ed.visual_lon, ed.visual_lat, ed.status,
ed.uploader_id, ed.manager_id, ed.review_time,
ed.source_organization, ed.upload_type, ed.is_deleted,
ed.is_publish, ed.is_download, ed.account,
ed.password, ed.source_link, ed.satellite_type_select,
ed.satellite_code, ed.product_serial_num, ed.product_resolution,
ed.cloud_cover, ed.product_time, ed.product_bands_num,
ed.reason, source, ed.sensor_type,
ed.download_link, ed.product_level, ed.raw_data_stripe_num,
ed.project_band_num, ed.coverage_area, ed.receiving_time,
ed.upper_left_lat, ed.upper_left_lon, ed.upper_right_lat,
ed.upper_right_lon, ed.view_center_lat, ed.view_center_lon,
ed.lower_right_lat, ed.lower_right_lon, ed.lower_left_lat,
ed.lower_left_lon, ed.create_time, ed.satellite_type,
ed.picture_name
</sql>
<select id="getEntityDataList" resultType="com.kening.vordm.entity.EntityDataAll">
select
<include refid="Base_Column_List"/>,
bu.name AS uploaderName,
bu.email AS email,
di.vordm_id,
di.geometry
from entity_data_all ed
left join blade_user bu on bu.id = ed.uploader_id
LEFT JOIN disaster_info di on di.id = ed.disaster_id
<where>
<if test="entityData.disasterId != null and entityData.disasterId != ''">
ed.disaster_id = #{entityData.disasterId}
</if>
<if test="entityData.sourceOrganization != null and entityData.sourceOrganization != ''">
and ed.source_organization = #{entityData.sourceOrganization}
</if>
<if test="entityData.satelliteTypeSelect != null and entityData.satelliteTypeSelect != ''">
and ed.satellite_type_select = #{entityData.satelliteTypeSelect}
</if>
<if test="entityData.title != null and entityData.title != ''">
and ed.title like concat('%',#{entityData.title},'%')
</if>
<if test="entityData.productResolution != null and entityData.productResolution != ''">
and ed.product_resolution like concat('%',#{entityData.productResolution},'%')
</if>
<if test="entityData.typeList != null and entityData.typeList.size > 0">
and ed.type IN
<foreach collection="entityData.typeList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entityData.stateList != null and entityData.stateList.size > 0">
and ed.status IN
<foreach collection="entityData.stateList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
/*灾前还是灾后*/
<if test="entityData.beforeOrAfter != null and entityData.beforeOrAfter != ''">
<if test="entityData.beforeOrAfter == 1">
and r.product_time &gt;= (select
disaster_time
from disaster_info where id = #{entityData.disasterId})
</if>
<if test="entityData.beforeOrAfter == 0">
and r.product_time &lt; (select
disaster_time
from disaster_info where id = #{entityData.disasterId})
</if>
</if>
AND ed.is_deleted = 0
</where>
ORDER BY ed.upload_time DESC
</select>
<select id="getEntityDataSourceOrganization" resultType="com.kening.vordm.vo.UserTenantVo">
select ed.source_organization AS organizationName
from entity_data_all ed
<where>
<if test="disasterId != null and disasterId != ''">
ed.disaster_id = #{disasterId}
</if>
</where>
GROUP BY ed.source_organization
</select>
</mapper>

View File

@ -0,0 +1,18 @@
package com.kening.vordm.mapper;
import com.kening.vordm.entity.GuestApplyDisasterRef;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author G
* @description 针对表guest_apply_disaster_ref(灾害响应表每一个灾害可能有多个用户响应-申请)的数据库操作Mapper
* @createDate 2024-07-09 14:26:25
* @Entity com.kening.vordm.entity.GuestApplyDisasterRef
*/
public interface GuestApplyDisasterRefMapper extends BaseMapper<GuestApplyDisasterRef> {
}

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.kening.vordm.mapper.GuestApplyDisasterRefMapper">
<resultMap id="BaseResultMap" type="com.kening.vordm.entity.GuestApplyDisasterRef">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="disasterId" column="disaster_id" jdbcType="BIGINT"/>
<result property="userStatus" column="user_status" jdbcType="INTEGER"/>
<result property="applyTime" column="apply_time" jdbcType="TIMESTAMP"/>
<result property="adminId" column="admin_id" jdbcType="BIGINT"/>
</resultMap>
<sql id="Base_Column_List">
id,disaster_id,user_status,
apply_time,admin_id
</sql>
</mapper>

View File

@ -15,14 +15,6 @@ import java.util.Map;
*/
public interface OtherDataMapper extends BaseMapper<EntityData> {
/**
* 灾害分页列表查询
* @param page
* @param params
* @return
*/
List<DataUpload> queryDisasterPage(IPage page,@Param("params") Map<String, Object> params);
/**
* 分页列表查询
* @param page

View File

@ -16,18 +16,6 @@
</where>
</select>
<select id="queryDisasterPage" resultType="com.kening.vordm.entity.DataUpload">
select
di.disaster_keyword,
di.vordm_id,
bdb.dict_value as disasterType,
di.id as disasterId,
di.disaster_time as disasterTime,
di.disaster_country as disasterCountry,
di.geometry
from disaster_info di
left join blade_dict_biz bdb on di.disaster_type = dict_key
</select>
<select id="queryPage" resultType="com.kening.vordm.entity.DataUpload">
select

View File

@ -15,13 +15,6 @@ import java.util.Map;
*/
public interface VisualDataMapper extends BaseMapper<EntityData> {
/**
* 灾害分页列表查询
* @param page
* @param params
* @return
*/
List<DataUpload> queryDisasterPage(IPage page,@Param("params") Map<String, Object> params);
/**
* 分页列表查询

View File

@ -16,17 +16,6 @@
</where>
</select>
<select id="queryDisasterPage" resultType="com.kening.vordm.entity.DataUpload">
select
di.disaster_keyword,
bdb.dict_value as disasterType,
di.id as disasterId,
di.vordm_id,
di.disaster_time as disasterTime,
di.disaster_country as disasterCountry
from disaster_info di
left join blade_dict_biz bdb on di.disaster_type = dict_key
</select>
<select id="queryPage" resultType="com.kening.vordm.entity.DataUpload">
select

View File

@ -12,14 +12,6 @@ import java.util.Map;
*/
public interface DataUploadService extends IService<EntityData> {
/**
* 灾害分页列表查询
* @param page
* @param params
* @return
*/
IPage queryDisasterPage(IPage page, Map<String,Object> params);
/**
* 分页列表查询
* @param page

View File

@ -0,0 +1,25 @@
package com.kening.vordm.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.kening.vordm.entity.EntityData;
import com.kening.vordm.entity.EntityDataAll;
import com.baomidou.mybatisplus.extension.service.IService;
import com.kening.vordm.vo.UserTenantVo;
import org.springblade.core.tool.api.R;
import java.util.List;
/**
* @author G
* @description 针对表entity_data_all(其他上传的实体数据)的数据库操作Service
* @createDate 2024-07-09 15:13:50
*/
public interface EntityDataAllService extends IService<EntityDataAll> {
IPage<EntityDataAll> getEntityDataList(IPage<Object> page, EntityDataAll entityData);
List<UserTenantVo> getEntityDataSourceOrganization(Long disasterId);
R saveEntityData(EntityDataAll entityData);
}

View File

@ -0,0 +1,13 @@
package com.kening.vordm.service;
import com.kening.vordm.entity.GuestApplyDisasterRef;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author G
* @description 针对表guest_apply_disaster_ref(灾害响应表每一个灾害可能有多个用户响应-申请)的数据库操作Service
* @createDate 2024-07-09 14:26:25
*/
public interface GuestApplyDisasterRefService extends IService<GuestApplyDisasterRef> {
}

View File

@ -13,13 +13,6 @@ import java.util.Map;
*/
public interface OtherDataService extends IService<EntityData> {
/**
* 灾害分页列表查询
* @param page
* @param params
* @return
*/
IPage queryDisasterPage(IPage page, Map<String,Object> params);
/**
* 分页列表查询

View File

@ -14,13 +14,6 @@ import java.util.Map;
*/
public interface VisualDataService extends IService<EntityData> {
/**
* 灾害分页列表查询
* @param page
* @param params
* @return
*/
IPage queryDisasterPage(IPage page, Map<String,Object> params);
/**
* 分页列表查询

View File

@ -28,17 +28,6 @@ public class DataUploadServiceImpl extends ServiceImpl<DataUploadMapper, EntityD
@Autowired
private GuestInfoMapper guestInfoMapper;
/**
* 灾害分页列表查询
* @param page
* @param params
* @return
*/
@Override
public IPage queryDisasterPage(IPage page, Map<String, Object> params) {
page.setRecords(baseMapper.queryDisasterPage(page,params));
return page;
}
/**
* 分页列表查询

View File

@ -0,0 +1,87 @@
package com.kening.vordm.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kening.vordm.entity.EntityDataAll;
import com.kening.vordm.entity.GuestInfo;
import com.kening.vordm.mapper.GuestInfoMapper;
import com.kening.vordm.service.EntityDataAllService;
import com.kening.vordm.mapper.EntityDataAllMapper;
import com.kening.vordm.vo.UserTenantVo;
import lombok.RequiredArgsConstructor;
import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* @author G
* @description 针对表entity_data_all(其他上传的实体数据)的数据库操作Service实现
* @createDate 2024-07-09 15:13:50
*/
@Service
@RequiredArgsConstructor
public class EntityDataAllServiceImpl extends ServiceImpl<EntityDataAllMapper, EntityDataAll>
implements EntityDataAllService{
private final GuestInfoMapper guestInfoMapper;
@Override
public IPage<EntityDataAll> getEntityDataList(IPage<Object> page, EntityDataAll entityData) {
if (entityData.getType() !=null && !entityData.getType().isEmpty()){
entityData.setTypeList(Arrays.asList(entityData.getType().split(",")));
}
if (entityData.getStateListNew() !=null && !entityData.getStateListNew().isEmpty()){
entityData.setStateList(Arrays.asList(entityData.getStateListNew().split(",")));
}
return this.baseMapper.getEntityDataList(entityData, page);
}
@Override
public List<UserTenantVo> getEntityDataSourceOrganization(Long disasterId) {
return this.baseMapper.getEntityDataSourceOrganization(disasterId);
}
@Override
public R saveEntityData(EntityDataAll entityData) {
if(entityData.getIsAdministration() == 0){
//判断上传用户是否存在
LambdaQueryWrapper<GuestInfo> qw = new LambdaQueryWrapper<>();
qw.eq(GuestInfo::getEmail, entityData.getEmail());
GuestInfo guestInfo1 = guestInfoMapper.selectOne(qw);
GuestInfo guestInfo = new GuestInfo();
guestInfo.setEmail(entityData.getEmail());
guestInfo.setOrganization(entityData.getOrganization());
guestInfo.setResearchField(entityData.getResearchField());
guestInfo.setUsername(entityData.getUsername());
guestInfo.setCountry(entityData.getCountry());
guestInfo.setOccupation(entityData.getOccupation());
guestInfo.setProfessionalTitle(entityData.getProfessionalTitle());
if (guestInfo1 == null) {
guestInfoMapper.insert(guestInfo);
entityData.setUploaderId(guestInfo.getId());
} else {
guestInfo.setId(guestInfo1.getId());
guestInfoMapper.updateById(guestInfo);
entityData.setUploaderId(guestInfo1.getId());
}
}
entityData.setUploadTime(new Date());
entityData.setStatus(0);
if (entityData.getId()!=null){
return R.status(this.baseMapper.updateById(entityData) > 0);
}
return R.status(this.baseMapper.insert(entityData) > 0);
}
}

View File

@ -0,0 +1,22 @@
package com.kening.vordm.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kening.vordm.entity.GuestApplyDisasterRef;
import com.kening.vordm.service.GuestApplyDisasterRefService;
import com.kening.vordm.mapper.GuestApplyDisasterRefMapper;
import org.springframework.stereotype.Service;
/**
* @author G
* @description 针对表guest_apply_disaster_ref(灾害响应表每一个灾害可能有多个用户响应-申请)的数据库操作Service实现
* @createDate 2024-07-09 14:26:25
*/
@Service
public class GuestApplyDisasterRefServiceImpl extends ServiceImpl<GuestApplyDisasterRefMapper, GuestApplyDisasterRef>
implements GuestApplyDisasterRefService{
}

View File

@ -43,18 +43,6 @@ public class OtherDataServiceImpl extends ServiceImpl<OtherDataMapper, EntityDat
@Value("${oss.minio.image-url:}")
private String imageUrl;
/**
* 灾害分页列表查询
* @param page
* @param params
* @return
*/
@Override
public IPage queryDisasterPage(IPage page, Map<String, Object> params) {
page.setRecords(baseMapper.queryDisasterPage(page, params));
return page;
}
/**
* 分页列表查询
*

View File

@ -35,17 +35,7 @@ public class VisualDataServiceImpl extends ServiceImpl<VisualDataMapper, EntityD
private HotspotService hotspotService;
/**
* 灾害分页列表查询
* @param page
* @param params
* @return
*/
@Override
public IPage queryDisasterPage(IPage page, Map<String, Object> params) {
page.setRecords(baseMapper.queryDisasterPage(page,params));
return page;
}
/**
* 分页列表查询