myBatis查询报错

   You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near

<select id="selectList" parameterType="com.hanilucky.core.vo.Dep"
resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from dep
<where>
<if test="uuid != null">
AND UUID = #{uuid,jdbcType=INTEGER}
</if>
<if test="name != null and name != ''">
AND NAME = #{name,jdbcType=VARCHAR}
</if>
<if test="tele != null and tele != ''">
AND TELE = #{tele,jdbcType=VARCHAR}
</if>
</where>
</select>

标红的NAME是mysql的关键字,解析时报错

修改时加上``引用(数字1左边的键)

<select id="selectList" parameterType="com.hanilucky.core.vo.Dep"
resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from dep
<where>
<if test="uuid != null">
AND UUID = #{uuid,jdbcType=INTEGER}
</if>
<if test="name != null and name != ''">
AND `NAME` = #{name,jdbcType=VARCHAR}
</if>
<if test="tele != null and tele != ''">
AND TELE = #{tele,jdbcType=VARCHAR}
</if>
</where>
</select>

myBatis查询报错 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near的更多相关文章

  1. mybatis批量更新update-设置多个字段值 报错 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near

    mybatis批量更新update-设置多个字段值 2016年08月01日 12:49:26 姚一号 阅读数:29539 标签: mysql mybatis批量更新批量更新allowMultiQuer ...

  2. 插入mysql语句报错:1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near

    插入一个很简单的sql语句时候,mysql一直报错: [SQL] INSERT INTO ORDER ( id, activity_id, order_type, phone, order_amoun ...

  3. ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'type=InnoDB' at line 7

    问题: 使用hibernate4.1.1,数据库使用mysql5.1.30,使用hibernate自动生成数据库表时,hibernate方言使用org.hibernate.dialect.MySQLI ...

  4. 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups)VALUES('1','hh','hh@163.com','Boss')' at line 1

    mysql8.0版本 在已存在的表里插入一条数据 insert INTO api_user(id,username,email,groups)VALUES('1','hh','hh@163.com', ...

  5. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group t1,customer t2

    ### SQL: select t1.gid,t1.gname,t1.gvalue,t1.gtype, t1.gaddress,t1.gmembers, t1.gcode,t1.gphone, t2. ...

  6. [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''&lt;h1 style=&quot;text-align: center;&quot;&gt;php

    [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL s ...

  7. 解决ROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'creat table study_record( id int(11) not null

    之前一直用的好好的,突然就出现了这个错误: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual tha ...

  8. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'like '%逸%'' at line 1

    <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-/ ...

  9. C# Mysql You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ????

    有几年没用过MySql数据了,今天在使用C#访问MySql数据库时出现了一个小插曲. 错误提示: You have an error in your SQL syntax; check the man ...

随机推荐

  1. 关于jenkins的安装及自动部署

    1. 安装Jenkins 1.1 准备Linux服务器, 关闭防火墙禁止开机启动 systemctl stop firewalld.service #停止firewall systemctl disa ...

  2. 使用VS2008,VS2010编译64位的应用程序

    要编译生成64位的应用程序,就必须把vs2008,或vs2010的配置管理器设置为x64. 如果你的配置管理器那里没有x64这个选项,那么是你在安装vs时可能没有安装这个组件.你不用卸载vs,只需打开 ...

  3. mariadb的安装与主从复制

    mariadb其实就是mysql mysql已经被oracle收购,它即将闭源,马上要开始收费了 因此还想免费试用开源的数据库mysql,就在centos7上,将mysql分支为mariadb 第一步 ...

  4. SIFT特征点检测与匹配

    SIFT的步骤如下: (1) 尺度空间极值检测(Scale-space Extrema Detection) 也就是在多尺度高斯差分(Difference of Gauss)空间中检测极值点(3x3x ...

  5. 转-关于UIView的autoresizingMask属性的研究

    在 UIView 中有一个autoresizingMask的属性,它对应的是一个枚举的值(如下),属性的意思就是自动调整子控件与父控件中间的位置,宽高. 1 2 3 4 5 6 7 8 9 enum  ...

  6. 转】在Ubuntu中安装Redis

    不多说,直接上干货! 原博文出自于: http://blog.fens.me/category/%E6%95%B0%E6%8D%AE%E5%BA%93/ 感谢! 在Ubuntu中安装Redis R利剑 ...

  7. 树莓派 离线安装 apt-get offline

    有网络的地方 sudo cp /var/cache/apt/archives/YOUR_PACK_NAME ~/swap/deb/ 没网络的地方 sudo dpkg -i ~/swap/deb/*

  8. [POJ1509]Glass Beads 后缀自动机 最小循环串

    题目链接:http://poj.org/problem?id=1509 题目意思就是求循环字符串的最小表示. 我们用字符串S+S建立SAM,然后从root开始走n步,每次尽量选最小的. 由于 SAM ...

  9. Bmob使用心得

    1.在 Project 的 build.gradle 文件中添加 Bmob的maven仓库地址,示例如下:(注意文字说明部分): allprojects { repositories { jcente ...

  10. Android开发-下载网络图片并显示到本地

    Android下载网络图片的流程是: 发送网络请求->将图片以流的形式下载下来->将流转换为Bitmap并赋给ImageView控件. 注意点 最新的Android系统不可以在主线程上请求 ...