| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!--
- Copyright 2009-2012 the original author or authors.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
- <!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
- "http://ibatis.apache.org/dtd/sql-map-2.dtd">
- <sqlMap namespace="com.runzhixing.util.interf.PlaceLoader">
- <!--模块配置-->
- <typeAlias alias="city" type="com.runzhixing.util.bean.City"/>
- <resultMap id="citymap" class="city">
- <result property="provinceNO" column="provinceno"/>
- <result property="name" column="name"/>
- <result property="id" column="id"/>
- <result property="placeAB" column="placeAB"/>
- <result property="carPrefix" column="carprefix"/>
- <result property="areaCode" column="areaCode"/>
- <!--
- 级联查询该市所有的区县
- -->
- <result property="subPlaceList" column="{provinceNO=provinceno,id=id}" select="getCountryList"/>
- </resultMap>
- <!-- 缓存 -->
- <cacheModel id="cache" type ="LRU" readOnly="true" serialize="false">
- <flushInterval seconds="1"/>
- <property name="cache-size" value="500" />
- </cacheModel>
- <!--Statement配置-->
- <select id="getCityById" parameterClass="com.runzhixing.util.bean.City" resultMap="citymap" cacheModel="cache">
- select
- provinceno,
- cityno as id,
- cityname as name,
- cityab as placeAB,
- carprefix,
- areaCode
- from td_city
- where provinceno=#{provinceNO}# and cityno=#{id}#
- </select>
- <select id="getCityList" parameterClass="string" resultMap="citymap" cacheModel="cache">
- select
- provinceno,
- cityno as id,
- cityname as name,
- cityab as placeAB,
- carprefix,
- areaCode
- from td_city
- where provinceno=#{provinceNO}#
- order by Provinceno,cityno
- </select>
- </sqlMap>
|