<?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.hdkj.lt.mq.mapper.plan.FhzgPlanProcessStateCheckMapper">

    <select id="getSwitchingSequenceCount" resultType="java.lang.Integer"
            parameterType="com.hdkj.lt.core.bizms.modle.dto.SchemeQueryDTO">
        select count(*)
        from fhzg_plan_transfer_scheme_switching_sequence
        where scheme_id = #{schemeId}
    </select>

    <select id="getSwitchingAutoSequenceCount" resultType="java.lang.Integer"
            parameterType="com.hdkj.lt.core.bizms.modle.dto.SchemeQueryDTO">
        select count(*) from
            fhzg_plan_transfer_scheme_switching_loop_check a
                left join fhzg_plan_transfer_scheme_switching_sequence b
                          on a.switching_id = b.switch_id
        where b.scheme_id = #{schemeId}
        and is_auto_switch = '是'
    </select>

    <select id="getMaxLoadFactorBySchemeId" resultType="java.lang.String">
        select max(fc.estimate_max_load_factor) from fhzg_plan_transfer_scheme_switching_final_check fc
            left join fhzg_plan_transfer_scheme_switching_sequence ss
                on fc.switching_id = ss.switch_id
        where ss.scheme_id = #{schemeId}
    </select>

</mapper>
