首页  >  问答  >  正文

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

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

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

xml:

<select id="getTitleCuntLike" 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参数该怎么写才能接收到值

ringa_leeringa_lee2683 天前1331

全部回复(1)我来回复

  • PHP中文网

    PHP中文网2017-06-15 09:23:18

    提供下实体类的信息.

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

    回复
    0
  • 取消回复