-
Notifications
You must be signed in to change notification settings - Fork 610
/
CountryMapper.xml
28 lines (26 loc) · 1.04 KB
/
CountryMapper.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?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.isea533.mybatis.mapper.CountryMapper">
<resultMap id="BaseResultMap" type="com.isea533.mybatis.model.Country">
<!--
WARNING - @mbg.generated
-->
<id column="Id" jdbcType="INTEGER" property="id" />
<result column="countryname" jdbcType="VARCHAR" property="countryname" />
<result column="countrycode" jdbcType="VARCHAR" property="countrycode" />
</resultMap>
<select id="selectByCountryQueryModel" resultMap="BaseResultMap">
select id,countryname,countrycode from country
<where>
<if test="countryname != null and countryname != ''">
countryname like concat('%',concat(#{countryname}, '%'))
</if>
<if test="countrycode != null and countrycode != ''">
and countrycode like concat('%',concat(#{countrycode}, '%'))
</if>
<if test="id != null">
and id = #{id}
</if>
</where>
</select>
</mapper>