From bf3b932fa31c8126c46c5ba80e3ffc765023d58a Mon Sep 17 00:00:00 2001 From: whyclxw <810412026@qq.com> Date: 星期五, 16 五月 2025 11:32:17 +0800 Subject: [PATCH] 机房下拉 --- src/main/resources/mapper/StationInfMapper.xml | 91 +++++++++++++++++++++++---------------------- 1 files changed, 46 insertions(+), 45 deletions(-) diff --git a/src/main/resources/mapper/StationInfMapper.xml b/src/main/resources/mapper/StationInfMapper.xml index 088ccc8..cd549b0 100644 --- a/src/main/resources/mapper/StationInfMapper.xml +++ b/src/main/resources/mapper/StationInfMapper.xml @@ -12,15 +12,15 @@ </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_baojigroup_usr.uid=#{uid} - </if> - </where> - ) + <where> + <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"> @@ -52,23 +52,30 @@ <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_baojigroup_usr.uid=#{uid} - </if> - </where> - ) + <where> + <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 @@ -76,15 +83,13 @@ <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_baojigroup_usr.uid=#{uid} - </if> - </where> - ) + <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="getCountryByUid" resultType="java.lang.String"> @@ -96,15 +101,13 @@ <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_baojigroup_usr.uid=#{uid} - </if> - </where> - ) + <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="getStationByUid" resultType="java.lang.String"> @@ -119,15 +122,13 @@ <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_baojigroup_usr.uid=#{uid} - </if> - </where> - ) + <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> </mapper> \ No newline at end of file -- Gitblit v1.9.1