其他分享
首页 > 其他分享> > mybatis3 多条件查询的xml写法

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

标签:xml,username,VARCHAR,mybatis3,查询,jdbcType,写法,id
来源: https://www.cnblogs.com/isme-zjh/p/12615564.html