<?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.yfd.platform.modules.patroltask.mapper.ExaminePlanMapper">

    <select id="getExaminePlanPage" resultType="java.util.Map">
        SELECT
        iep.*,ss.is_station_flag,ss.`online`
        FROM
        `iis_examine_plan` iep
        INNER JOIN iis_substation ss ON iep.station_id = ss.station_id
        WHERE iep.station_id=#{stationId}
        <if test="configName != null and configName != ''">
            AND iepconfig_name LIKE concat('%',#{configName},'%')
        </if>
        <choose>
            <when test="bindStatus == 0">
                <!-- 当 bindStatus 等于 0 时执行的逻辑 -->
                AND  (iep.device_list IS NULL OR iep.device_list='')
            </when>
            <otherwise>
                <!-- 当 bindStatus 不等于 0 时执行的逻辑 -->
                AND (iep.device_list IS NOT NULL AND iep.device_list!='')
            </otherwise>
        </choose>

    </select>
</mapper>
