今天写统计查询的时候出现了Springboot项目启动失败没有报错
关于Caused by: org.xml.sax.SAXParseException;必须为元素类型 "select" 声明属性 "parmeterType"
在main函数上捕捉异常
try {
SpringApplication.run(TiangongSpringBootDemoApplication.class, args);
} catch (Exception e) {
e.printStackTrace();
log.error("the exception is {}", e);
}
原来代码是这么写的
List<String> selectIds(@Param(value="dateVo")DateVo dateVo);
<select id="selectIds" resultType="java.lang.String" parameterType="com.api.entity.DateVo">
select distinct ajlcid
from ebd_fh_ajlc where sorttime >= to_date(#{startDate},'YYYY-MM-DD')
and created_date=updated_date
and keyvalue in (select distinct companyname from ebd_fh_company_list where isupdate='0')
</select>
看起来比较疑惑明明有parameterType这个参数,提示我没有参数
删除parameterType就可以了