<?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.zcloud.modules.kangzai.dao.BusRiverSectionsDao">

    <!--分页查询-->
    <select id="listPage" resultType="com.zcloud.modules.kangzai.entity.BusRiverSectionsEntity">
        SELECT
        t.*
        FROM bus_river_sections t
        <where>
            <if test="params.riverSectionsId != null and params.riverSectionsId != ''">
                AND t.river_sections_id = #{params.riverSectionsId}
            </if>
            <if test="params.riverId != null and params.riverId != ''">
                AND t.river_id = #{params.riverId}
            </if>
            <if test="params.province != null and params.province != ''">
                AND t.province = #{params.province}
            </if>
            <if test="params.city != null and params.city != ''">
                AND t.city = #{params.city}
            </if>
            <if test="params.county != null and params.county != ''">
                AND t.county = #{params.county}
            </if>
            <if test="params.sectionLength != null and params.sectionLength != ''">
                AND t.section_length = #{params.sectionLength}
            </if>
            <if test="params.riverWidthMin != null and params.riverWidthMin != ''">
                AND t.river_width_min = #{params.riverWidthMin}
            </if>
            <if test="params.riverWidthMax != null and params.riverWidthMax != ''">
                AND t.river_width_max = #{params.riverWidthMax}
            </if>
            <if test="params.riverWidthAvg != null and params.riverWidthAvg != ''">
                AND t.river_width_avg = #{params.riverWidthAvg}
            </if>
            <if test="params.sectionDescription != null and params.sectionDescription != ''">
                AND t.section_description = #{params.sectionDescription}
            </if>
        </where>
        ORDER BY t.county DESC
    </select>
</mapper>
