| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- <?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 mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.runzhixing.dao.interf.AuthorityRegionInterface">
- <!-- 结果集 -->
- <resultMap id="regionList" type="com.runzhixing.bean.AuthorityRegionPlace">
- <result column="ID" property="id"/>
- <result column="NAME" property="name"/>
- <result column="PLACEAB" property="placeAB"/>
- <result column="CARPREFIX" property="carprefix"/>
- <collection property="subPlaceList" resultMap="cityList"/>
- </resultMap>
-
- <resultMap id="cityList" type="com.runzhixing.bean.CityPlace">
- <result property="cprovinceNo" column="CPROVINCENO"/>
- <result property="id" column="CID"/>
- <result property="name" column="CNAME"/>
- <result property="placeab" column="CPLACEAB"/>
- <result property="carPrefix" column="CCARPREFIX"/>
- <result property="areaCode" column="CAREACODE"/>
- <association property="subPlaceList" column="{cprovinceNo=CPROVINCENO,id=CID}" javaType="com.runzhixing.bean.CityPlace" select="getCountryList"/>
- </resultMap>
-
-
- <resultMap id="countryList" type="com.runzhixing.bean.CountryPlace">
- <result property="provinceNO" column="YPROVINCENO"/>
- <result property="cityNO" column="YCITYNO"/>
- <result property="name" column="YNAME"/>
- <result property="id" column="YID"/>
- <result property="placeAB" column="YPLACEAB"/>
- </resultMap>
- <!-- sql配置文件 开始-->
- <!-- 只知道省id,查询省市县,sql配置文件 开始-->
- <!-- 根据省id查询省名 -->
- <!-- <select id="getProvinceList" parameterType="com.runzhixing.util.bean.ConditionParameter" resultMap="regionList">
- select
- t.PROVINCENO as ID,
- t.PROVINCENAME as NAME,
- t.PROVINCEAB as PLACEAB,
- t.CARPREFIX as CARPREFIX
- from TD_PROVINCE t
- <where>
- <if test="cpstring1 != null and !"".equals(cpstring1.trim())">
- and t.PROVINCENO = #{cpstring1}
- </if>
- </where>
- </select>
- -->
- <select id="getProvinceList" parameterType="com.runzhixing.util.bean.ConditionParameter" resultMap="regionList">
- select
- t.PROVINCENO as ID,
- t.PROVINCENAME as NAME,
- t.PROVINCEAB as PLACEAB,
- t.CARPREFIX as CARPREFIX,
-
- c.PROVINCENO as CPROVINCENO,
- c.CITYNO as CID,
- c.CITYNAME as CNAME,
- c.CITYAB as CPLACEAB,
- c.CARPREFIX as CCARPREFIX,
- c.AREACODE as CAREACODE
- from TD_PROVINCE t ,TD_CITY c
- <where>
- <if test="cpstring1 != null and !"".equals(cpstring1.trim())">
- and t.PROVINCENO = #{cpstring1}
- </if>
- <if test="cpstring1 != null and !"".equals(cpstring1.trim())">
- and c.PROVINCENO = #{cpstring1}
- </if>
- </where>
- </select>
-
- <!-- 根据省id查询所有市名 -->
-
- <select id="getCityListByPid" parameterType="java.lang.String" resultMap="cityList">
- select
- t.PROVINCENO as PROVINCENO,
- t.CITYNO as ID,
- t.CITYNAME as NAME,
- t.CITYAB as PLACEAB,
- t.CARPREFIX as CARPREFIX,
- t.AREACODE as AREACODE
- from TD_CITY t
- <where>
- <if test="ID != null and !"".equals(ID.trim())">
- and t.PROVINCENO = #{ID}
- </if>
- order by t.PROVINCENO,t.CITYNO
- </where>
- </select>
- <!-- 只知道省id,查询省市县,sql配置文件结束 -->
-
- <!-- 知道省id,市id,查询省市县,sql配置文件开始 -->
- <select id="getCountryList" parameterType="com.runzhixing.bean.CityPlace" resultMap="countryList">
- select
- u.PROVINCENO as YPROVINCENO,
- u.CITYNO as YCITYNO,
- u.COUNTYNAME as YNAME,
- u.COUNTYNO as YID,
- u.COUNTYAB as YPLACEAB
- from TD_COUNTY u
- <where>
- <if test="cprovinceNo != null and !"".equals(cprovinceNo.trim())">
- and u.PROVINCENO = #{cprovinceNo}
- </if>
- <if test="id != null and !"".equals(id.trim())">
- and u.CITYNO = #{id}
- </if>
- order by u.PROVINCENO,u.CITYNO,u.COUNTYNO
- </where>
- </select>
- <!-- 知道省id,市id,查询省市县,sql配置文件结束 -->
-
- <!-- 知道省id,市id,县id查询省市县,sql配置文件开始 -->
-
- <!-- 知道省id,市id,县id查询省市县,sql配置文件结束 -->
-
-
- <!-- sql配置文件结束 -->
- </mapper>
|