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

时间:2023-12-04 20:02:50

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的配置文件中不能出现小于号