对于这样的带有group by的语句,可以自定义返回类型
<select id="getAllInfoByRespCode" resultMap="allInfo">
select sum(transAmt),count(*), respCode from transdetail where batchNo = #{batchNo,jdbcType=VARCHAR} GROUP BY respCode</select>
<resultMap id="allInfo" type="java.util.Map">
<result column="sum(transAmt)" property="sum" jdbcType="VARCHAR"/>
<result column="count(*)" property="count" jdbcType="VARCHAR"/>
<result column="respCode" property="respCode" jdbcType="VARCHAR"/>
</resultMap>