当前使用版本(必填,否则不予处理)

3.4.0

该问题是如何引起的?(确定最新版也有问题再提!!!)

启用了 PaginationInterceptor 插件

给sql添加注释,mybatis-plus解析后丢失了注释,必现。

重现步骤(如果有就写完整)

在Mapper xml文件sql添加注释‘maxscale route to master’,例如:

    <select id="queryApiById" resultMap="FullResultMap">
        /*maxscale route to master*/ select
        <include refid="Full_Column_List" />
        from iam_api
        where id = #{id}
        and state = 0
    </select>

报错信息

Original SQL: /*maxscale route to master*/ select

         id, api_code, api_uri, api_name, api_description, api_type, state, created_time, updated_time

        from iam_api
        where id = ?
        and state = 0
parser sql: SELECT id, api_code, api_uri, api_name, api_description, api_type, state, created_time, updated_time FROM iam_api WHERE id = ? AND state = 0
==>  Preparing: SELECT id, api_code, api_uri, api_name, api_description, api_type, state, created_time, updated_time FROM iam_api WHERE id = ? AND state = 0 
==> Parameters: 221(Long)
<==    Columns: id, api_code, api_uri, api_name, api_description, api_type, state, created_time, updated_time
<==        Row: xxxxxx
<==      Total: 1

Comment From: aboutZZ

请使用XML注释

 <select id="queryApiById" resultMap="FullResultMap">
    <!-- maxscale route to master --> select
    <include refid="Full_Column_List" />
    from iam_api
    where id = #{id}
    and state = 0
</select>