142536a 发表于 2016-11-24 07:10:07

mybatis中的模糊查询

mybatis中的模糊查询

<select id="query" resultType="User" parameterType="java.util.HashMap">
select
<include refid="selectId" />
from user
<where>
<if test="t.userName != null and t.userName != ''">
userName like '%${t.userName}%'
</if>
<if test="t.userNickname != null and t.userNickname != ''">
and userNickname like '%${t.userNickname}%'
</if>
</where>
</select>
页: [1]
查看完整版本: mybatis中的模糊查询