文章詳情頁
mysql - mybatis 查詢 統(tǒng)計(jì)某個(gè)列數(shù)量 ,根據(jù)一個(gè)列,分組查詢,在xml文件如何接收
瀏覽:89日期:2022-06-11 13:02:35
問題描述
mybatis 查詢 統(tǒng)計(jì)某個(gè)列數(shù)量 ,根據(jù)一個(gè)列,分組查詢,在xml文件中resultType參數(shù)不知道怎么寫。
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>
試過用實(shí)體類去接收,不行,想問問這種情況,resultType參數(shù)該怎么寫才能接收到值
問題解答
回答1:提供下實(shí)體類的信息.
提示:count(title)你沒有映射對(duì)應(yīng)實(shí)體類的哪個(gè)變量.
排行榜

熱門標(biāo)簽