This commit is contained in:
zhangjun
2022-08-23 13:46:28 +08:00
parent aa13451ac6
commit 819d937d72
@@ -465,7 +465,34 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
" where STAND_ID = r.stand_id and CLOSE_STATE = '2' ) as counts ",
"(select GROUP_CONCAT( DISTINCT DATE_FORMAT( PLAN_CLOSE_TIME, '%Y-%m-%d' ) ORDER BY PLAN_CLOSE_TIME ) from sar_stand_unqualified where " +
" STAND_ID = r.stand_id and CLOSE_STATE = '1' AND PLAN_CLOSE_TIME is NOT NULL ) as endTimes ");
wrapper1.last("INNER JOIN sar_stand_project_relation r ON r.stand_id = sar_standards_info.ID WHERE r.project_id ='" + standId + "'");
wrapper1.last("INNER JOIN sar_stand_project_relation r ON r.stand_id = sar_standards_info.ID WHERE r.project_id ='" + standId + "'" +
"union all " +
"SELECT " +
"ID," +
"STAND_NUMBER," +
"STAND_SORT," +
"STAND_YEAR," +
"STAND_NAME," +
"STAND_EN_NAME," +
"'' as TEXT_STATUS," +
"'' as STAND_TYPE," +
"( SELECT count( * ) FROM sar_stand_unqualified WHERE STAND_ID = r.stand_id AND CLOSE_STATE = '1' ) AS unCount," +
"( SELECT count( * ) FROM sar_stand_unqualified WHERE STAND_ID = r.stand_id AND CLOSE_STATE = '2' ) AS counts," +
"(" +
"SELECT " +
"GROUP_CONCAT( DISTINCT DATE_FORMAT( PLAN_CLOSE_TIME, '%Y-%m-%d' ) ORDER BY PLAN_CLOSE_TIME ) " +
"FROM " +
"sar_stand_unqualified " +
"WHERE " +
"STAND_ID = r.stand_id " +
"AND CLOSE_STATE = '1' " +
"AND PLAN_CLOSE_TIME IS NOT NULL " +
") AS endTimes " +
"FROM " +
"sar_bussioness_stand " +
"INNER JOIN sar_stand_project_relation r ON r.stand_id = sar_bussioness_stand.ID " +
"WHERE " +
"r.project_id = '" + standId + "'");
Page<SarStandardsInfo> page1 = new Page<>(current, pageSize);
IPage<SarStandardsInfo> userIPage1 = SarStandardsInfoDao.selectPage(page1, wrapper1);
System.out.println("总条数"+userIPage1.getTotal());
@@ -473,7 +500,14 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
QueryWrapper<SarStandAttrInfo> wrapper2 = new QueryWrapper<>();
wrapper2.select("r.STAND_ID","SSRQ","XCXSSRQ","ZCCSSRQ","ZRBM","KCCVPPSBM","KCCVPPSCN","CYCVPPSBM","CYCVPPSCN");
wrapper2.last("INNER JOIN sar_stand_project_relation r ON r.stand_id = sar_stand_attr_info.STAND_ID WHERE r.project_id ='"+ standId+"'");
wrapper2.last("INNER JOIN sar_stand_project_relation r ON r.stand_id = sar_stand_attr_info.STAND_ID " +
"WHERE r.project_id ='"+ standId+"'" +
"union all " +
"SELECT r.STAND_ID,'' as SSRQ,'' as XCXSSRQ,'' as ZCCSSRQ,'' as ZRBM,KCVPPSBMBUSS as KCCVPPSBM," +
"KCVPPSCNBUSS as KCCVPPSCN, CYCVPPSBMBUSS as CYCVPPSBM,CYCVPPSCNBUSS as CYCVPPSCN " +
"FROM sar_buss_stand_attr_info " +
"INNER JOIN sar_stand_project_relation r ON r.stand_id = sar_buss_stand_attr_info.STAND_ID " +
"WHERE r.project_id ='" + standId + "'");
Page<SarStandAttrInfo> page2 = new Page<>(current, pageSize);
IPage<SarStandAttrInfo> userIPage2 = sarStandAttrInfoDao.selectPage(page2, wrapper2);
@@ -569,11 +603,43 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
System.out.println(idmis);
QueryWrapper<SarStandardsInfo> wrapper1 = new QueryWrapper<>();
wrapper1.select("ID","STAND_NUMBER","STAND_NAME","STAND_EN_NAME","STAND_TYPE","STAND_YEAR","STAND_SORT");
wrapper1.last("INNER JOIN sar_stand_project_relation r ON r.stand_id = sar_standards_info.ID WHERE r.stand_id in ("+ idmis +") and r.project_id = '"+ id+"'");
// wrapper1.last("INNER JOIN sar_stand_project_relation r ON r.stand_id = sar_standards_info.ID WHERE r.stand_id in ("+ idmis +") and r.project_id = '"+ id+"'");
wrapper1.last("INNER JOIN sar_stand_project_relation r ON r.stand_id = sar_standards_info.ID WHERE r.stand_id in ("+ idmis +") and r.project_id = '"+ id+"'" +
"union all " +
"SELECT " +
"ID, " +
"STAND_NUMBER, " +
"STAND_NAME, " +
"STAND_EN_NAME, " +
"'' as STAND_TYPE, " +
"STAND_YEAR, " +
"STAND_SORT " +
"FROM " +
"sar_bussioness_stand " +
"INNER JOIN sar_stand_project_relation r ON r.stand_id = sar_bussioness_stand.ID " +
"WHERE " +
"r.stand_id IN ( '5iy8azycsw8vl5tfqckk', 'x0ncqakb4kajf9zdhg2p' ) " +
"AND r.project_id = '5DYWDVEQTNH5PXSP6LWQ'"
// "union all " +
// "SELECT " +
// "ID","STAND_NUMBER","STAND_NAME","STAND_EN_NAME","STAND_TYPE","STAND_YEAR","STAND_SORT" +
// "FROM " +
// "sar_bussioness_stand " +
// "INNER JOIN sar_stand_project_relation r ON r.stand_id = sar_bussioness_stand.ID " +
// "WHERE " +
// "r.project_id = '" + standId + "'"
);
List<SarStandardsInfo> userList1 = SarStandardsInfoDao.selectList(wrapper1);
QueryWrapper<SarStandAttrInfo> wrapper2 = new QueryWrapper<>();
wrapper2.select("r.STAND_ID","SSRQ","XCXSSRQ","ZCCSSRQ","ZRBM","KCCVPPSBM","KCCVPPSCN","CYCVPPSBM","CYCVPPSCN");
wrapper2.last("INNER JOIN sar_stand_project_relation r ON r.stand_id = sar_stand_attr_info.STAND_ID WHERE r.stand_id in ("+ idmis +") and r.project_id = '"+ id+"'");
wrapper2.last("INNER JOIN sar_stand_project_relation r ON r.stand_id = sar_stand_attr_info.STAND_ID " +
"WHERE r.stand_id in ("+ idmis +") and r.project_id = '"+ id+"'" +
"union all " +
"SELECT r.STAND_ID,'' as SSRQ,'' as XCXSSRQ,'' as ZCCSSRQ,'' as ZRBM,KCVPPSBMBUSS as KCCVPPSBM," +
"KCVPPSCNBUSS as KCCVPPSCN, CYCVPPSBMBUSS as CYCVPPSBM,CYCVPPSCNBUSS as CYCVPPSCN " +
"FROM sar_buss_stand_attr_info " +
"INNER JOIN sar_stand_project_relation r ON r.stand_id = sar_buss_stand_attr_info.STAND_ID " +
"WHERE r.stand_id in ("+ idmis +") and r.project_id = '"+ id+"'");
List<SarStandAttrInfo> userList2 = sarStandAttrInfoDao.selectList(wrapper2);
Map<String,Object> map= iDicTypeEOService.getDicTypeListCode();