• MyBatis特殊字符转义


    使用mybatis的时候,特殊字符,例如<,>,<>,.....

    需使用以下进行转义

    &lt; < 小于号  
    &gt; > 大于号
    &amp; &  
    &apos; ' 单引号
    &quot; " 双引号
        <select id="selectByExampleExt" parameterType="com.cn21.redisCluster.model.AppInfoExampleExt" resultMap="BaseResultMapExt">
            SELECT temp.*,r.* from (
                SELECT a.* from appinfo as a where 1=1 
                <if test="appid != null and appid != '' ">
                    and a.appid=#{appid,jdbcType=VARCHAR}
                </if>
                <if test="productid != null">
                    and a.productid=#{productid,jdbcType=INTEGER}
                </if>
                ORDER BY a.lastupdatetime DESC
                <if test="limitStart&gt;=0 and limit&gt;0">   (这里就是类似的 <if test="limitStart>=0 and limit>0">
                    LIMIT ${limitStart} , ${limit}
                </if>
                <if test="limitStart==-1 and limit&gt;0">
                    LIMIT ${limit}
                </if>
                 ) temp,redisdb r where temp.appid = r.appid
        </select>
  • 相关阅读:
    java字符串实现正序和倒序输出
    暑假前挑战赛1—— A,B题解
    深搜
    poj 1200 Crazy Search
    poj 1840 Eqs (hash)
    Choose the best route
    一个人的旅行
    畅通工程续
    最短路基础算法
    完全背包问题
  • 原文地址:https://www.cnblogs.com/parryyang/p/5854075.html
Copyright © 2020-2023  润新知