mybatis查詢返回hashmap相關問題


 

記錄是為了更好的成長!

 

1、mapper.xml描述,注意是parameterType 和 resultType  

   <select id="findExamineInfoByYear" parameterType="java.util.HashMap" resultType="java.util.HashMap"> 
        select emid,datetime,totalscore,selfscore from examine ,examscore 
        where examine.selfscore = examscore.id 
        and examine.emid = #{emid} and examine.year = #{year}
    </select>

2、對應的mapper接口

List<Map> findExamineInfoByYear(Map map);

3、返回到頁面的json數據格式

[{"selfscore":4,"datetime":"2018-11-12","totalscore":"73","emid":1},{"selfscore":3,"datetime":"2018-12-12","totalscore":"32","emid":1}]

 

 

 

 

 

 

 

 

以上內容代表個人觀點,僅供參考,不喜勿噴。。。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM