直接将SQL语句导入报错
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [F:\RongSys\ruoyi-system\target\classes\mapper\system\SysLogininforMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 61; columnNumber: 41; 元素内容必须由格式正确的字符数据或标记组成。
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622)
... 115 common frames omitted
提示
元素内容必须由格式正确的字符数据或标记组成。
找到Mybatis不能直接使用sql部分的判断符
where
DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= date(login_time)
AND
解决办法
< 号换成 <
> 号 换成 >
修改为
where
DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= date(login_time)
AND
即可解决问题