<?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.CustomerPowerProtectionConfigHistMapper">

    <select id="getTransformerName" resultType="com.hdkj.lt.core.bizms.modle.dto.TransformerNameDTO">
        select distinct jt.join_ec as joinEc,concat(group_concat(distinct tb.name), '(', jb.name, ')') as dedicated_name,
                        concat(group_concat(distinct trim(tb.station_name) separator '-'), '(', jb.name, ')') as transformer_name
        from dwd_shb_ds_joinec_transformer_base jt
                 left join dwd_shb_ds_joinec_base jb on jb.psr_id = jt.join_ec
                 join dwd_shb_ds_transformer_base tb on jt.psr_id = tb.psr_id and tb.psr_state = '20'
        group by jt.join_ec;
    </select>
</mapper>
