Browse Source

modify:

1. 适配改造修改;
tags/24080901
WendyYang 1 month ago
parent
commit
6b6bc6929f
2 changed files with 24 additions and 3 deletions
  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 View File

@@ -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 View File

@@ -485,12 +485,11 @@ public class PurchaseManage {
.ge(req.getCreateOnMin() != null, Purchase::getCreateOn, req.getCreateOnMin()) .ge(req.getCreateOnMin() != null, Purchase::getCreateOn, req.getCreateOnMin())
.eq(req.getStatus() != null, function, req.getStatus()) .eq(req.getStatus() != null, function, req.getStatus())
.notExists(ExistsSqlConst.PURCHASE_EXISTS_PROJECT .notExists(ExistsSqlConst.PURCHASE_EXISTS_PROJECT
+ "and np.stage != {0}", ProjectStatus.STOPPED)
+ "and np.stage != {0}", ProjectStatus.STOPPED.getCode())
.isNotNull(function) .isNotNull(function)
.orderByDesc(Purchase::getCreateOn); .orderByDesc(Purchase::getCreateOn);
boolean display = !Boolean.FALSE.equals(req.getDisplay()); 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) { if (display) {
query.and(q1 -> q1.eq(Purchase::getBidType, BidTypeEnum.BUILD_APP.getCode()) query.and(q1 -> q1.eq(Purchase::getBidType, BidTypeEnum.BUILD_APP.getCode())
.or(q2 -> q2.exists(existsSql))); .or(q2 -> q2.exists(existsSql)));


Loading…
Cancel
Save