本来这个错不值得我写的,但是太久没写东西了,不水一篇文章多少也说不过去.主要最近也在工作,还没有总结
select *
FROM t_house_source a
INNER JOIN t_contract_info contractInfo ON a.HOUSE_ID = contractInfo.HOUSE_ID
INNER JOIN t_bill_all billAll ON contractInfo.id = billAll.CONTRACT_ID
INNER JOIN t_bill_details billDetails ON billAll.ID = billDetails.ALL_ID
WHERE
TO_DAYS( billDetails.COST_PERIOD_START ) - TO_DAYS( NOW( ) ) <= 10
AND billDetails.PAY_STATUS <> '1'
xml中写下以上代码(经过我的简化,主要是为了记录报错)
报错如下
Bean creation exception on non-lazy FactoryBean
type check: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'codeInfoMapper'
defined in file [E:\WJQ\house\target\house\WEB-INF\classes\com\jeeplus\modules\code\mapper\CodeInfoMapper.class]:
Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory';
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'sqlSessionFactory' defined in file
[E:\WJQ\house\target\house\WEB-INF\classes\spring\spring-context.xml]: Invocation of init method failed;
nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource:
'file [E:\WJQ\house\target\house\WEB-INF\classes\com\jeeplus\modules\house\mapper\xml\HouseSourceMapper.xml]';
nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance.
Cause: org.xml.sax.SAXParseException;
因为它出了两个mapper,我第一反应就是它重名了,反复寻找没有,因为在navicat中执行成功,我相信sql不会有问题.然后有照着现有的sql文比对,逐渐找到是条件出了问题,他出现两个咖啡杯让我不解.最终在同事的帮助下了解,xml中不能使用<号,因为xml中代表标签.加上之后项目正常启动.另外有个快捷键分享CTRL+ - 缩小,例如配置中如果是调用yaml的属性,使用该快捷键可以直接看到