<?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.panzhihua.service_community.dao.BcRegionDao">
|
|
<resultMap type="com.panzhihua.service_community.entity.BcRegion" id="BcRegionBaseResultMap">
|
<result property="regionId" column="region_id"/>
|
<result property="regionCode" column="region_code"/>
|
<result property="regionName" column="region_name"/>
|
<result property="parentId" column="parent_id"/>
|
<result property="hierarchyOrder" column="hierarchy_order"/>
|
<result property="levelOrder" column="level_order"/>
|
<result property="formatCode" column="format_code"/>
|
<result property="createUserId" column="create_user_id"/>
|
<result property="createDatetime" column="create_datetime"/>
|
<result property="modifyUserId" column="modify_user_id"/>
|
<result property="modifyDatetime" column="modify_datetime"/>
|
<result property="deleteFlag" column="delete_flag"/>
|
<result property="childrenNum" column="children_num"/>
|
</resultMap>
|
|
<select id="selectByName" resultType="string">
|
SELECT distinct left(code,6) FROM area_index_2022 where 1=1
|
<if test="province !=null and province!=''">
|
and province = #{province}
|
</if>
|
<if test="city !=null and city!=''">
|
and city =#{city}
|
</if>
|
<if test="county !=null and county!=''">
|
and county like concat(#{county},'%')
|
</if>
|
<if test="town !=null and town!=''">
|
and town = #{town}
|
</if>
|
limit 1
|
</select>
|
|
<select id="selectCommunityCodeByName" resultType="string">
|
SELECT distinct code FROM area_index_2022 where 1=1
|
<if test="city !=null and city!=''">
|
and city =#{city}
|
</if>
|
<if test="county !=null and county!=''">
|
and county like concat(#{county},'%')
|
</if>
|
<if test="town !=null and town!=''">
|
and town = #{town}
|
</if>
|
<if test="villagetr !=null and villagetr!=''">
|
and villagetr like concat(#{villagetr},'%')
|
</if>
|
limit 1
|
</select>
|
|
<select id="selectFirst" resultType="com.panzhihua.common.model.vos.community.ProvinceCityReturnVO">
|
select distinct name,code from area_code_2022 where level=1
|
</select>
|
|
<select id="selectSecond" resultType="com.panzhihua.common.model.vos.community.ProvinceCityReturnVO">
|
select distinct name,code from area_code_2022 where level=2 and pcode=#{name}
|
</select>
|
|
<select id="selectThird" resultType="com.panzhihua.common.model.vos.community.ProvinceCityReturnVO">
|
select distinct name,code from area_code_2022 where level=3 and pcode=#{name}
|
</select>
|
|
<select id="selectFourth" resultType="com.panzhihua.common.model.vos.community.ProvinceCityReturnVO">
|
select distinct name,code from area_code_2022 where level=4 and pcode=#{name}
|
</select>
|
</mapper>
|