天天看點

java兩個map合并_如何在Java中組合兩個不同的Map?

我追蹤了許多此類連結Merging two Maps,但仍無法解決問題.

我有兩個Maps List< Map< String,Object>> -此映射包含acc_num,parent_acc_num,crte_dt,rnwl_dt,使用者ID等,其他映射包含acc_num和isActive(這是對第一個映射的改進).

我想建立/合并這兩個映射,并建立包含acc_num,parent_acc_num,crte_dt,rnwl_dt,userid isActive詳細資訊的最終映射.

我怎樣才能做到這一點 ?

以下是示例資料.唯一的問題都是Map清單,如何在另一個清單之間進行疊代?

{CRTE_DT=2017-06-22, USER_ID=ABC, ACC_NUM=9449, RNWL_DT=2017-06-22, PARENT_ACC_NO=9449}

{ACC_NUM=9449, IS_ACTIVE=false}

另一個查詢:

如果以下工作可行,則可能無需進行計算

我有以下使用12c的Oracle查詢,我需要一種方法來檢查查詢本身是否

>如果CreatedDate 30天> Sysdate然後顯示具有true —>的列.徑内

>如果CreatedDate 30天< Sysdate然後顯示具有錯誤的列--->落後時期“select cust.acc_num, third.parent_acc_id, cust.crte_dt,cust.updated_dt ,cust.crte_user_id from CUST_ACCT cust, ThirdParty_third third ”

+ “where cust.updated_dt is null and cust.CRTE_DT < sysdate ”

+ “and cust.acc_num = third.third_code and is_actv = ? union ”

+ “select cust.acc_num, third.parent_acc_id, cust.crte_dt,cust.updated_dt, cust.crte_user_id from CUST_ACCT cust, ThirdParty_third third ”

+ “where ( cust.updated_dt is not null and cust.updated_dt < sysdate ) ”

+ “and cust.acc_num = third.third_code and is_actv = ? “;