mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-11-30 19:27:38 +08:00
parent
817328ee8f
commit
f20bb54896
@ -447,19 +447,14 @@ public class ProjectServiceImpl extends BaseServiceImpl implements ProjectServic
|
||||
}
|
||||
|
||||
/**
|
||||
* query all project list that have one or more process definitions.
|
||||
* query all project list
|
||||
*
|
||||
* @return project list
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> queryAllProjectList() {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
List<Project> projects = new ArrayList<>();
|
||||
|
||||
List<Integer> projectIds = processDefinitionMapper.listProjectIds();
|
||||
if (CollectionUtils.isNotEmpty(projectIds)) {
|
||||
projects = projectMapper.selectBatchIds(projectIds);
|
||||
}
|
||||
List<Project> projects = projectMapper.queryAllProject();
|
||||
|
||||
result.put(Constants.DATA_LIST, projects);
|
||||
putMsg(result, Status.SUCCESS);
|
||||
|
@ -322,8 +322,7 @@ public class ProjectServiceTest {
|
||||
|
||||
@Test
|
||||
public void testQueryAllProjectList() {
|
||||
Mockito.when(processDefinitionMapper.listProjectIds()).thenReturn(getProjectIds());
|
||||
Mockito.when(projectMapper.selectBatchIds(getProjectIds())).thenReturn(getList());
|
||||
Mockito.when(projectMapper.queryAllProject()).thenReturn(getList());
|
||||
|
||||
Map<String, Object> result = projectService.queryAllProjectList();
|
||||
logger.info(result.toString());
|
||||
|
@ -92,4 +92,10 @@ public interface ProjectMapper extends BaseMapper<Project> {
|
||||
*/
|
||||
ProjectUser queryProjectWithUserByProcessInstanceId(@Param("processInstanceId") int processInstanceId);
|
||||
|
||||
/**
|
||||
* query all project
|
||||
* @return projectList
|
||||
*/
|
||||
List<Project> queryAllProject();
|
||||
|
||||
}
|
||||
|
@ -109,4 +109,8 @@
|
||||
join t_ds_user u on dp.user_id = u.id
|
||||
where di.id = #{processInstanceId};
|
||||
</select>
|
||||
|
||||
<select id="queryAllProject" resultType="org.apache.dolphinscheduler.dao.entity.Project">
|
||||
select * from t_ds_project
|
||||
</select>
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user