您的位置:首页技术文章
文章详情页

mysql - mybatis 查询 统计某个列数量 ,根据一个列,分组查询,在xml文件如何接收

浏览:54日期:2022-06-11 13:02:35

问题描述

mybatis 查询 统计某个列数量 ,根据一个列,分组查询,在xml文件中resultType参数不知道怎么写。

SQL语句:select title_type,COUNT(title) from qa_title where title like ’%车%’ GROUP BY title_type ;

xml:

<select resultType='cheng.secondprice.entitylet.QaContent' parameterType='String'>

select title_type,COUNT(title) from qa_title where title like ’%${titles}%’ GROUP BY title_type

</select>

试过用实体类去接收,不行,想问问这种情况,resultType参数该怎么写才能接收到值

问题解答

回答1:

提供下实体类的信息.

提示:count(title)你没有映射对应实体类的哪个变量.