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>

猜你喜欢

转载自www.cnblogs.com/devin-sl/p/12706394.html