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

    <!--分页查询-->
    <select id="listPage" resultType="com.zcloud.modules.kangzai.entity.BusTailingsReservoirEntity">
        SELECT
            t.*
        FROM bus_tailings_reservoir t
        <where>
            <if test="params.tailingsReservoirId != null and params.tailingsReservoirId != ''">
                    AND t.tailings_reservoir_id = #{params.tailingsReservoirId}
            </if>
            <if test="params.name != null and params.name != ''">
                    AND t.name = #{params.name}
            </if>
            <if test="params.address != null and params.address != ''">
                    AND t.address = #{params.address}
            </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.areaName != null and params.areaName != ''">
                    AND t.area_name = #{params.areaName}
            </if>
            <if test="params.runningStatus != null and params.runningStatus != ''">
                    AND t.running_status = #{params.runningStatus}
            </if>
            <if test="params.hasProductionEntity != null and params.hasProductionEntity != ''">
                    AND t.has_production_entity = #{params.hasProductionEntity}
            </if>
            <if test="params.isOverheadVault != null and params.isOverheadVault != ''">
                    AND t.is_overhead_vault = #{params.isOverheadVault}
            </if>
            <if test="params.mineralSpecies != null and params.mineralSpecies != ''">
                    AND t.mineral_species = #{params.mineralSpecies}
            </if>
            <if test="params.designGrade != null and params.designGrade != ''">
                    AND t.design_grade = #{params.designGrade}
            </if>
            <if test="params.currentGrade != null and params.currentGrade != ''">
                    AND t.current_grade = #{params.currentGrade}
            </if>
            <if test="params.designDamHeight != null and params.designDamHeight != ''">
                    AND t.design_dam_height = #{params.designDamHeight}
            </if>
            <if test="params.currentDamHeight != null and params.currentDamHeight != ''">
                    AND t.current_dam_height = #{params.currentDamHeight}
            </if>
            <if test="params.designStorageCapacity != null and params.designStorageCapacity != ''">
                    AND t.design_storage_capacity = #{params.designStorageCapacity}
            </if>
            <if test="params.currentStorageCapacity != null and params.currentStorageCapacity != ''">
                    AND t.current_storage_capacity = #{params.currentStorageCapacity}
            </if>
            <if test="params.isCloseToImportantRivers != null and params.isCloseToImportantRivers != ''">
                    AND t.is_close_to_important_rivers = #{params.isCloseToImportantRivers}
            </if>
            <if test="params.safetyProductionLicense != null and params.safetyProductionLicense != ''">
                    AND t.safety_production_license = #{params.safetyProductionLicense}
            </if>
            <if test="params.effectiveDate != null and params.effectiveDate != ''">
                    AND t.effective_date = #{params.effectiveDate}
            </if>
            <if test="params.expiryDate != null and params.expiryDate != ''">
                    AND t.expiry_date = #{params.expiryDate}
            </if>
            <if test="params.corpPrincipalName != null and params.corpPrincipalName != ''">
                    AND t.corp_principal_name = #{params.corpPrincipalName}
            </if>
            <if test="params.corpPrincipalPost != null and params.corpPrincipalPost != ''">
                    AND t.corp_principal_post = #{params.corpPrincipalPost}
            </if>
            <if test="params.corpPrincipalPhone != null and params.corpPrincipalPhone != ''">
                    AND t.corp_principal_phone = #{params.corpPrincipalPhone}
            </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>
