mihutao

利用<bind>标签来防止模糊查询的时候sql注入

    <select id="......" parameterType="......" resultType="......">
        select
        *
        from 
        user
        where 
        state=1
        <if test="name != null">
            <bind name="content" value="\'%\' + name + \'%\'" />
            and name like #{content}
        </if>
        <if test="questionType != null">
            and type = #{type}
        </if>
        order by create_time desc
    </select>

 

分类:

技术点:

相关文章:

  • 2021-08-24
  • 2021-10-21
  • 2022-12-23
  • 2022-02-02
  • 2021-09-12
  • 2021-08-06
猜你喜欢
  • 2021-04-13
  • 2021-12-13
  • 2021-06-20
  • 2021-10-25
相关资源
相似解决方案