Mybatis是否支持sql case或if语句?

时间:2019-07-24 16:23:41

标签: mybatis ibatis

如何为下面的查询写一个等于mybatis的

   SELECT OrderID, Quantity,
    CASE
        WHEN Quantity > 30 THEN "The quantity is greater than 30"
        WHEN Quantity = 30 THEN "The quantity is 30"
        ELSE "The quantity is under 30"
    END AS QuantityText
    FROM OrderDetails;

0 个答案:

没有答案