|
|
|
@ -1727,18 +1727,34 @@ public class CollectModel {
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public List<Record> getTableDataByJobId(int job_id, String table_name) {
|
|
|
|
|
String sql = "select job_id from t_collect_job where parent_id=?";
|
|
|
|
|
List<Record> list = Db.find(sql, job_id);
|
|
|
|
|
List<Integer> jobList = new ArrayList<>();
|
|
|
|
|
dfsJob(job_id, jobList);
|
|
|
|
|
|
|
|
|
|
String ids = job_id + ",";
|
|
|
|
|
for (Record record : list) {
|
|
|
|
|
ids += record.getStr("job_id") + ",";
|
|
|
|
|
for (Integer x : jobList) {
|
|
|
|
|
ids += x + ",";
|
|
|
|
|
}
|
|
|
|
|
if (ids.length() > 0) ids = ids.substring(0, ids.length() - 1);
|
|
|
|
|
|
|
|
|
|
sql = "select * from " + table_name + " where job_id in(" + ids + ")";
|
|
|
|
|
String sql = "select * from " + table_name + " where job_id in(" + ids + ")";
|
|
|
|
|
return Db.find(sql);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:递归获取所有任务树的任务IDS
|
|
|
|
|
*
|
|
|
|
|
* @param job_id
|
|
|
|
|
* @param jobList
|
|
|
|
|
*/
|
|
|
|
|
public void dfsJob(int job_id, List<Integer> jobList) {
|
|
|
|
|
String sql = "select job_id from t_collect_job where parent_id=?";
|
|
|
|
|
List<Record> list = Db.find(sql, job_id);
|
|
|
|
|
jobList.add(job_id);
|
|
|
|
|
for (Record record : list) {
|
|
|
|
|
jobList.add(record.getInt("job_id"));
|
|
|
|
|
dfsJob(record.getInt("job_id"), jobList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:获取指定列的列描述信息
|
|
|
|
|
*
|
|
|
|
|