数据库去重查询问题详解

 

预算2014年院线预算 影城(多选)北京CBD影城 查询
       
科目蚌埠万达广场店北京CBD影城    
营业收入11    
票房收入11    
卖品收入00    
逾期收入00    
广告收入00    
映前广告00    
LCD广告00    
阵地收入00    
IMAX广告收入00    
其他广告收入00    
其他收入00    
租赁收入00    
喷绘费收入00    
卡费收入00    
影片返点奖励收入00    
IMAX冠名费收入00    
其它冠名费收入00    
赞助费0     
RealD广告赞助费0     
万达自有媒体收入0     
其它(其他收入)0     
变动成本0     
票房成本0     
卖品成本0     
广告成本0     
其他成本0     
营业税金及附加(不含专资)0     
电影专资0     
变动费用0     
影院分成租金0     
IMAX设备租金0     
固定费用0     
影院固定租金0     
职工薪酬0     
折旧摊销费0     
办公房屋租金及物业费0     

List<HashMap> list_temp = new ArrayList<HashMap>();
   List listSubject = hrSalaryReportDetail.removeDuplicateWithSubject(allCinema);
   List listOrg = hrSalaryReportDetail.removeDuplicatWithOrg(allCinema);
   HashMap map = new HashMap();
   for (int k = 0; k < allCinema.size(); k++) {
    // String org_id = listOrg.get(i).toString().split("_")[0];
    Object[] objLIst = (Object[]) allCinema.get(k);// 结果集
    // if(objLIst[2].toString().equals(org_id)&&objLIst[1].toString().equals(listSubject.get(j).toString())){//subjectid与orgid对应
    map.put(objLIst[2].toString() + "_" + objLIst[3].toString(),
      objLIst[6].toString());// subjectid与orgid对应
    // }
   }

   for (int j = 0; j < listSubject.size(); j++) {
    String subject_id = listSubject.get(j).toString().split("_")[0];
    String subject_name = listSubject.get(j).toString().split("_")[1];
    String subject_parent_id = listSubject.get(j).toString().split("_")[2];
  
    HashMap sub_map = new HashMap();
    sub_map.put("subjectId", subject_id);
    sub_map.put("parentSubjectId", subject_parent_id);
    sub_map.put("subject_name", subject_name);
    for (int i = 0; i < listOrg.size(); i++) {
     String org_id = listOrg.get(i).toString().split("_")[0];
     String str_key = subject_id + "_" + org_id;
     String str_value = "";
     if (map.containsKey(str_key)) {
      str_value = map.get(str_key).toString();
     }
     sub_map.put(org_id, str_value);
    }
    list_temp.add(sub_map);

 

转载于:https://www.cnblogs.com/SunDexu/p/3356174.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值