use of com.itrus.portal.db.ProjectExample in project portal by ixinportal.
the class AdminServiceImpl method getProjectByAdminId.
/**
* 根据管理员id获取管理的项目list
*
* @param adminId
* @return
*/
public List<Project> getProjectByAdminId(Long adminId) {
List<Project> projects = new ArrayList<Project>();
Admin admin = sqlSession.selectOne("com.itrus.portal.db.AdminMapper.selectByPrimaryKey", adminId);
if (null != projects && StringUtils.isNotBlank(admin.getProjects())) {
String[] projectIds = admin.getProjects().split(",");
Long[] projectIdsLong = new Long[projectIds.length];
for (int i = 0; i < projectIds.length; i++) {
if ("0".equals(projectIds[i])) {
// 返回所有项目id
List<Long> allProject = sqlSession.selectList("com.itrus.portal.db.ProjectMapper.selectAllProjectIds");
projectIdsLong = new Long[allProject.size()];
for (int j = 0; j < allProject.size(); j++) {
projectIdsLong[j] = allProject.get(j);
}
break;
}
projectIdsLong[i] = Long.parseLong(projectIds[i]);
}
ProjectExample projectExample = new ProjectExample();
ProjectExample.Criteria criteria = projectExample.or();
criteria.andIdIn(Arrays.asList(projectIdsLong));
projects = sqlSession.selectList("com.itrus.portal.db.ProjectMapper.selectByExample", projectExample);
}
return projects;
}
use of com.itrus.portal.db.ProjectExample in project portal by ixinportal.
the class ProjectServiceImpl method getProjectByName.
/**
* 根据项目名称,获取项目
* @param name
* @return
*/
public Project getProjectByName(String name) {
Project project = null;
ProjectExample example = new ProjectExample();
ProjectExample.Criteria criteria = example.or();
criteria.andNameEqualTo(name);
project = sqlSession.selectOne("com.itrus.portal.db.ProjectMapper.selectByExample", example);
return project;
}
use of com.itrus.portal.db.ProjectExample in project portal by ixinportal.
the class OnlineServiceImpl method selectProject.
/*
*得到所有的项目
*/
public Map<Long, Project> selectProject() {
ProjectExample projectex = new ProjectExample();
Map<Long, Project> projectexs = sqlSession.selectMap("com.itrus.portal.db.ProjectMapper.selectByExample", projectex, "id");
return projectexs;
}
use of com.itrus.portal.db.ProjectExample in project portal by ixinportal.
the class PersonalBillServiceImpl method getProjectMapByBills.
/**
* 根据订单list查找出对应的projectMap
*
* @param bills
* @return
*/
public Map<Long, Project> getProjectMapByBills(List<PersonalBill> bills) {
Map<Long, Project> projectMap = new HashMap<Long, Project>();
List<Long> projectIds = new ArrayList<Long>();
for (PersonalBill bill : bills) {
projectIds.add(bill.getProject());
}
if (!projectIds.isEmpty()) {
ProjectExample projectExample = new ProjectExample();
ProjectExample.Criteria criteria = projectExample.or();
criteria.andIdIn(projectIds);
projectMap = sqlSession.selectMap("com.itrus.portal.db.ProjectMapper.selectByExample", projectExample, "id");
}
return projectMap;
}
Aggregations