于紫祥_1901
2020-10-22 3a4442da13b6f1300956bd63a5d106c5b2fc7184
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?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.moral.mapper.CityMapper" >
  <resultMap id="BaseResultMap" type="com.moral.entity.City" >
    <id column="city_code" property="cityCode" jdbcType="INTEGER" />
    <result column="city_name" property="cityName" jdbcType="VARCHAR" />
    <result column="province_code" property="provinceCode" jdbcType="INTEGER" />
  </resultMap>
 
  <select id="getCityByName" resultType="com.moral.entity.City" resultMap="BaseResultMap">
    select * from city
    where city_name like '%${name}%' limit 0,1
  </select>
</mapper>