mybatis 能将五个count值转成list返回吗
展开全部
返回一个对象
<resultMap id="selectMap" type="Student" >
<result property="name" column="NAME" jdbcType="VARCHAR" />
<result property="num" column="NUM" jdbcType="NUMERIC" />
</resultMap>
<select id="selectStu" resultMap="selectMap">
select count(t.name) as NUM,t.name from pt_user t group by t.name
</select>
<resultMap id="selectMap" type="Student" >
<result property="name" column="NAME" jdbcType="VARCHAR" />
<result property="num" column="NUM" jdbcType="NUMERIC" />
</resultMap>
<select id="selectStu" resultMap="selectMap">
select count(t.name) as NUM,t.name from pt_user t group by t.name
</select>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询