Просмотр исходного кода

modify:

1. 适配改造修改;
tags/24080901
WendyYang 3 месяцев назад
Родитель
Сommit
6b6bc6929f
2 измененных файлов: 24 добавлений и 3 удалений
  1. +22
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/common/model/constant/ExistsSqlConst.java
  2. +2
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java

+ 22
- 0
hz-pm-api/src/main/java/com/hz/pm/api/common/model/constant/ExistsSqlConst.java Просмотреть файл

@@ -0,0 +1,22 @@
package com.hz.pm.api.common.model.constant;

/**
* <p>
* ExistsSqlConst
* </p>
*
* @author WendyYang
* @since 15:38 2024/8/8
*/
public class ExistsSqlConst {

private ExistsSqlConst() {
}

public static final String PURCHASE_EXISTS_PROJECT = " select 1 from nd_project np where np.id = nd_purchase.project_id ";

public static final String PROJECT_EXISTS_PURCHASE = " select 1 from nd_purchase np where nd_project.id = np.project_id ";

public static final String PURCHASE_EXISTS_OPERATION = " select 1 from nd_project_operation npo where npo.bid_id = nd_purchase.id ";

}

+ 2
- 3
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java Просмотреть файл

@@ -485,12 +485,11 @@ public class PurchaseManage {
.ge(req.getCreateOnMin() != null, Purchase::getCreateOn, req.getCreateOnMin())
.eq(req.getStatus() != null, function, req.getStatus())
.notExists(ExistsSqlConst.PURCHASE_EXISTS_PROJECT
+ "and np.stage != {0}", ProjectStatus.STOPPED)
+ "and np.stage != {0}", ProjectStatus.STOPPED.getCode())
.isNotNull(function)
.orderByDesc(Purchase::getCreateOn);
boolean display = !Boolean.FALSE.equals(req.getDisplay());
String existsSql = String.format("select 1 from nd_project_operation no" +
" where no.bid_id = nd_purchase.id and no.%s is not null", actualTimeColumn);
String existsSql = String.format(ExistsSqlConst.PURCHASE_EXISTS_OPERATION + " and npo.%s is not null", actualTimeColumn);
if (display) {
query.and(q1 -> q1.eq(Purchase::getBidType, BidTypeEnum.BUILD_APP.getCode())
.or(q2 -> q2.exists(existsSql)));


Загрузка…
Отмена
Сохранить