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

    <!--分页查询-->
    <select id="listPage" resultType="com.zcloud.modules.kangzai.entity.BusMountainFloodVillageEntity">
        SELECT
        t.*
        FROM bus_mountain_flood_village t
        <where>
            <if test="params.mountainFloodVillageId != null and params.mountainFloodVillageId != ''">
                AND t.mountain_flood_village_id = #{params.mountainFloodVillageId}
            </if>
            <if test="params.villageName != null and params.villageName != ''">
                AND t.village_name like concat('%',#{params.villageName},'%')
            </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.longitude != null and params.longitude != ''">
                AND t.longitude = #{params.longitude}
            </if>
            <if test="params.latitude != null and params.latitude != ''">
                AND t.latitude = #{params.latitude}
            </if>
            <if test="params.countyWarningOfficer != null and params.countyWarningOfficer != ''">
                AND t.county_warning_officer = #{params.countyWarningOfficer}
            </if>
            <if test="params.countyOfficerPosition != null and params.countyOfficerPosition != ''">
                AND t.county_officer_position = #{params.countyOfficerPosition}
            </if>
            <if test="params.countyOfficerPhone != null and params.countyOfficerPhone != ''">
                AND t.county_officer_phone = #{params.countyOfficerPhone}
            </if>
            <if test="params.townshipOfficer != null and params.townshipOfficer != ''">
                AND t.township_officer = #{params.townshipOfficer}
            </if>
            <if test="params.townshipOfficerPosition != null and params.townshipOfficerPosition != ''">
                AND t.township_officer_position = #{params.townshipOfficerPosition}
            </if>
            <if test="params.townshipOfficerPhone != null and params.townshipOfficerPhone != ''">
                AND t.township_officer_phone = #{params.townshipOfficerPhone}
            </if>
            <if test="params.villageOfficer != null and params.villageOfficer != ''">
                AND t.village_officer = #{params.villageOfficer}
            </if>
            <if test="params.villageOfficerPosition != null and params.villageOfficerPosition != ''">
                AND t.village_officer_position = #{params.villageOfficerPosition}
            </if>
            <if test="params.villageOfficerPhone != null and params.villageOfficerPhone != ''">
                AND t.village_officer_phone = #{params.villageOfficerPhone}
            </if>
            <if test="params.monitorName != null and params.monitorName != ''">
                AND t.monitor_name = #{params.monitorName}
            </if>
            <if test="params.monitorPosition != null and params.monitorPosition != ''">
                AND t.monitor_position = #{params.monitorPosition}
            </if>
            <if test="params.monitorPhone != null and params.monitorPhone != ''">
                AND t.monitor_phone = #{params.monitorPhone}
            </if>
            <if test="params.warningOfficerName != null and params.warningOfficerName != ''">
                AND t.warning_officer_name = #{params.warningOfficerName}
            </if>
            <if test="params.warningOfficerPosition != null and params.warningOfficerPosition != ''">
                AND t.warning_officer_position = #{params.warningOfficerPosition}
            </if>
            <if test="params.warningOfficerPhone != null and params.warningOfficerPhone != ''">
                AND t.warning_officer_phone = #{params.warningOfficerPhone}
            </if>
            <if test="params.transferOfficerName != null and params.transferOfficerName != ''">
                AND t.transfer_officer_name = #{params.transferOfficerName}
            </if>
            <if test="params.transferOfficerPosition != null and params.transferOfficerPosition != ''">
                AND t.transfer_officer_position = #{params.transferOfficerPosition}
            </if>
            <if test="params.transferOfficerPhone != null and params.transferOfficerPhone != ''">
                AND t.transfer_officer_phone = #{params.transferOfficerPhone}
            </if>
            <if test="params.remarks != null and params.remarks != ''">
                AND t.remarks = #{params.remarks}
            </if>
            <if test="params.creator != null and params.creator != ''">
                AND t.creator = #{params.creator}
            </if>
            <if test="params.createTime != null and params.createTime != ''">
                AND t.create_time = #{params.createTime}
            </if>
            <if test="params.operator != null and params.operator != ''">
                AND t.operator = #{params.operator}
            </if>
            <if test="params.operatTime != null and params.operatTime != ''">
                AND t.operat_time = #{params.operatTime}
            </if>
            <if test="params.isDelete != null">
                AND t.is_delete = #{params.isDelete}
            </if>
        </where>
        ORDER BY t.create_time DESC
    </select>
</mapper>
