用户登录
用户注册

分享至

mybatis的if

  • 作者: 六味地黄丸治肾亏不含糖
  • 来源: 51数据库
  • 2020-09-29
<select id="selectUser" parameterType="com.test.entity.User" resultMap="BaseResultMap">
select <include refid="basesql"/> from users where 1=1
<if test="userid !

=null">and userid=#{userid}</if>

<if test="username!=null">
and username like concat('%',#{username},'%')
</if>

<if test="age!=null">and age=#{age}</if>
</select>
软件
前端设计
程序设计
Java相关