Browse Source

bug:自定义sql数据集

master
tanghp 2 years ago
parent
commit
fa30fc7986
2 changed files with 6 additions and 3 deletions
  1. +1
    -1
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/dynPage/DynPageHelper.java
  2. +5
    -2
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/dynPage/DynPageListHandler.java

+ 1
- 1
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/dynPage/DynPageHelper.java View File

@@ -93,7 +93,7 @@ public class DynPageHelper {
//主表 //主表
ModelTable masterTable = ModelTableCache.getInstance().get(dataSet.masterTable); ModelTable masterTable = ModelTableCache.getInstance().get(dataSet.masterTable);
//非查询列表,或sql为空,则自己组装select sql //非查询列表,或sql为空,则自己组装select sql
if (!SwEnum.DatasetType.LIST.equals(dataSet.type) || StringUtils.isEmpty(dataSet.sql)) {
if (!SwEnum.DatasetType.LIST.value.equals(dataSet.type) || StringUtils.isEmpty(dataSet.sql)) {
sql.append("select "); sql.append("select ");
for (PageDatasetField field : dataSet.fields) { for (PageDatasetField field : dataSet.fields) {
sql.append(field.field); sql.append(field.field);


+ 5
- 2
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/dynPage/DynPageListHandler.java View File

@@ -56,8 +56,11 @@ public class DynPageListHandler extends AbstractListHandler {
} else { } else {
list = DbEngine.getInstance().queryN(sql, sp.mapParas, SwMap.class); list = DbEngine.getInstance().queryN(sql, sp.mapParas, SwMap.class);
} }
ModelTable masterTable = ModelTableCache.getInstance().get(pageDataSet.masterTable);
EntityHelper.loadBeanLink(masterTable.getName(), list, sp.mapFieldAlias);
if(pageDataSet.masterTable != 0 && pageDataSet.masterTable != -1){
ModelTable masterTable = ModelTableCache.getInstance().get(pageDataSet.masterTable);
EntityHelper.loadBeanLink(masterTable.getName(), list, sp.mapFieldAlias);
}

return list; return list;
} }




Loading…
Cancel
Save