于紫祥_1901
2020-12-01 636af927431b46a0788b7d76233387923135ac0c
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>