MyBatis-Plus这样实现动态SQL
需求1:根据作者名字和博客名字来查询博客!如果作者名字为空,那么只根据博客名字查询,反之,则根据作者名来查询select * from blog where title = #{title} and author = #{author}这样写我们可以看到,如果 author 等于 null,那么查询语句为 select * from user where title=#{title},但是如果title为空呢?那么查询语句为 select * from user where and autho
原创
2024-05-16 14:13:04 ·
339 阅读 ·
1 评论