54 lines
2.0 KiB
XML
54 lines
2.0 KiB
XML
<?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.zjyr.beidouservice.mapper.LocCityMapper">
|
|
<resultMap id="location_city" type="com.zjyr.beidouservice.pojo.dataobject.LocCityDO">
|
|
<result property="id" column="id" jdbcType="BIGINT"/>
|
|
<result property="cityName" column="city_name" jdbcType="VARCHAR"/>
|
|
<result property="cityCode" column="city_code" jdbcType="INTEGER"/>
|
|
<result property="provinceCode" column="province_code" jdbcType="INTEGER"/>
|
|
<result property="beidouBroadcastId" column="beidou_broadcast_id" jdbcType="INTEGER"/>
|
|
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
|
</resultMap>
|
|
|
|
|
|
<select id="selectCity" resultType="com.zjyr.beidouservice.pojo.dataobject.LocCityDO"
|
|
parameterType="java.lang.String" resultMap="location_city">
|
|
select *
|
|
from location_city
|
|
<where>
|
|
<if test="provinceCode != null">
|
|
and province_code = #{provinceCode}
|
|
</if>
|
|
<if test="cityCode != null">
|
|
and city_code = #{cityCode}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectCitys" resultType="java.lang.String" parameterType="java.lang.String" resultMap="location_city">
|
|
select city_code
|
|
from location_city
|
|
<where>
|
|
<if test="provinceCode != null">
|
|
and province_code = #{provinceCode}
|
|
</if>
|
|
</where>
|
|
|
|
</select>
|
|
|
|
<select id="selectCityByProvince" resultType="com.zjyr.beidouservice.pojo.dataobject.LocCityDO"
|
|
parameterType="java.lang.String" resultMap="location_city">
|
|
select *
|
|
from location_city
|
|
<where>
|
|
<if test="provinceCode != null">
|
|
and province_code = #{provinceCode}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper> |