mybatis 得sql語句對應簡單型別

藝術就是爆炸!發表於2020-10-22

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

 

相關文章