mybatis动态排序

如果我们要传入排序字段作为一个参数到mybatis中,用以实现按照指定字段来排序的功能,那么我们需要使用$,而不是像其他参数一样,使用#。如下所示。

  <if test="sortname!=null and sortname!=''">
            ${sortname} ${sortorder} ,
        </if>
原文地址:https://www.cnblogs.com/roy-blog/p/9233143.html