今天寫統計查詢的時候出現了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就可以了