頁面實現根據某個字段降序升序排序


前台頁面

1 <form id="pagerForm" method="post" action="${ctx}/user/list" onsubmit="return navTabSearch(this)"> 
2     <input type="hidden" name="orderField" value="${page.orderField}" />
3 </form>
4 
5 <th orderField="strAccount">工號</th>

后台mapper里:

1 <choose>
2       <when test="orderField!=null and orderField!=''">
3         order by ${orderField} ${orderDirection}
4       </when>
5       <otherwise>
6         order by createDateTime desc
7       </otherwise>
8  </choose>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM