whyclxw
2025-05-16 40299443ed9ed000a268da0906a1a948eeaf390e
下拉查询电源
4个文件已修改
41 ■■■■■ 已修改文件
src/main/java/com/whyc/controller/ConditionController.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/StationInfMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/StationInfService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/StationInfMapper.xml 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/ConditionController.java
@@ -48,6 +48,14 @@
        return stationInfService.getStationByUid(uinf.getId(),provice,city,country);
    }
    @ApiOperation("获取站点下的电源(下拉)")
    @GetMapping("getPowerByUid")
    public Response getPowerByUid(@RequestParam(required = false) String provice,@RequestParam(required = false) String city
            ,@RequestParam(required = false) String country,@RequestParam(required = false) String stationName) {
        User uinf= ActionUtil.getUser();
        return stationInfService.getPowerByUid(uinf.getId(),provice,city,country,stationName);
    }
    @ApiOperation(value = "当前用户所在包机组下所有的用户(下拉)")
    @GetMapping("getBaojiUserByUid")
src/main/java/com/whyc/mapper/StationInfMapper.java
@@ -19,5 +19,6 @@
    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<String> getPowerByUid(@Param("uid") Integer uid,@Param("provice") String provice,@Param("city") String city,@Param("country") String country,@Param("stationName") String stationName);
}
src/main/java/com/whyc/service/StationInfService.java
@@ -43,4 +43,9 @@
        List<String> 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);
        return new Response().setII(1,list.size()>0,list,"获取站点下的电源(下拉)");
    }
}
src/main/resources/mapper/StationInfMapper.xml
@@ -131,4 +131,29 @@
            </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
        <where>
            tb_power_inf.station_id=tb_station_inf.station_id
            <if test="provice!=null">
                and tb_station_inf.provice=#{provice}
            </if>
            <if test="city!=null">
                and tb_station_inf.city=#{city}
            </if>
            <if test="country!=null">
                and tb_station_inf.country=#{country}
            </if>
            <if test="stationName!=null">
                and tb_station_inf.station_name=#{stationName}
            </if>
            <if test="uid>100">
                and tb_power_inf.power_id in(
                select distinct power_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>
</mapper>