首页 > 数据库技术 > 详细

mybatis避免sql的like注入

时间:2019-05-31 21:30:57      阅读:147      评论:0      收藏:0      [点我收藏+]
<select id="NotInByEvalQuestion" resultType="com.rm.eval.entity.EvalQnQuestion">
        SELECT * FROM eval_question  WHERE  1=1 and validate_flag=‘Y‘
        <if test="title!=‘‘and title!=null">
            and title like concat(‘%‘, #{title}, ‘%‘)
        </if>
        <if test="null != strlist and strlist.size > 0">
          and  id not in
            <foreach collection="strlist" index="index" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
    </select>

  

mybatis避免sql的like注入

原文:https://www.cnblogs.com/q1359720840/p/10957380.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!