<?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.district.mapper.DistrictMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="districtResultMap" type="org.springblade.modules.district.entity.DistrictEntity">
|
<result column="id" property="id"/>
|
<result column="aoi_cdoe" property="aoiCdoe"/>
|
<result column="community_code" property="communityCode"/>
|
<result column="name" property="name"/>
|
<result column="address" property="address"/>
|
<result column="lng" property="lng"/>
|
<result column="lat" property="lat"/>
|
<result column="remark" property="remark"/>
|
<result column="create_user" property="createUser"/>
|
<result column="create_time" property="createTime"/>
|
<result column="update_user" property="updateUser"/>
|
<result column="update_time" property="updateTime"/>
|
<result column="is_deleted" property="isDeleted"/>
|
</resultMap>
|
|
<!--自定义分页-->
|
<select id="selectDistrictPage" resultType="org.springblade.modules.district.vo.DistrictVO">
|
select * from jczz_district
|
where is_deleted = 0
|
<if test="district.name !=null and district.name !=''">
|
and name like concat('%',#{district.name},'%')
|
</if>
|
<if test="district.communityCode !=null and district.communityCode !=''">
|
and community_code = #{district.communityCode}
|
</if>
|
</select>
|
|
<!--小区树查询-->
|
<select id="getDistrictTree" resultType="org.springblade.common.node.TreeStringNode">
|
SELECT
|
code as id,
|
parent_code as parentId,
|
name
|
FROM blade_region where district_code = '361102'
|
union all
|
(
|
select
|
id,
|
community_code as parentId,
|
name
|
from jczz_district
|
where is_deleted = 0
|
)
|
</select>
|
|
|
</mapper>
|