传任意带动态标签的sql,!!!
3条回答
- 故木 2019-03-20 11:27关注
select * from user <where> <if test="id != null ">id=#{id}</if> <if test="name != null and name.length()>0" >and name=#{name}</if> <if test="gender != null and gender.length()>0">and gender = #{gender}</if> </where>
根据test的值 来判定是否显示if标签中的语句
解决 无用评论 打赏 举报