Mybatis基于注解的Mapper如何使用动态sql?
网上说:
使用<script>标签直接包裹动态sql,例如:
@Select("<script>select * from user where <if test=\"username !=null \">username = #{username} </if> <if test=\"phone !=null \">phone = #{phone} </if> <if test=\"usermail !=null \">usermail = #{usermail } </if></script>")
但是并不行