<?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.yeejoin.amos.boot.module.ccs.api.mapper.FireRiskSourceMapper">

    <select id="queryForRpnDescList" resultType="com.yeejoin.amos.boot.module.ccs.api.dto.FireRiskSourceDto">
        SELECT
            rs.mrid,
            rs.`name`,
            rs.parent_mrid,
            rs.risk_level_mrid,
            IFNULL(rs.rpn, 0) rpn,
            IFNULL(rs.rpni, 0) rpni
        FROM `asf_fire_risk_source` rs
        where
        rs.parent_mrid > 0
        and rs.station_code = #{stationCode}
        <if test="top != null and top !=''">
            limit ${top}
        </if>
    </select>
</mapper>
