<?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.algorithm.mapper.AlgorithmLogsMapper">

    <select id="getAlgorithmLogsPage" resultType="com.yfd.platform.modules.algorithm.domain.AlgorithmLogs">
        SELECT
            ac.algorithm_class_name,
            al.*
        FROM
            iis_algorithm_logs al
        INNER JOIN iis_algorithm_class ac ON al.algorithm_id = ac.id
        WHERE 1=1
        <if test="stationCode != null and stationCode != ''">
            AND al.station_code = #{stationCode}
        </if>
        <if test="algorithmId != null and algorithmId != ''">
            AND al.algorithm_id = #{algorithmId}
        </if>
        <if test="areaId != null and areaId != ''">
            AND al.area_id = #{areaId}
        </if>
        <if test="bayId != null and bayId != ''">
            AND al.bay_id = #{bayId}
        </if>
        <if test="mainDeviceId != null and mainDeviceId != ''">
            AND al.main_device_id = #{mainDeviceId}
        </if>
        <if test="componentId != null and componentId != ''">
            AND al.component_id = #{componentId}
        </if>
        <if test="componentName != null and componentName != ''">
            AND al.component_name = #{componentName}
        </if>
    </select>
</mapper>
