<!-- 按天统计 -->
<insert id="insertVisitStatisticInfoDay" parameterClass="string">
<![CDATA[
insert into visit_statistic_day (app_id,user_num,pv,uv,visit_date)
select type_id as app_id ,count(distinct username) as user_num,count(id) as pv,
count(distinct ip) as uv, date_format(now_time,'%Y-%m-%d') as visit_date
from superbosstongji.pv_$tbNo$ group by type_id
]]>
<!--<selectKey resultClass="int" keyProperty="id">
<![CDATA[SELECT LAST_INSERT_ID() AS ID ]]>
</selectKey>-->
</insert>
报这种异常主要是因为你设置对象keyProperty='id' 在类型为int类型,而你传进来的是string类型
<!--<selectKey resultClass="int" keyProperty="id">
<![CDATA[SELECT LAST_INSERT_ID() AS ID ]]>
</selectKey>-->
这行代码主要作用时当插入成功后,返回表的索引值,访异常解决的办法是注释这行几行代码,
或者在传进来的参数值里包含keyProperty=‘id'