mybatis的ifelse

if else判断格式

<choose>
  <when test="">
    //...
  </when>
  <otherwise>
    //...
  </otherwise>
</choose>

     <choose>
            <when test="orderType==1">
                order by aci.register_time desc
            </when>
            <when test="orderType==2">
                order by aci.register_time asc
            </when>
            <when test="orderType==3">
                order by aci.register_capital_qxx desc
            </when>
            <otherwise>
                order by aci.id desc
            </otherwise>
        </choose>

 

posted @ 2020-04-15 16:48  代码伊甸园  阅读(384)  评论(0编辑  收藏  举报