Merge pull request #34 from jerrybai2009/master

DSS-3914, modify the sql to fetch only the latest version of jobs in …
This commit is contained in:
jerrybai2009 2016-02-19 11:30:59 -08:00
commit b7423dc9d3

View File

@ -57,10 +57,11 @@ public class FlowsDAO extends AbstractMySQLOpenSourceDAO
"SELECT count(*) FROM flow_job WHERE app_id = ? and flow_id = ?";
private final static String GET_PAGED_JOBS_BY_APP_ID_AND_FLOW_ID = "select SQL_CALC_FOUND_ROWS " +
"j.job_id, j.job_name, j.job_path, j.job_type, FROM_UNIXTIME(j.created_time) as created_time, " +
"j.job_id, MAX(j.last_source_version), j.job_name, j.job_path, j.job_type, FROM_UNIXTIME(j.created_time) as created_time, " +
"FROM_UNIXTIME(j.modified_time) as modified_time, f.flow_name " +
"FROM flow_job j JOIN flow f on j.app_id = f.app_id and j.flow_id = f.flow_id " +
"WHERE j.app_id = ? and j.flow_id = ? ORDER BY 1 LIMIT ?, ?";
"WHERE j.app_id = ? and j.flow_id = ? GROUP BY j.job_id, j.job_name, j.job_path, j.job_type, " +
"f.flow_name ORDER BY j.job_id LIMIT ?, ?";
public static Integer getApplicationIDByName(String applicationName)
{