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

    <select id="getLineRateCapacityPage" resultType="com.hdkj.lt.bf.entity.vo.LineRateCapacityVO">

        select l.id id,
               d.psr_id lineId,
               d.name lineName,
               d.maint_org countyId,
               d.maint_org_name countyName,
               d.start_station stationId,
               d.start_station_name stationName,
               l.rate_capacity rateCapacity,
               l.remarks remarks,
               l.creator creator,
               l.create_time createTime
        from dwd_shb_ds_feeder_base d
            left join fhzg_line_rate_capacity l on d.psr_id= l.line_id
        <where>
             d.del_flag = '0'
            <if test="params.countyId != null and params.countyId != ''">
                AND  d.maint_org = #{params.countyId}
            </if>
            <if test="params.lineName != null and params.lineName != ''">
                AND  d.name LIKE CONCAT('%',#{params.lineName},'%')
            </if>
        </where>
        order by  d.maint_org desc, d.psr_id desc
    </select>
</mapper>
