idea中mybatis的mapper.xml警告解决方式

一、警告信息1

No data sources are configured to run this SQL and provide advanced code assistance. Disable this inspection via problem menu (Alt+Enter). less… (Ctrl+F1) Inspection info: Prompts one to create a data source if there is none.

二、警告样图

idea中mybatis的mapper.xml警告解决方式

三、解决警告1

需要我们连接数据库
idea中mybatis的mapper.xml警告解决方式
但是发现,还有这个错误信息:

四、警告信息2

SQL dialect is not configured. SQL Server, Redshift, PostgreSQL match best. less… (Ctrl+F1)
Inspection info: Detects the best matching SQL dialect for files in dialect.

五、解决警告2

idea中mybatis的mapper.xml警告解决方式
现在xml相关的sql语句已经变成浅绿色了.

六、警告信息3

XML tag has empty body less… (Ctrl+F1)
Inspection info: Reports empty tag body. The validation works in XML / JSP / JSPX / HTML/ XHTML file types.
idea中mybatis的mapper.xml警告解决方式

七、解决告警3

将开合标签改成闭合标签即
idea中mybatis的mapper.xml警告解决方式

八、解决重复代码警告

idea中mybatis的mapper.xml警告解决方式