報錯:nested exception is org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 17
我返回的類型明明就是list 為什麼還是報這個錯
這個是我Mapper的
public List<RefusalCause> findPage(DefaultCriteria obj);
public Long findPageCount(DefaultCriteria obj);
public List<RefusalCause> refusalCause(DefaultCriteria obj);
這個是Mapper.xml
<resultMap type="com.xxx.o2o.model.RefusalCause" id="refusalCause">
<result property="refusalTime" column="refusalTime" />
<result property="noStore" column="noStore" />
<result property="idCheck" column="idCheck" />
<result property="preRefuse" column="preRefuse" />
<result property="noLocNoSecurity" column="noLocNoSecurity" />
<result property="FNoSecurity" column="FNoSecurity" />
<result property="MNoSecurity" column="MNoSecurity" />
</resultMap>
<select id="refusalCause" parameterType="com.xxx.o2o.model.RefusalCause"
resultMap="refusalCause">
select date_format(update_time,'%y-%m-%d') as refusalTime,
sum(case
when
close_reason=1 then 1 else 0 end) as noStore,
sum(case
when
close_reason=2 then 1 else 0 end) as idCheck,
sum(case when
close_reason=3 then 1 else 0 end) as preRefuse,
sum(case when
close_reason=5 then 1 else 0 end) as noLocNoSecurity,
sum(case when
close_reason=7 then 1 else 0 end) as FNoSecurity,
sum(case when
close_reason=8 then 1 else 0 end) as MNoSecurity
from t_order_overview
where order_id in (
select order_id from t_order_history where
1 = 1 and
order_status = 10
and
<![CDATA[order_time > '2015-10-12' ]]>
and
<![CDATA[order_time < '2015-10-22']]>)
and is_close = '1' group by
date_format(update_time,'%y-%m-%d')
</select>
<select id="findPage" parameterType="com.xxx.framework.pagination.DefaultCriteria"
resultMap="refusalCause">
select date_format(update_time,'%y-%m-%d') as refusalTime,
sum(case
when
close_reason=1 then 1 else 0 end) as noStore,
sum(case
when
close_reason=2 then 1 else 0 end) as idCheck,
sum(case when
close_reason=3 then 1 else 0 end) as preRefuse,
sum(case when
close_reason=5 then 1 else 0 end) as noLocNoSecurity,
sum(case when
close_reason=7 then 1 else 0 end) as FNoSecurity,
sum(case when
close_reason=8 then 1 else 0 end) as MNoSecurity
from t_order_overview
where order_id in (
select order_id from t_order_history where
1 = 1 and
order_status = 10
<if test="startTime !=null">
and order_time > #{startTime}
</if>
<if test="endTime !=null">
and order_time < #{endTime}
</if>
)and is_close = '1' group by
date_format(update_time,'%y-%m-%d')
order
by
refusalTime desc
limit #{start},#{end}
</select>
<select id="findPageCount" parameterType="com.xxx.framework.pagination.DefaultCriteria"
resultType="Long">
select count(1)
from t_order_overview
where order_id in (
select order_id
from t_order_history where
1 = 1 and
order_status = 10
<if test="startTime !=null">
and order_time > #{startTime}
</if>
<if test="endTime !=null">
and order_time < #{endTime}
</if>
)
and is_close = '1' group by
date_format(update_time,'%y-%m-%d')
</select>
求助
我知道了 ,我count(1)傳回來的是數組,我用了long接收