sqle icon indicating copy to clipboard operation
sqle copied to clipboard

SQLE审核xml文件支持namespace引用

Open ColdWaterLW opened this issue 1 year ago • 0 comments

如下MyBatis配置,在SQLE创建工单审核会报id不存在

<?xml version="1.0" encoding="UTF-8"?><!--Converted at: Mon Jun 07 09:48:24 CST 2021-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
		"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="test.common">
	<sql id="prefix">
		SELECT * FROM (
	</sql>

	<sql id="suffix">
		WHERE a=1 )
	</sql>

	<select id="sql1" parameterType="customer" resultMap="custResultMap">
		<include refid="prefix"/>
		SELECT a,b FROM tb1
		<include refid="suffix"/>
	</select>

	<select id="queryEmpHireSepList" parameterType="employee" resultType="employeeResult">
		<include refid="test.common.prefix"/>
		SELECT a,b FROM tb1
		<include refid="test.common.suffix"/>
	</select>
</mapper>

创建工单,上传xml文件 image

点审核报错 image

原因

SQLE解析MyBaits配置文件时,没有考虑sql id和namespace的关联,把test.common.prefix和prefix当成了两个不同的id处理

预期

能成功解析

ColdWaterLW avatar Aug 31 '23 09:08 ColdWaterLW