choose when otherwise 标签

在mybatis中可以使用when otherwise来达到if else 的效果

当when里面的条件成立,就按条件来查询,条件都不成立就按otherwise来查询

举例条件都不成立: sql语句变为:select * from product_ where id > 2

查询结果:

猜你喜欢

转载自blog.csdn.net/QingXu1234/article/details/82383354
今日推荐