mybatis 得sql语句对应简单类型

it2025-11-12  8

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);

 

最新回复(0)