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

    <!--分页查询-->
    <select id="listPage" resultType="com.zcloud.modules.kangzai.entity.BusRiverRiskVillagesEntity">
        SELECT
        t.*
        FROM bus_river_risk_villages t
        <where>
            <if test="params.riverRiskVillagesId != null and params.riverRiskVillagesId != ''">
                AND t.river_risk_villages_id = #{params.riverRiskVillagesId}
            </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.village != null and params.village != ''">
                AND t.village = #{params.village}
            </if>
            <if test="params.street != null and params.street != ''">
                AND t.street = #{params.street}
            </if>
            <if test="params.riskLevel != null and params.riskLevel != ''">
                AND t.risk_level = #{params.riskLevel}
            </if>
            <if test="params.riskDescription != null and params.riskDescription != ''">
                AND t.risk_description = #{params.riskDescription}
            </if>
        </where>
        ORDER BY t.village
    </select>
</mapper>
