choose when otherwise 标签
在mybatis中可以使用when otherwise来达到if else 的效果
当when里面的条件成立,就按条件来查询,条件都不成立就按otherwise来查询
举例条件都不成立: sql语句变为:select * from product_ where id > 2
查询结果:
在mybatis中可以使用when otherwise来达到if else 的效果
当when里面的条件成立,就按条件来查询,条件都不成立就按otherwise来查询
举例条件都不成立: sql语句变为:select * from product_ where id > 2
查询结果: