Commit 60155ad9 authored by 单奇雲's avatar 单奇雲

1.调试接口,2.新增右侧检索查询接口

parent b505fa5e
package com.yeejoin.amos.fas.core.common.response;
/**
*
* <pre>
* 三维坐标点实体
* </pre>
*
*/
public class CoordDTO
{
/**
* <pre>
*
* </pre>
*/
private Double x;
private Double y;
private Double z;
public Double getX()
{
return x;
}
public void setX(Double x)
{
this.x = x;
}
public Double getY()
{
return y;
}
public void setY(Double y)
{
this.y = y;
}
public Double getZ()
{
return z;
}
public void setZ(Double z)
{
this.z = z;
}
}
\ No newline at end of file
package com.yeejoin.amos.fas.core.common.response;
import com.alibaba.fastjson.JSON;
/**
*
* <pre>
* 三维视图节点元素
* </pre>
*/
public class Node3DVoResponse{
protected String id;
private String key;
/**
* 设备名称
*/
private String label;
/**
* 类型,nodeVo中填充View3DNodeType中的name值
*/
private String type;
/**
* 等级
*/
private String level;
/**
* "level_0"
*/
private String levelStr;
/**
* 所属模型,例如floor_1’,‘floor_2’,‘floor_3’
*/
private String objKey;
/**
* 显示图标
*/
private String displayIcon;
/**
* 节点位置,{x: 17.6681, y: 39.7036, z: 13.8012}
*/
private String positionDTO;
/**
* 节点位置,{x: 0, y: 0, z: 0}
*/
private String rotationDTO;
/**
* 节点位置,{x: 1, y: 1, z: 1}
*/
private String scaleDTO;
/**
* 节点位置,包括x,y,z值
*/
private CoordDTO position;
/**
* 节点位置,包括x,y,z值
*/
private CoordDTO rotation;
/**
* 节点位置,包括x,y,z值
*/
private CoordDTO scale;
/**
* 显示图标闪烁标题
*/
private Boolean showInfo = false;
/**
* 显示图标闪烁
*/
private Boolean twinkle = false;
/**
* 显示图标闪烁标题
*/
private String title;
/**
* 点编号
*/
private String dataCode;
/**
* 点等级
*/
private String dataLevel;
/**
* 保护对象名称
*/
private String protectObjName;
/**
* 是否室内(默认false,为室外)
*/
private Boolean isDoor = false;
private String orgCode;
/**
* 闪烁频率每秒
*/
private int rate = 0;
public int getRate() {
return rate;
}
public void setRate(int rate) {
this.rate = rate;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getLevel() {
return level;
}
public void setLevel(String level) {
this.level = level;
}
public String getLevelStr() {
return levelStr;
}
public void setLevelStr(String levelStr) {
this.levelStr = levelStr;
}
public String getObjKey() {
return objKey;
}
public void setObjKey(String objKey) {
this.objKey = objKey;
}
public String getDisplayIcon() {
return displayIcon;
}
public void setDisplayIcon(String displayIcon) {
this.displayIcon = displayIcon;
}
public Boolean getShowInfo() {
return showInfo;
}
public void setShowInfo(Boolean showInfo) {
this.showInfo = showInfo;
}
public Boolean getTwinkle() {
return twinkle;
}
public void setTwinkle(Boolean twinkle) {
this.twinkle = twinkle;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDataCode() {
return dataCode;
}
public void setDataCode(String dataCode) {
this.dataCode = dataCode;
}
public String getDataLevel() {
return dataLevel;
}
public void setDataLevel(String dataLevel) {
this.dataLevel = dataLevel;
}
public String getProtectObjName() {
return protectObjName;
}
public void setProtectObjName(String protectObjName) {
this.protectObjName = protectObjName;
}
public Boolean getIsDoor() {
return isDoor;
}
public void setIsDoor(Boolean isDoor) {
this.isDoor = isDoor;
}
public String getOrgCode() {
return orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getPositionDTO() {
return positionDTO;
}
public void setPositionDTO(String positionDTO) {
this.positionDTO = positionDTO;
}
public String getRotationDTO() {
return rotationDTO;
}
public void setRotationDTO(String rotationDTO) {
this.rotationDTO = rotationDTO;
}
public String getScaleDTO() {
return scaleDTO;
}
public void setScaleDTO(String scaleDTO) {
this.scaleDTO = scaleDTO;
}
public CoordDTO getPosition() {
return positionDTO == null?null:JSON.parseObject(positionDTO, CoordDTO.class);
}
public void setPosition(CoordDTO position) {
this.position = position;
}
public CoordDTO getRotation() {
return rotationDTO == null?null:JSON.parseObject(rotationDTO, CoordDTO.class);
}
public void setRotation(CoordDTO rotation) {
this.rotation = rotation;
}
public CoordDTO getScale() {
return scaleDTO == null?null:JSON.parseObject(scaleDTO, CoordDTO.class);
}
public void setScale(CoordDTO scale) {
this.scale = scale;
}
}
\ No newline at end of file
......@@ -19,6 +19,10 @@ public class RegionTreeResponse {
private Boolean isBind;
private String type;
private Boolean isRegion;
private String position3d;
private String routePath;
private String level;
private String levelStr;
private List<RegionTreeResponse> children = new ArrayList<>();
......@@ -88,6 +92,48 @@ public class RegionTreeResponse {
public void setIsRegion(Boolean isRegion) {
this.isRegion = isRegion;
}
public String getPosition3d() {
return position3d;
}
public void setPosition3d(String position3d) {
this.position3d = position3d;
}
/**
* @return the routePath
*/
public String getRoutePath() {
return routePath;
}
/**
* @param routePath the routePath to set
*/
public void setRoutePath(String routePath) {
this.routePath = routePath;
}
/**
* @return the levelStr
*/
public String getLevelStr() {
return levelStr;
}
/**
* @param levelStr the levelStr to set
*/
public void setLevelStr(String levelStr) {
this.levelStr = levelStr;
}
/**
* @return the level
*/
public String getLevel() {
return level;
}
/**
* @param level the level to set
*/
public void setLevel(String level) {
this.level = level;
}
......
......@@ -94,6 +94,14 @@ public class BaseController {
return authToken;
}
protected String getChannelType() {
String channelType = request.getHeader("channelType");
if (channelType == null) {
channelType = request.getParameter("channelType");
}
return channelType;
}
//redi缓存选择的用户信息
private String buildKey(String userId, String token) {
//return "region_" + userId + "_" + token.substring(0, token.indexOf('_', 1));
......
......@@ -13,10 +13,12 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.itextpdf.text.pdf.PdfStructTreeController.returnType;
import com.yeejoin.amos.fas.business.bo.BindPointBo;
import com.yeejoin.amos.fas.business.bo.BindRegionBo;
import com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService;
import com.yeejoin.amos.fas.business.service.intfc.IView3dService;
import com.yeejoin.amos.fas.business.util.StringUtil;
import com.yeejoin.amos.fas.business.vo.ExceptionRegionVo;
import com.yeejoin.amos.fas.business.vo.ReginParams;
import com.yeejoin.amos.fas.common.enums.ResourceTypeDefEnum;
......@@ -48,7 +50,8 @@ public class View3dController extends BaseController {
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
orgCode = "10";
return CommonResponseUtil.success(riskSourceService.findRegionTree(orgCode));
String channelType = this.getChannelType();
return CommonResponseUtil.success(riskSourceService.findRegionTree(channelType,orgCode));
}
@ApiOperation(value = "区域详情查询", notes = "区域详情查询")
......@@ -57,7 +60,8 @@ public class View3dController extends BaseController {
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
orgCode = "10";
return CommonResponseUtil.success(riskSourceService.findRegionById(riskSourceId,orgCode));
String channelType = this.getChannelType();
return CommonResponseUtil.success(riskSourceService.findRegionById(riskSourceId,orgCode,channelType));
}
@ApiOperation(value = "区域绑定", notes = "区域绑定")
......@@ -84,7 +88,8 @@ public class View3dController extends BaseController {
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
orgCode = "10";
return CommonResponseUtil.success(view3dService.getPointTreeByType(type,orgCode));
String channelType = this.getChannelType();
return CommonResponseUtil.success(view3dService.getPointTreeByType(type,orgCode,channelType));
}
return CommonResponseUtil.failure(type + " 类型不存在");
}
......@@ -203,4 +208,33 @@ public class View3dController extends BaseController {
return CommonResponseUtil.success();
}
/**
* <pre>
* 初始化三维视图节点
* </pre>
*/
@GetMapping(value = "/init3dViewNode", produces = "application/json;charset=UTF-8")
@ApiOperation(value = "初始化三维视图节点", notes = "初始化三维视图节点")
public CommonResponse init3dViewNode(
@ApiParam(value = "节点类型", required = false) @RequestParam(required = false) String type) {
if (StringUtil.isNotEmpty(type)) {
return CommonResponseUtil.success(view3dService.find3dViewDataByType(type));
}
return CommonResponseUtil.failure();
}
@GetMapping(value = "/retrieve/all",produces = "application/json;charset=UTF-8")
@ApiOperation(value = "右侧边栏搜索", notes = "右侧边栏搜索")
public CommonResponse retrieveAll(
@RequestParam(required = false) String type,
@RequestParam(required = false) String inputText,
@RequestParam(required = true) int current,
@RequestParam(required = true) int pageSize
) {
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
orgCode = "1*2";
return view3dService.retrieveAll(type,inputText,current,pageSize,orgCode);
}
}
......@@ -99,9 +99,9 @@ public interface RiskSourceMapper extends BaseMapper {
void updateRpn(RiskSource riskSource);
List<RegionTreeResponse> getRegionList(String orgCode);
List<RegionTreeResponse> getRegionList(String channelType,String orgCode);
HashMap<String, Object> findRegionById(@Param("id")Long id,@Param("orgCode")String orgCode);
HashMap<String, Object> findRegionById(@Param("id")Long id,@Param("orgCode")String orgCode,@Param("channelType")String channelType);
void batchSaveRegionUe4(List<BindRegionBo> regionBoList);
}
......@@ -11,6 +11,7 @@ import com.yeejoin.amos.fas.business.vo.View3dNodeVo;
import com.yeejoin.amos.fas.dao.entity.RiskSource;
import org.apache.ibatis.annotations.Param;
import com.yeejoin.amos.fas.core.common.response.Node3DVoResponse;
import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse;
public interface View3dMapper extends BaseMapper{
......@@ -20,7 +21,7 @@ public interface View3dMapper extends BaseMapper{
* @param orgCode
* @return
*/
List<RegionTreeResponse> getPointTreeByType(@Param("type")String type,@Param("orgCode")String orgCode);
List<RegionTreeResponse> getPointTreeByType(@Param("type")String type,@Param("orgCode")String orgCode,@Param("channelType") String channelType);
/**
* 获取点详情
......@@ -112,4 +113,10 @@ public interface View3dMapper extends BaseMapper{
* @return
*/
List<View3dNodeVo> initViewErrorNode(String type, String orgCode);
List<Node3DVoResponse> findViewDataByType(String type);
Long retrieveAllCount(String type, String inputText,String orgCode);
List<HashMap<String, Object>> retrieveAll(String type, String inputText, long start, int length,String orgCode);
}
......@@ -1748,8 +1748,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
@Override
public List<RegionTreeResponse> findRegionTree(String orgCode) {
List<RegionTreeResponse> regionList = riskSourceMapper.getRegionList(orgCode);
public List<RegionTreeResponse> findRegionTree(String channelType,String orgCode) {
List<RegionTreeResponse> regionList = riskSourceMapper.getRegionList(channelType,orgCode);
return getRiskRegionTree(regionList);
}
......@@ -1773,8 +1773,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
@Override
public HashMap<String, Object> findRegionById(Long id,String orgCode) {
HashMap<String, Object> regionDetail = riskSourceMapper.findRegionById(id,orgCode);
public HashMap<String, Object> findRegionById(Long id,String orgCode,String channelType) {
HashMap<String, Object> regionDetail = riskSourceMapper.findRegionById(id,orgCode,channelType);
if(regionDetail != null) {
Long isBind = (Long) regionDetail.get("isBind");
regionDetail.put("isBind", isBind == 0 ? false : true);
......
......@@ -16,6 +16,8 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
......@@ -53,7 +55,9 @@ import com.yeejoin.amos.fas.common.enums.ResourceTypeDefEnum;
import com.yeejoin.amos.fas.common.enums.RpnChangeTypeEum;
import com.yeejoin.amos.fas.common.enums.StatisticsErrorTypeEum;
import com.yeejoin.amos.fas.common.enums.View3dRefreshAreaEum;
import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.common.request.DateUtil;
import com.yeejoin.amos.fas.core.common.response.Node3DVoResponse;
import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
......@@ -155,8 +159,12 @@ public class View3dServiceImpl implements IView3dService {
Optional<FireCar> data = iFireCarDao.findById(pointBo.getPointId());
if(data.isPresent()){
FireCar fireCar = data.get();
fireCar.setUe4Location(pointBo.getUe4Location());
fireCar.setUe4Rotation(pointBo.getUe4Rotation());
String ue4Location = pointBo.getUe4Location();
String ue4Rotation = pointBo.getUe4Rotation();
String position3d = pointBo.getPosition3d();
if(ue4Location != null) fireCar.setUe4Location(ue4Location);
if(ue4Rotation != null) fireCar.setUe4Rotation(ue4Rotation);
if(position3d != null) fireCar.setPosition3d(position3d);
iFireCarDao.save(fireCar);
}
}
......@@ -165,8 +173,12 @@ public class View3dServiceImpl implements IView3dService {
Optional<WaterResource> data = iWaterResourceDao.findById(pointBo.getPointId());
if(data.isPresent()){
WaterResource waterResource = data.get();
waterResource.setUe4Location(pointBo.getUe4Location());
waterResource.setUe4Rotation(pointBo.getUe4Rotation());
String ue4Location = pointBo.getUe4Location();
String ue4Rotation = pointBo.getUe4Rotation();
String position3d = pointBo.getPosition3d();
if(ue4Location != null) waterResource.setUe4Location(ue4Location);
if(ue4Rotation != null) waterResource.setUe4Rotation(ue4Rotation);
if(position3d != null) waterResource.setPosition3d(position3d);
iWaterResourceDao.save(waterResource);
}
}
......@@ -175,8 +187,12 @@ public class View3dServiceImpl implements IView3dService {
Optional<FireStation> data = iFireStationDao.findById(pointBo.getPointId());
if(data.isPresent()){
FireStation fireStation = data.get();
fireStation.setUe4Location(pointBo.getUe4Location());
fireStation.setUe4Rotation(pointBo.getUe4Rotation());
String ue4Location = pointBo.getUe4Location();
String ue4Rotation = pointBo.getUe4Rotation();
String position3d = pointBo.getPosition3d();
if(ue4Location != null) fireStation.setUe4Location(ue4Location);
if(ue4Rotation != null) fireStation.setUe4Rotation(ue4Rotation);
if(position3d != null) fireStation.setPosition3d(position3d);
iFireStationDao.save(fireStation);
}
}
......@@ -185,8 +201,12 @@ public class View3dServiceImpl implements IView3dService {
Optional<FireEquipment> data = iFireEquipmentDao.findById(pointBo.getPointId());
if(data.isPresent()){
FireEquipment fireEquipment = data.get();
fireEquipment.setUe4Location(pointBo.getUe4Location());
fireEquipment.setUe4Rotation(pointBo.getUe4Rotation());
String ue4Location = pointBo.getUe4Location();
String ue4Rotation = pointBo.getUe4Rotation();
String position3d = pointBo.getPosition3d();
if(ue4Location != null) fireEquipment.setUe4Location(ue4Location);
if(ue4Rotation != null) fireEquipment.setUe4Rotation(ue4Rotation);
if(position3d != null) fireEquipment.setPosition3d(position3d);
iFireEquipmentDao.save(fireEquipment);
}
}
......@@ -196,8 +216,12 @@ public class View3dServiceImpl implements IView3dService {
Equipment equipment = null;
if(data.isPresent()){
equipment = data.get();
equipment.setUe4Location(pointBo.getUe4Location());
equipment.setUe4Rotation(pointBo.getUe4Rotation());
String ue4Location = pointBo.getUe4Location();
String ue4Rotation = pointBo.getUe4Rotation();
String position3d = pointBo.getPosition3d();
if(ue4Location != null) equipment.setUe4Location(ue4Location);
if(ue4Rotation != null) equipment.setUe4Rotation(ue4Rotation);
if(position3d != null) equipment.setPosition3d(position3d);
iEquipmentDao.save(equipment);
}
}
......@@ -210,8 +234,12 @@ public class View3dServiceImpl implements IView3dService {
Optional<RiskSource> data = iRiskSourceDao.findById(pointBo.getPointId());
if(data.isPresent()){
RiskSource riskSource = data.get();
riskSource.setUe4Location(pointBo.getUe4Location());
riskSource.setUe4Rotation(pointBo.getUe4Rotation());
String ue4Location = pointBo.getUe4Location();
String ue4Rotation = pointBo.getUe4Rotation();
String position3d = pointBo.getPosition3d();
if(ue4Location != null) riskSource.setUe4Location(ue4Location);
if(ue4Rotation != null) riskSource.setUe4Rotation(pointBo.getUe4Rotation());
if(position3d != null) riskSource.setPosition3d(position3d);
iRiskSourceDao.save(riskSource);
}
}
......@@ -222,8 +250,8 @@ public class View3dServiceImpl implements IView3dService {
}
@Override
public List<RegionTreeResponse> getPointTreeByType(String type,String orgCode) {
List<RegionTreeResponse> pointTreeByType = view3dMapper.getPointTreeByType(type,orgCode);
public List<RegionTreeResponse> getPointTreeByType(String type,String orgCode,String channelType) {
List<RegionTreeResponse> pointTreeByType = view3dMapper.getPointTreeByType(type,orgCode,channelType);
return convertPointTree(pointTreeByType);
}
......@@ -543,4 +571,18 @@ public class View3dServiceImpl implements IView3dService {
e.printStackTrace();
}
}
@Override
public List<Node3DVoResponse> find3dViewDataByType(String type) {
return view3dMapper.findViewDataByType(type);
}
@Override
public CommonResponse retrieveAll(String type, String inputText, int current, int pageSize,String orgCode) {
CommonPageable pageable = new CommonPageable( current, pageSize);
Long count = view3dMapper.retrieveAllCount(type,inputText,orgCode);
List<HashMap<String, Object>> retrieveAll = view3dMapper.retrieveAll(type, inputText,pageable.getOffset(),pageable.getPageSize(),orgCode);
Page result = new PageImpl(retrieveAll,pageable,count);
return CommonResponseUtil.success(result);
}
}
......@@ -121,7 +121,7 @@ public interface IRiskSourceService {
* @param orgCode 机构
* @return 树
*/
List<RegionTreeResponse> findRegionTree(String orgCode);
List<RegionTreeResponse> findRegionTree(String channelType,String orgCode);
/**
* 区域详情重新
......@@ -129,7 +129,7 @@ public interface IRiskSourceService {
* @param orgCode 机构
* @return map
*/
HashMap<String, Object> findRegionById(Long id,String orgCode);
HashMap<String, Object> findRegionById(Long id,String orgCode,String channelType);
/**
* 批量保存区域信息
......
package com.yeejoin.amos.fas.business.service.intfc;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.fas.business.bo.BindPointBo;
import com.yeejoin.amos.fas.business.bo.SafetyExecuteBo;
import com.yeejoin.amos.fas.business.vo.ExceptionRegionVo;
import com.yeejoin.amos.fas.business.vo.SafetyIndexDetailVo;
import com.yeejoin.amos.fas.business.vo.TodaySafetyIndexVo;
import com.yeejoin.amos.fas.business.vo.View3dNodeVo;
import com.yeejoin.amos.fas.core.common.response.Node3DVoResponse;
import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author DELL
......@@ -37,7 +39,7 @@ public interface IView3dService {
* @param orgCode 登陆机构
* @return list
*/
List<RegionTreeResponse> getPointTreeByType(String type,String orgCode);
List<RegionTreeResponse> getPointTreeByType(String type,String orgCode,String channelType);
/**
* 获取点详情
......@@ -131,4 +133,8 @@ public interface IView3dService {
* 刷新安全指数
*/
void safetyIndexRefresh();
List<Node3DVoResponse> find3dViewDataByType(String type);
CommonResponse retrieveAll(String type, String inputText, int current, int pageSize,String orgCode);
}
......@@ -41,7 +41,7 @@ public class CrossDomainFilter implements Filter
// 允许的方法
response.setHeader("Access-Control-Allow-Methods","GET,POST,DELETE,OPTIONS,PUT");
response.setHeader("Access-Control-Max-Age", "3600");
response.setHeader("Access-Control-Allow-Headers","Origin, X-Requested-With, X-Access-Token, X-Api-Key, Content-Type, Accept, Cache-Control,appKey, product, token");
response.setHeader("Access-Control-Allow-Headers","Origin, X-Requested-With, X-Access-Token, X-Api-Key, Content-Type, Accept, Cache-Control,appKey, product, token, channelType");
chain.doFilter(req, res);
}
......
......@@ -182,4 +182,16 @@
<column name="type"/>
</createIndex>
</changeSet>
<changeSet author="shanqiyun" id="1588067351000-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="f_risk_source" columnName="route_path"/>
</not>
</preConditions>
<comment>f_risk_source add column route_path </comment>
<sql>
alter table f_risk_source add column `route_path` varchar(2000) DEFAULT NULL COMMENT '路径坐标' after `position3d`;
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -2,11 +2,13 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.PatrolMapper">
<update id="updatePoint3dPosition">
update p_point
set
ue4_location = #{ue4Location},
ue4_rotation = #{ue4Rotation}
where id = #{pointId}
</update>
<update id="updatePoint3dPosition">
update p_point
<trim prefix="set" suffixOverrides=",">
<if test="ue4Location != null">ue4_location = #{ue4Location},</if>
<if test="ue4Rotation != null">ue4_rotation = #{ue4Rotation},</if>
<if test="position3d != null">coordinates = #{position3d},</if>
</trim>
where id = #{pointId}
</update>
</mapper>
\ No newline at end of file
......@@ -678,19 +678,37 @@
<select id="getRegionList" parameterType="string" resultType="com.yeejoin.amos.fas.core.common.response.RegionTreeResponse">
select
id,name,code,parent_id,ue4_location,ue4_rotation,ue4_extent,
IF(ISNULL(IF(replace(trim(ue4_rotation),'[]','')='',NULL,ue4_rotation))
AND ISNULL(IF(replace(trim(ue4_location),'[]','')='',NULL,ue4_location)),0,1) as is_bind,
IF(is_region = 'TRUE',1,0) as is_region
from f_risk_source
where is_region = 'TRUE' AND org_code like CONCAT(#{orgCode},'%')
rs.id,rs.name,rs.code,rs.parent_id,rs.ue4_location,rs.ue4_rotation,rs.ue4_extent,
<choose>
<when test="channelType == '3dpage'">
IF(ISNULL(rs.route_path) || LENGTH(trim(rs.route_path)) <![CDATA[ <]]> 1,0,1) as is_bind,
</when>
<otherwise>
IF(ISNULL(IF(replace(trim(rs.ue4_rotation),'[]','')='',NULL,rs.ue4_rotation))
AND ISNULL(IF(replace(trim(rs.ue4_location),'[]','')='',NULL,rs.ue4_location)),0,1) as is_bind,
</otherwise>
</choose>
IF(rs.is_region = 'TRUE',1,0) as is_region,
rs.route_path,
rl.level,
CONCAT('level_',rl.level) as level_str
from f_risk_source rs
left join f_risk_level rl ON rs.risk_level_id = rl.id
where is_region = 'TRUE' AND rs.org_code like CONCAT(#{orgCode},'%')
</select>
<select id="findRegionById" resultType="java.util.HashMap">
select
id,name,code,parent_id as parentId,ue4_location as ue4Location,ue4_rotation as ue4Rotation,ue4_extent as ue4Extent,
IF(ISNULL(IF(replace(trim(ue4_rotation),'[]','')='',NULL,ue4_rotation))
AND ISNULL(IF(replace(trim(ue4_location),'[]','')='',NULL,ue4_location)),0,1) as isBind,
id,name,code,parent_id as parentId,ue4_location as ue4Location,ue4_rotation as ue4Rotation,ue4_extent as ue4Extent,route_path as routePath,
<choose>
<when test="channelType == '3dpage'">
IF(ISNULL(route_path) || LENGTH(trim(route_path)) <![CDATA[ <]]> 1,0,1) as isBind,
</when>
<otherwise>
IF(ISNULL(IF(replace(trim(ue4_rotation),'[]','')='',NULL,ue4_rotation))
AND ISNULL(IF(replace(trim(ue4_location),'[]','')='',NULL,ue4_location)),0,1) as isBind,
</otherwise>
</choose>
IF(is_region = 'TRUE',1,0) as isRegion,
(select name from f_risk_level where level = r.risk_level_id) as riskLevel
from f_risk_source r
......@@ -711,7 +729,7 @@
ue4_extent = #{item.ue4Extent,jdbcType=VARCHAR},
</if>
<if test="item.position3d != null" >
position3d = #{item.position3d,jdbcType=VARCHAR},
route_path = #{item.position3d,jdbcType=VARCHAR},
</if>
</set>
where id = #{item.riskSourceId,jdbcType=BIGINT}
......
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