zoukankan      html  css  js  c++  java
  • java xml中sql处理大于号与小于号

    这种问题在xml处理sql的程序中经常需要我们来进行特殊处理。

    其实很简单,我们只需作如下替换即可避免上述的错误:

    < <= > >= & ' "

    &lt;

    &lt;=

    &gt;

    &gt;=

    &amp;

    &apos;

    &quot;

    例如常见的时间比较:

    <select id="select" parameterType="xxx" resultMap="xxx">
        select
            distinct
            <include refid="Base_Column_List" />
        from xxx
        <where>
            <if test="createDate != null">
                create_date <= #{createDate}
            </if>
        </where>
    </select>

    正确写法:

    <select id="select" parameterType="xxx" resultMap="xxx">
        select
            distinct
            <include refid="Base_Column_List" />
        from xxx
        <where>
            <if test="createDate != null">
                create_date &lt;= #{createDate}
            </if>
        </where>
    </select>

    转自:https://www.cnblogs.com/qingmuchuanqi48/p/11839253.html

  • 相关阅读:
    C++ 中static 使用大全
    JsonCpp 简单使用
    [转]C++ string的trim, split方法
    线程函数
    C++ 读写文件流
    JQ_返回顶部
    JQ_开发经验
    JQ_五星级评分特效
    JQ_One()函数特效
    JQ_插件开发
  • 原文地址:https://www.cnblogs.com/JoeYD/p/14544457.html
Copyright © 2011-2022 走看看