ibatis 层配置
<!-- 指标项操作 -->
<select id= "getReportTarget " parameterClass= "ReportTarget " resultClass= "ReportTarget ">
select
RTID as targetID,RID as reportID,JCDM as targetCode,Title as title,TitlePre as titlePre,TitlePost as titlePost,Note as note
from
XNW_REPORT_TARGET
<dynamic prepend= "where ">
<isNotEmpty property= "targetID " prepend= "and "> RTID = #targetID# </isNotEmpty>
<isNotEmpty property= "reportID " prepend= "and "> RID = #reportID# </isNotEmpty>
</dynamic>
</select>
sql语句正确
当有值返回时 报错如下
org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; --- The error occurred in db/report/sqlmap_report_def.xml. --- The error occurred while applying a result map.
------解决方案--------------------
Mapping的时候出错,看看实体对象的属性是否和你xml里面定义的匹配?