mybatis3 多条件查询的xml写法

多条件查询时,用<where>

<select id="findAllSelective" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_user
<where>
<if test="id != null">
and id = #{id,jdbcType=BIGINT}
</if>
<if test="username != null">
and username = #{username,jdbcType=VARCHAR}
</if>
</where>
</select>

https://blog.csdn.net/thris/article/details/84810974

上一篇:大文件上传与下载


下一篇:MyBatis源码解析 - 类型转换模块