分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow
也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!
使用#orderstr#是会有问题的,ibatis会自动给你加上单引号,应该使用如下
<dynamic prepend="ORDER BY">
<isNotEmpty property="order">
$order$ $sortDirection$
</isNotEmpty>
</dynamic>
例子:
<select id="getNewsList" resultMap="newsResult" parameterClass="map">
select NEWS_ID,BLOCK_ID,NEWS_TITLE,NEWS_CONTENT,NEWS_SECONDTITLE,NEWS_SUMMARY,NEWS_AUTHOR,NEWS_SOURCE,NEWS_ANNEX,NEWS_TIME,NEWS_OPEN,NEWS_KEYWORDS,NEWS_APPROVE,ISTOP,BROWSENUM,NEWS_COMMENT,NEWS_REFUSE,NEWS_AUDITOR,lasteditor,prjid,prjname,wsflag,MEM_NAME,LASTEDITTIME,ISBLOCKPIC from yc_news where BLOCK_ID = #blockid#
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderstr">
$orderstr$
</isNotEmpty>
</dynamic>
</select>
给我老师的人工智能教程打call!http://blog.csdn.net/jiangjunshow
![这里写图片描述](https://i-blog.csdnimg.cn/blog_migrate/2e19ffb3303a490d20ea5d00dd397156.gif)