Commit 85a1744a authored by 周健威's avatar 周健威

添加地区、卫星传感器列表等

parent 51ff787d
package com.github.wxiaoqi.security.common.biz;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.wxiaoqi.security.common.msg.TableResultResponse;
......@@ -8,11 +9,15 @@ import com.github.wxiaoqi.security.common.util.Query;
import org.springframework.beans.factory.annotation.Autowired;
import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.weekend.Fn;
import tk.mybatis.mapper.weekend.WeekendSqls;
import java.lang.reflect.ParameterizedType;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.function.Supplier;
/**
* Created by Mr.AG
......@@ -24,6 +29,9 @@ public abstract class BaseBiz<M extends Mapper<T>, T> {
@Autowired
protected M mapper;
//第二个泛型class
protected Class<T> entityClass = (Class<T>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[1];
public void setMapper(M mapper) {
this.mapper = mapper;
}
......@@ -37,6 +45,61 @@ public abstract class BaseBiz<M extends Mapper<T>, T> {
return mapper.selectByPrimaryKey(id);
}
public void updateByWeekendSelective(T target, Function<WeekendSqls<T>, WeekendSqls<T>> where) {
WeekendSqls whereSqls = where.apply(WeekendSqls.<T>custom());
Example.Builder builder = new Example.Builder(entityClass)
.where(whereSqls);
Example example = builder.build();
mapper.updateByExampleSelective(target, example);
}
public List<T> selectByWeekend(Function<WeekendSqls<T>, WeekendSqls<T>> where, String orderStr) {
WeekendSqls whereSqls = where.apply(WeekendSqls.<T>custom());
Example.Builder builder = new Example.Builder(entityClass)
.where(whereSqls);
Example example = builder.build();
if(StrUtil.isNotBlank(orderStr)) {
example.setOrderByClause(orderStr);
}
return selectByExample(example);
}
public List<T> selectByWeekendsOr(Supplier<List<WeekendSqls<T>>> where, String orderStr) {
List<WeekendSqls<T>> whereSqlss = where.get();
Example.Builder builder = new Example.Builder(entityClass);
for(WeekendSqls weekendSqls : whereSqlss) {
builder.andWhere(weekendSqls);
}
Example example = builder.build();
if(StrUtil.isNotBlank(orderStr)) {
example.setOrderByClause(orderStr);
}
return selectByExample(example);
}
public List<T> selectByWeekend(Function<WeekendSqls<T>, WeekendSqls<T>> where) {
return selectByWeekend(where, null);
}
public List<T> selectByAttrs(Fn<T, Object> attrFn, List attrFnList) {
return selectByExample(new Example.Builder(entityClass)
.where(WeekendSqls.<T>custom().andIn(attrFn, attrFnList)).build());
}
public List<T> selectBetween(Fn<T, Object> attrFn, Object start, Object end) {
return selectBetween(attrFn, start, end, null);
}
public List<T> selectBetween(Fn<T, Object> attrFn, Object start, Object end, Fn<T, Object> deleteAttrFn) {
WeekendSqls<T> weekendSqls = WeekendSqls.<T>custom()
.andGreaterThanOrEqualTo(attrFn, start)
.andLessThanOrEqualTo(attrFn, end);
if(null != deleteAttrFn) {
weekendSqls.andEqualTo(deleteAttrFn, 0);
}
return selectByExample(new Example.Builder(entityClass)
.where(weekendSqls).build());
}
public List<T> selectList(T entity) {
return mapper.select(entity);
......
......@@ -3,7 +3,8 @@
#\u5305\u540D
package=com.upyuns.platform.rs.website
#\u4F5C\u8005
author=jiaoruizhen
#author=jiaoruizhen
author=zjw
#Email
email=jiaoruizhen@126.com
#\u8868\u524D\u9519\u8BEF\u7684Unicode\u5B57\u7B26\u4E32!
......
......@@ -3,7 +3,8 @@
#\u5305\u540D
package=com.upyuns.platform.rs.website
#\u4F5C\u8005
author=jiaoruizhen
#author=jiaoruizhen
author=zjw
#Email
email=jiaoruizhen@126.com
#\u8868\u524D\u9519\u8BEF\u7684Unicode\u5B57\u7B26\u4E32!
......
package com.upyuns.platform.rs.datacenter.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Table;
import java.math.BigDecimal;
@Data
@Table(name = "rscm_area_info")
@ApiModel(description = "")
public class RscpAreaInfo implements java.io.Serializable {
/** 版本号 */
private static final long serialVersionUID = -3661956697950578813L;
/* This code was generated by TableGo tools, mark 1 begin. */
/** admincode */
@ApiModelProperty(value = "")
private String admincode;
/** proadcode */
@ApiModelProperty(value = "")
private String proadcode;
/** cityadcode */
@ApiModelProperty(value = "")
private String cityadcode;
/** name */
@ApiModelProperty(value = "")
private String name;
/** cityname */
@ApiModelProperty(value = "")
private String cityname;
/** proname */
@ApiModelProperty(value = "")
private String proname;
/** shapeLeng */
@ApiModelProperty(value = "")
private Integer shapeLeng;
/** shapeArea */
@ApiModelProperty(value = "")
private Integer shapeArea;
/** geom */
@ApiModelProperty(value = "")
private String geom;
/** pointGeom */
@ApiModelProperty(value = "")
private String pointGeom;
/** 地区中文拼音 */
@ApiModelProperty(value = "地区中文拼音")
private String pinyin;
/** 拼音缩写 */
@ApiModelProperty(value = "拼音缩写")
private String pysx;
/** geomSamll */
@ApiModelProperty(value = "")
private String geomSamll;
/** 是否根据下级区域计算覆盖率 */
@ApiModelProperty(value = "是否根据下级区域计算覆盖率")
private Integer isHandleCoverRate;
/** 下级占上级区域的百分比 */
@ApiModelProperty(value = "下级占上级区域的百分比")
private BigDecimal areaParentPercent;
/* This code was generated by TableGo tools, mark 1 end. */
/* This code was generated by TableGo tools, mark 2 begin. */
/**
* 获取admincode
*
* @return admincode
*/
public String getAdmincode() {
return this.admincode;
}
/**
* 设置admincode
*
* @param admincode
*/
public void setAdmincode(String admincode) {
this.admincode = admincode;
}
/**
* 获取proadcode
*
* @return proadcode
*/
public String getProadcode() {
return this.proadcode;
}
/**
* 设置proadcode
*
* @param proadcode
*/
public void setProadcode(String proadcode) {
this.proadcode = proadcode;
}
/**
* 获取cityadcode
*
* @return cityadcode
*/
public String getCityadcode() {
return this.cityadcode;
}
/**
* 设置cityadcode
*
* @param cityadcode
*/
public void setCityadcode(String cityadcode) {
this.cityadcode = cityadcode;
}
/**
* 获取name
*
* @return name
*/
public String getName() {
return this.name;
}
/**
* 设置name
*
* @param name
*/
public void setName(String name) {
this.name = name;
}
/**
* 获取cityname
*
* @return cityname
*/
public String getCityname() {
return this.cityname;
}
/**
* 设置cityname
*
* @param cityname
*/
public void setCityname(String cityname) {
this.cityname = cityname;
}
/**
* 获取proname
*
* @return proname
*/
public String getProname() {
return this.proname;
}
/**
* 设置proname
*
* @param proname
*/
public void setProname(String proname) {
this.proname = proname;
}
/**
* 获取shapeLeng
*
* @return shapeLeng
*/
public Integer getShapeLeng() {
return this.shapeLeng;
}
/**
* 设置shapeLeng
*
* @param shapeLeng
*/
public void setShapeLeng(Integer shapeLeng) {
this.shapeLeng = shapeLeng;
}
/**
* 获取shapeArea
*
* @return shapeArea
*/
public Integer getShapeArea() {
return this.shapeArea;
}
/**
* 设置shapeArea
*
* @param shapeArea
*/
public void setShapeArea(Integer shapeArea) {
this.shapeArea = shapeArea;
}
/**
* 获取geom
*
* @return geom
*/
public String getGeom() {
return this.geom;
}
/**
* 设置geom
*
* @param geom
*/
public void setGeom(String geom) {
this.geom = geom;
}
/**
* 获取pointGeom
*
* @return pointGeom
*/
public String getPointGeom() {
return this.pointGeom;
}
/**
* 设置pointGeom
*
* @param pointGeom
*/
public void setPointGeom(String pointGeom) {
this.pointGeom = pointGeom;
}
/**
* 获取地区中文拼音
*
* @return 地区中文拼音
*/
public String getPinyin() {
return this.pinyin;
}
/**
* 设置地区中文拼音
*
* @param pinyin
* 地区中文拼音
*/
public void setPinyin(String pinyin) {
this.pinyin = pinyin;
}
/**
* 获取拼音缩写
*
* @return 拼音缩写
*/
public String getPysx() {
return this.pysx;
}
/**
* 设置拼音缩写
*
* @param pysx
* 拼音缩写
*/
public void setPysx(String pysx) {
this.pysx = pysx;
}
/**
* 获取geomSamll
*
* @return geomSamll
*/
public String getGeomSamll() {
return this.geomSamll;
}
/**
* 设置geomSamll
*
* @param geomSamll
*/
public void setGeomSamll(String geomSamll) {
this.geomSamll = geomSamll;
}
/**
* 获取是否根据下级区域计算覆盖率
*
* @return 是否根据下级区域计算覆盖率
*/
public Integer getIsHandleCoverRate() {
return this.isHandleCoverRate;
}
/**
* 设置是否根据下级区域计算覆盖率
*
* @param isHandleCoverRate
* 是否根据下级区域计算覆盖率
*/
public void setIsHandleCoverRate(Integer isHandleCoverRate) {
this.isHandleCoverRate = isHandleCoverRate;
}
/**
* 获取下级占上级区域的百分比
*
* @return 下级占上级区域的百分比
*/
public BigDecimal getAreaParentPercent() {
return this.areaParentPercent;
}
/**
* 设置下级占上级区域的百分比
*
* @param areaParentPercent
* 下级占上级区域的百分比
*/
public void setAreaParentPercent(BigDecimal areaParentPercent) {
this.areaParentPercent = areaParentPercent;
}
/* This code was generated by TableGo tools, mark 2 end. */
}
\ No newline at end of file
package com.upyuns.platform.rs.datacenter.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.sql.Timestamp;
@Data
@Table(name = "rscp_image_price")
@ApiModel(description = "影像数据单价表")
public class RscpImagePrice implements java.io.Serializable {
/** 版本号 */
private static final long serialVersionUID = 1324632775380935758L;
/* This code was generated by TableGo tools, mark 1 begin. */
/** 标识 */
@ApiModelProperty(value = "标识")
private String id;
/** 卫星 */
@ApiModelProperty(value = "卫星")
private String imageSatelliteType;
/** 分辨率 */
@ApiModelProperty(value = "分辨率")
private String imageResolution;
/** 光谱 */
@ApiModelProperty(value = "光谱")
private String imageSpectrumType;
/** 单价 */
@ApiModelProperty(value = "单价")
private BigDecimal price;
/** 优惠 */
@ApiModelProperty(value = "优惠")
private BigDecimal discount;
/** 更新人 */
@ApiModelProperty(value = "更新人")
private String updName;
/** 更新时间 */
@ApiModelProperty(value = "更新时间")
private Timestamp updTime;
/** 产品类型 0101 原始 0102 正射 */
@ApiModelProperty(value = "产品类型 0101 原始 0102 正射")
private String imageProductType;
/** 每景单价 */
@ApiModelProperty(value = "每景单价")
private BigDecimal unitPrice;
/** 传感器类型 */
@ApiModelProperty(value = "传感器类型")
private String imageSensorType;
/** 是否应用于数据定制 */
@ApiModelProperty(value = "是否应用于数据定制")
private Integer isUseForData;
/** 状态。0 不可用, 1可用 */
@ApiModelProperty(value = " 状态。0 不可用, 1可用")
private Integer status;
/** 卫星全称 */
@ApiModelProperty(value = "卫星全称")
private String satelliteName;
/** 传感器全称 */
@ApiModelProperty(value = "传感器全称")
private String sensorName;
/** 数据类型 定制化 */
@ApiModelProperty(value = " 数据类型 定制化")
private String dataType;
/** 是否在每日最新里显示:0 不显示,1 显示 */
@ApiModelProperty(value = "是否在每日最新里显示:0 不显示,1 显示")
private Integer dailyDisplay;
/** 每日最新的排序 */
@ApiModelProperty(value = "每日最新的排序")
private Integer dailySort;
/** 销售状态 0下架 1上架 */
@ApiModelProperty(value = "销售状态 0下架 1上架")
private Integer isSell;
/** 首页排序 */
@ApiModelProperty(value = "首页排序")
private Integer indexSort;
/** 是否要首页显示:0否,1是 */
@ApiModelProperty(value = "是否要首页显示:0否,1是")
private Integer isIndex;
/* This code was generated by TableGo tools, mark 1 end. */
/* This code was generated by TableGo tools, mark 2 begin. */
/**
* 获取标识
*
* @return 标识
*/
public String getId() {
return this.id;
}
/**
* 设置标识
*
* @param id
* 标识
*/
public void setId(String id) {
this.id = id;
}
/**
* 获取卫星
*
* @return 卫星
*/
public String getImageSatelliteType() {
return this.imageSatelliteType;
}
/**
* 设置卫星
*
* @param imageSatelliteType
* 卫星
*/
public void setImageSatelliteType(String imageSatelliteType) {
this.imageSatelliteType = imageSatelliteType;
}
/**
* 获取分辨率
*
* @return 分辨率
*/
public String getImageResolution() {
return this.imageResolution;
}
/**
* 设置分辨率
*
* @param imageResolution
* 分辨率
*/
public void setImageResolution(String imageResolution) {
this.imageResolution = imageResolution;
}
/**
* 获取光谱
*
* @return 光谱
*/
public String getImageSpectrumType() {
return this.imageSpectrumType;
}
/**
* 设置光谱
*
* @param imageSpectrumType
* 光谱
*/
public void setImageSpectrumType(String imageSpectrumType) {
this.imageSpectrumType = imageSpectrumType;
}
/**
* 获取单价
*
* @return 单价
*/
public BigDecimal getPrice() {
return this.price;
}
/**
* 设置单价
*
* @param price
* 单价
*/
public void setPrice(BigDecimal price) {
this.price = price;
}
/**
* 获取优惠
*
* @return 优惠
*/
public BigDecimal getDiscount() {
return this.discount;
}
/**
* 设置优惠
*
* @param discount
* 优惠
*/
public void setDiscount(BigDecimal discount) {
this.discount = discount;
}
/**
* 获取更新人
*
* @return 更新人
*/
public String getUpdName() {
return this.updName;
}
/**
* 设置更新人
*
* @param updName
* 更新人
*/
public void setUpdName(String updName) {
this.updName = updName;
}
/**
* 获取更新时间
*
* @return 更新时间
*/
public Timestamp getUpdTime() {
return this.updTime;
}
/**
* 设置更新时间
*
* @param updTime
* 更新时间
*/
public void setUpdTime(Timestamp updTime) {
this.updTime = updTime;
}
/**
* 获取产品类型 0101 原始 0102 正射
*
* @return 产品类型 0101 原始 0102 正射
*/
public String getImageProductType() {
return this.imageProductType;
}
/**
* 设置产品类型 0101 原始 0102 正射
*
* @param imageProductType
* 产品类型 0101 原始 0102 正射
*/
public void setImageProductType(String imageProductType) {
this.imageProductType = imageProductType;
}
/**
* 获取每景单价
*
* @return 每景单价
*/
public BigDecimal getUnitPrice() {
return this.unitPrice;
}
/**
* 设置每景单价
*
* @param unitPrice
* 每景单价
*/
public void setUnitPrice(BigDecimal unitPrice) {
this.unitPrice = unitPrice;
}
/**
* 获取传感器类型
*
* @return 传感器类型
*/
public String getImageSensorType() {
return this.imageSensorType;
}
/**
* 设置传感器类型
*
* @param imageSensorType
* 传感器类型
*/
public void setImageSensorType(String imageSensorType) {
this.imageSensorType = imageSensorType;
}
/**
* 获取是否应用于数据定制
*
* @return 是否应用于数据定制
*/
public Integer getIsUseForData() {
return this.isUseForData;
}
/**
* 设置是否应用于数据定制
*
* @param isUseForData
* 是否应用于数据定制
*/
public void setIsUseForData(Integer isUseForData) {
this.isUseForData = isUseForData;
}
/**
* 获取 状态。0 不可用, 1可用
*
* @return 状态。0 不可用
*/
public Integer getStatus() {
return this.status;
}
/**
* 设置 状态。0 不可用, 1可用
*
* @param status
* 状态。0 不可用
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* 获取卫星全称
*
* @return 卫星全称
*/
public String getSatelliteName() {
return this.satelliteName;
}
/**
* 设置卫星全称
*
* @param satelliteName
* 卫星全称
*/
public void setSatelliteName(String satelliteName) {
this.satelliteName = satelliteName;
}
/**
* 获取传感器全称
*
* @return 传感器全称
*/
public String getSensorName() {
return this.sensorName;
}
/**
* 设置传感器全称
*
* @param sensorName
* 传感器全称
*/
public void setSensorName(String sensorName) {
this.sensorName = sensorName;
}
/**
* 获取 数据类型 定制化
*
* @return 数据类型 定制化
*/
public String getDataType() {
return this.dataType;
}
/**
* 设置 数据类型 定制化
*
* @param dataType
* 数据类型 定制化
*/
public void setDataType(String dataType) {
this.dataType = dataType;
}
/**
* 获取是否在每日最新里显示:0 不显示,1 显示
*
* @return 是否在每日最新里显示:0 不显示
*/
public Integer getDailyDisplay() {
return this.dailyDisplay;
}
/**
* 设置是否在每日最新里显示:0 不显示,1 显示
*
* @param dailyDisplay
* 是否在每日最新里显示:0 不显示
*/
public void setDailyDisplay(Integer dailyDisplay) {
this.dailyDisplay = dailyDisplay;
}
/**
* 获取每日最新的排序
*
* @return 每日最新的排序
*/
public Integer getDailySort() {
return this.dailySort;
}
/**
* 设置每日最新的排序
*
* @param dailySort
* 每日最新的排序
*/
public void setDailySort(Integer dailySort) {
this.dailySort = dailySort;
}
/**
* 获取销售状态 0下架 1上架
*
* @return 销售状态 0下架 1上架
*/
public Integer getIsSell() {
return this.isSell;
}
/**
* 设置销售状态 0下架 1上架
*
* @param isSell
* 销售状态 0下架 1上架
*/
public void setIsSell(Integer isSell) {
this.isSell = isSell;
}
/**
* 获取首页排序
*
* @return 首页排序
*/
public Integer getIndexSort() {
return this.indexSort;
}
/**
* 设置首页排序
*
* @param indexSort
* 首页排序
*/
public void setIndexSort(Integer indexSort) {
this.indexSort = indexSort;
}
/**
* 获取是否要首页显示:0否,1是
*
* @return 是否要首页显示:0否
*/
public Integer getIsIndex() {
return this.isIndex;
}
/**
* 设置是否要首页显示:0否,1是
*
* @param isIndex
* 是否要首页显示:0否
*/
public void setIsIndex(Integer isIndex) {
this.isIndex = isIndex;
}
/* This code was generated by TableGo tools, mark 2 end. */
}
\ No newline at end of file
package com.upyuns.platform.rs.datacenter.biz;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.upyuns.platform.rs.datacenter.entity.RscpAreaInfo;
import com.upyuns.platform.rs.datacenter.entity.RscpImagePrice;
import com.upyuns.platform.rs.datacenter.mapper.RscpAreaInfoMapper;
import com.upyuns.platform.rs.datacenter.mapper.RscpImagePriceMapper;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class RscpAreaInfoBiz extends BaseBiz<RscpAreaInfoMapper, RscpAreaInfo> {
public RscpAreaInfo queryAreaInfoByAreaId(String areaCode) {
return mapper.queryAreaInfoByAreaCode(areaCode);
}
public List<RscpAreaInfo> getDirectSubAreas(String parentId) {
return mapper.getDirectSubAreas(parentId);
}
}
package com.upyuns.platform.rs.datacenter.biz;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.upyuns.platform.rs.datacenter.entity.RscpImagePrice;
import com.upyuns.platform.rs.datacenter.mapper.RscpImagePriceMapper;
import org.springframework.stereotype.Service;
@Service
public class RscpImagePriceBiz extends BaseBiz<RscpImagePriceMapper, RscpImagePrice> {
}
package com.upyuns.platform.rs.datacenter.mapper;
import com.upyuns.platform.rs.datacenter.entity.RscpAreaInfo;
import com.upyuns.platform.rs.datacenter.entity.RscpImagePrice;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface RscpAreaInfoMapper extends Mapper<RscpAreaInfo> {
public RscpAreaInfo queryAreaInfoByAreaCode(String areaCode);
public List<RscpAreaInfo> getDirectSubAreas(String parentId);
}
\ No newline at end of file
package com.upyuns.platform.rs.datacenter.mapper;
import com.upyuns.platform.rs.datacenter.entity.RscpImagePrice;
import tk.mybatis.mapper.common.Mapper;
public interface RscpImagePriceMapper extends Mapper<RscpImagePrice> {
}
\ No newline at end of file
package com.upyuns.platform.rs.datacenter.rest;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.upyuns.platform.rs.datacenter.biz.RscpAreaInfoBiz;
import com.upyuns.platform.rs.datacenter.entity.RscpAreaInfo;
import lombok.Data;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.stream.Collectors;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE;
@RestController
@RequestMapping("areaInfo")
public class RscpAreaInfoController extends BaseController<RscpAreaInfoBiz, RscpAreaInfo> {
@RequestMapping(value = "/app/unauth/getAreaList", method = RequestMethod.GET)
public ObjectRestResponse<List<RscpAreaInfo>> getAreaList(String parentId) {
if(StrUtil.isNotBlank(parentId)) {
parentId = "000000";
}
return ObjectRestResponse.succ( baseBiz.getDirectSubAreas(parentId));
}
@RequestMapping(value = "/app/unauth/queryAreaInfoByAreaId", method = RequestMethod.GET)
public ObjectRestResponse<RscpAreaInfo> queryAreaInfoByAreaId(String areaCode) {
return ObjectRestResponse.succ( baseBiz.queryAreaInfoByAreaId(areaCode));
}
}
\ No newline at end of file
......@@ -3,15 +3,34 @@ package com.upyuns.platform.rs.datacenter.rest;
import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.util.Query;
import com.github.wxiaoqi.security.common.util.UserAgentUtil;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.util.result.JsonResultUtil;
import com.github.wxiaoqi.security.common.vo.PageParam;
import com.upyuns.platform.rs.datacenter.biz.RscpImageDataTotalBiz;
import com.upyuns.platform.rs.datacenter.entity.RscpImageDataTotal;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
@RestController
@RequestMapping("imageData")
public class RscpImageDataTotalController extends BaseController<RscpImageDataTotalBiz, RscpImageDataTotal> {
@RequestMapping(value = "/app/unauth/query", method = RequestMethod.GET)
public ObjectRestResponse unauthQuery(PageParam pageParam) {
return ObjectRestResponse.succ(baseBiz.selectByQuery(new Query(pageParam)));
}
@RequestMapping(value = "/app/unauth/query1", method = RequestMethod.GET)
public ObjectRestResponse unauthQuery1(PageParam pageParam) {
return ObjectRestResponse.succ(baseBiz.selectByQuery(new Query(pageParam)));
}
static public class DTO {
}
}
\ No newline at end of file
package com.upyuns.platform.rs.datacenter.rest;
import cn.hutool.core.collection.CollUtil;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.util.Query;
import com.github.wxiaoqi.security.common.vo.PageParam;
import com.upyuns.platform.rs.datacenter.biz.RscpImageDataTotalBiz;
import com.upyuns.platform.rs.datacenter.biz.RscpImagePriceBiz;
import com.upyuns.platform.rs.datacenter.entity.RscpImageDataTotal;
import com.upyuns.platform.rs.datacenter.entity.RscpImagePrice;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.stream.Collectors;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE;
@RestController
@RequestMapping("imagePrice")
public class RscpImagePriceController extends BaseController<RscpImagePriceBiz, RscpImagePrice> {
@RequestMapping(value = "/app/unauth/all", method = RequestMethod.GET)
public ObjectRestResponse unauthQuery() {
List<RscpImagePrice> list = baseBiz.selectByWeekend(w -> {
w.andEqualTo(RscpImagePrice::getStatus, SYS_TRUE);
return w;
}, " dailySort asc");
List<ImagePriceVO> imagePriceVOS = CollUtil.newArrayList();
String key = "";
List<String> satelliteTypes = list.parallelStream().map(RscpImagePrice::getImageSatelliteType).collect(Collectors.toList());
for(String satelliteType : satelliteTypes) {
List<RscpImagePrice> imagePrices = list.parallelStream().filter(rscpImagePrice -> satelliteType.equals(rscpImagePrice.getImageSatelliteType())).collect(Collectors.toList());
imagePriceVOS.add(new ImagePriceVO(){{
setImageSatelliteType(satelliteType);
setSatelliteName(imagePrices.get(0).getSatelliteName());
setImagePrices(imagePrices);
}});
}
return ObjectRestResponse.succ(imagePriceVOS);
}
@Data
static public class ImagePriceVO {
/** 卫星 */
private String imageSatelliteType;
/** 卫星全称 */
@ApiModelProperty(value = "卫星全称")
private String satelliteName;
List<RscpImagePrice> imagePrices;
}
}
\ No newline at end of file
......@@ -89,4 +89,7 @@
</sql>
<!-- This code was generated by TableGo tools, mark 2 end. -->
<!-- <select id="selectList" >-->
<!-- </select>-->
</mapper>
\ No newline at end of file
<?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">
<!-- rscm_area_info -->
<mapper namespace="com.upyuns.platform.rs.datacenter.mapper.RscpAreaInfoMapper">
<!-- This code was generated by TableGo tools, mark 1 begin. -->
<!-- 字段映射 -->
<resultMap id="rscmAreaInfoMap" type="com.upyuns.platform.rs.datacenter.entity.RscpAreaInfo">
<id column="admincode" property="admincode" jdbcType="VARCHAR" />
<result column="proadcode" property="proadcode" jdbcType="VARCHAR" />
<result column="cityadcode" property="cityadcode" jdbcType="VARCHAR" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="cityname" property="cityname" jdbcType="VARCHAR" />
<result column="proname" property="proname" jdbcType="VARCHAR" />
<result column="shape_leng" property="shapeLeng" jdbcType="INTEGER" />
<result column="shape_area" property="shapeArea" jdbcType="INTEGER" />
<result column="geom" property="geom" jdbcType="VARCHAR" />
<result column="point_geom" property="pointGeom" jdbcType="VARCHAR" />
<result column="pinyin" property="pinyin" jdbcType="VARCHAR" />
<result column="pysx" property="pysx" jdbcType="VARCHAR" />
<result column="geom_samll" property="geomSamll" jdbcType="VARCHAR" />
<result column="is_handle_cover_rate" property="isHandleCoverRate" jdbcType="INTEGER" />
<result column="area_parent_percent" property="areaParentPercent" jdbcType="INTEGER" />
</resultMap>
<!-- This code was generated by TableGo tools, mark 1 end. -->
<!-- This code was generated by TableGo tools, mark 2 begin. -->
<!-- 表查询字段 -->
<sql id="allColumns">
rai.admincode, rai.proadcode, rai.cityadcode, rai.name, rai.cityname, rai.proname, rai.shape_leng, rai.shape_area,
rai.geom, rai.point_geom, rai.pinyin, rai.pysx, rai.geom_samll, rai.is_handle_cover_rate, rai.area_parent_percent
</sql>
<!-- This code was generated by TableGo tools, mark 2 end. -->
<select id="queryAreaInfoByAreaCode" resultType="com.upyuns.platform.rs.datacenter.entity.RscpAreaInfo">
select a.name,a.shape_area,a.admincode,st_asgeojson(geom,16,0) geom,a.proname,a.cityname
from rscp_area_info a
where admincode=#{areaCode}
</select>
<select id="getDirectSubAreas" resultType="com.upyuns.platform.rs.datacenter.entity.RscpAreaInfo">
select admincode as adminid,name as name, pinyin as namepy
from rscm_area_info where admincode != #{parentId} and admincode like
CASE WHEN #{parentId} = '000000' THEN '%0000' "
WHEN substring(#{parentId}, 3, 4) = '0000' THEN substring(#{parentId}, 1, 2)||'%'||substring(#{parentId}, 5, 2)
ELSE substring(#{parentId}, 1, 4)||'%' END
order by pinyin
</select>
</mapper>
\ No newline at end of file
<?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">
<!-- 影像数据单价表(rscp_image_price) -->
<mapper namespace="com.upyuns.platform.rs.datacenter.mapper.RscpImagePriceMapper">
<!-- This code was generated by TableGo tools, mark 1 begin. -->
<!-- 字段映射 -->
<resultMap id="rscpImagePriceMap" type="com.upyuns.platform.rs.datacenter.entity.RscpImagePrice">
<id column="id" property="id" jdbcType="VARCHAR" />
<result column="image_satellite_type" property="imageSatelliteType" jdbcType="VARCHAR" />
<result column="image_resolution" property="imageResolution" jdbcType="VARCHAR" />
<result column="image_spectrum_type" property="imageSpectrumType" jdbcType="VARCHAR" />
<result column="price" property="price" jdbcType="INTEGER" />
<result column="discount" property="discount" jdbcType="INTEGER" />
<result column="upd_name" property="updName" jdbcType="VARCHAR" />
<result column="upd_time" property="updTime" jdbcType="TIMESTAMP" />
<result column="image_product_type" property="imageProductType" jdbcType="VARCHAR" />
<result column="unit_price" property="unitPrice" jdbcType="INTEGER" />
<result column="image_sensor_type" property="imageSensorType" jdbcType="VARCHAR" />
<result column="is_use_for_data" property="isUseForData" jdbcType="INTEGER" />
<result column="status" property="status" jdbcType="INTEGER" />
<result column="satellite_name" property="satelliteName" jdbcType="VARCHAR" />
<result column="sensor_name" property="sensorName" jdbcType="VARCHAR" />
<result column="data_type" property="dataType" jdbcType="VARCHAR" />
<result column="daily_display" property="dailyDisplay" jdbcType="INTEGER" />
<result column="daily_sort" property="dailySort" jdbcType="INTEGER" />
<result column="is_sell" property="isSell" jdbcType="INTEGER" />
<result column="index_sort" property="indexSort" jdbcType="INTEGER" />
<result column="is_index" property="isIndex" jdbcType="INTEGER" />
</resultMap>
<!-- This code was generated by TableGo tools, mark 1 end. -->
<!-- This code was generated by TableGo tools, mark 2 begin. -->
<!-- 表查询字段 -->
<sql id="allColumns">
rip.id, rip.image_satellite_type, rip.image_resolution, rip.image_spectrum_type, rip.price, rip.discount, rip.upd_name, rip.upd_time,
rip.image_product_type, rip.unit_price, rip.image_sensor_type, rip.is_use_for_data, rip.status, rip.satellite_name, rip.sensor_name, rip.data_type,
rip.daily_display, rip.daily_sort, rip.is_sell, rip.index_sort, rip.is_index
</sql>
<!-- This code was generated by TableGo tools, mark 2 end. -->
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment