use of com.itrus.portal.db.ProjectExample in project portal by ixinportal.
the class ProjectController method isExistProject.
/**
* 判断企业代码的唯一性
*
* @param projecId
* @param orgCode
* @return
*/
private boolean isExistProject(Long projecId, String orgCode) {
if (StringUtils.isBlank(orgCode))
return false;
ProjectExample example = new ProjectExample();
ProjectExample.Criteria criteria = example.or();
if (projecId != null) {
List<Long> ids = new ArrayList<Long>();
ids.add(projecId);
criteria.andIdNotIn(ids);
}
criteria.andOrgCodeEqualTo(orgCode);
List projectList = sqlSession.selectList("com.itrus.portal.db.ProjectMapper.selectByExample", example);
return (projectList == null || projectList.isEmpty()) ? false : true;
}
use of com.itrus.portal.db.ProjectExample in project portal by ixinportal.
the class ProjectController method list.
// 列表所有信息
@RequestMapping(produces = "text/html")
public String list(@RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, Model uiModel) {
// page,size
if (page == null || page < 1)
page = 1;
if (size == null || size < 1)
size = 10;
// count,pages
Integer count = sqlSession.selectOne("com.itrus.portal.db.ProjectMapper.countByExample", null);
uiModel.addAttribute("count", count);
uiModel.addAttribute("pages", (count + size - 1) / size);
// page, size
if (page > 1 && size * (page - 1) >= count) {
page = (count + size - 1) / size;
}
uiModel.addAttribute("page", page);
uiModel.addAttribute("size", size);
// query data
Integer offset = size * (page - 1);
ProjectExample projectex = new ProjectExample();
// projectex.or().andIdIsNotNull();
projectex.setOffset(offset);
projectex.setLimit(size);
List projectall = sqlSession.selectList("com.itrus.portal.db.ProjectMapper.selectByExample", projectex);
uiModel.addAttribute("projects", projectall);
// itemcount
uiModel.addAttribute("itemcount", projectall.size());
return "projects/list";
}
use of com.itrus.portal.db.ProjectExample in project portal by ixinportal.
the class ProjectKeyInfoController method listjson.
// 列表所有信息
@RequestMapping(value = "/listjson", method = RequestMethod.GET)
@ResponseBody
public Map listjson() {
ProjectKeyInfoExample projectkeyinfoex = new ProjectKeyInfoExample();
List<ProjectKeyInfo> projectkeyinfoall = sqlSession.selectList("com.itrus.portal.db.ProjectKeyInfoMapper.selectByExample", projectkeyinfoex);
ProjectExample projectex = new ProjectExample();
Map projectmap = sqlSession.selectMap("com.itrus.portal.db.ProjectMapper.selectByExample", projectex, "id");
return projectmap;
}
use of com.itrus.portal.db.ProjectExample in project portal by ixinportal.
the class OnlineServiceController method establishCustomerService.
/*
* 创建客服
*
*/
@RequestMapping(produces = "text/html", params = "form")
public String establishCustomerService(Model model) {
// 管理员项目权限
Long[] projectsOfAdmin = getProjectLongIdsOfAdmin();
List<Map<String, Object>> projectIds = onlineService.getProjects();
List<Long> pids = new ArrayList<>();
for (Map<String, Object> p : projectIds) {
if (p != null) {
Long project_id = (Long) p.get("project_id");
pids.add(project_id);
}
}
model.addAttribute("pids", pids);
// 查询默认客服的数据
EnterpriseQqExample enterpriseE = new EnterpriseQqExample();
EnterpriseQqExample.Criteria qqEx = enterpriseE.createCriteria();
qqEx.andEnterpriseQqStateEqualTo(0L);
EnterpriseQq enterpriseqq = onlineService.selectQq(enterpriseE);
// 查询默认客服的数据
CustomerServiceExample customerE = new CustomerServiceExample();
CustomerServiceExample.Criteria serviceE = customerE.createCriteria();
serviceE.andServiceStateEqualTo(0);
CustomerService customerService = onlineService.selectService(customerE);
if (customerService == null) {
model.addAttribute("customerstatus", 1);
}
if (enterpriseqq == null) {
model.addAttribute("qqstatus", 1);
}
ProjectExample projectE = new ProjectExample();
ProjectExample.Criteria pec = projectE.createCriteria();
pec.andIdIn(Arrays.asList(projectsOfAdmin));
List<Project> projectlist = projectService.getProjectByExample(projectE);
// Map<Long,Project> projectlist= onlineService.selectProject();
model.addAttribute("projectlist", projectlist);
return "onlineservices/create";
}
use of com.itrus.portal.db.ProjectExample in project portal by ixinportal.
the class SignatureConfigController method updateForm.
// 返回修改页面
@RequestMapping(value = "/{id}", params = "form", produces = "text/html")
public String updateForm(@PathVariable("id") Long id, Model uiModel) throws Exception {
SignatureConfig signatureconfig = sqlSession.selectOne("com.itrus.portal.db.SignatureConfigMapper.selectByPrimaryKey", id);
uiModel.addAttribute("signatureconfig", signatureconfig);
ProjectExample projectex = new ProjectExample();
List projectexall = sqlSession.selectList("com.itrus.portal.db.ProjectMapper.selectByExample", projectex);
uiModel.addAttribute("projects", projectexall);
return "signatureconfig/update";
}
Aggregations