<?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="org.springblade.modules.yjxt.base.map.mapper.MapRegionMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="dangerAreaResultMap" type="org.springblade.modules.yjxt.base.map.entity.MapRegionEntity">

        <result column="adcd" property="adcd"/>
        <result column="adnm" property="adnm"/>
        <result column="district_adcd" property="districtAdcd"/>
        <result column="district_adnm" property="districtAdnm"/>
        <result column="city_adcd" property="cityAdcd"/>
        <result column="city_adnm" property="cityAdnm"/>
        <result column="center_point_lng" property="centerPointLng"/>
        <result column="center_point_lat" property="centerPointLat"/>
        <result column="parent_adcd" property="parentAdcd"/>

    </resultMap>


    <resultMap id="dangerAreaResultVOMap" type="org.springblade.modules.yjxt.base.map.vo.MapRegionVO">

        <result column="adcd" property="adcd"/>
        <result column="adnm" property="adnm"/>
        <result column="district_adcd" property="districtAdcd"/>
        <result column="district_adnm" property="districtAdnm"/>
        <result column="city_adcd" property="cityAdcd"/>
        <result column="city_adnm" property="cityAdnm"/>
        <result column="center_point_lng" property="centerPointLng"/>
        <result column="center_point_lat" property="centerPointLat"/>
    </resultMap>


    <select id="selectPage" resultMap="dangerAreaResultVOMap">
        SELECT
        d.*
        FROM
        map_region_info d
        WHERE
        d.is_deleted = 0
        <if test="dto.adnm!=null">
            and d.adnm like concat(concat('%', #{dto.adnm}), '%')
        </if>
        order by d.adcd
    </select>
</mapper>
