<?xml version="1.0" encoding="UTF-8"?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.whyc.mapper.BaojigroupPowerMapper">
|
|
<delete id="deleteStationAndLockList">
|
<foreach collection="list" item="item" separator=";">
|
delete from db_user.tb_baojigroup_power where baoji_group_id = #{item.baojiGroupId} and
|
station_id = #{item.stationId} and power_id=#{item.powerId}
|
</foreach>
|
</delete>
|
<select id="getALlLockByBjId" resultType="com.whyc.pojo.db_user.BaojigroupPower">
|
select tb_baojigroup_power.*,tb_power_inf.power_name,tb_station_inf.station_name
|
from db_user.tb_baojigroup_power,db_station.tb_station_inf,db_station.tb_power_inf
|
where
|
tb_baojigroup_power.station_id=tb_station_inf.station_id
|
and tb_baojigroup_power.power_id=tb_power_inf.power_id
|
and baoji_group_id=#{id}
|
order by tb_baojigroup_power.baoji_group_id asc ,tb_baojigroup_power.station_id asc,tb_baojigroup_power.power_id asc
|
</select>
|
<select id="getHomeStationAndLock" resultType="com.whyc.pojo.db_user.BaojigroupPower">
|
select distinct tb_baojigroup_power.station_id,tb_baojigroup_power.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
|
<if test="uid>100">
|
and tb_baojigroup_usr.uid=#{uid}
|
</if>
|
</where>
|
</select>
|
<select id="getLocIdByStationidAndBjId" resultType="java.lang.Integer">
|
select distinct tb_baojigroup_power.power_id
|
from db_user.tb_baojigroup_power
|
<where>
|
tb_baojigroup_power.baoji_group_id=#{baojiId}
|
and tb_baojigroup_power.station_id=#{stationId}
|
</where>
|
</select>
|
<select id="getLockList" resultType="com.whyc.pojo.db_station.PowerInf">
|
select distinct l.power_id,l.power_name,l.station_id,s.station_name
|
from db_user.tb_baojigroup_power bl ,db_station.tb_power_inf l,db_station.tb_station_inf s
|
where bl.power_id = l.power_id and bl.station_id = s.station_id
|
and bl.baoji_group_id = #{id}
|
order by s.station_name
|
</select>
|
<select id="getPowerList" resultType="com.whyc.pojo.db_station.PowerInf">
|
select distinct l.power_id,l.power_name,l.station_id,s.station_name
|
from db_user.tb_baojigroup_power bl ,db_station.tb_power_inf l,db_station.tb_station_inf s
|
where bl.power_id = l.power_id and bl.station_id = s.station_id
|
and bl.baoji_group_id = #{id}
|
order by s.station_name
|
</select>
|
<select id="getStationIdListWithDischargePlanFlag" resultType="com.whyc.pojo.db_user.BaojigroupPower">
|
SELECT gb.baoji_group_id,gb.station_id,g.baoji_group_name,b.provice,b.city,b.country,b.station_name,p.power_name
|
FROM db_user.tb_baojigroup g,db_user.tb_baojigroup_power gb,db_station.tb_station_inf b,db_station.tb_power_inf p
|
where g.baoji_group_id = gb.baoji_group_id and gb.station_id = b.station_id
|
and gb.power_id = p.power_id
|
and g.team_flag = 1
|
</select>
|
<select id="getListByUserId" resultType="com.whyc.pojo.db_user.BaojigroupPower">
|
SELECT distinct gb.baoji_group_id,gb.station_id,g.baoji_group_name as baoJiGroupName,b.station_name
|
FROM db_user.tb_baojigroup g,db_user.tb_baojigroup_power gb,db_station.tb_station_inf b
|
where g.baoji_group_id = gb.baoji_group_id 0
|
and gb.station_id = b.station_id
|
and g.team_flag = 1
|
and gb.station_id in (
|
select distinct station_id from db_user.tb_baojigroup_usr bu,db_user.tb_baojigroup_power bp
|
where bu.baoji_group_id = bp.baoji_group_id
|
and bu.uid = #{userId}
|
)
|
order by g.baoji_group_name
|
</select>
|
</mapper>
|