在下面关于传递办公室代码列表的查询中,我得到了 countryID 的列表。现在,我需要一个 Map,其中的键是 countryID,它的值是办公室代码列表。你能帮我么。
示例:如果我们的办公室为abc,def属于国家123,xyz属于789,我需要一个类似 (123, List(abc,def).... (789,List(xyz)))的地图
public List getData(List officeCode) {
try {
StringBuffer queryString = new StringBuffer("select distinct
(abc.countryID) from com.#####.TABLE table");
queryString.append(" where table.officeCode in (:oCode)");
return SessionFactory.getCurrentSession()
.createQuery(queryString.toString())
.setParameterList("oCode",officeCode )
.list();
}
catch (Exception e)
{
e.printStackTrace();
return null;
}
}