qq_43010024
2020-12-26 16:52
采纳率: 100%
浏览 498
已采纳

mybatis-plus sql报错 Navicat正常执行

救救孩子吧

报错具体如下

### Error querying database.  Cause: com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: Error: Method queryTotal execution error of sql : 
 SELECT COUNT(1) FROM ( SELECT twl.id,c.id as 'cid',c.mac_addr,c.`name`,c.remarks,twl.date,twl.state,twl.`port`
        FROM `t_log_wireless` twl
         WHERE  c.`name`=? 
        INNER JOIN `t_client` c ON twl.cid=c.id
        ORDER BY twl.id DESC,twl.date DESC ) TOTAL 

### The error may exist in file [E:\Workspace\IdeaProjects\wrdm\target\classes\mapper\LogWirelessDao.xml]
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### Cause: com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: Error: Method queryTotal execution error of sql : 
 SELECT COUNT(1) FROM ( SELECT twl.id,c.id as 'cid',c.mac_addr,c.`name`,c.remarks,twl.date,twl.state,twl.`port`
        FROM `t_log_wireless` twl
         WHERE  c.`name`=? 
        INNER JOIN `t_client` c ON twl.cid=c.id
        ORDER BY twl.id DESC,twl.date DESC ) TOTAL 
] with root cause

mapper xml

<select id="listFull" resultType="net.zzj6.wrdm.vo.LogWireless">
	SELECT twl.id,c.id as 'cid',c.mac_addr,c.`name`,c.remarks,twl.date,twl.state,twl.`port`
	FROM `t_log_wireless` twl
	<where>
		<if test="cname != null and cname != ''">
			and c.`name`=#{cname}
		</if>
	</where>
	INNER JOIN `t_client` c ON twl.cid=c.id
	ORDER BY twl.id DESC,twl.date DESC
</select>

用的mysql数据库  ER图如下

 

 Navicat正常执行的

 

 

求解答 谢谢。

2条回答 默认 最新

相关推荐 更多相似问题