码迷,mamicode.com
首页 > 数据库 > 详细

ibatis动态sql配置启动时提示:The content of elements must consist of well-formed character data...

时间:2016-06-25 13:44:43      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:

ibatis动态sql配置启动时提示:The content of elements must consist of well-formed character data...

2012-07-18 11:21wuming3632171 | 浏览 5114 次
ibatis配置如下,高手帮我看看。
<select id="exportRecieveData" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT L_SERIALNO as serialno,
C_CONTENT as content,
C_MOBILENO as mobileno,
C_DATE as cdate,
C_TIME as ctime,
C_FUNDACCO as fundacco,
L_BACKID as backid,
C_TASKCODE as taskcode,
C_BACK as back,
C_BACKCONTENT as backcontent,
C_BACKDATE as backdate,
C_BACKTIME as backtime,
c_pipe as l_type
FROM TSMS_RECEIVE
<dynamic prepend="where">
<isPropertyAvailable property="taskCode">
<isNotEmpty prepend="and" property="taskCode">
C_TASKCODE =#taskCode#
</isNotEmpty>
</isPropertyAvailable>
<isPropertyAvailable property="startDate">
<isNotEmpty prepend="and" property="startDate">
C_DATE >= #startDate#
</isNotEmpty>
</isPropertyAvailable>
<isPropertyAvailable property="endDate">
<isNotEmpty prepend="and" property="endDate">
C_DATE <= #endDate#
</isNotEmpty>
</isPropertyAvailable>
<isPropertyAvailable property="mobileNo">
<isNotEmpty prepend="and" property="mobileNo">
C_MOBILENO = #mobileNo#
</isNotEmpty>
</isPropertyAvailable>
<isPropertyAvailable property="fundAcco">
<isNotEmpty prepend="and" property="fundAcco">
C_FUNDACCO = #fundAcco#
</isNotEmpty>
</isPropertyAvailable>
</dynamic>
</select>
2012-07-18 12:21
提问者采纳
 
把下面这个表达式反过来写就可以了
<isNotEmpty prepend="and" property="endDate">
C_DATE <= #endDate#
</isNotEmpty>
改为
<isNotEmpty prepend="and" property="endDate">
#endDate# >= C_DATE
</isNotEmpty>

记住:在ibatis的配置文件中不能出现小于号

ibatis动态sql配置启动时提示:The content of elements must consist of well-formed character data...

标签:

原文地址:http://www.cnblogs.com/love540376/p/5616206.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!