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. 关于ArcGis for javascrept查询ArcGis server图层信息的方式

    方式一: queryTask方式: 该方式用于单个图层的条件查询(不能跨图层查询) 1. 创建query对象 query = new esri.tasks.Query(); 2. 给query对象设置 ...

  2. java-异常简介

    1.简介 ############################################################### ############################### ...

  3. Tree POJ - 174

    点分模板题 都快改的跟题解一模一样了2333333 #include<cstdio> #include<cstring> #include<algorithm> u ...

  4. 题解报告:hdu 2709 Sumsets

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2709 Problem Description Farmer John commanded his co ...

  5. 用.NetReactor保护您的源码[转][修改]

    原文链接 前言 VS开发的源代码安全性,是很多开发者头痛的事情.于是保护好源代码便成了开发者们最关心的事情之一了. 在网上搜一搜,很多有不少的第三方工具可以为源代码加密.加密方式不外乎就是混淆,加壳. ...

  6. 用java打印输出九九乘法表

    package com.wh.multiplication public class Multiplication Table { public static void main(String[] a ...

  7. 转-iOS开发系列--地图与定位

    来自: http://www.cnblogs.com/kenshincui/p/4125570.html#autoid-3-4-0 概览 现在很多社交.电商.团购应用都引入了地图和定位功能,似乎地图功 ...

  8. 转】Nodejs对MongoDB模糊查询

    原博文出自于: http://blog.fens.me/category/%E6%95%B0%E6%8D%AE%E5%BA%93/page/4/ 感谢! Posted: Jul 1, 2013 Tag ...

  9. ASP.NET Core MVC使用MessagePack配合前端fetch交换数据

    1.安装Nuget包 - WebApiContrib.Core.Formatter.MessagePack https://www.nuget.org/packages/WebApiContrib.C ...

  10. AJPFX实践 java实现快速排序算法

    快速排序算法使用的分治法策略来把一个序列分为两个子序列来实现排序的思路: 1.从数列中挑出一个元素,称为“基准“2.重新排序数列,所有元素比基准值小的摆放在基准前面,所有元素比基准值大的摆在基准的后面 ...