public KpiSearchLNResult findKpiSearch(KpiSearchLNParam request, UserAccount account) {//获取当前登陆机构String userCode = account.getDeptUuid();String userType = kpiCustomerLNMapper.findKpiCustomerUserType(userCode);request.setOrgUuid(userCode);//List<KpiSearchLNResult> kpiSearchResplist = new ArrayList<>();KpiSearchLNResult kpiSearchResult = new KpiSearchLNResult();kpiSearchResult.setOrgType(userType);if ("10001".equals(userType)) {kpiSearchResult = kpiSearchMapper.findKpiSearchSg(request);} else if ("10002".equals(userType)) {kpiSearchResult = kpiSearchMapper.findKpiSearchJc(request);}return kpiSearchResult;}
这段代码里面的kpiSearchResult先set一个orgType,然后继续sql查询,我一刻开始以为这个set的值不会被带入到查询出来的结果中,后来发现带入了,很简单自己没有这个意识。下次一定记住了!!!