whyclxw
7 天以前 257c8bcbc5453ecfa9c108ed650422013f7c11b6
src/main/resources/mapper/PwrdevAlarmMapper.xml
@@ -63,4 +63,35 @@
            and bu.uid = #{userId}
        )
    </select>
    <select id="getPwrtAlmAnalyse" resultType="com.whyc.pojo.db_pwrdev_alarm.PwrdevAlarm">
        select tb_pwrdev_alarm.*,tb_power_inf.power_name,tb_station_inf.station_name,tb_station_inf.provice,tb_station_inf.city,tb_station_inf.country,tb_station_inf.full_name
        from db_pwrdev_alarm.tb_pwrdev_alarm,db_station.tb_power_inf,db_station.tb_station_inf
        <where>
            tb_pwrdev_alarm.power_id=tb_power_inf.power_id
            and 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="stationId!=null">
                and tb_station_inf.station_id=#{stationId}
            </if>
            <if test="powerId!=null">
                and tb_pwrdev_alarm.power_id=#{powerId}
            </if>
            <if test="uid>100">
                and tb_pwrdev_alarm.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>
        order by alm_start_time desc
    </select>
</mapper>