<?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.bf.mapper.FaultTransferSchemeEvaluationIndexMapper">

    <select id="getTransferSchemeEvaluationIndexByFaultId"
            resultType="com.hdkj.lt.core.bizms.modle.dto.FhzgPlanTransferSchemeEvaluationIndexDTO">
            select
                sei.id id,
                sei.scheme_id schemeId,
                ts.scheme_name schemeName,
                ts.scheme_state schemeState,
                ts.evaluation_score evaluationScore,
                sei.transfer_load_ratio  transferLoadRatio,
                sei.opposite_line_max_load_rate  oppositeLineMaxLoadRate,
                sei.switch_operation_times  switchOperationTimes,
                sei.loss_users  lossUsers,
                sei.non_auto_switch_operation_times  nonAutoSwitchOperationTimes,
                sei.distribution_transformer_voltage  distributionTransformerVoltage,
                sei.to_be_transfer_load  toBeTransferLoad,
                sei.carried_load  carriedLoad,
                sei.auto_switch_operation_times  autoSwitchOperationTimes,
                sei.total_to_be_transfer_users  totalToBeTransferUsers,
                sei.loss_important_users  lossImportantUsers,
                sei.loss_sensitive_users  lossSensitiveUsers,
                sei.loss_power_secured_users lossPowerSecuredUsers
            from
                fhzg_fault_transfer_scheme ts left join
                fhzg_fault_transfer_scheme_evaluation_index sei on ts.id = sei.scheme_id
            where ts.fault_id = #{faultId}
            order by ts.scheme_state asc,ts.evaluation_score desc
    </select>



</mapper>
