写了一条带条件判断的数据库语句例如:
SELECT if((a-b)<=0,0,(a-b)) as c from xxx
意思就是我想判断select a-b as c from xxxx,如果a-b<=0,c=0,如果a-b>0,就c=a-b
这种在mapper里怎么写啊是用标签在select后面直接写么?
_七七的博客文章目录MybatisMapper的动态SQL语句问题一、if二、choose、when、otherwise三、where四、trim 元素来定制 where 元素的功能五、set 动态地在行首插入 SET 关键字六、foreach七、script八、bind应用举例1、Mybatis ...