public static List<JSONObject> getTaskShare(Long userId){
List<JSONObject> list=new ArrayList<JSONObject>();
List lists=JPA.em().createNativeQuery("select task_id,task_name from filter_task where task_id in (select task_id from filter_task_share where businessGroup_id in (select businessGroup_id from BusinessGroupUnitLink where businessUnit_id="+userId+"))").getResultList();
for (Object object : lists) {
Object[] o=(Object[]) object;
System.out.println(o[0]);
JSONObject json=new JSONObject();
json.put("task_id", o[0]);
json.put("task_name", o[1]);
list.add(json);
}
return list;
}
JPA查询
最新推荐文章于 2024-06-30 15:03:08 发布