<select id="findUserByCondition" resultMap="userMap" parameterType="user">
select * from user where 1=1
<if test="userName != null">
and username = #{userName}
</if>
<if test="userSex != null">
and sex = #{userSex}
</if>
</select>
mybatis 动态SQL-if标签
最新推荐文章于 2024-04-03 18:30:00 发布