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>
            <when test="orderType=3">
                order by aci.register_capital_qxx asc
            </when>
            <otherwise>
                order by aci.id desc
            </otherwise>
        </choose>

 

上一篇:贡献一下多年珍藏的特效例子


下一篇:SQL学习笔记3-排序检索数据