提交 83acb333 编写于 作者: chenxiang@lab.ibiz5.com's avatar chenxiang@lab.ibiz5.com

分组

上级 11667559
...@@ -24,7 +24,7 @@ public interface ${item.getCodeName()}Mapper extends BaseMapper<${item.getCodeNa ...@@ -24,7 +24,7 @@ public interface ${item.getCodeName()}Mapper extends BaseMapper<${item.getCodeNa
<#if item.getAllPSDEDataSets()??> <#if item.getAllPSDEDataSets()??>
<#list item.getAllPSDEDataSets() as dedataset> <#list item.getAllPSDEDataSets() as dedataset>
Page<${item.getCodeName()}> search${dedataset.getCodeName()}(IPage page, @Param("srf") ${de.codeName}SearchContext context, @Param("ew") Wrapper<${item.getCodeName()}> wrapper) ; Page<<#if dedataset.isEnableGroup()>HashMap<#else>${item.getCodeName()}</#if>> search${dedataset.getCodeName()}(IPage page, @Param("srf") ${de.codeName}SearchContext context, @Param("ew") Wrapper<${item.getCodeName()}> wrapper) ;
</#list> </#list>
</#if> </#if>
<#assign keyfieldCodeName=item.getKeyPSDEField().codeName?lower_case> <#assign keyfieldCodeName=item.getKeyPSDEField().codeName?lower_case>
......
...@@ -112,7 +112,7 @@ public interface I${item.codeName}Service{ ...@@ -112,7 +112,7 @@ public interface I${item.codeName}Service{
</#if> </#if>
<#if item.getAllPSDEDataSets()??> <#if item.getAllPSDEDataSets()??>
<#list item.getAllPSDEDataSets() as dedataset> <#list item.getAllPSDEDataSets() as dedataset>
Page<${item.codeName}> search${dedataset.getCodeName()}(${item.codeName}SearchContext context) ; Page<<#if dedataset.isEnableGroup()>HashMap<#else>${item.getCodeName()}</#if>> search${dedataset.getCodeName()}(${item.codeName}SearchContext context) ;
</#list> </#list>
</#if> </#if>
......
...@@ -390,11 +390,11 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa ...@@ -390,11 +390,11 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa
* 查询集合 ${dedataset.getLogicName()} * 查询集合 ${dedataset.getLogicName()}
*/ */
@Override @Override
public Page<${item.getCodeName()}> search${dedataset.getCodeName()}(${item.getCodeName()}SearchContext context) { public Page<<#if dedataset.isEnableGroup()>HashMap<#else>${item.getCodeName()}</#if>> search${dedataset.getCodeName()}(${item.getCodeName()}SearchContext context) {
<#if item.isEnableSQLStorage() && item.getAllPSDEDBTables()??> <#if item.isEnableSQLStorage() && item.getAllPSDEDBTables()??>
<#--<#list item.getAllPSDEDBTables() as detable>--> <#--<#list item.getAllPSDEDBTables() as detable>-->
com.baomidou.mybatisplus.extension.plugins.pagination.Page<${de.getCodeName()}> pages=baseMapper.search${dedataset.getCodeName()}(context.getPages(),context,context.getSelectCond()); com.baomidou.mybatisplus.extension.plugins.pagination.Page<<#if dedataset.isEnableGroup()>HashMap<#else>${item.getCodeName()}</#if>> pages=baseMapper.search${dedataset.getCodeName()}(context.getPages(),context,context.getSelectCond());
return new PageImpl<${item.getCodeName()}>(pages.getRecords(), context.getPageable(), pages.getTotal()); return new PageImpl<<#if dedataset.isEnableGroup()>HashMap<#else>${item.getCodeName()}</#if>>(pages.getRecords(), context.getPageable(), pages.getTotal());
<#--</#list>--> <#--</#list>-->
<#else> <#else>
return null ; return null ;
......
...@@ -147,6 +147,7 @@ TARGET=PSDATAENTITY ...@@ -147,6 +147,7 @@ TARGET=PSDATAENTITY
<#if singleSet.getPSDEDataQueries()??> <#if singleSet.getPSDEDataQueries()??>
<!--数据集合[${singleSet.getCodeName()}]--> <!--数据集合[${singleSet.getCodeName()}]-->
<select id="search${singleSet.getCodeName()}" parameterType="${pub.getPKGCodeName()}.core.${de.getPSSystemModule().getCodeName()?lower_case}.filter.${de.codeName}SearchContext" resultMap="${de.codeName}ResultMap"> <select id="search${singleSet.getCodeName()}" parameterType="${pub.getPKGCodeName()}.core.${de.getPSSystemModule().getCodeName()?lower_case}.filter.${de.codeName}SearchContext" resultMap="${de.codeName}ResultMap">
select <#list singleSet.getPSDEDataSetGroupParams() as groupParam><#if groupParam_index gt 0>,</#if><#if groupParam.isEnableGroup()>${groupParam.getName()}<#else>${groupParam.getGroupCode()}</#if> as "${groupParam.getName()?lower_case}"</#list> from (
select t1.* from ( select t1.* from (
<#list singleSet.getPSDEDataQueries() as dataQuery> <#list singleSet.getPSDEDataQueries() as dataQuery>
<#if dataQuery_index gt 0> <#if dataQuery_index gt 0>
...@@ -157,6 +158,8 @@ TARGET=PSDATAENTITY ...@@ -157,6 +158,8 @@ TARGET=PSDATAENTITY
)t1 )t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere"><#noparse>${ew.sqlSegment}</#noparse></if></where> <where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere"><#noparse>${ew.sqlSegment}</#noparse></if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere"><#noparse>${ew.sqlSegment}</#noparse></if> <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere"><#noparse>${ew.sqlSegment}</#noparse></if>
)
group by <#assign groupIndex = 0 ><#list singleSet.getPSDEDataSetGroupParams() as groupParam><#if groupParam.isEnableGroup()><#if groupIndex gt 0>,</#if>${groupParam.getName()?lower_case}<#assign groupIndex = groupIndex + 1 ></#if></#list>
</select> </select>
</#if> </#if>
......
...@@ -266,25 +266,40 @@ public class ${itemCodeName}Resource { ...@@ -266,25 +266,40 @@ public class ${itemCodeName}Resource {
@PreAuthorize("hasPermission('Get',{#context,'${deds.getCodeName()}',this.getEntity(),'${deStorageMode}'})") @PreAuthorize("hasPermission('Get',{#context,'${deds.getCodeName()}',this.getEntity(),'${deStorageMode}'})")
@ApiOperation(value = "fetch${deds.getLogicName()}", tags = {"${itemCodeName}" } ,notes = "fetch${deds.getLogicName()}") @ApiOperation(value = "fetch${deds.getLogicName()}", tags = {"${itemCodeName}" } ,notes = "fetch${deds.getLogicName()}")
@RequestMapping(method= RequestMethod.${reqMtd} , value="${fullPath}/fetch<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()?lower_case}<#else>${deds.getCodeName()?lower_case}</#if>") @RequestMapping(method= RequestMethod.${reqMtd} , value="${fullPath}/fetch<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()?lower_case}<#else>${deds.getCodeName()?lower_case}</#if>")
public ResponseEntity<List<${itemCodeName}DTO>> fetch<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()}<#else>${deds.getCodeName()}</#if>(${deCodeName}SearchContext context) { public ResponseEntity<List<<#if deds.isEnableGroup()>HashMap<#else>${itemCodeName}DTO</#if>>> fetch<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()}<#else>${deds.getCodeName()}</#if>(${deCodeName}SearchContext context) {
<#--${parentSearchParams}--> <#--${parentSearchParams}-->
Page<${deCodeName}> domains = ${deCodeNameLC}Service.search${deds.getCodeName()}(context) ; <#if deds.isEnableGroup()>
Page<HashMap> domains = ${deCodeNameLC}Service.search${deds.getCodeName()}(context) ;
return ResponseEntity.status(${statusCode})
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(domains.getContent());
<#else>
Page<<#if deds.isEnableGroup()>HashMap<#else>${itemCodeName}</#if>> domains = ${deCodeNameLC}Service.search${deds.getCodeName()}(context) ;
List<${itemCodeName}DTO> list = ${itemCodeNameLC}Mapping.toDto(domains.getContent()); List<${itemCodeName}DTO> list = ${itemCodeNameLC}Mapping.toDto(domains.getContent());
return ResponseEntity.status(${statusCode}) return ResponseEntity.status(${statusCode})
.header("x-page", String.valueOf(context.getPageable().getPageNumber())) .header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize())) .header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements())) .header("x-total", String.valueOf(domains.getTotalElements()))
.body(list); .body(list);
</#if>
} }
@PreAuthorize("hasPermission('Get',{#context,'${deds.getCodeName()}',this.getEntity(),'${deStorageMode}'})") @PreAuthorize("hasPermission('Get',{#context,'${deds.getCodeName()}',this.getEntity(),'${deStorageMode}'})")
@ApiOperation(value = "search${deds.getLogicName()}", tags = {"${itemCodeName}" } ,notes = "search${deds.getLogicName()}") @ApiOperation(value = "search${deds.getLogicName()}", tags = {"${itemCodeName}" } ,notes = "search${deds.getLogicName()}")
@RequestMapping(method= RequestMethod.${reqMtd} , value="${fullPath}/search<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()?lower_case}<#else>${deds.getCodeName()?lower_case}</#if>") @RequestMapping(method= RequestMethod.${reqMtd} , value="${fullPath}/search<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()?lower_case}<#else>${deds.getCodeName()?lower_case}</#if>")
public ResponseEntity<Page<${itemCodeName}DTO>> search<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()}<#else>${deds.getCodeName()}</#if>(${deCodeName}SearchContext context) { public ResponseEntity<Page<<#if deds.isEnableGroup()>HashMap<#else>${itemCodeName}DTO</#if>>> search<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()}<#else>${deds.getCodeName()}</#if>(${deCodeName}SearchContext context) {
<#--${parentSearchParams}--> <#--${parentSearchParams}-->
<#if deds.isEnableGroup()>
Page<HashMap> domains = ${deCodeNameLC}Service.search${deds.getCodeName()}(context) ;
return ResponseEntity.status(${statusCode})
.body(new PageImpl(domains.getContent(), context.getPageable(), domains.getTotalElements()));
<#else>
Page<${deCodeName}> domains = ${deCodeNameLC}Service.search${deds.getCodeName()}(context) ; Page<${deCodeName}> domains = ${deCodeNameLC}Service.search${deds.getCodeName()}(context) ;
return ResponseEntity.status(${statusCode}) return ResponseEntity.status(${statusCode})
.body(new PageImpl(${itemCodeNameLC}Mapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements())); .body(new PageImpl(${itemCodeNameLC}Mapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
</#if>
} }
</#if> </#if>
...@@ -545,8 +560,16 @@ public class ${itemCodeName}Resource { ...@@ -545,8 +560,16 @@ public class ${itemCodeName}Resource {
<#assign deds = apiMethod.getPSDEDataSet()> <#assign deds = apiMethod.getPSDEDataSet()>
@ApiOperation(value = "fetch${deds.getLogicName()}${byParams}", tags = {"${itemCodeName}${byParams}" } ,notes = "fetch${deds.getLogicName()}${byParams}") @ApiOperation(value = "fetch${deds.getLogicName()}${byParams}", tags = {"${itemCodeName}${byParams}" } ,notes = "fetch${deds.getLogicName()}${byParams}")
@RequestMapping(method= RequestMethod.${reqMtd} , value="${fullPath}/fetch<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()?lower_case}<#else>${deds.getCodeName()?lower_case}</#if>") @RequestMapping(method= RequestMethod.${reqMtd} , value="${fullPath}/fetch<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()?lower_case}<#else>${deds.getCodeName()?lower_case}</#if>")
public ResponseEntity<List<${itemCodeName}DTO>> fetch${itemCodeName}<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()}<#else>${deds.getCodeName()}</#if>${byParams}(<#if parentParams!="">${parentParams},</#if>${deCodeName}SearchContext context) { public ResponseEntity<List<<#if deds.isEnableGroup()>HashMap<#else>${itemCodeName}DTO</#if>>> fetch${itemCodeName}<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()}<#else>${deds.getCodeName()}</#if>${byParams}(<#if parentParams!="">${parentParams},</#if>${deCodeName}SearchContext context) {
${parentSearchParams} ${parentSearchParams}
<#if deds.isEnableGroup()>
Page<HashMap> domains = ${deCodeNameLC}Service.search${deds.getCodeName()}(context) ;
return ResponseEntity.status(${statusCode})
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(domains.getContent());
<#else>
Page<${deCodeName}> domains = ${deCodeNameLC}Service.search${deds.getCodeName()}(context) ; Page<${deCodeName}> domains = ${deCodeNameLC}Service.search${deds.getCodeName()}(context) ;
List<${itemCodeName}DTO> list = ${itemCodeNameLC}Mapping.toDto(domains.getContent()); List<${itemCodeName}DTO> list = ${itemCodeNameLC}Mapping.toDto(domains.getContent());
return ResponseEntity.status(${statusCode}) return ResponseEntity.status(${statusCode})
...@@ -554,15 +577,22 @@ public class ${itemCodeName}Resource { ...@@ -554,15 +577,22 @@ public class ${itemCodeName}Resource {
.header("x-per-page", String.valueOf(context.getPageable().getPageSize())) .header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements())) .header("x-total", String.valueOf(domains.getTotalElements()))
.body(list); .body(list);
</#if>
} }
@ApiOperation(value = "search${deds.getLogicName()}${byParams}", tags = {"${itemCodeName}${byParams}" } ,notes = "search${deds.getLogicName()}${byParams}") @ApiOperation(value = "search${deds.getLogicName()}${byParams}", tags = {"${itemCodeName}${byParams}" } ,notes = "search${deds.getLogicName()}${byParams}")
@RequestMapping(method= RequestMethod.${reqMtd} , value="${fullPath}/search<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()?lower_case}<#else>${deds.getCodeName()?lower_case}</#if>") @RequestMapping(method= RequestMethod.${reqMtd} , value="${fullPath}/search<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()?lower_case}<#else>${deds.getCodeName()?lower_case}</#if>")
public ResponseEntity<Page<${itemCodeName}DTO>> search${itemCodeName}<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()}<#else>${deds.getCodeName()}</#if>${byParams}(<#if parentParams!="">${parentParams},</#if>${deCodeName}SearchContext context) { public ResponseEntity<Page<<#if deds.isEnableGroup()>HashMap<#else>${itemCodeName}DTO</#if>>> search${itemCodeName}<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()}<#else>${deds.getCodeName()}</#if>${byParams}(<#if parentParams!="">${parentParams},</#if>${deCodeName}SearchContext context) {
${parentSearchParams} ${parentSearchParams}
<#if deds.isEnableGroup()>
Page<HashMap> domains = ${deCodeNameLC}Service.search${deds.getCodeName()}(context) ;
return ResponseEntity.status(${statusCode})
.body(new PageImpl(domains.getContent(), context.getPageable(), domains.getTotalElements()));
<#else>
Page<${deCodeName}> domains = ${deCodeNameLC}Service.search${deds.getCodeName()}(context) ; Page<${deCodeName}> domains = ${deCodeNameLC}Service.search${deds.getCodeName()}(context) ;
return ResponseEntity.status(${statusCode}) return ResponseEntity.status(${statusCode})
.body(new PageImpl(${itemCodeNameLC}Mapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements())); .body(new PageImpl(${itemCodeNameLC}Mapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
</#if>
} }
</#if> </#if>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册