use of com.itrus.portal.db.ProjectExample in project portal by ixinportal.
the class AdminController method listjson.
// 列表所有信息
@RequestMapping(value = "/listjson", method = RequestMethod.GET)
@ResponseBody
public Map listjson() {
AdminExample adminex = new AdminExample();
List<Admin> adminall = sqlSession.selectList("com.itrus.portal.db.AdminMapper.selectByExample", adminex);
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 BillServiceImpl method getProjectMapByEnterpriseId.
/**
* 根据企业id查询订单表中对应的projectMap
*
* @param enterprise
* @return
*/
public Map<Long, Project> getProjectMapByEnterpriseId(Long enterprise) {
Map<Long, Project> projectMap = new HashMap<Long, Project>();
List<Long> projectIds = sqlSession.selectList("com.itrus.portal.db.BillMapper.selectProjectsByEnterprise", enterprise);
if (null != projectIds && !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;
}
use of com.itrus.portal.db.ProjectExample in project portal by ixinportal.
the class PersonalBillServiceImpl method getProjectMapByUserInfoId.
/**
* 根据用户id查找订单表中对应的projectMap
*
* @param userInfo
* @return
*/
public Map<Long, Project> getProjectMapByUserInfoId(Long userInfo) {
Map<Long, Project> projectMap = new HashMap<Long, Project>();
List<Long> projectIds = sqlSession.selectList("com.itrus.portal.db.BillMapper.selectProjectsByUserInfo", userInfo);
if (null != projectIds && !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;
}
use of com.itrus.portal.db.ProjectExample in project portal by ixinportal.
the class SignatureConfigController method createForm.
// 返回新建页面
@RequestMapping(params = "form", produces = "text/html")
public String createForm(Model uiModel) {
ProjectExample projectex = new ProjectExample();
List projectexall = sqlSession.selectList("com.itrus.portal.db.ProjectMapper.selectByExample", projectex);
uiModel.addAttribute("projects", projectexall);
return "signatureconfig/create";
}
use of com.itrus.portal.db.ProjectExample in project portal by ixinportal.
the class OnlineServiceController method selectProject.
@RequestMapping(produces = "text/html")
public String selectProject(@RequestParam(value = "queryDate1", required = false) Date queryDate1, @RequestParam(value = "queryDate2", required = false) Date queryDate2, @RequestParam(value = "projectId", required = false) Long projectId, @RequestParam(value = "phone", required = false) String phone, @RequestParam(value = "enterpriseQq", required = false) String enterpriseQq, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, @RequestParam(value = "status", required = false) String status, Model uiModel) {
if (queryDate1 == null && queryDate2 == null) {
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DATE, 1);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
calendar.add(Calendar.MILLISECOND, -1);
queryDate2 = calendar.getTime();
calendar.add(Calendar.MILLISECOND, 1);
calendar.add(Calendar.MONTH, -1);
queryDate1 = calendar.getTime();
}
// 管理员项目权限
Long[] projectsOfAdmin = getProjectLongIdsOfAdmin();
Map param = new HashMap();
param.put("hasProjects", Arrays.asList(projectsOfAdmin));
if (page == null || page < 1)
page = 1;
if (size == null || size < 1)
size = 10;
Integer offset = size * (page - 1);
param.put("offset", offset);
param.put("limit", size);
param.put("queryDate1", queryDate1);
param.put("queryDate2", queryDate2);
if (projectId != null) {
param.put("projectId", projectId);
}
if (StringUtils.isNotEmpty(phone)) {
param.put("phone", "%" + phone + "%");
}
if (StringUtils.isNotEmpty(enterpriseQq)) {
param.put("enterpriseQq", "%" + enterpriseQq + "%");
}
// 查詢qq客服
List<Map<String, Object>> enterpriseqQq = onlineService.selectQqList(param);
// 得到數量
int count = onlineService.selectcount(param);
uiModel.addAttribute("pages", (count + size - 1) / size);
if (page > 1 && size * (page - 1) >= count) {
page = (count + size - 1) / size;
}
Map<Long, List<CustomerService>> listmain = new HashMap<Long, List<CustomerService>>();
for (int i = 0; i < enterpriseqQq.size(); i++) {
long id = Long.parseLong(enterpriseqQq.get(i).get("id").toString());
CustomerServiceExample customerE = new CustomerServiceExample();
CustomerServiceExample.Criteria serviceE = customerE.createCriteria();
int cid = Integer.parseInt(enterpriseqQq.get(i).get("id").toString());
serviceE.andEnterpriseIdEqualTo(cid);
List<CustomerService> listcustomer = onlineService.selectServiceList(customerE);
listmain.put(id, listcustomer);
}
ProjectExample projectE = new ProjectExample();
ProjectExample.Criteria pec = projectE.createCriteria();
pec.andIdIn(Arrays.asList(projectsOfAdmin));
List<Project> project = projectService.getProjectByExample(projectE);
uiModel.addAttribute("listQq", enterpriseqQq);
uiModel.addAttribute("listmain", listmain);
uiModel.addAttribute("list", project);
// 查询默认客服的数据
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);
uiModel.addAttribute("enterpriseqq", enterpriseqq);
uiModel.addAttribute("customerService", customerService);
uiModel.addAttribute("count", count);
uiModel.addAttribute("queryDate1", queryDate1);
uiModel.addAttribute("queryDate2", queryDate2);
uiModel.addAttribute("projectId", projectId);
uiModel.addAttribute("phone", phone);
uiModel.addAttribute("enterpriseQq", enterpriseQq);
uiModel.addAttribute("size", size);
uiModel.addAttribute("page", page);
return "onlineservices/list";
}
Aggregations