|
|
@@ -50,30 +50,33 @@ public class FacilityEnvironmentServiceImpl implements FacilityEnvironmentServic
|
|
|
buMen = result1.getData().stream().map(n -> n.getId()).collect(Collectors.joining(","));
|
|
|
}
|
|
|
}
|
|
|
- String sql = " SELECT parent_id_ as id_ FROM ibps_party_entity WHERE party_type_='position' AND depth_=3 AND FIND_IN_SET(id_,'%s')";
|
|
|
- List<Map<String,Object>> object3 =
|
|
|
- (List<Map<String, Object>>) commonDao.query(String.format(sql,buMen));
|
|
|
+ String sql = " SELECT parent_id_ as di_dian,id_ FROM ibps_party_entity WHERE party_type_='position' AND depth_=3 AND FIND_IN_SET(id_,'%s')";
|
|
|
+ List<Map<String,Object>> object3 = (List<Map<String, Object>>) commonDao.query(String.format(sql,buMen));
|
|
|
+ String jyk = "";String mainPosition = "";
|
|
|
+ if (BeanUtils.isNotEmpty(object3)){
|
|
|
+ jyk = object3.get(0).get("id_").toString();
|
|
|
+ }
|
|
|
String sql3 = "select p.id_ from IBPS_PARTY_POSITION p INNER JOIN ibps_party_rel r on p.id_=r.MAIN_PID_ " +
|
|
|
"where r.sub_pid_='%s' and r.BIZ_='mainPost' ORDER BY p.CREATE_TIME_ DESC";
|
|
|
Map<String, Object> data = commonDao.queryOne(String.format(sql3,userId));
|
|
|
+ String fetchSql = "SELECT jian_ce_zhou_qi_,facs_type,pos.name_,COUNT(shi_fou_guo_shen_<>'已完成' OR NULL ) AS todo,COUNT(shi_fou_guo_shen_='已完成' OR NULL) AS done ,MAX(facs.pagePath) AS pagePath" +
|
|
|
+ " FROM v_facs_summary_daily, ibps_party_position pos,(SELECT DISTINCT pagePath,`type` FROM v_facs WHERE pagePath <>'') facs" +
|
|
|
+ " WHERE FIND_IN_SET(bian_zhi_bu_men_,'%s') AND bian_zhi_bu_men_=pos.id_ AND facs_type = facs.type" +
|
|
|
+ " GROUP BY jian_ce_zhou_qi_,facs_type,bian_zhi_bu_men_ ORDER BY facs_type;";
|
|
|
if (BeanUtils.isNotEmpty(data)){
|
|
|
- buMen = data.get("id_").toString();
|
|
|
- String fetchSql = "SELECT jian_ce_zhou_qi_,facs_type,pos.name_,COUNT(shi_fou_guo_shen_<>'已完成' OR NULL ) AS todo,COUNT(shi_fou_guo_shen_='已完成' OR NULL) AS done ,MAX(facs.pagePath) AS pagePath" +
|
|
|
- " FROM v_facs_summary_daily, ibps_party_position pos,(SELECT DISTINCT pagePath,`type` FROM v_facs WHERE pagePath <>'') facs" +
|
|
|
- " WHERE FIND_IN_SET(bian_zhi_bu_men_,'%s') AND bian_zhi_bu_men_=pos.id_ AND facs_type = facs.type" +
|
|
|
- " GROUP BY jian_ce_zhou_qi_,facs_type,bian_zhi_bu_men_ ORDER BY facs_type;";
|
|
|
- return (List<Map<String, Object>>)commonDao.query(String.format(fetchSql,buMen));
|
|
|
- }else if(Collections.isEmpty(object3)) {
|
|
|
- String fetchSql = "SELECT jian_ce_zhou_qi_,facs_type,pos.name_,COUNT(shi_fou_guo_shen_<>'已完成' OR NULL ) AS todo,COUNT(shi_fou_guo_shen_='已完成' OR NULL) AS done ,MAX(facs.pagePath) AS pagePath" +
|
|
|
+ mainPosition = data.get("id_").toString();
|
|
|
+ }
|
|
|
+ if (BeanUtils.isNotEmpty(mainPosition) && mainPosition.equals(jyk)){
|
|
|
+ fetchSql = "SELECT jian_ce_zhou_qi_,facs_type,pos.name_,COUNT(shi_fou_guo_shen_<>'已完成' OR NULL ) AS todo,COUNT(shi_fou_guo_shen_='已完成' OR NULL) AS done ,MAX(facs.pagePath) AS pagePath" +
|
|
|
" FROM v_facs_summary_daily, ibps_party_position pos,(SELECT DISTINCT pagePath,`type` FROM v_facs WHERE pagePath <>'') facs" +
|
|
|
- " WHERE FIND_IN_SET(bian_zhi_bu_men_,'%s') AND bian_zhi_bu_men_=pos.id_ AND facs_type = facs.type" +
|
|
|
+ " WHERE di_dian_='%s' AND bian_zhi_bu_men_=pos.id_ AND facs_type = facs.type" +
|
|
|
" GROUP BY jian_ce_zhou_qi_,facs_type,bian_zhi_bu_men_ ORDER BY facs_type;";
|
|
|
- return (List<Map<String, Object>>)commonDao.query(String.format(fetchSql,buMen));
|
|
|
+ fetchSql = String.format(fetchSql,object3.get(0).get("di_dian"));
|
|
|
+ }else if (BeanUtils.isNotEmpty(mainPosition)){
|
|
|
+ fetchSql = String.format(fetchSql,mainPosition);
|
|
|
+ }else {
|
|
|
+ fetchSql = String.format(fetchSql,buMen);
|
|
|
}
|
|
|
- String fetchSql = "SELECT jian_ce_zhou_qi_,facs_type,pos.name_,COUNT(shi_fou_guo_shen_<>'已完成' OR NULL ) AS todo,COUNT(shi_fou_guo_shen_='已完成' OR NULL) AS done ,MAX(facs.pagePath) AS pagePath" +
|
|
|
- " FROM v_facs_summary_daily, ibps_party_position pos,(SELECT DISTINCT pagePath,`type` FROM v_facs WHERE pagePath <>'') facs" +
|
|
|
- " WHERE di_dian_='%s' AND bian_zhi_bu_men_=pos.id_ AND facs_type = facs.type" +
|
|
|
- " GROUP BY jian_ce_zhou_qi_,facs_type,bian_zhi_bu_men_ ORDER BY facs_type;";
|
|
|
- return (List<Map<String, Object>>)commonDao.query(String.format(fetchSql,object3.get(0).get("id_")));
|
|
|
+ return (List<Map<String, Object>>)commonDao.query(fetchSql);
|
|
|
}
|
|
|
}
|