mybatis返回一个count加一个字段该怎么设置返回resultType
2个回答
2016-05-28
展开全部
返回一个对象
<雹扮悔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>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询