起因是我写了一个复杂的sql,sql中使用了@这种自定义的变量,在查询sql的时候直接报错了,
解决办法:
1.是升级mybatisplus版本到v3.5.1及以上,
2.或者在mapper上打注解 @InterceptorIgnore(tenantLine = "true")
SELECT
t1.id
FROM
xc_department t1
JOIN
(SELECT @pids := 2) t2
JOIN
(SELECT
t1.*,
IF(
find_in_set(t1.pid, @pids) > 0,
@pids := concat(@pids, ',', t1.id),
0
) AS ischild
FROM
xc_department t1
) t3 ON t3.id = t1.id
WHERE
ischild != 0 OR t1.id = 2;