xml
<select id="getPraiseFabulous" resultType="java.lang.Integer">
SELECT COUNT(fabulous = "1") AS number
FROM vc_praise a
WHERE fabulous = "1" and target_id = #{targetId}
HAVING COUNT(fabulous = "1")
</select>
mybatis文件中resultType定义为”java.lang.Integer”才能映射起来。
dao
public Integer getPraiseFabulous(VcPraise vcPraise);