<?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.baojiId} 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>
|
</mapper>
|