关键点:resultType

resultType是sql映射文件中定义返回值类型,返回值有基本类型,对象类型,List类型,Map类型等

一般我们查询中resultType带的都是实体类

<select id="findPaperTitleByPaperId" resultType="PaperTitle">
        select * from paper_title
</select>

 

当我们想查询数据的条数之类的数据,这个适合改变一下我们的resultType返回类型即可

<select id="PaperTitleCount" resultType="Int">
        select count(*) from paper_title
</select>

 

结果:

 

 

 

 


posted on 2023-01-27 16:58  最帅爸爸  阅读(55)  评论(0)    收藏  举报