|
@@ -20,6 +20,7 @@ import com.rtrh.projects.modules.rolemeun.po.SecRole;
|
|
|
import com.rtrh.projects.modules.system.dao.TSystableDao;
|
|
|
import com.rtrh.projects.modules.system.po.*;
|
|
|
import com.rtrh.projects.modules.utils.DateUtils;
|
|
|
+import com.rtrh.projects.util.TargetDataSource;
|
|
|
import com.rtrh.projects.vo.SubIdVO;
|
|
|
import com.rtrh.projects.vo.subject.SubinfoPreQueryVo;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -1024,7 +1025,7 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
|
|
|
@Override
|
|
|
public Page pageQueryReportListSql(Page page, LoginUserVO loginUserVO, String subName, String unitId, String kind, String status, String statusSp,
|
|
|
- String propKind, String indusKind, Date beginDate, Date endDate) {
|
|
|
+ String propKind, String indusKind, Date beginDate, Date endDate, List<String> subInfoIds) {
|
|
|
|
|
|
StringBuffer sql = new StringBuffer();
|
|
|
sql.append(" select a.id,a.status ,a.sub_name subName,a.amt_total amtTotal,a.begin_date beginDate,a.end_date endDate,ju.title unitName,ts.title subjectName, ts1.title indusKindName ");
|
|
@@ -1038,6 +1039,17 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
|
|
|
sql.append(" where a.logic_delete_flag =0 ");
|
|
|
|
|
|
+ // 处理 subInfoIds 参数
|
|
|
+ if (subInfoIds != null && !subInfoIds.isEmpty()) {
|
|
|
+ String idListStr = subInfoIds.stream()
|
|
|
+ .map(id -> "'" + id + "'") // 每个 ID 加单引号
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
+ sql.append(" and a.id in (").append(idListStr).append(") ");
|
|
|
+ }else {
|
|
|
+ sql.append(" and a.id in ( ) ");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
//2024-03-28客户提出admin用户需查询和储备台账一样的数据
|
|
|
SecRole role = secRoleDao.findById(loginUserVO.getKind());
|
|
@@ -3090,7 +3102,12 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Page pageQueryRreDepartment(Page page, SubinfoPreQueryVo queryVO, LoginUserVO loginUser) throws Exception {
|
|
|
+ public Page pageQueryRreDepartment(Page page, SubinfoPreQueryVo queryVO, LoginUserVO loginUser, List<String> subInfoIds) throws Exception {
|
|
|
+
|
|
|
+ // 将 List 转换为 SQL 中的 IN 语句---只查询工信局项目库中的数据
|
|
|
+ String subIdFilter = subInfoIds.stream()
|
|
|
+ .map(id -> "'" + id + "'") // 每个 id 加上单引号
|
|
|
+ .collect(Collectors.joining(", ")); // 逗号拼接
|
|
|
|
|
|
if (StringUtil.isEmpty(queryVO.getBeginDate())) {
|
|
|
queryVO.setBeginDate("200001"); //默认设置一个开始时间
|
|
@@ -3181,7 +3198,7 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
"\tWHERE\n" +
|
|
|
"\t\to.`status` =1 \n" +
|
|
|
" \t\t and o.sub_unit_id is not null" +
|
|
|
- " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
|
|
|
+ " AND o.sub_id IN (" + subIdFilter + ")" +
|
|
|
"\t\tAND o.status_conf >=1 \n" +
|
|
|
"\t\tAND o.status_conf !=3 \n" +
|
|
|
"\t\tAND o.logic_delete_flag = 0 \n" +
|
|
@@ -3207,7 +3224,7 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
"\t\tAND o.status_conf >= 1 \n" +
|
|
|
"\t\tAND o.logic_delete_flag = 0 \n" +
|
|
|
" \t\t and o.sub_unit_id is not null" +
|
|
|
- " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
|
|
|
+ " AND o.sub_id IN (" + subIdFilter + ")" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getTBeginDate() + "\" \n" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getTEndDate() + "\" \n" +
|
|
|
this.getWhereSql(queryVO) +
|
|
@@ -3240,7 +3257,7 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
"\t\t\tAND o.status_conf >= 1 \n" +
|
|
|
"\t\t\tAND o.logic_delete_flag = 0 \n" +
|
|
|
" \t\t and o.sub_unit_id is not null" +
|
|
|
- " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
|
|
|
+ " AND o.sub_id IN (" + subIdFilter + ")" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getBeginDate() + "\" \n" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getEndDate() + "\" \n" +
|
|
|
this.getWhereSql(queryVO) +
|
|
@@ -3267,7 +3284,7 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
"\t\tAND o.status_conf >=1 \n" +
|
|
|
"\t\tAND o.logic_delete_flag = 0 \n" +
|
|
|
" \t\t and o.sub_unit_id is not null" +
|
|
|
- " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
|
|
|
+ " AND o.sub_id IN (" + subIdFilter + ")" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getHBeginDate() + "\" \n" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getHEndDate() + "\" \n" +
|
|
|
this.getWhereSql(queryVO) +
|
|
@@ -3320,7 +3337,12 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public Page pageQueryRreFile(Page page, SubinfoPreQueryVo queryVO, LoginUserVO loginUser) throws Exception {
|
|
|
+ public Page pageQueryRreFile(Page page, SubinfoPreQueryVo queryVO, LoginUserVO loginUser, List<String> subInfoIds) throws Exception {
|
|
|
+
|
|
|
+ // 将 List 转换为 SQL 中的 IN 语句---只查询工信局项目库中的数据
|
|
|
+ String subIdFilter = subInfoIds.stream()
|
|
|
+ .map(id -> "'" + id + "'") // 每个 id 加上单引号
|
|
|
+ .collect(Collectors.joining(", ")); // 逗号拼接
|
|
|
|
|
|
if (StringUtil.isEmpty(queryVO.getBeginDate())) {
|
|
|
queryVO.setBeginDate("200001"); //默认设置一个开始时间
|
|
@@ -3411,7 +3433,7 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
"\tWHERE\n" +
|
|
|
"\t\to.`status` =1 \n" +
|
|
|
" \t\t and o.sub_unit_id is not null" +
|
|
|
- " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
|
|
|
+ " AND o.sub_id IN (" + subIdFilter + ")" +
|
|
|
"\t\tAND o.status_conf >=1 \n" +
|
|
|
"\t\tAND o.status_conf !=3 \n" +
|
|
|
"\t\tAND o.logic_delete_flag = 0 \n" +
|
|
@@ -3437,7 +3459,7 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
"\t\tAND o.status_conf >= 1 \n" +
|
|
|
"\t\tAND o.logic_delete_flag = 0 \n" +
|
|
|
" \t\t and o.sub_unit_id is not null" +
|
|
|
- " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
|
|
|
+ " AND o.sub_id IN (" + subIdFilter + ")" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getTBeginDate() + "\" \n" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getTEndDate() + "\" \n" +
|
|
|
this.getWhereSql(queryVO) +
|
|
@@ -3469,7 +3491,7 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
"\t\t\tAND o.status_conf >= 1 \n" +
|
|
|
"\t\t\tAND o.logic_delete_flag = 0 \n" +
|
|
|
" \t\t and o.sub_unit_id is not null" +
|
|
|
- " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
|
|
|
+ " AND o.sub_id IN (" + subIdFilter + ")" +
|
|
|
"\t\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getBeginDate() + "\" \n" +
|
|
|
"\t\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getEndDate() + "\" \n" +
|
|
|
this.getWhereSql(queryVO) +
|
|
@@ -3497,7 +3519,7 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
"\t\tAND o.status_conf >=1 \n" +
|
|
|
"\t\tAND o.logic_delete_flag = 0 \n" +
|
|
|
" \t\t and o.sub_unit_id is not null" +
|
|
|
- " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
|
|
|
+ " AND o.sub_id IN (" + subIdFilter + ")" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getHBeginDate() + "\" \n" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getHEndDate() + "\" \n" +
|
|
|
this.getWhereSql(queryVO) +
|
|
@@ -3515,7 +3537,13 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public Page pageQueryRreProject(Page page, SubinfoPreQueryVo queryVO, LoginUserVO loginUser) throws Exception {
|
|
|
+ public Page pageQueryRreProject(Page page, SubinfoPreQueryVo queryVO, LoginUserVO loginUser, List<String> subInfoIds) throws Exception {
|
|
|
+
|
|
|
+ // 将 List 转换为 SQL 中的 IN 语句---只查询工信局项目库中的数据
|
|
|
+ String subIdFilter = subInfoIds.stream()
|
|
|
+ .map(id -> "'" + id + "'") // 每个 id 加上单引号
|
|
|
+ .collect(Collectors.joining(", ")); // 逗号拼接
|
|
|
+
|
|
|
|
|
|
if (StringUtil.isEmpty(queryVO.getBeginDate())) {
|
|
|
queryVO.setBeginDate("200001"); //默认设置一个开始时间
|
|
@@ -3582,7 +3610,8 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
"\t\tWHERE\n" +
|
|
|
"\t\t\to.logic_delete_flag = 0 \n" +
|
|
|
" \t\t and o.sub_unit_id is not null" +
|
|
|
- " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
|
|
|
+ " AND o.sub_id IN (" + subIdFilter + ")" +
|
|
|
+ " AND s.id IN (" + subIdFilter + ")" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getBeginDate() + "\" \n" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getEndDate() + "\" \n" +
|
|
|
this.getWhereSql(queryVO) +
|
|
@@ -3620,7 +3649,8 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
"\t\t\t\tAND o.status_conf != 3 \n" +
|
|
|
"\t\t\t\tAND o.logic_delete_flag = 0 \n" +
|
|
|
" \t\t and o.sub_unit_id is not null" +
|
|
|
- " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
|
|
|
+ " AND o.sub_id IN (" + subIdFilter + ")" +
|
|
|
+ " AND s.id IN (" + subIdFilter + ")" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getBeginDate() + "\" \n" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getEndDate() + "\" \n" +
|
|
|
this.getWhereSql(queryVO) +
|
|
@@ -3635,6 +3665,7 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
"\t\t) file ON a.id = file.sub_id \n" +
|
|
|
"\tWHERE\n" +
|
|
|
"\t\ta.logic_delete_flag = 0 \n" +
|
|
|
+ " AND a.id IN (" + subIdFilter + ")" +
|
|
|
"\t) a \n" +
|
|
|
"WHERE\n" +
|
|
|
"\ta.sub_id IS NOT NULL");
|
|
@@ -3648,7 +3679,12 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public Object sumDepartment(SubinfoPreQueryVo queryVO, LoginUserVO loginUser) throws Exception {
|
|
|
+ public Object sumDepartment(SubinfoPreQueryVo queryVO, LoginUserVO loginUser, List<String> subInfoIds) throws Exception {
|
|
|
+
|
|
|
+ // 将 List 转换为 SQL 中的 IN 语句---只查询工信局项目库中的数据
|
|
|
+ String subIdFilter = subInfoIds.stream()
|
|
|
+ .map(id -> "'" + id + "'") // 每个 id 加上单引号
|
|
|
+ .collect(Collectors.joining(", ")); // 逗号拼接
|
|
|
|
|
|
if (StringUtil.isEmpty(queryVO.getBeginDate())) {
|
|
|
queryVO.setBeginDate("200001"); //默认设置一个开始时间
|
|
@@ -3762,7 +3798,7 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
"\tWHERE\n" +
|
|
|
"\t\to.`status` =1 \n" +
|
|
|
" \t\t and o.sub_unit_id is not null" +
|
|
|
- " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
|
|
|
+ " AND o.sub_id IN (" + subIdFilter + ")" +
|
|
|
"\t\tAND o.status_conf >=1 \n" +
|
|
|
"\t\tAND o.logic_delete_flag = 0 \n" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getBeginDate() + "\" \n" +
|
|
@@ -3787,7 +3823,7 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
"\t\tAND o.status_conf >= 1 \n" +
|
|
|
"\t\tAND o.logic_delete_flag = 0 \n" +
|
|
|
" \t\t and o.sub_unit_id is not null" +
|
|
|
- " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
|
|
|
+ " AND o.sub_id IN (" + subIdFilter + ")" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getTBeginDate() + "\" \n" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getTEndDate() + "\" \n" +
|
|
|
this.getWhereSql(queryVO) +
|
|
@@ -3820,7 +3856,7 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
"\t\t\tAND o.status_conf >= 1 \n" +
|
|
|
"\t\t\tAND o.logic_delete_flag = 0 \n" +
|
|
|
" \t\t and o.sub_unit_id is not null" +
|
|
|
- " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
|
|
|
+ " AND o.sub_id IN (" + subIdFilter + ")" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getBeginDate() + "\" \n" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getEndDate() + "\" \n" +
|
|
|
this.getWhereSql(queryVO) +
|
|
@@ -3847,7 +3883,7 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
"\t\tAND o.status_conf >=1 \n" +
|
|
|
"\t\tAND o.logic_delete_flag = 0 \n" +
|
|
|
" \t\t and o.sub_unit_id is not null" +
|
|
|
- " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
|
|
|
+ " AND o.sub_id IN (" + subIdFilter + ")" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getHBeginDate() + "\" \n" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getHEndDate() + "\" \n" +
|
|
|
this.getWhereSql(queryVO) +
|
|
@@ -3866,7 +3902,12 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public Object sumFile(SubinfoPreQueryVo queryVO, LoginUserVO loginUser) throws Exception {
|
|
|
+ public Object sumFile(SubinfoPreQueryVo queryVO, LoginUserVO loginUser, List<String> subInfoIds) throws Exception {
|
|
|
+
|
|
|
+ // 将 List 转换为 SQL 中的 IN 语句---只查询工信局项目库中的数据
|
|
|
+ String subIdFilter = subInfoIds.stream()
|
|
|
+ .map(id -> "'" + id + "'") // 每个 id 加上单引号
|
|
|
+ .collect(Collectors.joining(", ")); // 逗号拼接
|
|
|
|
|
|
if (StringUtil.isEmpty(queryVO.getBeginDate())) {
|
|
|
queryVO.setBeginDate("200001"); //默认设置一个开始时间
|
|
@@ -3982,7 +4023,7 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
"\t\tAND o.status_conf >=1 \n" +
|
|
|
"\t\tAND o.status_conf !=3 \n" +
|
|
|
" \t\t and o.sub_unit_id is not null" +
|
|
|
- " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
|
|
|
+ " AND o.sub_id IN (" + subIdFilter + ")" +
|
|
|
"\t\tAND o.logic_delete_flag = 0 \n" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getBeginDate() + "\" \n" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getEndDate() + "\" \n" +
|
|
@@ -4006,7 +4047,7 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
"\t\tAND o.status_conf >= 1 \n" +
|
|
|
"\t\tAND o.logic_delete_flag = 0 \n" +
|
|
|
" \t\t and o.sub_unit_id is not null" +
|
|
|
- " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
|
|
|
+ " AND o.sub_id IN (" + subIdFilter + ")" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getTBeginDate() + "\" \n" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getTEndDate() + "\" \n" +
|
|
|
this.getWhereSql(queryVO) +
|
|
@@ -4038,7 +4079,7 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
"\t\t\tAND o.status_conf >= 1 \n" +
|
|
|
"\t\t\tAND o.logic_delete_flag = 0 \n" +
|
|
|
" \t\t and o.sub_unit_id is not null" +
|
|
|
- " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
|
|
|
+ " AND o.sub_id IN (" + subIdFilter + ")" +
|
|
|
"\t\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getBeginDate() + "\" \n" +
|
|
|
"\t\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getEndDate() + "\" \n" +
|
|
|
this.getWhereSql(queryVO) +
|
|
@@ -4065,7 +4106,7 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
"\t\tAND o.status_conf >=1 \n" +
|
|
|
"\t\tAND o.logic_delete_flag = 0 \n" +
|
|
|
" \t\t and o.sub_unit_id is not null" +
|
|
|
- " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
|
|
|
+ " AND o.sub_id IN (" + subIdFilter + ")" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getHBeginDate() + "\" \n" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getHEndDate() + "\" \n" +
|
|
|
this.getWhereSql(queryVO) +
|
|
@@ -4083,7 +4124,12 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public Object sumProject(SubinfoPreQueryVo queryVO, LoginUserVO loginUser) throws Exception {
|
|
|
+ public Object sumProject(SubinfoPreQueryVo queryVO, LoginUserVO loginUser, List<String> subInfoIds) throws Exception {
|
|
|
+
|
|
|
+ // 将 List 转换为 SQL 中的 IN 语句---只查询工信局项目库中的数据
|
|
|
+ String subIdFilter = subInfoIds.stream()
|
|
|
+ .map(id -> "'" + id + "'") // 每个 id 加上单引号
|
|
|
+ .collect(Collectors.joining(", ")); // 逗号拼接
|
|
|
|
|
|
if (StringUtil.isEmpty(queryVO.getBeginDate())) {
|
|
|
queryVO.setBeginDate("200001"); //默认设置一个开始时间
|
|
@@ -4136,6 +4182,7 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getBeginDate() + "\" \n" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getEndDate() + "\" \n" +
|
|
|
this.getWhereSql(queryVO) +
|
|
|
+ "\t\tAND s.id IN (" + subIdFilter + ") \n" + // 添加筛选条件
|
|
|
"\t\t\tGROUP BY\n" +
|
|
|
"\t\t\t\tsub_id,\n" +
|
|
|
"\t\t\t\tsub_unit_id \n" +
|
|
@@ -4211,15 +4258,17 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
"\t\t\tWHERE\n" +
|
|
|
"\t\t\t\to.logic_delete_flag = 0 \n" +
|
|
|
"\t\t\t\tAND o.sub_unit_id IS NOT NULL \n" +
|
|
|
- " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
|
|
|
+ " AND o.sub_id IN (" + subIdFilter + ")" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getBeginDate() + "\" \n" +
|
|
|
"\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getEndDate() + "\" \n" +
|
|
|
this.getWhereSql(queryVO) +
|
|
|
+ "\t\t\tAND s.id IN (" + subIdFilter + ") \n" + // 添加筛选条件
|
|
|
"\t\t\tGROUP BY\n" +
|
|
|
"\t\t\t\to.sub_id \n" +
|
|
|
"\t\t\t) bt ON a.id = bt.sub_id \n" +
|
|
|
"\t\tWHERE\n" +
|
|
|
"\t\t\ta.logic_delete_flag = 0 \n" +
|
|
|
+ "\t\t\tAND a.id IN (" + subIdFilter + ") \n" + // 添加筛选条件
|
|
|
"\t\t) a \n" +
|
|
|
"\tWHERE\n" +
|
|
|
"\ta.sub_id IS NOT NULL \n" +
|
|
@@ -4663,6 +4712,12 @@ public class SubInfoServiceImpl implements SubInfoService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @TargetDataSource("secondary")
|
|
|
+ @Override
|
|
|
+ public List<String> selectAllSubInfoIds() {
|
|
|
+ return subInfoMapper.selectAllSubInfoIds();
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public List<SubLabel> getSubLabels(SubLabelAddVO vo) {
|
|
|
List<SubLabel> labelList = subLabelDao.findByCon(vo);
|