gather_program add git conditions

This commit is contained in:
waterbeach 2017-03-20 10:33:08 +08:00
parent ed6683fecf
commit 649a6363a7
2 changed files with 15 additions and 1 deletions

View File

@ -145,7 +145,12 @@ public class GatherThreadNew implements Runnable {
} else
//这是对项目进行汇总的操作
if (conf.getTargetTableName().equals("gather_projects")) {
List<GatherProject> dataGet = gatherDao.getPrjGatherData(sourceTableName, selectItems, beginId, endId,
List<GatherProject> dataGet = null;
if(sourceTableName.equals("github"))
dataGet = gatherDao.getPrjGatherDataForGit(sourceTableName, selectItems, beginId, endId,
conf.getAndWhere());
else
dataGet = gatherDao.getPrjGatherData(sourceTableName, selectItems, beginId, endId,
conf.getAndWhere());
gatherProjects(dataGet);

View File

@ -58,6 +58,15 @@ public interface GatherDao {
@Param("selectItems") String selectItems,
@Param("idBegin") int idBegin, @Param("idEnd") int idEnd,
@Param("andWhere") String andWhere);
// 获取项目分表中相应数据 两边都有等于号
@Select("Select ${selectItems} from ${sourceTable} "
+ "where id >=${idBegin} and id <= ${idEnd} and fork=0 ${andWhere}")
public List<GatherProject> getPrjGatherDataForGit(
@Param("sourceTable") String sourceTableName,
@Param("selectItems") String selectItems,
@Param("idBegin") int idBegin, @Param("idEnd") int idEnd,
@Param("andWhere") String andWhere);
// 获取job_requirement中相应数据 两边都有等于号
@Select("Select ${selectItems} from ${sourceTable} "