码迷,mamicode.com
首页 > 编程语言 > 详细

java 建maplist放case center合并

时间:2019-02-12 12:58:15      阅读:157      评论:0      收藏:0      [点我收藏+]

标签:getname   pat   selectall   bsp   col   api   object   void   for   

    public void import12(){
        List<Map<String, Object>> mapList=new ArrayList<Map<String, Object>>();
        Map<String,Object> mapInfo=new HashMap<>();
        ImgCaseFilter imgCaseFilter=new ImgCaseFilter();
        List<ImgCase> imgCases=imgCaseService.selectAll(imgCaseFilter);        
        
        for(ImgCase imgCase:imgCases){
            ImgCenterFilter imgCenterFilter=new ImgCenterFilter();
            imgCenterFilter.setEq_caseId(imgCase.getId());
            JSONObject obj = new JSONObject();    
            
            String patientId = imgCase.getPatientId();
            String name = imgCase.getName();
            String age = imgCase.getAge();
            String sex = imgCase.getSex();
            
            obj.put("patientid", patientId);
            obj.put("name", name);
            obj.put("age", age);
            obj.put("sex", sex);
            obj.put("imgInfo", null);
            obj.put("imgInfo", null);
            
            List<ImgCenter> imgCenters=imgCenterService.selectAll(imgCenterFilter);    
            List<String> urllist=new ArrayList<String>();//当前caseid下imgcenter里的图片url            
            for(ImgCenter imgCenter:imgCenters){
                String url=imgCenter.getImgUrl();
                urllist.add(url);                
            }
            mapInfo.put("imgCase", obj);
            mapInfo.put("imgCenter", urllist);
            mapList.add(mapInfo);
        }
    }
    

 

java 建maplist放case center合并

标签:getname   pat   selectall   bsp   col   api   object   void   for   

原文地址:https://www.cnblogs.com/lely/p/10364611.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!