Commit da1592e5 authored by 董国亮's avatar 董国亮

增加高德link查询接口

parent 80ee780d
...@@ -7,6 +7,7 @@ import io.swagger.annotations.ApiResponses; ...@@ -7,6 +7,7 @@ import io.swagger.annotations.ApiResponses;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.databus.dao.entity.GreenwaveCrossPO; import net.wanji.databus.dao.entity.GreenwaveCrossPO;
import net.wanji.databus.dao.entity.GreenwaveInfoPO; import net.wanji.databus.dao.entity.GreenwaveInfoPO;
import net.wanji.databus.dao.entity.LinkInfoEntity;
import net.wanji.databus.dao.entity.RidInfoEntity; import net.wanji.databus.dao.entity.RidInfoEntity;
import net.wanji.databus.po.BaseCrossInfoPO; import net.wanji.databus.po.BaseCrossInfoPO;
import net.wanji.databus.po.CrossBaseLaneInfoPO; import net.wanji.databus.po.CrossBaseLaneInfoPO;
...@@ -77,6 +78,18 @@ public class CrossBaseInfoController { ...@@ -77,6 +78,18 @@ public class CrossBaseInfoController {
return JsonViewObject.newInstance().success(crossTurnInfoPOS); return JsonViewObject.newInstance().success(crossTurnInfoPOS);
} }
@ApiOperation(value = "Link信息查询", notes = "Link信息查询", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@GetMapping(value = "/linkInfoList")
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = JsonViewObject.class),
})
public JsonViewObject linkInfoList(String rid) {
List<LinkInfoEntity> linkInfoEntities = baseInfoService.linkInfoList(rid);
return JsonViewObject.newInstance().success(linkInfoEntities);
}
@ApiOperation(value = "绿波基础信息查询", notes = "绿波基础信息查询", response = JsonViewObject.class, @ApiOperation(value = "绿波基础信息查询", notes = "绿波基础信息查询", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@GetMapping(value = "/greenInfoList") @GetMapping(value = "/greenInfoList")
......
...@@ -2,6 +2,7 @@ package net.wanji.web.service; ...@@ -2,6 +2,7 @@ package net.wanji.web.service;
import net.wanji.databus.dao.entity.GreenwaveCrossPO; import net.wanji.databus.dao.entity.GreenwaveCrossPO;
import net.wanji.databus.dao.entity.GreenwaveInfoPO; import net.wanji.databus.dao.entity.GreenwaveInfoPO;
import net.wanji.databus.dao.entity.LinkInfoEntity;
import net.wanji.databus.dao.entity.RidInfoEntity; import net.wanji.databus.dao.entity.RidInfoEntity;
import net.wanji.databus.po.BaseCrossInfoPO; import net.wanji.databus.po.BaseCrossInfoPO;
import net.wanji.databus.po.CrossBaseLaneInfoPO; import net.wanji.databus.po.CrossBaseLaneInfoPO;
...@@ -21,4 +22,6 @@ public interface BaseInfoService { ...@@ -21,4 +22,6 @@ public interface BaseInfoService {
List<CrossTurnInfoPO> turnInfoList(); List<CrossTurnInfoPO> turnInfoList();
List<GreenwaveInfoPO> greenInfoList(); List<GreenwaveInfoPO> greenInfoList();
List<GreenwaveCrossPO> greenCrossInfoList(); List<GreenwaveCrossPO> greenCrossInfoList();
List<LinkInfoEntity> linkInfoList(String rid);
} }
package net.wanji.web.service.impl; package net.wanji.web.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.jsonwebtoken.lang.Objects;
import io.netty.util.internal.StringUtil;
import net.wanji.databus.dao.entity.GreenwaveCrossPO; import net.wanji.databus.dao.entity.GreenwaveCrossPO;
import net.wanji.databus.dao.entity.GreenwaveInfoPO; import net.wanji.databus.dao.entity.GreenwaveInfoPO;
import net.wanji.databus.dao.entity.LinkInfoEntity;
import net.wanji.databus.dao.entity.RidInfoEntity; import net.wanji.databus.dao.entity.RidInfoEntity;
import net.wanji.databus.dao.mapper.*; import net.wanji.databus.dao.mapper.*;
import net.wanji.databus.po.BaseCrossInfoPO; import net.wanji.databus.po.BaseCrossInfoPO;
import net.wanji.databus.po.CrossBaseLaneInfoPO; import net.wanji.databus.po.CrossBaseLaneInfoPO;
import net.wanji.databus.po.CrossTurnInfoPO; import net.wanji.databus.po.CrossTurnInfoPO;
import net.wanji.web.common.util.StringUtils;
import net.wanji.web.service.BaseInfoService; import net.wanji.web.service.BaseInfoService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -34,6 +39,10 @@ public class BaseInfoServiceImpl implements BaseInfoService { ...@@ -34,6 +39,10 @@ public class BaseInfoServiceImpl implements BaseInfoService {
@Resource @Resource
private GreenwaveCrossMapper greenwaveCrossMapper; private GreenwaveCrossMapper greenwaveCrossMapper;
@Resource
private LinkInfoMapper linkInfoMapper;
@Override @Override
public List<BaseCrossInfoPO> crossInfoList() { public List<BaseCrossInfoPO> crossInfoList() {
List<BaseCrossInfoPO> list = baseCrossInfoMapper.selectAll(); List<BaseCrossInfoPO> list = baseCrossInfoMapper.selectAll();
...@@ -70,4 +79,15 @@ public class BaseInfoServiceImpl implements BaseInfoService { ...@@ -70,4 +79,15 @@ public class BaseInfoServiceImpl implements BaseInfoService {
List<GreenwaveCrossPO> greenwaveCrossPOS = greenwaveCrossMapper.selectAll(); List<GreenwaveCrossPO> greenwaveCrossPOS = greenwaveCrossMapper.selectAll();
return greenwaveCrossPOS; return greenwaveCrossPOS;
} }
@Override
public List<LinkInfoEntity> linkInfoList(String rid) {
List<LinkInfoEntity> linkInfoEntities=new ArrayList<>();
if(StringUtil.isNullOrEmpty(rid)) {
linkInfoEntities = linkInfoMapper.selectAll();
}else {
linkInfoEntities = linkInfoMapper.selectByRid(rid);
}
return linkInfoEntities;
}
} }
package net.wanji.databus.dao.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author guoliang.dong
* @date 2024/11/19 8:40
*/
@Data
public class LinkInfoEntity {
/**
* 高德编号
*/
@ApiModelProperty(name = "高德LINK编号", notes = "")
private String linkId;
/**
* 路段编号
*/
@ApiModelProperty(name = "路段编号", notes = "")
private String rid;
/**
* 行驶方向:0上行;1下行
*/
@ApiModelProperty(name = "行驶方向:0上行;1下行", notes = "")
private Integer direction;
@ApiModelProperty(name = "顺序号", notes = "")
private Integer orderId;
@ApiModelProperty(name = "行政区划代码,跨区数据会以逗号分开", notes = "")
private String areaCode;
/**
* RID;空间对象
*/
@ApiModelProperty(name = "空间对象", notes = "空间对象")
private String wkt;
/**
* 创建时间
*/
@ApiModelProperty(name = "创建时间", notes = "")
private Date gmtCreate;
}
package net.wanji.databus.dao.mapper;
import net.wanji.databus.dao.entity.LinkInfoEntity;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author guoliang.dong
* @date 2024/11/19 09:22
*/
@Repository
public interface LinkInfoMapper {
List<LinkInfoEntity> selectAll();
List<LinkInfoEntity> selectByRid(String rid);
}
<?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="net.wanji.databus.dao.mapper.LinkInfoMapper">
<!-- 通用查询映射结果 -->
<resultMap type="net.wanji.databus.dao.entity.LinkInfoEntity" id="BaseResultMap">
<result property="linkId" column="link_id"/>
<result property="rid" column="rid"/>
<result property="direction" column="direction"/>
<result property="orderId" column="order_id"/>
<result property="areaCode" column="area_code"/>
<result property="wkt" column="wkt"/>
<result property="gmtCreate" column="gmt_create"/>
</resultMap>
<sql id="Base_Column_List">
link_id,rid,direction,order_id,area_code,wkt,gmt_create
</sql>
<select id="selectAll" resultType="net.wanji.databus.dao.entity.LinkInfoEntity">
select <include refid="Base_Column_List"/>
from t_base_link_info
</select>
<select id="selectByRid" resultType="net.wanji.databus.dao.entity.LinkInfoEntity">
select <include refid="Base_Column_List"/>
from t_base_link_info
where rid = #{rid}
</select>
</mapper>
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