fix: 优化逻辑
This commit is contained in:
parent
8c2fb08efe
commit
652abf2cb2
@ -1908,11 +1908,11 @@ public class EnvWqDataServiceImpl implements EnvWqDataService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataSourceResult<WbsbVo> getWbsbList(DataSourceRequest dataSourceRequest) {
|
public DataSourceResult<WbsbVo> getWbsbList(DataSourceRequest dataSourceRequest) {
|
||||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest == null ? null : dataSourceRequest.toDevRequest();
|
DataSourceLoadOptionsBase loadOptions = dataSourceRequest == null ? null : dataSourceRequest.toDevRequest();
|
||||||
String wbsType = loadOptions == null ? null : QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "wbsType");
|
String wbsType = loadOptions == null ? null : QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "wbsType");
|
||||||
|
String objId = loadOptions == null ? null : QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "objId");
|
||||||
if (!"PSB_RVCD".equalsIgnoreCase(wbsType) && !"PSB".equalsIgnoreCase(wbsType)) {
|
if (!"PSB_RVCD".equalsIgnoreCase(wbsType) && !"PSB".equalsIgnoreCase(wbsType)) {
|
||||||
DataSourceResult<WbsbVo> emptyResult = new DataSourceResult<>();
|
DataSourceResult<WbsbVo> emptyResult = new DataSourceResult<>();
|
||||||
emptyResult.setData(new ArrayList<>());
|
emptyResult.setData(new ArrayList<>());
|
||||||
@ -1922,6 +1922,7 @@ public class EnvWqDataServiceImpl implements EnvWqDataService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder sql = new StringBuilder();
|
StringBuilder sql = new StringBuilder();
|
||||||
|
Map<String, Object> paramMap = new HashMap<>();
|
||||||
if ("PSB".equalsIgnoreCase(wbsType)) {
|
if ("PSB".equalsIgnoreCase(wbsType)) {
|
||||||
sql.append("SELECT ")
|
sql.append("SELECT ")
|
||||||
.append("t.BASEID AS id, ")
|
.append("t.BASEID AS id, ")
|
||||||
@ -1974,6 +1975,10 @@ public class EnvWqDataServiceImpl implements EnvWqDataService {
|
|||||||
.append("NULL AS displayDepartment ")
|
.append("NULL AS displayDepartment ")
|
||||||
.append("FROM SD_HYDROBASE t ")
|
.append("FROM SD_HYDROBASE t ")
|
||||||
.append("WHERE NVL(t.IS_DELETED, 0) = 0 ");
|
.append("WHERE NVL(t.IS_DELETED, 0) = 0 ");
|
||||||
|
if (StrUtil.isNotBlank(objId)) {
|
||||||
|
sql.append("AND t.BASEID = #{map.objId} ");
|
||||||
|
paramMap.put("objId", objId);
|
||||||
|
}
|
||||||
sql.append("ORDER BY NVL(t.ORDER_INDEX, 999999), t.BASENAME ASC");
|
sql.append("ORDER BY NVL(t.ORDER_INDEX, 999999), t.BASENAME ASC");
|
||||||
} else {
|
} else {
|
||||||
sql.append("SELECT ")
|
sql.append("SELECT ")
|
||||||
@ -2028,9 +2033,13 @@ public class EnvWqDataServiceImpl implements EnvWqDataService {
|
|||||||
.append("NULL AS displayDepartment ")
|
.append("NULL AS displayDepartment ")
|
||||||
.append("FROM SD_HBRV_DIC t ")
|
.append("FROM SD_HBRV_DIC t ")
|
||||||
.append("WHERE NVL(t.IS_DELETED, 0) = 0 ");
|
.append("WHERE NVL(t.IS_DELETED, 0) = 0 ");
|
||||||
|
if (StrUtil.isNotBlank(objId)) {
|
||||||
|
sql.append("AND t.BASEID = #{map.objId} ");
|
||||||
|
paramMap.put("objId", objId);
|
||||||
|
}
|
||||||
sql.append("ORDER BY NVL(t.ORDER_INDEX, 999999), t.HBRVNM ASC");
|
sql.append("ORDER BY NVL(t.ORDER_INDEX, 999999), t.HBRVNM ASC");
|
||||||
}
|
}
|
||||||
List<WbsbVo> list = microservicDynamicSQLMapper.getAllListWithResultType(sql.toString(), new HashMap<>(), WbsbVo.class);
|
List<WbsbVo> list = microservicDynamicSQLMapper.getAllListWithResultType(sql.toString(), paramMap, WbsbVo.class);
|
||||||
DataSourceResult<WbsbVo> result = new DataSourceResult<>();
|
DataSourceResult<WbsbVo> result = new DataSourceResult<>();
|
||||||
result.setData(list);
|
result.setData(list);
|
||||||
result.setTotal((long) list.size());
|
result.setTotal((long) list.size());
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user