mirror of
https://github.com/JeffLi1993/springboot-learning-example.git
synced 2026-03-13 21:43:45 +08:00
25 lines
844 B
XML
25 lines
844 B
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="org.spring.springboot.dao.CityDao">
|
|
<resultMap id="BaseResultMap" type="org.spring.springboot.domain.City">
|
|
<result column="id" property="id" />
|
|
<result column="province_id" property="provinceId" />
|
|
<result column="city_name" property="cityName" />
|
|
<result column="description" property="description" />
|
|
</resultMap>
|
|
|
|
<parameterMap id="City" type="org.spring.springboot.domain.City"/>
|
|
|
|
<sql id="Base_Column_List">
|
|
id, province_id, city_name, description
|
|
</sql>
|
|
|
|
<select id="findByName" resultMap="BaseResultMap" parameterType="java.lang.String">
|
|
select
|
|
<include refid="Base_Column_List" />
|
|
from city
|
|
where city_name = #{cityName}
|
|
</select>
|
|
|
|
</mapper>
|