| | |
| | | @RequestMapping(value = "/base/site/querySite", method = RequestMethod.POST) |
| | | @ApiOperation(value = "获取起点和终点的站点", tags = {"用户端-跨城"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "起点站点id", name = "startSiteId", required = false, dataType = "int") |
| | | @ApiImplicitParam(value = "起点站点id", name = "startSiteId", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "类型", name = "startSiteId", required = false, dataType = "int") |
| | | }) |
| | | public ResultUtil<List<SiteWarpper>> querySite(Integer startSiteId){ |
| | | public ResultUtil<List<SiteWarpper>> querySite(Integer startSiteId,Integer type) { |
| | | try { |
| | | List<SiteWarpper> list = siteService.querySite(startSiteId); |
| | | if(type == 3){ |
| | | type = 1; |
| | | } |
| | | if(type == 4){ |
| | | type = 2; |
| | | } |
| | | List<SiteWarpper> list = siteService.querySite(startSiteId, type); |
| | | return ResultUtil.success(list); |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 根据起点站点获取线路相关的终点站点 |
| | | * |
| | | * @param startSiteId |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> querySite(@Param("startSiteId") Integer startSiteId); |
| | | List<Map<String, Object>> querySite(@Param("startSiteId") Integer startSiteId, @Param("type") Integer type); |
| | | } |
| | |
| | | <select id="querySite" resultType="map"> |
| | | select * from |
| | | ( |
| | | select id as id, `name` as `name`, provinceCode as cityCode, province as cityName from t_site where province like '%市' and state = 1 |
| | | select id as id, `name` as `name`, provinceCode as cityCode, province as cityName,type from t_site where province like '%市' and state = 1 |
| | | UNION ALL |
| | | select id as id, `name` as `name`, cityCode as cityCode, city as cityName from t_site where province not like '%市' and state = 1 |
| | | select id as id, `name` as `name`, cityCode as cityCode, city as cityName,type from t_site where province not like '%市' and state = 1 |
| | | ) as a where 1 = 1 |
| | | and type = ${type} |
| | | <if test="null != startSiteId"> |
| | | and a.id in(select siteId from t_line_site where lineId in(select lineId from t_line_site where siteId = #{startSiteId} and type = 1) and type = 2) |
| | | </if> |
| | |
| | | @TableField("insertUserId") |
| | | private Integer insertUserId; |
| | | |
| | | @TableField("type") |
| | | private Integer type; |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<SiteWarpper> querySite(Integer startSiteId) throws Exception; |
| | | List<SiteWarpper> querySite(Integer startSiteId,Integer type) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<SiteWarpper> querySite(Integer startSiteId) throws Exception { |
| | | public List<SiteWarpper> querySite(Integer startSiteId,Integer type) throws Exception { |
| | | List<Map<String, Object>> sites = null; |
| | | if(null == startSiteId){ |
| | | sites = siteMapper.querySite(null); |
| | | sites = siteMapper.querySite(null,type); |
| | | }else{ |
| | | sites = siteMapper.querySite(startSiteId); |
| | | sites = siteMapper.querySite(startSiteId,type); |
| | | } |
| | | Set<String> set = new HashSet<>(); |
| | | for(Map<String, Object> site : sites) { |