一、该问题的重现步骤是什么?
1. 在2.9.0.RELEASE版本里的分页sql到4.3.0.RELEASE版本里之后执行报错,在navicat和2.9.0.RELEASE里面执行没有任何问题
二、你期待的结果是什么?实际看到的又是什么?
我把sql里面的所有条件都注释了也没用
三、你正在使用的是什么产品,什么版本?在什么操作系统上?
上夜班4.3.0.RELEASE,java。win7
四、请提供详细的错误堆栈信息,这很重要。
org.springblade.core.log.exception.ServiceException:
### Error querying database. Cause: com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: Failed to process, Error SQL: select
a.id,
a.name,
a.address,
a.receipt_status,
a.region_code,
a.state,
a.longitude,
a.latitude,
a.state,
a.is_update,
a.last_consumable_time,
a.last_inspect_time,
d.name_path AS region_code_name,
IFNULL(a.is_inspect,0) inspect_count,
IFNULL(a.is_consumable,0) as consumable_count,
IFNULL(a.is_expansion,0) as expansion_count
from
(
SELECT
a.id
FROM
tb_base_ent a
left JOIN (
SELECT
count(*) as inspect_count,
ent_id
FROM
tb_inspect
WHERE
is_deleted = 0 and status=1
AND (
region_code LIKE CONCAT(?, '%')
OR
region_code LIKE CONCAT(?, '%')
OR
region_code LIKE CONCAT(?, '%')
OR
region_code LIKE CONCAT(?, '%')
OR
region_code LIKE CONCAT(?, '%')
)
GROUP BY ent_id
) b ON a.id = b.ent_id
WHERE
is_deleted = 0
AND FIND_IN_SET(?,a.receipt_status)
AND (
region_code LIKE CONCAT(?, '%')
OR
region_code LIKE CONCAT(?, '%')
OR
region_code LIKE CONCAT(?, '%')
OR
region_code LIKE CONCAT(?, '%')
OR
region_code LIKE CONCAT(?, '%')
)
) c join tb_base_ent a on c.id=a.id
LEFT JOIN ( SELECT region_code, city_name, name_path FROM tb_base_region WHERE is_deleted = 0 ) d ON
a.region_code = d.region_code
ORDER BY a.create_time desc
limit ?,?
### Cause: com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: Failed to process, Error SQL: select
a.id,
a.name,
a.address,
a.receipt_status,
a.region_code,
a.state,
a.longitude,
a.latitude,
a.state,
a.is_update,
a.last_consumable_time,
a.last_inspect_time,
d.name_path AS region_code_name,
IFNULL(a.is_inspect,0) inspect_count,
IFNULL(a.is_consumable,0) as consumable_count,
IFNULL(a.is_expansion,0) as expansion_count
from
(
SELECT
a.id
FROM
tb_base_ent a
left JOIN (
SELECT
count(*) as inspect_count,
ent_id
FROM
tb_inspect
WHERE
is_deleted = 0 and status=1
AND (
region_code LIKE CONCAT(?, '%')
OR
region_code LIKE CONCAT(?, '%')
OR
region_code LIKE CONCAT(?, '%')
OR
region_code LIKE CONCAT(?, '%')
OR
region_code LIKE CONCAT(?, '%')
)
GROUP BY ent_id
) b ON a.id = b.ent_id
WHERE
is_deleted = 0
AND FIND_IN_SET(?,a.receipt_status)
AND (
region_code LIKE CONCAT(?, '%')
OR
region_code LIKE CONCAT(?, '%')
OR
region_code LIKE CONCAT(?, '%')
OR
region_code LIKE CONCAT(?, '%')
OR
region_code LIKE CONCAT(?, '%')
)
) c join tb_base_ent a on c.id=a.id
LEFT JOIN ( SELECT region_code, city_name, name_path FROM tb_base_region WHERE is_deleted = 0 ) d ON
a.region_code = d.region_code
ORDER BY a.create_time desc
limit ?,?
五、若有更多详细信息,请在下面提供。
扫一扫访问 Blade技术社区 移动端