src/main/java/org/springblade/modules/FTP/OutJson.java
@@ -1,5 +1,7 @@ package org.springblade.modules.FTP; import org.springblade.common.constant.FtpConstant; import java.io.*; public class OutJson { @@ -152,8 +154,8 @@ * @return */ public static String TestJson(String fileName){ File file = new File("/home/song/anbao/"+fileName); //File file = new File("D:\\anbao\\"+fileName); //File file = new File(FtpConstant.jsonUrl+fileName); File file = new File(FtpConstant.jsonUrl+fileName); StringBuilder localStrBulider = new StringBuilder(); if(file.isFile() && file.exists()) { try { src/main/java/org/springblade/modules/information/controller/InformationController.java
@@ -196,32 +196,32 @@ return R.success("删除成功"); } /** * 首页保安公司统计接口 * * @return */ @PostMapping("/SelectCount") public R SelectCount() { List<Map<Object, String>> list = iDeptService.selectCount(); List<Map<String, Object>> lists = new ArrayList<>(); for (int i = 0; i < list.size(); i++) { String title = list.get(i).get("title");//部门名称 String departmentid = String.valueOf(list.get(i).get("jurisdiction"));//部门id Map<String, Object> map = new HashMap<String, Object>(); Map maps = informationService.selectCount(departmentid); map.put("name", title); map.put("server", maps); lists.add(map); } return R.data(lists); } // /** // * 首页保安公司统计接口 // * // * @return // */ // @PostMapping("/SelectCount") // public R SelectCount() { // List<Map<Object, String>> list = iDeptService.selectCount(); // List<Map<String, Object>> lists = new ArrayList<>(); // for (int i = 0; i < list.size(); i++) { // String title = list.get(i).get("title");//部门名称 // String departmentid = String.valueOf(list.get(i).get("jurisdiction"));//部门id // Map<String, Object> map = new HashMap<String, Object>(); // Map maps = informationService.selectCount(departmentid); // map.put("name", title); // map.put("server", maps); // lists.add(map); // } // return R.data(lists); // } /** * 首页保安持证统计接口 * * @return */ *//* @PostMapping("/SelectCounthold") public R SelectCounthold() { List<Map<Object, String>> list = iDeptService.selectCount(); @@ -249,7 +249,7 @@ } } return R.data(lists); } }*/ /** @@ -650,30 +650,30 @@ return sortedMap; } /** * 统计保安员资格异常的数量 * * @param jurisdiction * @param deptid * @param type 1:当天 2:当月 3:全部 * @return */ @PostMapping("/selectExtype") public R selectExtype(String jurisdiction, String deptid, String type) { Map<String, Object> map = new HashMap<String, Object>(); Integer count = 0; List<Map<String, Object>> lists = new ArrayList<>(); List<Map<Object, Object>> maps = informationService.selectExtype(jurisdiction, deptid, type); for (int i = 0; i < maps.size(); i++) { String num = maps.get(i).get("num").toString(); count += Integer.valueOf(num); } map.put("count", count); map.put("list", maps); lists.add(map); return R.data(lists); } // // /** // * 统计保安员资格异常的数量 // * // * @param jurisdiction // * @param deptid // * @param type 1:当天 2:当月 3:全部 // * @return // */ // @PostMapping("/selectExtype") // public R selectExtype(String jurisdiction, String deptid, String type) { // Map<String, Object> map = new HashMap<String, Object>(); // Integer count = 0; // List<Map<String, Object>> lists = new ArrayList<>(); // List<Map<Object, Object>> maps = informationService.selectExtype(jurisdiction, deptid, type); // for (int i = 0; i < maps.size(); i++) { // String num = maps.get(i).get("num").toString(); // count += Integer.valueOf(num); // } // map.put("count", count); // map.put("list", maps); // lists.add(map); // return R.data(lists); // } /** * 统计用户资格异常的数量 @@ -693,7 +693,7 @@ * @param deptid * @param type 1:当天 2:当月 3:全部 * @return */ *//* @PostMapping("/selectBx") public R selectBx(String jurisdiction, String deptid, String type) { Map<String, Object> map = new HashMap<String, Object>(); @@ -708,58 +708,58 @@ map.put("list", maps); lists.add(map); return R.data(lists); } }*/ /** * 分局预警统计 */ @PostMapping("/selectFj") public R selectFj() { //辖区信息 List<Map<Object, Object>> list = informationService.selectJur(); List<Map<String, Object>> lists = new ArrayList<>(); for (int i = 0; i < list.size(); i++) { Integer count = 0; Map<String, Object> map = new HashMap<String, Object>(); //辖区id String jurisdiction = list.get(i).get("id").toString(); //辖区名称 String jurname = list.get(i).get("dept_name").toString(); //保安员表现差预警数量 List<Map<Object, Object>> mapbx = informationService.selectBx(jurisdiction, "", ""); for (int ibx = 0; ibx < mapbx.size(); ibx++) { String num = mapbx.get(ibx).get("num").toString(); count += Integer.valueOf(num); } //保安员资格异常的数量 List<Map<Object, Object>> mapEx = informationService.selectExtype(jurisdiction, "", ""); for (int iex = 0; iex < mapEx.size(); iex++) { String num = mapEx.get(iex).get("num").toString(); count += Integer.valueOf(num); } //保安公司未持证数量 List<Map<Object, String>> mapgs = informationService.selectInCount(jurisdiction, ""); count += mapgs.size(); //未缴社保数量 List<Map<String, Object>> mapsb = informationService.selectCs(jurisdiction, ""); for (int isb = 0; isb < mapsb.size(); isb++) { //交社保数 String numjs = mapsb.get(isb).get("numj").toString(); Integer numj = Integer.parseInt(numjs); //单位总人数 String numzs = mapsb.get(isb).get("numz").toString(); Integer numz = Integer.parseInt(numzs); //统计未交社保人数 int i1 = numz - numj; count += i1; } map.put("Count", count); map.put("jurname", jurname); lists.add(map); } return R.data(lists); } // /** // * 分局预警统计 // */ // @PostMapping("/selectFj") // public R selectFj() { // //辖区信息 // List<Map<Object, Object>> list = informationService.selectJur(); // List<Map<String, Object>> lists = new ArrayList<>(); // for (int i = 0; i < list.size(); i++) { // Integer count = 0; // Map<String, Object> map = new HashMap<String, Object>(); // //辖区id // String jurisdiction = list.get(i).get("id").toString(); // //辖区名称 // String jurname = list.get(i).get("dept_name").toString(); // //保安员表现差预警数量 // List<Map<Object, Object>> mapbx = informationService.selectBx(jurisdiction, "", ""); // for (int ibx = 0; ibx < mapbx.size(); ibx++) { // String num = mapbx.get(ibx).get("num").toString(); // count += Integer.valueOf(num); // } // //保安员资格异常的数量 // List<Map<Object, Object>> mapEx = informationService.selectExtype(jurisdiction, "", ""); // for (int iex = 0; iex < mapEx.size(); iex++) { // String num = mapEx.get(iex).get("num").toString(); // count += Integer.valueOf(num); // } // //保安公司未持证数量 // List<Map<Object, String>> mapgs = informationService.selectInCount(jurisdiction, ""); // count += mapgs.size(); // //未缴社保数量 // List<Map<String, Object>> mapsb = informationService.selectCs(jurisdiction, ""); // for (int isb = 0; isb < mapsb.size(); isb++) { // //交社保数 // String numjs = mapsb.get(isb).get("numj").toString(); // Integer numj = Integer.parseInt(numjs); // //单位总人数 // String numzs = mapsb.get(isb).get("numz").toString(); // Integer numz = Integer.parseInt(numzs); // //统计未交社保人数 // int i1 = numz - numj; // count += i1; // } // map.put("Count", count); // map.put("jurname", jurname); // lists.add(map); // } // return R.data(lists); // } /** @@ -781,14 +781,14 @@ return R.data(lists); } /** * 单位列表 */ @PostMapping("/selectIn") public R selectIn(String jurisdiction) { List<Map<Object, Object>> maps = informationService.selectIn(jurisdiction); return R.data(maps); } // /** // * 单位列表 // */ // @PostMapping("/selectIn") // public R selectIn(String jurisdiction) { // List<Map<Object, Object>> maps = informationService.selectIn(jurisdiction); // return R.data(maps); // } /** * 单位删除 @@ -833,32 +833,32 @@ return R.data(list); } /** * 公司运营情况进入图表 */ @PostMapping("/selectTb") public R<IPage> selectTb(String jurisdiction, String enterpriseName, Query query) { IPage list = informationService.selectTb(Condition.getPage(query), jurisdiction, enterpriseName); return R.data(list); } /** * 公司经济情况进入图表 */ @PostMapping("/selectJj") public R<IPage> selectJj(String jurisdiction, String enterpriseName, Query query) { IPage list = informationService.selectJj(Condition.getPage(query), jurisdiction, enterpriseName); return R.data(list); } /** * 业务统计情况 */ @PostMapping("/selectYw") public R<IPage> selectYw(String jurisdiction, String deptid,String stats, Query query) { IPage list = informationService.selectYw(Condition.getPage(query), jurisdiction, deptid,stats); return R.data(list); } // /** // * 公司运营情况进入图表 // */ // @PostMapping("/selectTb") // public R<IPage> selectTb(String jurisdiction, String enterpriseName, Query query) { // IPage list = informationService.selectTb(Condition.getPage(query), jurisdiction, enterpriseName); // return R.data(list); // } // // /** // * 公司经济情况进入图表 // */ // @PostMapping("/selectJj") // public R<IPage> selectJj(String jurisdiction, String enterpriseName, Query query) { // IPage list = informationService.selectJj(Condition.getPage(query), jurisdiction, enterpriseName); // return R.data(list); // } // // /** // * 业务统计情况 // */ // @PostMapping("/selectYw") // public R<IPage> selectYw(String jurisdiction, String deptid,String stats, Query query) { // IPage list = informationService.selectYw(Condition.getPage(query), jurisdiction, deptid,stats); // return R.data(list); // } /** * 保安员详情 @@ -888,18 +888,18 @@ return R.data(list); } /** * 公司处罚数量统计 */ @PostMapping("/selectCf") public R selectCf(String jurisdiction) { Map<String, Object> map = new HashMap<String, Object>(); Integer count = 0; List<Map<String, Object>> lists = new ArrayList<>(); List<Map<Object, Object>> maps = informationService.selectCf(jurisdiction); map.put("count", maps.size()); return R.data(map); } // /** // * 公司处罚数量统计 // */ // @PostMapping("/selectCf") // public R selectCf(String jurisdiction) { // Map<String, Object> map = new HashMap<String, Object>(); // Integer count = 0; // List<Map<String, Object>> lists = new ArrayList<>(); // List<Map<Object, Object>> maps = informationService.selectCf(jurisdiction); // map.put("count", maps.size()); // return R.data(map); // } /** * 公司材料不全数量统计 @@ -920,85 +920,85 @@ return R.data(lists); } /** * 违规经营 */ @PostMapping("/selectWg") public R selectWg(String jurisdiction) { List<Map<Object, Object>> list = informationService.selectWg(jurisdiction); List list1 = new ArrayList(); int count=0; Map map = new HashMap(); for (int i = 0; i < list.size(); i++) { //总数 String znums = list.get(i).get("znum").toString(); int znum = Integer.parseInt(znums); //持证人数 String cznums = list.get(i).get("cznum").toString(); int cznum = Integer.parseInt(cznums); //缴纳社保人数 String sbnums = list.get(i).get("sbnum").toString(); int sbnum = Integer.parseInt(sbnums); //保安总人数为0 if (znum==0){ continue; } else { int a = znum / 2; if (cznum<=a || sbnum<=a){ count++; list1.add(list.get(i)); } } } map.put("count",count); map.put("list",list1); return R.data(map); } // /** // * 违规经营 // */ // @PostMapping("/selectWg") // public R selectWg(String jurisdiction) { // List<Map<Object, Object>> list = informationService.selectWg(jurisdiction); // List list1 = new ArrayList(); // int count=0; // Map map = new HashMap(); // for (int i = 0; i < list.size(); i++) { // //总数 // String znums = list.get(i).get("znum").toString(); // int znum = Integer.parseInt(znums); // //持证人数 // String cznums = list.get(i).get("cznum").toString(); // int cznum = Integer.parseInt(cznums); // //缴纳社保人数 // String sbnums = list.get(i).get("sbnum").toString(); // int sbnum = Integer.parseInt(sbnums); // //保安总人数为0 // if (znum==0){ // continue; // } // else { // int a = znum / 2; // if (cznum<=a || sbnum<=a){ // count++; // list1.add(list.get(i)); // } // } // } // map.put("count",count); // map.put("list",list1); // return R.data(map); // } /** * 经营不善 */ @PostMapping("/selectJy") public R selectJy(String jurisdiction) { List<Map<Object, Object>> list = informationService.selectJy(jurisdiction); List list1 = new ArrayList(); Map map = new HashMap(); int count = 0; for (int i = 0; i < list.size(); i++) { String num = list.get(i).get("fwnum").toString(); int a = Integer.parseInt(num); if (a == 0) { count++; list1.add(list.get(i)); } } map.put("count", count); map.put("List", list1); return R.data(map); } // /** // * 经营不善 // */ // @PostMapping("/selectJy") // public R selectJy(String jurisdiction) { // List<Map<Object, Object>> list = informationService.selectJy(jurisdiction); // List list1 = new ArrayList(); // Map map = new HashMap(); // int count = 0; // for (int i = 0; i < list.size(); i++) { // String num = list.get(i).get("fwnum").toString(); // int a = Integer.parseInt(num); // if (a == 0) { // count++; // list1.add(list.get(i)); // } // } // map.put("count", count); // map.put("List", list1); // return R.data(map); // } /** * 有实无名 */ @PostMapping("/selectYs") public R selectYs(String jurisdiction) { List<Map<Object, Object>> list = informationService.selectYs(jurisdiction); List list1 = new ArrayList(); Map map = new HashMap(); int count = 0; for (int i = 0; i < list.size(); i++) { String num = list.get(i).get("znum").toString(); int a = Integer.parseInt(num); if (a == 0) { count++; list1.add(list.get(i)); } } map.put("count", count); map.put("List", list1); return R.data(map); } // /** // * 有实无名 // */ // @PostMapping("/selectYs") // public R selectYs(String jurisdiction) { // List<Map<Object, Object>> list = informationService.selectYs(jurisdiction); // List list1 = new ArrayList(); // Map map = new HashMap(); // int count = 0; // for (int i = 0; i < list.size(); i++) { // String num = list.get(i).get("znum").toString(); // int a = Integer.parseInt(num); // if (a == 0) { // count++; // list1.add(list.get(i)); // } // } // map.put("count", count); // map.put("List", list1); // return R.data(map); // } /** * @return @@ -1030,4 +1030,522 @@ } /** * 首页保安公司统计接口 * * @return */ @PostMapping("/SelectCount") public R SelectCount() { //查出所有辖区 List<Map<Object, Object>> list = informationService.selJur(); List<Map<String, Object>> lists = new ArrayList<>(); for (int i = 0; i < list.size(); i++){ Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> mapc = new HashMap<String, Object>(); String id = list.get(i).get("id").toString(); //查出辖区下面所有的子菜单 String childer = informationService.selJurchilder(id); String[] split = childer.split(","); String strArrays = ""; for (int j = 0; j < split.length; j++) { strArrays += "'" + split[j] + "',"; } String substring = strArrays.substring(0, strArrays.length() - 1); List<Map<Object, Object>> maps = informationService.seleJuList(substring); mapc.put("confess",maps.get(0).get("num")); mapc.put("staff",maps.get(1).get("num")); mapc.put("security",maps.get(2).get("num")); mapc.put("armed",maps.get(3).get("num")); mapc.put("region",maps.get(4).get("num")); map.put("name", list.get(i).get("deptname")); map.put("server", mapc); lists.add(map); } return R.data(lists); } /** * 分局预警统计 */ @PostMapping("/selectFj") public R selectFj() { //辖区信息 List<Map<Object, Object>> list = informationService.selectJur(); List<Map<String, Object>> lists = new ArrayList<>(); for (int i = 0; i < list.size(); i++) { Integer count = 0; Map<String, Object> map = new HashMap<String, Object>(); //辖区id String id = list.get(i).get("id").toString(); //辖区名称 String jurname = list.get(i).get("dept_name").toString(); String childer = informationService.selJurchilder(id); String[] split = childer.split(","); String strArrays = ""; for (int j = 0; j < split.length; j++) { strArrays += "'" + split[j] + "',"; } String jurisdiction = strArrays.substring(0, strArrays.length() - 1); //保安员表现差预警数量 List<Map<Object, Object>> mapbx = informationService.selectBx(jurisdiction, "", ""); for (int ibx = 0; ibx < mapbx.size(); ibx++) { String num = mapbx.get(ibx).get("num").toString(); count += Integer.valueOf(num); } //保安员资格异常的数量 List<Map<Object, Object>> mapEx = informationService.selectExtype(jurisdiction, "", ""); for (int iex = 0; iex < mapEx.size(); iex++) { String num = mapEx.get(iex).get("num").toString(); count += Integer.valueOf(num); } //保安公司未持证数量 List<Map<Object, String>> mapgs = informationService.selectInCount(jurisdiction, ""); count += mapgs.size(); //未缴社保数量 List<Map<String, Object>> mapsb = informationService.selectCs(jurisdiction, ""); for (int isb = 0; isb < mapsb.size(); isb++) { //交社保数 String numjs = mapsb.get(isb).get("numj").toString(); Integer numj = Integer.parseInt(numjs); //单位总人数 String numzs = mapsb.get(isb).get("numz").toString(); Integer numz = Integer.parseInt(numzs); //统计未交社保人数 int i1 = numz - numj; count += i1; } map.put("Count", count); map.put("jurname", jurname); lists.add(map); } return R.data(lists); } /** * 首页保安持证统计接口 * * @return */ @PostMapping("/SelectCounthold") public R SelectCounthold() { List<Map<Object, Object>> list = informationService.selJur(); List<Map<String, Object>> lists = new ArrayList<>(); for (int i = 0; i < list.size(); i++) { int cznumber = 0;//总的持证数量 int wcznumber = 0;//总的未持证数量 String id = list.get(i).get("id").toString(); //查出辖区下面所有的子菜单 String childer = informationService.selJurchilder(id); String[] split = childer.split(","); String strArrays = ""; for (int j = 0; j < split.length; j++) { strArrays += "'" + split[j] + "',"; } String deptid = strArrays.substring(0, strArrays.length() - 1); Map<String, Object> map = new HashMap<String, Object>(); Map<Object, Object> objectStringMap = iDeptService.selectHold(deptid); if (objectStringMap == null) { map.put("name", list.get(i).get("deptname")); map.put("cz", cznumber); map.put("wcz", wcznumber); lists.add(map); } else { String cz = objectStringMap.get("cz").toString(); cznumber = Integer.valueOf(cz); String wcz = objectStringMap.get("wcz").toString(); wcznumber = Integer.valueOf(wcz); map.put("name", list.get(i).get("deptname")); map.put("cz", cznumber); map.put("wcz", wcznumber); lists.add(map); } } return R.data(lists); } /** * 统计保安员表现差的数量 * * @param jurisdiction * @param deptid * @param type 1:当天 2:当月 3:全部 * @return */ @PostMapping("/selectBx") public R selectBx(String jurisdiction, String deptid, String type) { Map<String, Object> map = new HashMap<String, Object>(); Integer count = 0; List<Map<String, Object>> lists = new ArrayList<>(); if (jurisdiction.equals("1372091709474910209")){ List<Map<Object, Object>> maps = informationService.selectBx(jurisdiction, deptid, type); for (int i = 0; i < maps.size(); i++) { String num = maps.get(i).get("num").toString(); count += Integer.valueOf(num); } map.put("count", count); map.put("list", maps); lists.add(map); } else { String childer = informationService.selJurchilder(jurisdiction); String[] split = childer.split(","); String strArrays = ""; for (int j = 0; j < split.length; j++) { strArrays += "'" + split[j] + "',"; } String jurisdictiond = strArrays.substring(0, strArrays.length() - 1); List<Map<Object, Object>> maps = informationService.selectBx(jurisdictiond, deptid, type); for (int i = 0; i < maps.size(); i++) { String num = maps.get(i).get("num").toString(); count += Integer.valueOf(num); } map.put("count", count); map.put("list", maps); lists.add(map); } return R.data(lists); } /** * 统计保安员资格异常的数量 * * @param jurisdiction * @param deptid * @param type 1:当天 2:当月 3:全部 * @return */ @PostMapping("/selectExtype") public R selectExtype(String jurisdiction, String deptid, String type) { Map<String, Object> map = new HashMap<String, Object>(); Integer count = 0; List<Map<String, Object>> lists = new ArrayList<>(); if (jurisdiction.equals("1372091709474910209")) { List<Map<Object, Object>> maps = informationService.selectExtype(jurisdiction, deptid, type); for (int i = 0; i < maps.size(); i++) { String num = maps.get(i).get("num").toString(); count += Integer.valueOf(num); } map.put("count", count); map.put("list", maps); lists.add(map); } else { String childer = informationService.selJurchilder(jurisdiction); String[] split = childer.split(","); String strArrays = ""; for (int j = 0; j < split.length; j++) { strArrays += "'" + split[j] + "',"; } String jurisdictiond = strArrays.substring(0, strArrays.length() - 1); List<Map<Object, Object>> maps = informationService.selectExtype(jurisdictiond, deptid, type); for (int i = 0; i < maps.size(); i++) { String num = maps.get(i).get("num").toString(); count += Integer.valueOf(num); } map.put("count", count); map.put("list", maps); lists.add(map); } return R.data(lists); } /** * 违规经营 */ @PostMapping("/selectWg") public R selectWg(String jurisdiction) { if (jurisdiction.equals("1372091709474910209")){ List<Map<Object, Object>> list = informationService.selectWg(jurisdiction); List list1 = new ArrayList(); int count=0; Map map = new HashMap(); for (int i = 0; i < list.size(); i++) { //总数 String znums = list.get(i).get("znum").toString(); int znum = Integer.parseInt(znums); //持证人数 String cznums = list.get(i).get("cznum").toString(); int cznum = Integer.parseInt(cznums); //缴纳社保人数 String sbnums = list.get(i).get("sbnum").toString(); int sbnum = Integer.parseInt(sbnums); //保安总人数为0 if (znum==0){ continue; } else { int a = znum / 2; if (cznum<=a || sbnum<=a){ count++; list1.add(list.get(i)); } } } map.put("count",count); map.put("list",list1); return R.data(map); } else { String childer = informationService.selJurchilder(jurisdiction); String[] split = childer.split(","); String strArrays = ""; for (int j = 0; j < split.length; j++) { strArrays += "'" + split[j] + "',"; } String jurisdictiond = strArrays.substring(0, strArrays.length() - 1); List<Map<Object, Object>> list = informationService.selectWg(jurisdictiond); List list1 = new ArrayList(); int count=0; Map map = new HashMap(); for (int i = 0; i < list.size(); i++) { //总数 String znums = list.get(i).get("znum").toString(); int znum = Integer.parseInt(znums); //持证人数 String cznums = list.get(i).get("cznum").toString(); int cznum = Integer.parseInt(cznums); //缴纳社保人数 String sbnums = list.get(i).get("sbnum").toString(); int sbnum = Integer.parseInt(sbnums); //保安总人数为0 if (znum==0){ continue; } else { int a = znum / 2; if (cznum<=a || sbnum<=a){ count++; list1.add(list.get(i)); } } } map.put("count",count); map.put("list",list1); return R.data(map); } } /** * 经营不善 */ @PostMapping("/selectJy") public R selectJy(String jurisdiction) { if (jurisdiction.equals("1372091709474910209")){ List<Map<Object, Object>> list = informationService.selectJy(jurisdiction); List list1 = new ArrayList(); Map map = new HashMap(); int count = 0; for (int i = 0; i < list.size(); i++) { String num = list.get(i).get("fwnum").toString(); int a = Integer.parseInt(num); if (a == 0) { count++; list1.add(list.get(i)); } } map.put("count", count); map.put("List", list1); return R.data(map); } else { String childer = informationService.selJurchilder(jurisdiction); String[] split = childer.split(","); String strArrays = ""; for (int j = 0; j < split.length; j++) { strArrays += "'" + split[j] + "',"; } String jurisdictiond = strArrays.substring(0, strArrays.length() - 1); List<Map<Object, Object>> list = informationService.selectJy(jurisdictiond); List list1 = new ArrayList(); Map map = new HashMap(); int count = 0; for (int i = 0; i < list.size(); i++) { String num = list.get(i).get("fwnum").toString(); int a = Integer.parseInt(num); if (a == 0) { count++; list1.add(list.get(i)); } } map.put("count", count); map.put("List", list1); return R.data(map); } } /** * 有实无名 */ @PostMapping("/selectYs") public R selectYs(String jurisdiction) { if (jurisdiction.equals("1372091709474910209")) { List<Map<Object, Object>> list = informationService.selectYs(jurisdiction); List list1 = new ArrayList(); Map map = new HashMap(); int count = 0; for (int i = 0; i < list.size(); i++) { String num = list.get(i).get("znum").toString(); int a = Integer.parseInt(num); if (a == 0) { count++; list1.add(list.get(i)); } } map.put("count", count); map.put("List", list1); return R.data(map); } else { String childer = informationService.selJurchilder(jurisdiction); String[] split = childer.split(","); String strArrays = ""; for (int j = 0; j < split.length; j++) { strArrays += "'" + split[j] + "',"; } String jurisdictiond = strArrays.substring(0, strArrays.length() - 1); List<Map<Object, Object>> list = informationService.selectYs(jurisdictiond); List list1 = new ArrayList(); Map map = new HashMap(); int count = 0; for (int i = 0; i < list.size(); i++) { String num = list.get(i).get("znum").toString(); int a = Integer.parseInt(num); if (a == 0) { count++; list1.add(list.get(i)); } } map.put("count", count); map.put("List", list1); return R.data(map); } } /** * 公司处罚数量统计 */ @PostMapping("/selectCf") public R selectCf(String jurisdiction) { Map<String, Object> map = new HashMap<String, Object>(); Integer count = 0; List<Map<String, Object>> lists = new ArrayList<>(); if (jurisdiction.equals("1372091709474910209")) { List<Map<Object, Object>> maps = informationService.selectCf(jurisdiction); map.put("count", maps.size()); return R.data(map); } else { String childer = informationService.selJurchilder(jurisdiction); String[] split = childer.split(","); String strArrays = ""; for (int j = 0; j < split.length; j++) { strArrays += "'" + split[j] + "',"; } String jurisdictiond = strArrays.substring(0, strArrays.length() - 1); List<Map<Object, Object>> maps = informationService.selectCf(jurisdictiond); map.put("count", maps.size()); return R.data(map); } } /** * 单位列表 */ @PostMapping("/selectIn") public R selectIn(String jurisdiction) { if (jurisdiction.equals("1372091709474910209")|| "".equals(jurisdiction)) { List<Map<Object, Object>> maps = informationService.selectIn(jurisdiction); return R.data(maps); } else { String childer = informationService.selJurchilder(jurisdiction); String[] split = childer.split(","); String strArrays = ""; for (int j = 0; j < split.length; j++) { strArrays += "'" + split[j] + "',"; } String jurisdictiond = strArrays.substring(0, strArrays.length() - 1); List<Map<Object, Object>> maps = informationService.selectIn(jurisdictiond); return R.data(maps); } } /** * 公司运营情况进入图表 */ @PostMapping("/selectTb") public R<IPage> selectTb(String jurisdiction, String enterpriseName, Query query) { if (jurisdiction.equals("1372091709474910209") || "".equals(jurisdiction)){ IPage list = informationService.selectTb(Condition.getPage(query), jurisdiction, enterpriseName); return R.data(list); } else { String childer = informationService.selJurchilder(jurisdiction); String[] split = childer.split(","); String strArrays = ""; for (int j = 0; j < split.length; j++) { strArrays += "'" + split[j] + "',"; } String jurisdictiond = strArrays.substring(0, strArrays.length() - 1); IPage list = informationService.selectTb(Condition.getPage(query), jurisdictiond, enterpriseName); return R.data(list); } } /** * 公司经济情况进入图表 */ @PostMapping("/selectJj") public R<IPage> selectJj(String jurisdiction, String enterpriseName, Query query) { if (jurisdiction.equals("1372091709474910209")|| "".equals(jurisdiction)) { IPage list = informationService.selectJj(Condition.getPage(query), jurisdiction, enterpriseName); return R.data(list); } else { String childer = informationService.selJurchilder(jurisdiction); String[] split = childer.split(","); String strArrays = ""; for (int j = 0; j < split.length; j++) { strArrays += "'" + split[j] + "',"; } String jurisdictiond = strArrays.substring(0, strArrays.length() - 1); IPage list = informationService.selectJj(Condition.getPage(query), jurisdictiond, enterpriseName); return R.data(list); } } /** * 业务统计情况 */ @PostMapping("/selectYw") public R<IPage> selectYw(String jurisdiction, String deptid,String stats, Query query) { if (jurisdiction.equals("1372091709474910209")|| "".equals(jurisdiction)) { IPage list = informationService.selectYw(Condition.getPage(query), jurisdiction, deptid, stats); return R.data(list); } else { String childer = informationService.selJurchilder(jurisdiction); String[] split = childer.split(","); String strArrays = ""; for (int j = 0; j < split.length; j++) { strArrays += "'" + split[j] + "',"; } String jurisdictiond = strArrays.substring(0, strArrays.length() - 1); IPage list = informationService.selectYw(Condition.getPage(query), jurisdictiond, deptid, stats); return R.data(list); } } } src/main/java/org/springblade/modules/information/mapper/InformationMapper.java
@@ -16,6 +16,7 @@ */ package org.springblade.modules.information.mapper; import liquibase.pro.packaged.S; import org.apache.ibatis.annotations.Param; import org.springblade.modules.dispatcher.vo.DispatcherVO; import org.springblade.modules.information.entity.Information; @@ -80,6 +81,9 @@ List<Map<Object,Object>> selectWg(String jurisdiction); List<Map<Object,Object>> selectJy(String jurisdiction); List<Map<Object,Object>> selectYs(String jurisdiction); List<Map<Object,Object>> selJur(); String selJurchilder(String id); List<Map<Object,Object>> seleJuList(String substring); Map<String, String> queryYearZ(String year,String jurisdiction,String deptid); Map<String, String> queryYearZc(String year,String jurisdiction,String deptid); src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
@@ -60,7 +60,7 @@ <if test="information.stats!=null and information.stats!=''"> and i.stats=#{information.stats} </if> <if test="information.jurisdiction!=null and information.jurisdiction!='' and information.jurisdiction!='1123598813738675201'"> <if test="information.jurisdiction!=null and information.jurisdiction!='' and information.jurisdiction!='1372091709474910209'"> and i.jurisdiction=#{information.jurisdiction} </if> <if test="information.departmentid!=null and information.departmentid!=''"> @@ -124,9 +124,9 @@ LEFT JOIN blade_dept d ON d.id= u.dept_id LEFT JOIN sys_jurisdiction j ON j.id= u.jurisdiction WHERE hold = 2 u.hold = 2 and u.status=1 <if test="jurisdiction!=null and jurisdiction!=''"> and u.jurisdiction =#{jurisdiction} and u.jurisdiction in(${jurisdiction}) </if> <if test="deptid!=null and deptid!=''"> and u.dept_id =#{deptid} @@ -149,8 +149,8 @@ WHERE deptid IN (SELECT i.departmentid FROM sys_information i LEFT JOIN sys_jurisdiction j ON j.id = i.jurisdiction where 1=1 <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> and i.jurisdiction =#{jurisdiction} <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and i.jurisdiction in(${jurisdiction}) </if> GROUP BY i.departmentid) GROUP BY deptid @@ -163,8 +163,8 @@ WHERE dept_id IN (SELECT i.departmentid FROM sys_information i LEFT JOIN sys_jurisdiction j ON j.id = i.jurisdiction where 1=1 <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> and i.jurisdiction =#{jurisdiction} <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and i.jurisdiction in(${jurisdiction}) </if> GROUP BY i.departmentid) GROUP BY dept_id @@ -194,7 +194,7 @@ <!-- WHERE--> <!-- deptid IN ( SELECT i.departmentid FROM sys_information i LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction--> <!-- where 1=1--> <!-- <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">--> <!-- <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'">--> <!-- and i.jurisdiction =#{jurisdiction}--> <!-- </if>--> <!-- GROUP BY i.departmentid )--> @@ -215,7 +215,7 @@ <!-- WHERE--> <!-- deptid IN ( SELECT i.departmentid FROM sys_information i LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction--> <!-- where 1=1--> <!-- <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">--> <!-- <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'">--> <!-- and i.jurisdiction =#{jurisdiction}--> <!-- </if>--> <!-- GROUP BY i.departmentid )--> @@ -240,7 +240,7 @@ <!-- sys_information i--> <!-- LEFT JOIN sys_jurisdiction j ON j.id = i.jurisdiction--> <!-- where 1=1--> <!-- <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">--> <!-- <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'">--> <!-- and i.jurisdiction =#{jurisdiction}--> <!-- </if>--> <!-- GROUP BY--> @@ -266,7 +266,7 @@ <!-- sys_information i--> <!-- LEFT JOIN sys_jurisdiction j ON j.id = i.jurisdiction--> <!-- where 1=1--> <!-- <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">--> <!-- <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'">--> <!-- and i.jurisdiction =#{jurisdiction}--> <!-- </if>--> <!-- GROUP BY--> @@ -292,7 +292,7 @@ <!-- sys_information i--> <!-- LEFT JOIN sys_jurisdiction j ON j.id = i.jurisdiction--> <!-- where 1=1--> <!-- <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">--> <!-- <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'">--> <!-- and i.jurisdiction =#{jurisdiction}--> <!-- </if>--> <!-- GROUP BY--> @@ -316,7 +316,7 @@ <!-- sys_information i--> <!-- LEFT JOIN sys_jurisdiction j ON j.id = i.jurisdiction--> <!-- where 1=1--> <!-- <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">--> <!-- <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'">--> <!-- and i.jurisdiction =#{jurisdiction}--> <!-- </if>--> <!-- GROUP BY--> @@ -407,7 +407,7 @@ AND is_deleted = 0 GROUP BY dept_id ) J ON J.dept_id = H.departmentid where 1=1 <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and H.jurisdiction =#{jurisdiction} </if> <if test="deptid!=null and deptid!=''"> @@ -437,7 +437,7 @@ FROM sys_information i LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction where 1=1 <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and i.jurisdiction =#{jurisdiction} </if> GROUP BY @@ -467,7 +467,7 @@ AND is_deleted=0 AND dept_id IN ( SELECT i.departmentid FROM sys_information i LEFT JOIN sys_jurisdiction j ON j.id = i.jurisdiction where 1=1 <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and i.jurisdiction =#{jurisdiction} </if> GROUP BY i.departmentid ) @@ -496,7 +496,7 @@ YEAR ( s.dispatcherTime ) =#{year} AND dept_id IN ( SELECT i.departmentid FROM sys_information i LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction where 1=1 <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and i.jurisdiction =#{jurisdiction} </if> GROUP BY i.departmentid ) @@ -520,7 +520,7 @@ WHERE YEAR (s.insuredtime) =#{year} AND deptid IN (SELECT i.departmentid FROM sys_information i LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction where 1=1 <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and i.jurisdiction =#{jurisdiction} </if> GROUP BY i.departmentid ) @@ -577,7 +577,7 @@ LEFT JOIN blade_dept d ON C.dept_id = d.id LEFT JOIN sys_jurisdiction j ON j.id = C.jurisdiction WHERE 1 =1 <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and C.jurisdiction =#{jurisdiction} </if> <if test="deptid!=null and deptid!=''"> @@ -622,7 +622,7 @@ ) B ON A.dept_id = B.dept_id) C LEFT JOIN blade_dept d ON C.dept_id = d.id LEFT JOIN sys_jurisdiction j ON j.id = C.jurisdiction where 1=1 <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and C.jurisdiction =#{jurisdiction} </if> <if test="deptid!=null and deptid!=''"> @@ -667,7 +667,7 @@ ) B ON A.dept_id = B.dept_id) C LEFT JOIN blade_dept d ON C.dept_id = d.id LEFT JOIN sys_jurisdiction j ON j.id = C.jurisdiction where 1=1 <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and C.jurisdiction =#{jurisdiction} </if> <if test="deptid!=null and deptid!=''"> @@ -709,7 +709,7 @@ ) C LEFT JOIN blade_dept d ON C.deptid = d.id LEFT JOIN sys_jurisdiction j ON j.id = C.jurisdiction where 1=1 <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and C.jurisdiction =#{jurisdiction} </if> <if test="deptid!=null and deptid!=''"> @@ -752,7 +752,7 @@ ) C LEFT JOIN blade_dept d ON C.dept_id = d.id LEFT JOIN sys_jurisdiction j ON j.id = C.jurisdiction WHERE 1=1 <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and C.jurisdiction =#{jurisdiction} </if> <if test="deptid!=null and deptid!=''"> @@ -789,7 +789,7 @@ ) B ON A.dept_id = B.dept_id) C LEFT JOIN blade_dept d ON C.dept_id = d.id LEFT JOIN sys_jurisdiction j ON j.id = C.jurisdiction where 1=1 <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and C.jurisdiction =#{jurisdiction} </if> <if test="deptid!=null and deptid!=''"> @@ -819,7 +819,7 @@ FROM sys_information i LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction where 1=1 <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and i.jurisdiction =#{jurisdiction} </if> GROUP BY @@ -851,7 +851,7 @@ FROM sys_information i LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction where 1=1 <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and i.jurisdiction =#{jurisdiction} </if> GROUP BY @@ -883,7 +883,7 @@ FROM sys_information i LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction where 1=1 <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and i.jurisdiction =#{jurisdiction} </if> GROUP BY @@ -918,7 +918,7 @@ FROM sys_information i LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction where 1=1 <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and i.jurisdiction =#{jurisdiction} </if> GROUP BY @@ -949,7 +949,7 @@ FROM sys_information i LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction where 1=1 <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and i.jurisdiction =#{jurisdiction} </if> GROUP BY @@ -971,8 +971,8 @@ LEFT JOIN blade_dept d ON d.id = u.dept_id LEFT JOIN sys_jurisdiction j ON j.id = u.jurisdiction WHERE u.examination_type = 1 and u.is_deleted=0 and u.status = 1 <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> and u.jurisdiction =#{jurisdiction} <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and u.jurisdiction in (${jurisdiction}) </if> <if test="deptid!=null and deptid!=''"> and u.dept_id =#{deptid} @@ -995,8 +995,8 @@ LEFT JOIN blade_dept d ON d.id = u.departmentid LEFT JOIN sys_jurisdiction j ON j.id = u.jurisdiction WHERE score = 3 <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> and u.jurisdiction =#{jurisdiction} <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and u.jurisdiction in(${jurisdiction}) </if> <if test="deptid!=null and deptid!=''"> and u.departmentid =#{deptid} @@ -1011,12 +1011,12 @@ j.dept_name </select> <!--查询出所有辖区信息--> <select id="selectJur" resultType="java.util.HashMap"> SELECT id, dept_name FROM sys_jurisdiction WHERE id!=1123598813738675201 </select> <!-- <!–查询出所有辖区信息–>--> <!-- <select id="selectJur" resultType="java.util.HashMap">--> <!-- SELECT id, dept_name--> <!-- FROM sys_jurisdiction--> <!-- WHERE id!=1372091709474910209--> <!-- </select> --> <select id="selectExtypeUser" resultType="java.lang.Integer"> SELECT COUNT(CASE WHEN (examination_mx IS NOT NULL OR examination_mx != "") THEN 1 END) AS sum @@ -1034,7 +1034,7 @@ LEFT JOIN blade_dept d ON d.id = u.dept_id LEFT JOIN sys_jurisdiction j ON j.id = u.jurisdiction WHERE dispatch = 0 <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and u.jurisdiction =#{jurisdiction} </if> <if test="deptid!=null and deptid!=''"> @@ -1049,7 +1049,7 @@ LEFT JOIN blade_dept d ON d.id = u.dept_id LEFT JOIN sys_jurisdiction j ON j.id = u.jurisdiction WHERE dispatch = 1 <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and u.jurisdiction =#{jurisdiction} </if> <if test="deptid!=null and deptid!=''"> @@ -1060,8 +1060,8 @@ <select id="selectIn" resultType="java.util.HashMap"> SELECT enterpriseName, departmentid FROM sys_information where 1=1 <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> and jurisdiction =#{jurisdiction} <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and jurisdiction in(${jurisdiction}) </if> </select> <delete id="deleteDept"> @@ -1164,7 +1164,7 @@ LEFT JOIN sys_information d ON A.dept_id = d.departmentid LEFT JOIN sys_jurisdiction j ON j.id = A.jurisdiction WHERE 1=1 <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and A.jurisdiction =#{jurisdiction} </if> <if test="deptid!=null and deptid!=''"> @@ -1181,7 +1181,7 @@ <if test="deptid!=null and deptid!=''"> and departmentid=#{deptid} </if> <if test="jurisdiction!=null and jurisdiction!=''and jurisdiction!='1123598813738675201'"> <if test="jurisdiction!=null and jurisdiction!=''and jurisdiction!='1372091709474910209'"> AND jurisdiction=#{jurisdiction} </if> GROUP BY stats @@ -1191,7 +1191,7 @@ <if test="deptid!=null and deptid!=''"> and dept_id=#{deptid} </if> <if test="jurisdiction!=null and jurisdiction!=''and jurisdiction!='1123598813738675201'"> <if test="jurisdiction!=null and jurisdiction!=''and jurisdiction!='1372091709474910209'"> AND jurisdiction=#{jurisdiction} </if> </select> @@ -1200,7 +1200,7 @@ <if test="deptid!=null and deptid!=''"> and dept_id=#{deptid} </if> <if test="jurisdiction!=null and jurisdiction!=''and jurisdiction!='1123598813738675201'"> <if test="jurisdiction!=null and jurisdiction!=''and jurisdiction!='1372091709474910209'"> AND jurisdiction=#{jurisdiction} </if> </select> @@ -1314,8 +1314,8 @@ ) G ON A.departmentid = G.dept_id ) J WHERE 1=1 <if test="jurisdiction!=null and jurisdiction!=''and jurisdiction!='1123598813738675201'"> and J.jurisdiction =#{jurisdiction} <if test="jurisdiction!=null and jurisdiction!=''and jurisdiction!='1372091709474910209'"> and J.jurisdiction in(${jurisdiction}) </if> <if test="enterpriseName!=null and enterpriseName!=''"> and J.enterpriseName like concat('%', #{enterpriseName},'%') @@ -1368,8 +1368,8 @@ WHERE role_id = '1412226235153731586' and status=1 GROUP BY dept_id, jurisdiction) E ON A.departmentid = E.dept_id) J WHERE 1=1 <if test="jurisdiction!=null and jurisdiction!=''and jurisdiction!='1123598813738675201'"> and J.jurisdiction =#{jurisdiction} <if test="jurisdiction!=null and jurisdiction!=''and jurisdiction!='1372091709474910209'"> and J.jurisdiction in(${jurisdiction}) </if> <if test="enterpriseName!=null and enterpriseName!=''"> and J.enterpriseName like concat('%', #{enterpriseName},'%') @@ -1408,8 +1408,8 @@ status=1 GROUP BY dept_id ) C ON A.departmentid = C.dept_id where 1=1 <if test="jurisdiction!=null and jurisdiction!=''and jurisdiction!='1123598813738675201'"> AND A.jurisdiction=#{jurisdiction} <if test="jurisdiction!=null and jurisdiction!=''and jurisdiction!='1372091709474910209'"> AND A.jurisdiction in(${jurisdiction}) </if> <if test="deptid!=null and deptid!=''"> and A.enterpriseName like concat('%', #{deptid},'%') @@ -1474,7 +1474,7 @@ LEFT JOIN sys_dispatcher_unit u ON u.id = di.dispatcher_unit_id LEFT JOIN sys_jurisdiction j ON j.id = di.jurisdiction where 1=1 and di.dept_id=#{deptid} <if test="jurisdiction!=null and jurisdiction!=''and jurisdiction!='1123598813738675201'"> <if test="jurisdiction!=null and jurisdiction!=''and jurisdiction!='1372091709474910209'"> and di.jurisdiction =#{jurisdiction} </if> <if test="fid!=null and fid!=''"> @@ -1492,8 +1492,8 @@ SELECT COUNT(*) AS num, deptid FROM `sys_punish` where 1=1 <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> and jurisdiction =#{jurisdiction} <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and jurisdiction in(${jurisdiction}) </if> GROUP BY deptid </select> @@ -1507,7 +1507,7 @@ FROM sys_information i LEFT JOIN sys_jurisdiction j ON j.id=i.jurisdiction WHERE i.creditCode is NULL <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'"> <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> and i.jurisdiction =#{jurisdiction} </if> GROUP BY @@ -1524,11 +1524,9 @@ SELECT u.enterpriseName, u.departmentid, u.jurisdiction, d.dept_name AS deptname, j.dept_name AS jurname FROM sys_information u LEFT JOIN blade_dept d ON d.id = u.departmentid LEFT JOIN sys_jurisdiction j ON j.id = u.jurisdiction LEFT JOIN sys_jurisdiction j ON j.id = u.jurisdiction WHERE u.stats!=0 ) A LEFT JOIN ( SELECT COUNT(*) AS cznum, @@ -1553,8 +1551,8 @@ WHERE role_id = '1412226235153731586' AND `status`=1 AND is_deleted = 0 GROUP BY dept_id) D ON D.dept_id = A.departmentid where 1=1 <if test="jurisdiction!=null and jurisdiction != '' and jurisdiction != '1123598813738675201'"> and A.jurisdiction = #{jurisdiction} <if test="jurisdiction!=null and jurisdiction != '' and jurisdiction != '1372091709474910209'"> and A.jurisdiction in(${jurisdiction}) </if> </select> @@ -1567,7 +1565,7 @@ IFNULL( d.num, 0 ) AS fwnum, IFNULL( B.cznum, 0 ) AS cznum, IFNULL( C.painum, 0 ) AS painum, IFNULL( D.znum, 0 ) AS znum IFNULL( E.znum, 0 ) AS znum FROM sys_information i LEFT JOIN ( SELECT COUNT( * ) num, dept_id FROM sys_dispatcher_unit GROUP BY dept_id ) d ON i.departmentid = @@ -1612,9 +1610,9 @@ AND is_deleted = 0 GROUP BY dept_id ) D ON D.dept_id = i.departmentid where 1=1 <if test="jurisdiction!=null and jurisdiction != '' and jurisdiction != '1123598813738675201'"> and i.jurisdiction = #{jurisdiction} ) E ON E.dept_id = i.departmentid where 1=1 AND i.stats!=0 <if test="jurisdiction!=null and jurisdiction != '' and jurisdiction != '1372091709474910209'"> and i.jurisdiction in(${jurisdiction}) </if> </select> @@ -1671,25 +1669,100 @@ dept_id ) D ON D.dept_id = i.departmentid LEFT JOIN ( SELECT COUNT( * ) fwnum, dept_id FROM sys_dispatcher_unit GROUP BY dept_id ) E ON i.departmentid = E.dept_id WHERE 1 =1 <if test="jurisdiction!=null and jurisdiction != '' and jurisdiction != '1123598813738675201'"> and i.jurisdiction = #{jurisdiction} E.dept_id WHERE 1 =1 AND i.stats!=0 <if test="jurisdiction!=null and jurisdiction != '' and jurisdiction != '1372091709474910209'"> and i.jurisdiction in(${jurisdiction}) </if> </select> <select id="selectAge" resultType="java.util.HashMap"> SELECT IFNULL(TIMESTAMPDIFF( YEAR, bu.birthday, CURDATE( ) ),0) AS age YEAR (now()) - YEAR (substring(bu.cardid, 7, 8)) AS age FROM blade_user bu LEFT JOIN sys_information si ON si.departmentid = bu.dept_id WHERE bu.`status`=1 AND bu.role_id='1412226235153731586' <if test="jurisdiction!=null and jurisdiction != '' and jurisdiction != '1123598813738675201'"> <if test="jurisdiction!=null and jurisdiction != '' and jurisdiction != '1372091709474910209'"> and bu.jurisdiction = #{jurisdiction} </if> <if test="deptid!=null and deptid != ''"> and bu.dept_id = #{deptid} </if> </select> <!--查询所有辖区--> <select id="selJur" resultType="java.util.HashMap"> SELECT dept.id, dept_name as deptname FROM sys_jurisdiction dept WHERE ( SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM sys_jurisdiction WHERE parent_id = dept.id AND is_deleted = 0 ) = 1 AND parent_id!=0 </select> <!--查辖区的子数据--> <select id="selJurchilder" resultType="java.lang.String"> SELECT GROUP_CONCAT(id) as id FROM sys_jurisdiction WHERE parent_id = #{id} </select> <select id="seleJuList" resultType="java.util.HashMap"> SELECT COUNT(stats) as num FROM sys_information WHERE stats = 0 AND jurisdiction IN (${substring}) UNION ALL SELECT COUNT(stats) FROM sys_information WHERE stats = 1 AND jurisdiction IN (${substring}) UNION ALL SELECT COUNT(stats) FROM sys_information WHERE stats = 2 AND jurisdiction IN (${substring}) UNION ALL SELECT COUNT(stats) FROM sys_information WHERE stats = 3 AND jurisdiction IN (${substring}) UNION ALL SELECT COUNT(stats) FROM sys_information WHERE stats = 4 AND jurisdiction IN (${substring}) </select> <!--查询出所有辖区信息--> <select id="selectJur" resultType="java.util.HashMap"> SELECT dept.id, dept_name FROM sys_jurisdiction dept WHERE ( SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM sys_jurisdiction WHERE parent_id = dept.id AND is_deleted = 0 ) = 1 AND parent_id!=0 </select> </mapper> src/main/java/org/springblade/modules/information/service/IInformationService.java
@@ -88,4 +88,7 @@ List<Map<Object,Object>> selectJy(String jurisdiction); List<Map<Object,Object>> selectYs(String jurisdiction); List<Map<Object,Object>> selectAge(String jurisdiction,String deptid); List<Map<Object,Object>> selJur(); String selJurchilder(String id); List<Map<Object,Object>> seleJuList(String substring); } src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java
@@ -271,5 +271,20 @@ return baseMapper.selectAge(jurisdiction, deptid); } @Override public List<Map<Object, Object>> selJur() { return baseMapper.selJur(); } @Override public String selJurchilder(String id) { return baseMapper.selJurchilder(id); } @Override public List<Map<Object, Object>> seleJuList(String substring) { return baseMapper.seleJuList(substring); } } src/main/java/org/springblade/modules/jurisdiction/mapper/JurisdictionMapper.xml
@@ -35,15 +35,15 @@ <select id="lazyList" resultMap="deptVOResultMap"> SELECT dept.* , ( SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM dept.* , ( SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM sys_jurisdiction WHERE parent_id = dept.id and is_deleted = 0 ) AS "has_children" WHERE parent_id = dept.id and is_deleted = 0 ) AS "has_children" FROM sys_jurisdiction dept WHERE dept.is_deleted = 0 @@ -68,21 +68,21 @@ </if> </select> <select id="lazyTree" resultMap="treeNodeResultMap" > <select id="lazyTree" resultMap="treeNodeResultMap"> SELECT dept.id, dept.parent_id, dept.dept_name AS title, dept.id AS "value", dept.id AS "key", ( SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM dept.id, dept.parent_id, dept.dept_name AS title, dept.id AS "value", dept.id AS "key", ( SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM sys_jurisdiction WHERE parent_id = dept.id and is_deleted = 0 ) AS "has_children" WHERE parent_id = dept.id and is_deleted = 0 ) AS "has_children" FROM sys_jurisdiction dept WHERE dept.is_deleted = 0 @@ -94,7 +94,7 @@ </if> </select> <select id="lazyTrees" resultMap="treeNodeResultMap" > <!--<select id="lazyTrees" resultMap="treeNodeResultMap" > SELECT dept.id, dept.parent_id, @@ -112,31 +112,47 @@ FROM sys_jurisdiction dept WHERE dept.is_deleted = 0 </select> <select id="lazyTreeJu" resultMap="treeNodeResultMap" > SELECT dept.id, dept.parent_id, dept.dept_name AS title, dept.id AS "value", dept.id AS "key", ( SELECT CASE </select>--> WHEN COUNT ( 1 ) > 0 THEN 1 ELSE 0 END FROM sys_jurisdiction WHERE parent_id = dept.id AND is_deleted = 0 ) AS "has_children" FROM sys_jurisdiction dept WHERE dept.is_deleted = 0 <select id="lazyTrees" resultMap="treeNodeResultMap"> SELECT dept.id, dept.parent_id, dept.dept_name AS title, dept.id AS "value", dept.id AS "key", ( SELECT CASE WHEN count(1) > 0 THEN 0 ELSE 1 END FROM sys_jurisdiction WHERE parent_id = dept.id and is_deleted = 0 ) AS "has_children" FROM sys_jurisdiction dept WHERE ( SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM sys_jurisdiction WHERE parent_id = dept.id and is_deleted = 0 ) = 1 </select> <select id="lazyTreeJu" resultMap="treeNodeResultMap"> SELECT dept.id, dept.parent_id, dept.dept_name AS title, dept.id AS "value", dept.id AS "key", ( SELECT CASE WHEN COUNT (1) > 0 THEN 1 ELSE 0 END FROM sys_jurisdiction WHERE parent_id = dept.id AND is_deleted = 0 ) AS "has_children" FROM sys_jurisdiction dept WHERE dept.is_deleted = 0 </select> </mapper> src/main/java/org/springblade/modules/system/mapper/DeptMapper.xml
@@ -386,9 +386,9 @@ IFNULL(B.cz,0) as cz, IFNULL(C.wcz,0) as wcz FROM (SELECT jurisdiction FROM blade_user ) A LEFT JOIN (SELECT COUNT(hold) as cz,jurisdiction FROM blade_user WHERE hold=0 GROUP BY jurisdiction ) B ON A.jurisdiction=B.jurisdiction LEFT JOIN (SELECT COUNT(hold) as wcz,jurisdiction FROM blade_user WHERE hold=1 GROUP BY jurisdiction ) C ON A.jurisdiction=C.jurisdiction WHERE A.jurisdiction=#{deptid} GROUP BY cz,wcz LEFT JOIN (SELECT COUNT(hold) as cz,jurisdiction FROM blade_user WHERE hold=0 and status=1 GROUP BY jurisdiction ) B ON A.jurisdiction=B.jurisdiction LEFT JOIN (SELECT COUNT(hold) as wcz,jurisdiction FROM blade_user WHERE hold=1 and status=1 GROUP BY jurisdiction ) C ON A.jurisdiction=C.jurisdiction WHERE A.jurisdiction in(${deptid}) GROUP BY cz,wcz </select> <!--查询部门下面的所有单位-->