Failed to process, please exclude the tableName or statementId.

5 阅读1分钟

说明:执行一次查询时,报下面这个错误;

Failed to process, please exclude the tableName or statementId.

排查结果,在Mapper.xml里面,对应的statement使用了复杂的函数,

    <select id="getLastEleRank" resultType="java.lang.Integer">
        select t.rank_no from (
        SELECT
        @rownum := @rownum + 1 as rank_no,e.id
        FROM
        (SELECT @rownum := 0) r
        ,(select a.id from t_goods a
        where a.del_flag='0' and a.status=1
		...
    </select>

需要在对应的Mapper方法上增加@SqlParser(filter = true)注解

在这里插入图片描述