Mybatis中表达大于等于或小于等于的正确书写

直接将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

解决办法

 < 号换成  &lt;     
> 号 换成 &gt;

修改为

where
	DATE_SUB(CURDATE(), INTERVAL 30 DAY) &lt;= date(login_time)
AND

即可解决问题

发布了104 篇原创文章 · 获赞 264 · 访问量 54万+

猜你喜欢

转载自blog.csdn.net/teavamc/article/details/88854857