|
@@ -17,6 +17,9 @@
|
|
|
<result property="longitude" column="longitude_" />
|
|
|
<result property="latitude" column="latitude_" />
|
|
|
<result property="radius" column="radius_" />
|
|
|
+ <result property="sortNo" column="sort_no" />
|
|
|
+ <result property="parentName" column="parent_name" />
|
|
|
+
|
|
|
</resultMap>
|
|
|
<insert id="insert" parameterType="com.jpsoft.bus.modules.base.entity.RegionInfo">
|
|
|
<!--
|
|
@@ -27,7 +30,7 @@
|
|
|
<![CDATA[
|
|
|
insert into base_region_info
|
|
|
(id_,name_,parent_id,remark_,create_by,create_time,update_by,update_time,del_flag,full_name,
|
|
|
- longitude_,latitude_,radius_)
|
|
|
+ longitude_,latitude_,radius_,sort_no)
|
|
|
values
|
|
|
(
|
|
|
#{id,jdbcType=VARCHAR}
|
|
@@ -43,6 +46,7 @@
|
|
|
,#{longitude,jdbcType=DOUBLE}
|
|
|
,#{latitude,jdbcType=DOUBLE}
|
|
|
,#{radius,jdbcType= NUMERIC }
|
|
|
+,#{sortNo,jdbcType= NUMERIC }
|
|
|
)
|
|
|
]]>
|
|
|
</insert>
|
|
@@ -88,6 +92,9 @@
|
|
|
<if test="radius!=null">
|
|
|
radius_=#{radius,jdbcType= NUMERIC },
|
|
|
</if>
|
|
|
+ <if test="sortNo!=null">
|
|
|
+ sort_no=#{sortNo,jdbcType= NUMERIC },
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where id_=#{id}
|
|
|
</update>
|
|
@@ -102,12 +109,20 @@
|
|
|
</select>
|
|
|
<select id="search" parameterType="hashmap" resultMap="RegionInfoMap">
|
|
|
<![CDATA[
|
|
|
- select * from base_region_info
|
|
|
+ SELECT
|
|
|
+ a.*,
|
|
|
+ b.name_ AS parent_name
|
|
|
+ FROM
|
|
|
+ base_region_info a
|
|
|
+ LEFT JOIN base_region_info b ON a.parent_id = b.id_
|
|
|
]]>
|
|
|
<where>
|
|
|
- and del_flag = 0
|
|
|
+ and a.del_flag = 0
|
|
|
<if test="searchParams.id != null">
|
|
|
- and ID_ like #{searchParams.id}
|
|
|
+ and a.ID_ like #{searchParams.id}
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.name != null">
|
|
|
+ and a.name_ like #{searchParams.name}
|
|
|
</if>
|
|
|
</where>
|
|
|
<foreach item="sort" collection="sortList" open="order by" separator=",">
|