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

Posted 疯子加天才

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ibatis动态sql配置启动时提示:The content of elements must consist of well-formed character data...相关的知识,希望对你有一定的参考价值。

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...的主要内容,如果未能解决你的问题,请参考以下文章

ibatiS启动的异常 The content of elements must consist of well-formed character data or markup

oracle client配置完成连接到数据库已经测试成功,但是PLSQL提示ora-12154:TNS:counld not resolve the co

Spring动态配置多数据源的基于spring和ibatis的多数据源切换方案

Ibatis动态拼装sql,常用标签总结及举栗子。

ibatis项目启动报错The string "--" is not permitted within comments原

配置DTD提示的方法