| | |
| | | private BattInfService service; |
| | | |
| | | |
| | | @ApiOperation(value = "添加电池组") |
| | | @PostMapping("addBatt") |
| | | @ApiOperation(value = "设备添加电池组") |
| | | @PostMapping("addBattInDev") |
| | | public Response addBatt(@RequestBody BattInf binf){ |
| | | return service.addBatt(binf); |
| | | } |
| | | @ApiOperation(value = "新建电池组(新的设备新的电池组)") |
| | | @PostMapping("addDev") |
| | | public Response addDev(@RequestBody BattInf binf){ |
| | | return service.addDev(binf); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除电池组") |
| | | @GetMapping("delBatt") |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.dto.Station.Provice; |
| | | import com.whyc.pojo.db_station.PowerInf; |
| | | import com.whyc.pojo.db_station.StationInf; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | //获取省市下的区县 |
| | | List<String> getCountryByUid(@Param("uid") Integer uid,@Param("provice") String provice, @Param("city") String city); |
| | | //获取省市区县下的站点 |
| | | List<String> getStationByUid(@Param("uid") Integer uid,@Param("provice") String provice,@Param("city") String city,@Param("country") String country); |
| | | List<StationInf> getStationByUid(@Param("uid") Integer uid,@Param("provice") String provice,@Param("city") String city,@Param("country") String country); |
| | | //获取站点下的电源(下拉) |
| | | List<String> getPowerByUid(@Param("uid") Integer uid,@Param("provice") String provice,@Param("city") String city,@Param("country") String country,@Param("stationName") String stationName); |
| | | List<PowerInf> getPowerByUid(@Param("uid") Integer uid, @Param("provice") String provice, @Param("city") String city, @Param("country") String country, @Param("stationName") String stationName); |
| | | } |
| | |
| | | @ApiModelProperty(value = "设备名称") |
| | | private String devName; |
| | | |
| | | @ApiModelProperty(value = "设备类型") |
| | | private String devType; |
| | | |
| | | @ApiModelProperty(value = "设备编号") |
| | | private Integer devNum; |
| | | |
| | | @ApiModelProperty(value = "电池组id") |
| | | private Integer battgroupId; |
| | | |
| | |
| | | @Autowired(required = false) |
| | | private BattInfMapper mapper; |
| | | |
| | | |
| | | //添加电源 |
| | | /*新建电池组(新的设备新的电池组) |
| | | * @param binf |
| | | * 1.在电源下新建设备,记录设备编号,devNum,设备名称为设备类型+devNum |
| | | */ |
| | | public Response addDev(BattInf adddinf) { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("station_id",adddinf.getStationId()); |
| | | wrapper.eq("power_id",adddinf.getPowerId()); |
| | | return new Response().set(1, true, "新建电池组(新的设备新的电池组)"); |
| | | } |
| | | //设备下添加电源 |
| | | @Transactional |
| | | public Response addBatt(BattInf addbinf) { |
| | | //判断电池组是否存在 |
| | |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list!=null,pageInfo,"查询电池"); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.Station.Provice; |
| | | import com.whyc.mapper.StationInfMapper; |
| | | import com.whyc.pojo.db_station.PowerInf; |
| | | import com.whyc.pojo.db_station.StationInf; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | } |
| | | //获取省市区县下的站点 |
| | | public Response getStationByUid(int uid, String provice, String city, String country) { |
| | | List<String> list=mapper.getStationByUid(uid,provice,city,country); |
| | | List<StationInf> list=mapper.getStationByUid(uid,provice,city,country); |
| | | return new Response().setII(1,list.size()>0,list,"获取省市区县下的站点"); |
| | | } |
| | | //获取站点下的电源(下拉) |
| | | public Response getPowerByUid(int uid, String provice, String city, String country, String stationName) { |
| | | List<String> list=mapper.getPowerByUid(uid,provice,city,country,stationName); |
| | | List<PowerInf> list=mapper.getPowerByUid(uid,provice,city,country,stationName); |
| | | return new Response().setII(1,list.size()>0,list,"获取站点下的电源(下拉)"); |
| | | } |
| | | } |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="getStationByUid" resultType="java.lang.String"> |
| | | select distinct station_name from db_station.tb_station_inf |
| | | <select id="getStationByUid" resultType="StationInf"> |
| | | select distinct * from db_station.tb_station_inf |
| | | <where> |
| | | <if test="provice!=null"> |
| | | and provice=#{provice} |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="getPowerByUid" resultType="java.lang.String"> |
| | | select distinct power_name from db_station.tb_power_inf,db_station.tb_station_inf |
| | | <select id="getPowerByUid" resultType="PowerInf"> |
| | | select distinct * 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"> |