user5 1 vuosi sitten
vanhempi
commit
04425b286d

+ 39 - 10
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java

@@ -4613,11 +4613,16 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 			page.setPageNo((page.getPageNo() - 1) * page.getPageSize());
 		}
 		projectRecords.setPage(page);
+		Office office = officeService.get(officeId);
 		//如果访问的是2023年4月份之后的月报信息,则获取新的office信息
 		if(StringUtils.isBlank(isThisMonth) || !"1".equals(isThisMonth)){
 			projectRecords.getSqlMap().put("officeId", "or parent_ids like concat('%',#{officeId},'%')");
 		}else{
-			projectRecords.getSqlMap().put("officeId", "");
+			if(null != office && StringUtils.isNotBlank(office.getName()) && office.getName().equals("工程五部")){
+				projectRecords.getSqlMap().put("officeId", "or parent_ids like concat('%',#{officeId},'%')");
+			}else{
+				projectRecords.getSqlMap().put("officeId", "");
+			}
 		}
 
 		List<RuralProjectRecords> recordsList = dao.selectReportPage(projectRecords,officeId,grade,beginDate,endDate,recordState,reportedState,projectPaperFiling,projectFlingBatchRelation);
@@ -4676,7 +4681,7 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 	//公司级:超期项目报表详细
 	public Page<RuralProjectRecords> findReportPageOverdue(Page<RuralProjectRecords> page, RuralProjectRecords projectRecords,
 														   StatementCompanyComprehensiveInfo statementCompanyComprehensiveInfo,
-															String year,String bigDateType,String smallDateType,String isThisMonth) {
+															String year,String bigDateType,String smallDateType,String isThisMonth,String officeId) {
 		if(StringUtils.isNotBlank(statementCompanyComprehensiveInfo.getDepartmentLevel()) && "company".equals(statementCompanyComprehensiveInfo.getDepartmentLevel())){
 			bigDateType = "0";
 			statementCompanyComprehensiveInfo.setBigDateType("2");
@@ -4698,12 +4703,18 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 		}
 		projectRecords.setPage(page);
 
+		Office office = officeService.get(officeId);
 		//如果访问的是2023年4月份之后的月报信息,则获取新的office信息
 		if(StringUtils.isBlank(isThisMonth) || !"1".equals(isThisMonth)){
-			projectRecords.getSqlMap().put("officeId", "or parent_ids like concat('%',#{statementCompanyComprehensiveInfo.officeId},'%')");
+			projectRecords.getSqlMap().put("officeId", "or parent_ids like concat('%',#{officeId},'%')");
 		}else{
-			projectRecords.getSqlMap().put("officeId", "");
+			if(null != office && StringUtils.isNotBlank(office.getName()) && office.getName().equals("工程五部")){
+				projectRecords.getSqlMap().put("officeId", "or parent_ids like concat('%',#{officeId},'%')");
+			}else{
+				projectRecords.getSqlMap().put("officeId", "");
+			}
 		}
+
 		List<RuralProjectRecords> recordsList = dao.selectReportPageOverdue(projectRecords,statementCompanyComprehensiveInfo,beginDate,endDate);
 		int count = dao.selectReportPageOverdueCount(projectRecords,statementCompanyComprehensiveInfo,beginDate,endDate);
 		page.setPageNo(oldPageNo);
@@ -4724,7 +4735,7 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 	//公司级:超期项目报表详细
 	public Page<RuralProjectRecords> findThisMonthReportPageOverdue(Page<RuralProjectRecords> page, RuralProjectRecords projectRecords,
 														   StatementCompanyComprehensiveInfo statementCompanyComprehensiveInfo,
-															String year,String bigDateType,String smallDateType) {
+															String year,String bigDateType,String smallDateType,String officeId) {
 		if(StringUtils.isNotBlank(statementCompanyComprehensiveInfo.getDepartmentLevel()) && "company".equals(statementCompanyComprehensiveInfo.getDepartmentLevel())){
 			bigDateType = "0";
 			statementCompanyComprehensiveInfo.setBigDateType("2");
@@ -4744,6 +4755,16 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 		if((page.getPageNo()-1) >= 0) {
 			page.setPageNo((page.getPageNo() - 1) * page.getPageSize());
 		}
+
+		Office office = officeService.get(officeId);
+		//如果访问的是2023年4月份之后的月报信息,则获取新的office信息
+
+		if(null != office && StringUtils.isNotBlank(office.getName()) && office.getName().equals("工程五部")){
+			projectRecords.getSqlMap().put("officeId", "or parent_ids like concat('%','"+ office.getId() +"','%')");
+		}else{
+			projectRecords.getSqlMap().put("officeId", "");
+		}
+
 		projectRecords.setPage(page);
 		List<RuralProjectRecords> recordsList = dao.selectThisMonthReportPageOverdue(projectRecords,statementCompanyComprehensiveInfo,beginDate,endDate);
 		int count = dao.selectThisMonthReportPageOverdueCount(projectRecords,statementCompanyComprehensiveInfo,beginDate,endDate);
@@ -4765,12 +4786,13 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 	//公司级:chaoqi项目报表详细 年度级
 	public Page<RuralProjectRecords> findReportPageOverdueByYear(Page<RuralProjectRecords> page, RuralProjectRecords projectRecords,
 														   StatementCompanyComprehensiveInfo statementCompanyComprehensiveInfo,
-														   String year,String bigDateType,String smallDateType,String isThisMonth) {
+														   String year,String bigDateType,String smallDateType,String isThisMonth,String officeId) {
 		//将获取的datetype转为需要的具体时间   含年月日
 		Map<String,String> map = statementCompanyComprehensiveService.getDateNew(new Integer(bigDateType),new Integer(smallDateType),new Integer(year));
 		String beginDate = map.get("beginDate");
 		String endDate = map.get("endDate");
 		statementCompanyComprehensiveInfo.setBigDateType("2");
+		statementCompanyComprehensiveInfo.setSmallDateType("");
 		if(null!= projectRecords.getOffice() && StringUtils.isNotBlank(projectRecords.getOffice().getId())){
 			//查询该选择节点下所有的部门Id
 			List<String> officeIdList = officeService.getChildrenOffice(projectRecords.getOffice().getId());
@@ -4782,15 +4804,22 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 		if((page.getPageNo()-1) >= 0) {
 			page.setPageNo((page.getPageNo() - 1) * page.getPageSize());
 		}
+		Office office = officeService.get(officeId);
 		//如果访问的是2023年4月份之后的月报信息,则获取新的office信息
 		if(StringUtils.isBlank(isThisMonth) || !"1".equals(isThisMonth)){
-			projectRecords.getSqlMap().put("officeId", "or parent_ids like concat('%',#{statementCompanyComprehensiveInfo.officeId},'%')");
+			projectRecords.getSqlMap().put("officeId", "or parent_ids like concat('%',#{officeId},'%')");
 		}else{
-			projectRecords.getSqlMap().put("officeId", "");
+			if(null != office && StringUtils.isNotBlank(office.getName()) && office.getName().equals("工程五部")){
+				projectRecords.getSqlMap().put("officeId", "or parent_ids like concat('%','"+ office.getId() +"','%')");
+			}else{
+				projectRecords.getSqlMap().put("officeId", "");
+			}
 		}
+
+
 		projectRecords.setPage(page);
-		List<RuralProjectRecords> recordsList = dao.selectReportPageOverdue(projectRecords,statementCompanyComprehensiveInfo,beginDate,endDate);
-		int count = dao.selectReportPageOverdueCount(projectRecords,statementCompanyComprehensiveInfo,beginDate,endDate);
+		List<RuralProjectRecords> recordsList = dao.selectThisMonthReportPageOverdue(projectRecords,statementCompanyComprehensiveInfo,beginDate,endDate);
+		int count = dao.selectThisMonthReportPageOverdueCount(projectRecords,statementCompanyComprehensiveInfo,beginDate,endDate);
 		page.setPageNo(oldPageNo);
 		page.setCount(count);
 		page.setCountFlag(false);

+ 4 - 4
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectSignatureOldMessageDisposeController.java

@@ -189,10 +189,10 @@ public class RuralProjectSignatureOldMessageDisposeController extends BaseContro
         Integer month = 12; //第一个月从0开始,所以得到月份+1
         //当月最后一天
         //projectRecordsService.getBatchArchiveNotify();
-        logger.info("-----------公司级—月度报表(开始)------------------");
+        /*logger.info("-----------公司级—月度报表(开始)------------------");
         statementCompanyComprehensiveService.disposeStatementCompany(year,2,month);
-        logger.info("------------公司级—月度报表(结束)------------------");
-        /*logger.info("-----------部门级—月度报表(开始)------------------");
+        logger.info("------------公司级—月度报表(结束)------------------");*/
+        logger.info("-----------部门级—月度报表(开始)------------------");
         //statementCompanyComprehensiveService.disposeStatementOffice(year,2,month);
         logger.info("------------部门级—月度报表(结束)------------------");
         logger.info("------------公司级—年度报表(月报中年度信息)(开始)------------------");
@@ -203,7 +203,7 @@ public class RuralProjectSignatureOldMessageDisposeController extends BaseContro
         logger.info("------------部门级—年度报表(月报中年度信息)(结束)------------------");
         logger.info("-----------张静—月度报表(开始)------------------");
         // statementCompanyComprehensiveService.disposeReportDataStatementCompany(year,2,month);
-        logger.info("------------张静—月度报表(结束)------------------");*/
+        logger.info("------------张静—月度报表(结束)------------------");
         //}
 
         map.put("msgMonth","月度报表处理完成");

+ 6 - 5
src/main/java/com/jeeplus/modules/statement/controller/StatementCompanyComprehensiveController.java

@@ -163,9 +163,9 @@ public class StatementCompanyComprehensiveController extends BaseController {
             statementCompanyComprehensiveInfo.setType("1");
             //判定是否是获取本月的数据信息,若是获取本月信息,则进入该方法进行处理,否则则正常走之前的方法
             if(StringUtils.isNotBlank(isThisMonth) && "1".equals(isThisMonth)){
-                page = projectRecordsService.findThisMonthReportPageOverdue(new Page<RuralProjectRecords>(request, response), projectRecords,statementCompanyComprehensiveInfo,year,bigDateType, smallDateType);
+                page = projectRecordsService.findThisMonthReportPageOverdue(new Page<RuralProjectRecords>(request, response), projectRecords,statementCompanyComprehensiveInfo,year,bigDateType, smallDateType,officeId);
             }else{
-                page = projectRecordsService.findReportPageOverdue(new Page<RuralProjectRecords>(request, response), projectRecords,statementCompanyComprehensiveInfo,year,bigDateType, smallDateType,isThisMonth);
+                page = projectRecordsService.findReportPageOverdue(new Page<RuralProjectRecords>(request, response), projectRecords,statementCompanyComprehensiveInfo,year,bigDateType, smallDateType,isThisMonth,officeId);
             }
         }
         //查询工程类型
@@ -236,7 +236,8 @@ public class StatementCompanyComprehensiveController extends BaseController {
             page = projectRecordsService.findReportPage(new Page<RuralProjectRecords>(request, response), projectRecords, officeId, grade, bigDateType, smallDateType, recordState, reportedState, year,projectPaperFiling,projectFlingBatchRelation,isThisMonth);
         }else {
             statementCompanyComprehensiveInfo.setType("1");
-            page = projectRecordsService.findReportPageOverdueByYear(new Page<RuralProjectRecords>(request, response), projectRecords,statementCompanyComprehensiveInfo,year,bigDateType, smallDateType,isThisMonth);
+
+            page = projectRecordsService.findReportPageOverdueByYear(new Page<RuralProjectRecords>(request, response), projectRecords,statementCompanyComprehensiveInfo,year,bigDateType, smallDateType,isThisMonth, officeId);
         }
         //查询工程类型
         if (projectRecords.getEngineeringType()!=null){
@@ -1204,9 +1205,9 @@ public class StatementCompanyComprehensiveController extends BaseController {
                 statementCompanyComprehensiveInfo.setType("1");
                 //判定是否是获取本月的数据信息,若是获取本月信息,则进入该方法进行处理,否则则正常走之前的方法
                 if(StringUtils.isNotBlank(isThisMonth) && "1".equals(isThisMonth)){
-                    page = projectRecordsService.findThisMonthReportPageOverdue(new Page<RuralProjectRecords>(request, response, -1), projectRecords,statementCompanyComprehensiveInfo,year,bigDateType, smallDateType);
+                    page = projectRecordsService.findThisMonthReportPageOverdue(new Page<RuralProjectRecords>(request, response, -1), projectRecords,statementCompanyComprehensiveInfo,year,bigDateType, smallDateType,officeId);
                 }else{
-                    page = projectRecordsService.findReportPageOverdue(new Page<RuralProjectRecords>(request, response, -1), projectRecords,statementCompanyComprehensiveInfo,year,bigDateType, smallDateType,isThisMonth);
+                    page = projectRecordsService.findReportPageOverdue(new Page<RuralProjectRecords>(request, response, -1), projectRecords,statementCompanyComprehensiveInfo,year,bigDateType, smallDateType,isThisMonth,officeId);
                 }
                 // page = projectRecordsService.findReportPageOverdue(new Page<RuralProjectRecords>(request, response, -1), projectRecords,statementCompanyComprehensiveInfo,year,bigDateType, smallDateType,isThisMonth);
             }

+ 22 - 0
src/main/java/com/jeeplus/modules/statement/dao/StatementCompanyComprehensiveDao.java

@@ -561,6 +561,13 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
     List<StatementCompanyComprehensiveInfo> selectAllByType(StatementCompanyComprehensiveInfo statementCompanyComprehensiveInfo);
 
     /**
+     * 按照类型查询公司级所有报表信息(五部)
+     * @param statementCompanyComprehensiveInfo
+     * @return
+     */
+    StatementCompanyComprehensiveInfo selectAllWbByType(StatementCompanyComprehensiveInfo statementCompanyComprehensiveInfo);
+
+    /**
      * 按照类型查询公司级所有报表信息 年度
      * @param statementCompanyComprehensiveInfo
      * @return
@@ -900,4 +907,19 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
      * @return
      */
     List<ReportDataEntity> getOfficeProjectFlingBatchRelationList(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
+
+    /**
+     * 根据部门名称查询所有子集部门
+     * @param officeName
+     * @return
+     */
+    List<Office> getAllWBChildrenOfficeListInfo(String officeName);
+
+
+    /**
+     * 按照类型查询公司级所有报表信息 年度
+     * @param statementCompanyComprehensiveInfo
+     * @return
+     */
+    StatementCompanyComprehensiveInfo selectAllByTypeByYearAndOfficeId(StatementCompanyComprehensiveInfo statementCompanyComprehensiveInfo);
 }

+ 97 - 3
src/main/java/com/jeeplus/modules/statement/service/StatementCompanyComprehensiveService.java

@@ -9,6 +9,7 @@ import com.jeeplus.modules.statement.entity.StatementCompanyComprehensiveInfo;
 import com.jeeplus.modules.statement.entity.StatementDataInfo;
 import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.service.OfficeService;
 import com.jeeplus.modules.sys.utils.UserUtils;
 import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
 import com.jeeplus.modules.workprojectnotify.util.UtilNotify;
@@ -38,6 +39,8 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
 
     @Autowired
     private WorkProjectNotifyService workProjectNotifyService;
+    @Autowired
+    private OfficeService officeService;
 
     /**
      *
@@ -922,7 +925,7 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
 
         //创建utilNotifyId参数
         //参数是由 year、bigDateType、smallDateType参数设定
-        /*String utilNotifyId = year + "," + bigDateType + "," + smallDateType;
+        String utilNotifyId = year + "," + bigDateType + "," + smallDateType;
         //发送通知
         switch (bigDateType){
             //年度汇总
@@ -939,7 +942,7 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
                 //smallDateType  为月度时候
                 companyNotification(statementDate,"月","163",utilNotifyId);
                 break;
-        }*/
+        }
     }
 
     /**
@@ -1597,6 +1600,10 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
 
         //查询部门信息
         List<Office> officeList = dao.getOfficeListInfo(decisionValue);
+        //查询五部的所有部门
+        List<Office> wbofficeList = dao.getAllWBChildrenOfficeListInfo("工程五部");
+        officeList.addAll(wbofficeList);
+
         for (Office officeInfo : officeList) {
             StatementCompanyComprehensiveInfo comprehensiveInfo = new StatementCompanyComprehensiveInfo();
 //            代表项目
@@ -3661,14 +3668,101 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
 
     //根据type查询公司级表所有内容
     public List<StatementCompanyComprehensiveInfo> selectAllByType(StatementCompanyComprehensiveInfo info){
-        List<StatementCompanyComprehensiveInfo> list = dao.selectAllByType(info);
+        //对五部数据单独处理
+        //查询五部的所有部门
+        if("1".equalsIgnoreCase(info.getType())){
+            List<Office> officeList = dao.getAllWBChildrenOfficeListInfo("工程五部");
+
+            List<String> officeId = Lists.newArrayList();
+            //获取所有子集节点,并遍历子集节点计算出所有数据信息
+            for (Office officeInfo : officeList) {
+                officeId.add(officeInfo.getId());
+                info.setOfficeIdList(officeId);
+            }
+        }
+        List<StatementCompanyComprehensiveInfo> list = Lists.newArrayList();
+
+        if("0".equals(info.getBigDateType())){
+
+            list =  dao.selectAllByTypeByYear(info);
+        }else{
+            list = dao.selectAllByType(info);
+            Boolean flag = true;
+            String statementDate = "";
+            for (StatementCompanyComprehensiveInfo comprehensiveInfo : list) {
+                statementDate = comprehensiveInfo.getStatementDate();
+                if("工程五部".equals(comprehensiveInfo.getOfficeName()) && "1".equals(info.getType())){
+                    flag = false;
+                    StatementCompanyComprehensiveInfo statementCompanyComprehensiveInfo = dao.selectAllWbByType(comprehensiveInfo);
+                    statementCompanyComprehensiveInfo.setYear(info.getYear());
+                    statementCompanyComprehensiveInfo.setType(info.getType());
+                    statementCompanyComprehensiveInfo.setBigDateType(info.getBigDateType());
+                    statementCompanyComprehensiveInfo.setSmallDateType(info.getSmallDateType());
+                    statementCompanyComprehensiveInfo.setStatementDate(info.getStatementDate());
+                    statementCompanyComprehensiveInfo.setOfficeId(info.getOfficeId());
+
+                    list.add(statementCompanyComprehensiveInfo);
+                }
+            }
+            if(flag && "1".equals(info.getType())){
+                StatementCompanyComprehensiveInfo statementCompanyComprehensiveInfo = dao.selectAllWbByType(info);
+                statementCompanyComprehensiveInfo.setYear(info.getYear());
+                statementCompanyComprehensiveInfo.setType(info.getType());
+                statementCompanyComprehensiveInfo.setBigDateType(info.getBigDateType());
+                statementCompanyComprehensiveInfo.setSmallDateType(info.getSmallDateType());
+                statementCompanyComprehensiveInfo.setStatementDate(statementDate);
+                Office office = officeService.getByName("工程五部");
+                statementCompanyComprehensiveInfo.setOfficeId(office.getId());
+                statementCompanyComprehensiveInfo.setOfficeName(office.getName());
+
+                list.add(statementCompanyComprehensiveInfo);
+            }
+        }
         return list;
     }
 
 //根据公司级报告查询所有的表内容
     public List<StatementCompanyComprehensiveInfo> selectAllByTypeInYearReport(StatementCompanyComprehensiveInfo info){
         info.setBigDateType("0");
+        //对五部数据单独处理
+        //查询五部的所有部门
+        if("1".equalsIgnoreCase(info.getType())){
+            List<Office> officeList = dao.getAllWBChildrenOfficeListInfo("工程五部");
+
+            List<String> officeId = Lists.newArrayList();
+            //获取所有子集节点,并遍历子集节点计算出所有数据信息
+            for (Office officeInfo : officeList) {
+                officeId.add(officeInfo.getId());
+                info.setOfficeIdList(officeId);
+            }
+        }
         List<StatementCompanyComprehensiveInfo> list = dao.selectAllByTypeByYear(info);
+
+        StatementCompanyComprehensiveInfo childrenInfo = dao.selectAllByTypeByYearAndOfficeId(info);
+
+        if(null != childrenInfo){
+            for (StatementCompanyComprehensiveInfo comprehensiveInfo : list) {
+                if("工程五部".equalsIgnoreCase(comprehensiveInfo.getOfficeName())){
+                    comprehensiveInfo.setField1(childrenInfo.getField1());
+                    comprehensiveInfo.setField2(childrenInfo.getField2());
+                    comprehensiveInfo.setField3(childrenInfo.getField3());
+                    comprehensiveInfo.setField4(childrenInfo.getField4());
+                    comprehensiveInfo.setField5(childrenInfo.getField5());
+                    comprehensiveInfo.setField6(childrenInfo.getField6());
+                    comprehensiveInfo.setField7(childrenInfo.getField7());
+                    comprehensiveInfo.setField8(childrenInfo.getField8());
+                    comprehensiveInfo.setField9(childrenInfo.getField9());
+                    comprehensiveInfo.setField10(childrenInfo.getField10());
+                    comprehensiveInfo.setField11(childrenInfo.getField11());
+                    comprehensiveInfo.setField12(childrenInfo.getField12());
+                    comprehensiveInfo.setField13(childrenInfo.getField13());
+                    comprehensiveInfo.setField14(childrenInfo.getField14());
+                    comprehensiveInfo.setField15(childrenInfo.getField15());
+                    comprehensiveInfo.setField16(childrenInfo.getField16());
+                }
+            }
+        }
+
         return list;
     }
 

+ 12 - 12
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml

@@ -6257,7 +6257,7 @@ GROUP BY
 				and pmdr.id is null
 				and a.over_record_status = 1
 				<if test="statementCompanyComprehensiveInfo.officeId != null and statementCompanyComprehensiveInfo.officeId !=''">
-					and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId})
+					and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId}  ${ruralProjectRecords.sqlMap.officeId})
 				</if>
 			</if>
 			<if test="statementCompanyComprehensiveInfo.field6 == '5'.toString() ">
@@ -6265,7 +6265,7 @@ GROUP BY
 				and pmdr.id is null
 				and a.over_record_status = 1
 				<if test="statementCompanyComprehensiveInfo.officeId != null and statementCompanyComprehensiveInfo.officeId !=''">
-					and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId})
+					and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId}  ${ruralProjectRecords.sqlMap.officeId})
 				</if>
 				and prr.status = 7
 				and prr.del_flag = 0
@@ -6278,14 +6278,14 @@ GROUP BY
 				and a.reported_state != 10
 				and a.reported_state != 11
 				<if test="statementCompanyComprehensiveInfo.officeId != null and statementCompanyComprehensiveInfo.officeId !=''">
-					and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId})
+					and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId}  ${ruralProjectRecords.sqlMap.officeId})
 				</if>
 			</if>
 			<if test="statementCompanyComprehensiveInfo.field8 == '5'.toString() ">
 				and a.reported_state = 7
 				and a.over_due_status = 1
 				<if test="statementCompanyComprehensiveInfo.officeId != null and statementCompanyComprehensiveInfo.officeId !=''">
-					and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId})
+					and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId}  ${ruralProjectRecords.sqlMap.officeId})
 				</if>
 				and rprr.report_status = 5
 				and rprr.del_flag = 0
@@ -6299,7 +6299,7 @@ GROUP BY
 				AND a.paper_filing_status != '11'
 				and a.over_paper_filing_status = 1
 				<if test="statementCompanyComprehensiveInfo.officeId != null and statementCompanyComprehensiveInfo.officeId !=''">
-					and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId})
+					and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId}  ${ruralProjectRecords.sqlMap.officeId})
 				</if>
 				and pmdr.id is null
 			</if>
@@ -6307,7 +6307,7 @@ GROUP BY
 				and a.submit_money = 2
 				and a.paper_filing_status = 7
 				<if test="statementCompanyComprehensiveInfo.officeId != null and statementCompanyComprehensiveInfo.officeId !=''">
-					and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId})
+					and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId}  ${ruralProjectRecords.sqlMap.officeId})
 				</if>
 				and ppf.status = 7
 				and ppf.del_flag = 0
@@ -6461,7 +6461,7 @@ GROUP BY
 				and pmdr.id is null
 				and a.over_record_status = 1
 				<if test="statementCompanyComprehensiveInfo.officeId != null and statementCompanyComprehensiveInfo.officeId !=''">
-					and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId})
+					and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId}  ${ruralProjectRecords.sqlMap.officeId})
 				</if>
 			</if>
 			<if test="statementCompanyComprehensiveInfo.field6 == '5'.toString() ">
@@ -6469,7 +6469,7 @@ GROUP BY
 				and pmdr.id is null
 				and a.over_record_status = 1
 				<if test="statementCompanyComprehensiveInfo.officeId != null and statementCompanyComprehensiveInfo.officeId !=''">
-					and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId})
+					and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId}  ${ruralProjectRecords.sqlMap.officeId})
 				</if>
 				and prr.status = 7
 				and prr.del_flag = 0
@@ -6482,14 +6482,14 @@ GROUP BY
 				and a.reported_state != 10
 				and a.reported_state != 11
 				<if test="statementCompanyComprehensiveInfo.officeId != null and statementCompanyComprehensiveInfo.officeId !=''">
-					and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId})
+					and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId}  ${ruralProjectRecords.sqlMap.officeId})
 				</if>
 			</if>
 			<if test="statementCompanyComprehensiveInfo.field8 == '5'.toString() ">
 				and a.reported_state = 7
 				and a.over_due_status = 1
 				<if test="statementCompanyComprehensiveInfo.officeId != null and statementCompanyComprehensiveInfo.officeId !=''">
-					and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId})
+					and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId}  ${ruralProjectRecords.sqlMap.officeId})
 				</if>
 				and rprr.report_status = 5
 				and rprr.del_flag = 0
@@ -6503,7 +6503,7 @@ GROUP BY
 				AND a.paper_filing_status != '11'
 				and a.over_paper_filing_status = 1
 				<if test="statementCompanyComprehensiveInfo.officeId != null and statementCompanyComprehensiveInfo.officeId !=''">
-					and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId})
+					and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId}  ${ruralProjectRecords.sqlMap.officeId})
 				</if>
 				and pmdr.id is null
 			</if>
@@ -6511,7 +6511,7 @@ GROUP BY
 				and a.submit_money = 2
 				and a.paper_filing_status = 7
 				<if test="statementCompanyComprehensiveInfo.officeId != null and statementCompanyComprehensiveInfo.officeId !=''">
-					and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId})
+					and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId}  ${ruralProjectRecords.sqlMap.officeId})
 				</if>
 				and ppf.status = 7
 				and ppf.del_flag = 0

+ 93 - 0
src/main/resources/mappings/modules/statement/StatementCompanyComprehensiveDao.xml

@@ -1597,6 +1597,49 @@
 			and a.big_date_type = #{bigDateType}
 			and a.year = #{year}
 			and a.small_date_type = #{smallDateType}
+
+			<if test="officeIdList!=null and officeIdList.size!=0">
+			and a.office_id not in
+			<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
+				#{officeId}
+			</foreach>
+			</if>
+		</where>
+	</select>
+
+	<select id="selectAllWbByType" parameterType="StatementCompanyComprehensiveInfo" resultType="StatementCompanyComprehensiveInfo">
+		select
+
+		sum(a.field1) as "field1",
+		sum(a.field2) as "field2",
+		sum(a.field3) as "field3",
+		sum(a.field4) as "field4",
+		sum(a.field5) as "field5",
+		sum(a.field6) as "field6",
+		sum(a.field7) as "field7",
+		sum(a.field8) as "field8",
+		sum(a.field9) as "field9",
+		sum(a.field10) as "field10",
+		sum(a.field11) as "field11",
+		sum(a.field12) as "field12",
+		sum(a.field13) as "field13",
+		sum(a.field14) as "field14",
+		sum(a.field15) as "field15",
+		sum(a.field16) as "field16"
+		from statement_company_comprehensive_info a
+		<where>
+			a.type = #{type}
+			and a.del_flag = 0
+			and a.big_date_type = #{bigDateType}
+			and a.year = #{year}
+			and a.small_date_type = #{smallDateType}
+
+			<if test="officeIdList!=null and officeIdList.size!=0">
+			and a.office_id in
+			<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
+				#{officeId}
+			</foreach>
+			</if>
 		</where>
 	</select>
 
@@ -1636,10 +1679,18 @@
 			and a.big_date_type = #{bigDateType}
 			and a.year = #{year}
 			and a.small_date_type = #{smallDateType}
+
+			<if test="officeIdList!=null and officeIdList.size!=0">
+				and a.office_id not in
+				<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
+					#{officeId}
+				</foreach>
+			</if>
 		</where>
 	</select>
 
 
+
 	<select id="selectAllByTypeInYearReport" parameterType="StatementCompanyComprehensiveInfo" resultType="StatementCompanyComprehensiveInfo">
 		select
 		a.id as "id",
@@ -2534,4 +2585,46 @@
 		group by a.office_id
 	</select>
 
+	<select id="getAllWBChildrenOfficeListInfo" resultType="Office">
+		select * from sys_office where parent_id = (select id from sys_office where name = #{officeName})
+	</select>
+
+
+
+
+	<select id="selectAllByTypeByYearAndOfficeId" parameterType="StatementCompanyComprehensiveInfo" resultType="StatementCompanyComprehensiveInfo">
+		select
+		sum(a.field1) as "field1",
+		sum(a.field2) as "field2",
+		sum(a.field3) as "field3",
+		sum(a.field4) as "field4",
+		sum(a.field5) as "field5",
+		sum(a.field6) as "field6",
+		sum(a.field7) as "field7",
+		sum(a.field8) as "field8",
+		sum(a.field9) as "field9",
+		sum(a.field10) as "field10",
+		sum(a.field11) as "field11",
+		sum(a.field12) as "field12",
+		sum(a.field13) as "field13",
+		sum(a.field14) as "field14",
+		sum(a.field15) as "field15",
+		sum(a.field16) as "field16"
+		from statement_company_comprehensive_info2 a
+		<where>
+			a.type = #{type}
+			and a.del_flag = 0
+			and a.big_date_type = #{bigDateType}
+			and a.year = #{year}
+			and a.small_date_type = #{smallDateType}
+			<if test="officeIdList!=null and officeIdList.size!=0">
+			and a.office_id in
+			<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
+				#{officeId}
+			</foreach>
+		</if>
+
+		</where>
+	</select>
+
 </mapper>