修改查询除了非改项目下标准的数据

This commit is contained in:
zhangjun
2022-09-08 13:25:17 +08:00
parent 83f36cc913
commit 8b82bfac9f
@@ -460,9 +460,13 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
//cars传回值为1时判断是从车型项目库中调取
QueryWrapper<SarStandardsInfo> wrapper1 = new QueryWrapper<>();
wrapper1.select("ID","STAND_NUMBER","STAND_SORT","STAND_YEAR","STAND_NAME","STAND_EN_NAME","TEXT_STATUS","STAND_TYPE","ISSUE_TIME","(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 ",
wrapper1.select("ID","STAND_NUMBER","STAND_SORT","STAND_YEAR","STAND_NAME","STAND_EN_NAME","TEXT_STATUS","STAND_TYPE","ISSUE_TIME",
"(select count(*) from sar_stand_unqualified ssu " +
"inner join sar_stand_project_library pn on pn.project_number = ssu.product_id" +
" where ssu.STAND_ID = r.stand_id and ssu.CLOSE_STATE = '1' and pn.id = '" + standId + "') as unCount ",
"(select count(*) from sar_stand_unqualified ssu " +
"inner join sar_stand_project_library pn on pn.project_number = ssu.product_id" +
" where ssu.STAND_ID = r.stand_id and ssu.CLOSE_STATE = '2' and pn.id = '" + standId + "') 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 + "'" +
@@ -477,8 +481,12 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
"TEXT_STATUS_BUSS as TEXT_STATUS," +
"'BUSINESS_STAND' as STAND_TYPE," +
"ISSUE_TIME,"+
"( 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 count(*) from sar_stand_unqualified ssu " +
"inner join sar_stand_project_library pn on pn.project_number = ssu.product_id" +
" where ssu.STAND_ID = r.stand_id and ssu.CLOSE_STATE = '1' and pn.id = '" + standId + "') as unCount, "+
"(select count(*) from sar_stand_unqualified ssu " +
"inner join sar_stand_project_library pn on pn.project_number = ssu.product_id" +
" where ssu.STAND_ID = r.stand_id and ssu.CLOSE_STATE = '2' and pn.id = '" + standId + "') as counts, "+
"(" +
"SELECT " +
"GROUP_CONCAT( DISTINCT DATE_FORMAT( PLAN_CLOSE_TIME, '%Y-%m-%d' ) ORDER BY PLAN_CLOSE_TIME ) " +