• 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的配置文件中不能出现小于号
  • 相关阅读:
    session生命周期
    解决安装sql server 需要重启问题
    myeclipse + tomcat 项目自动部署
    JSP页面转向方式
    关于Response.redirect()方法
    MyEclipse修改项目名称后,部署到tomcat问题
    为Eclipse安装主题插件
    MyEclipse自定义快捷键
    如何查看JSP和Servlet版本
    Wannafly挑战赛2 C.Butterfly(线段树优化枚举)
  • 原文地址:https://www.cnblogs.com/telwanggs/p/5616206.html
Copyright © 2020-2023  润新知