mybatis query counts the number of a certain column, group query based on a column, I don’t know how to write the resultType parameter in the xml file.
SQL statement:
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>
I tried using the entity class to receive it, but it didn’t work. I would like to ask in this case, how to write the resultType parameter to receive the value
Provide information about entity classes.
Tips: count(title) you have not mapped which variable of the corresponding entity class.