| | |
| | | |
| | | @ApiOperation("获取省下的市(下拉)") |
| | | @GetMapping("getCityByUid") |
| | | public Response getCityByUid(@RequestParam(required = false) String stationName1) { |
| | | public Response getCityByUid(@RequestParam(required = false) String provice) { |
| | | User uinf= ActionUtil.getUser(); |
| | | return stationInfService.getCityByUid(uinf.getId(),stationName1); |
| | | return stationInfService.getCityByUid(uinf.getId(),provice); |
| | | } |
| | | |
| | | @ApiOperation("获取省市下的区县(下拉)") |
| | | @GetMapping("getCountryByUid") |
| | | public Response getCountryByUid(@RequestParam(required = false) String stationName1,@RequestParam(required = false) String stationName2) { |
| | | public Response getCountryByUid(@RequestParam(required = false) String provice,@RequestParam(required = false) String city) { |
| | | User uinf= ActionUtil.getUser(); |
| | | return stationInfService.getCountryByUid(uinf.getId(),stationName1,stationName2); |
| | | return stationInfService.getCountryByUid(uinf.getId(),provice,city); |
| | | } |
| | | |
| | | @ApiOperation("获取省市区县下的站点(下拉)") |
| | | @GetMapping("getStationByUid") |
| | | public Response getStationByUid(@RequestParam(required = false) String stationName1,@RequestParam(required = false) String stationName2,@RequestParam(required = false) String stationName3) { |
| | | public Response getStationByUid(@RequestParam(required = false) String provice,@RequestParam(required = false) String city,@RequestParam(required = false) String country) { |
| | | User uinf= ActionUtil.getUser(); |
| | | return stationInfService.getStationByUid(uinf.getId(),stationName1,stationName2,stationName3); |
| | | return stationInfService.getStationByUid(uinf.getId(),provice,city,country); |
| | | } |
| | | |
| | | |
| | |
| | | package com.whyc.dto.Station; |
| | | |
| | | import com.whyc.pojo.db_station.PowerInf; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class Station { |
| | |
| | | private String country; |
| | | private String stationName; |
| | | private Integer stationId; |
| | | private List<PowerInf> pinflist; |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private String stationName; |
| | | |
| | | @TableField(exist = false) |
| | | private String provice; |
| | | |
| | | @TableField(exist = false) |
| | | private String city; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | private String country; |
| | | |
| | | @TableField(exist = false) |
| | | private String fullName; |
| | | |
| | | |
| | | } |
| | |
| | | return new Response().setII(1,list.size()>0,list,"获取所有的省份"); |
| | | } |
| | | //获取省下的市 |
| | | public Response getCityByUid(int uid, String stationName1) { |
| | | List<String> list=mapper.getCityByUid(uid,stationName1); |
| | | public Response getCityByUid(int uid, String provice) { |
| | | List<String> list=mapper.getCityByUid(uid,provice); |
| | | return new Response().setII(1,list.size()>0,list,"获取省下的市"); |
| | | } |
| | | //获取省市下的区县 |
| | | public Response getCountryByUid(int uid, String stationName1, String stationName2) { |
| | | List<String> list=mapper.getCountryByUid(uid,stationName1,stationName2); |
| | | public Response getCountryByUid(int uid, String provice, String city) { |
| | | List<String> list=mapper.getCountryByUid(uid,provice,city); |
| | | return new Response().setII(1,list.size()>0,list,"获取省市下的区县"); |
| | | } |
| | | //获取省市区县下的站点 |
| | | public Response getStationByUid(int uid, String stationName1, String stationName2, String stationName3) { |
| | | List<String> list=mapper.getStationByUid(uid,stationName1,stationName2,stationName3); |
| | | public Response getStationByUid(int uid, String provice, String city, String country) { |
| | | List<String> list=mapper.getStationByUid(uid,provice,city,country); |
| | | return new Response().setII(1,list.size()>0,list,"获取省市区县下的站点"); |
| | | } |
| | | } |
| | |
| | | select ifnull(max(power_id),0) from db_station.tb_power_inf where power_id>0; |
| | | </select> |
| | | <select id="getPower" resultType="com.whyc.pojo.db_station.PowerInf"> |
| | | select tb_power_inf.*,tb_station_inf.station_name |
| | | select tb_power_inf.*,tb_station_inf.station_name,tb_station_inf.provice,tb_station_inf.city,tb_station_inf.country,tb_station_inf.full_name |
| | | from db_station.tb_power_inf,db_station.tb_station_inf |
| | | where tb_power_inf.station_id=tb_station_inf.station_id |
| | | <if test="provice!=null"> |
| | |
| | | </resultMap> |
| | | <select id="getLeftStation" resultMap="name1List"> |
| | | select distinct provice from db_station.tb_station_inf |
| | | where station_id in( |
| | | select distinct station_id from db_user.tb_user_baojigroup_power,db_user.tb_baojigroup_usr |
| | | <where> |
| | | tb_user_baojigroup_power.baoji_id=tb_baojigroup_usr.baoji_id |
| | | <if test="uid>100"> |
| | | and tb_station_inf.station_id in( |
| | | select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr |
| | | where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id |
| | | and tb_baojigroup_usr.uid=#{uid} |
| | | ) |
| | | </if> |
| | | </where> |
| | | ) |
| | | </select> |
| | | |
| | | <resultMap id="name2List" type="city"> |
| | |
| | | <result property="country" column="country" ></result> |
| | | <result property="stationName" column="station_name" ></result> |
| | | <result property="stationId" column="station_id" ></result> |
| | | <collection property="pinflist" javaType="java.util.ArrayList" ofType="com.whyc.pojo.db_station.PowerInf" column="{stationId=station_id}" select="selectPowerInf"> |
| | | </collection> |
| | | </resultMap> |
| | | <select id="selectStation" resultMap="name4List"> |
| | | SELECT distinct #{provice} as provice, #{city} as city, #{country} as country,station_name,station_id from db_station.tb_station_inf |
| | | where provice=#{provice} and city=#{city} and country=#{country} |
| | | </select> |
| | | |
| | | <select id="selectPowerInf" resultType="powerInf"> |
| | | SELECT distinct tb_power_inf.* from db_station.tb_power_inf,db_station.tb_station_inf |
| | | where tb_power_inf.station_id=tb_station_inf.station_id and tb_power_inf.station_id=#{stationId} |
| | | </select> |
| | | |
| | | <select id="getProviceByUid" resultType="java.lang.String"> |
| | | select distinct provice from db_station.tb_station_inf |
| | | where tb_station_inf.station_id in( |
| | | select distinct station_id from db_user.tb_user_baojigroup_power,db_user.tb_baojigroup_usr |
| | | <where> |
| | | tb_user_baojigroup_power.baoji_id=tb_baojigroup_usr.baoji_id |
| | | <if test="uid>100"> |
| | | and tb_station_inf.station_id in( |
| | | select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr |
| | | where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id |
| | | and tb_baojigroup_usr.uid=#{uid} |
| | | ) |
| | | </if> |
| | | </where> |
| | | ) |
| | | </select> |
| | | <select id="getCityByUid" resultType="java.lang.String"> |
| | | select distinct city from db_station.tb_station_inf |
| | |
| | | <if test="provice!=null"> |
| | | and provice=#{provice} |
| | | </if> |
| | | and tb_station_inf.station_id in( |
| | | select distinct station_id from db_user.tb_user_baojigroup_power,db_user.tb_baojigroup_usr |
| | | <where> |
| | | tb_user_baojigroup_power.baoji_id=tb_baojigroup_usr.baoji_id |
| | | <if test="uid>100"> |
| | | and tb_station_inf.station_id in( |
| | | select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr |
| | | where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id |
| | | and tb_baojigroup_usr.uid=#{uid} |
| | | </if> |
| | | </where> |
| | | ) |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="getCountryByUid" resultType="java.lang.String"> |
| | |
| | | <if test="city!=null"> |
| | | and city=#{city} |
| | | </if> |
| | | and tb_station_inf.station_id in( |
| | | select distinct station_id from db_user.tb_user_baojigroup_power,db_user.tb_baojigroup_usr |
| | | <where> |
| | | tb_user_baojigroup_power.baoji_id=tb_baojigroup_usr.baoji_id |
| | | <if test="uid>100"> |
| | | and tb_station_inf.station_id in( |
| | | select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr |
| | | where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id |
| | | and tb_baojigroup_usr.uid=#{uid} |
| | | </if> |
| | | </where> |
| | | ) |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="getStationByUid" resultType="java.lang.String"> |
| | |
| | | <if test="country!=null"> |
| | | and country=#{country} |
| | | </if> |
| | | and tb_station_inf.station_id in( |
| | | select distinct station_id from db_user.tb_user_baojigroup_power,db_user.tb_baojigroup_usr |
| | | <where> |
| | | tb_user_baojigroup_power.baoji_id=tb_baojigroup_usr.baoji_id |
| | | <if test="uid>100"> |
| | | and tb_station_inf.station_id in( |
| | | select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr |
| | | where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id |
| | | and tb_baojigroup_usr.uid=#{uid} |
| | | </if> |
| | | </where> |
| | | ) |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |