select <#list singleSet.getPSDEDataSetGroupParams() as groupParam><#if groupParam_index gt 0>,</#if><#if groupParam.isEnableGroup()><#if groupParam.getGroupCode()??>${groupParam.getGroupCode()}<#else>${groupParam.getName()}</#if><#else>${groupParam.getGroupCode()}</#if> as "${groupParam.getName()?lower_case}"</#list> from (
select <#if enableGroup><@outputGroup singleSet/><#else>*</#if> from (
</#if>
</#if>
select t1.* from (
select t1.* from (
<#list singleSet.getPSDEDataQueries() as dataQuery>
<#list singleSet.getPSDEDataQueries() as dataQuery>
...
@@ -160,10 +173,15 @@ TARGET=PSDATAENTITY
...
@@ -160,10 +173,15 @@ 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>
<#if singleSet.isEnableGroup()>
<#if enableGroup || enableOrderby>
) groupinfo
)t1
<#if enableGroup>
group by <#assign groupIndex = 0 ><#list singleSet.getPSDEDataSetGroupParams() as groupParam><#if groupParam.isEnableGroup()><#if groupIndex gt 0>,</#if><#if groupParam.getGroupCode()??>${groupParam.getGroupCode()}<#else>${groupParam.getName()}</#if><#assign groupIndex = groupIndex + 1 ></#if></#list>
group by <#assign groupIndex = 0 ><#list singleSet.getPSDEDataSetGroupParams() as groupParam><#if groupParam.isEnableGroup()><#if groupIndex gt 0>,</#if><#if groupParam.getGroupCode()??>${groupParam.getGroupCode()}<#else>${groupParam.getName()}</#if><#assign groupIndex = groupIndex + 1 ></#if></#list>
</#if>
</#if>
<#if enableOrderby>
order by <#if singleSet.getMajorSortPSDEField()??>${singleSet.getMajorSortPSDEField().getName()?lower_case}</#if> <#if singleSet.getMajorSortDir()??> ${singleSet.getMajorSortDir()?lower_case}</#if> <#if singleSet.getMinorSortPSDEField()??>, ${singleSet.getMinorSortPSDEField().getName()?lower_case} </#if> <#if singleSet.getMinorSortDir()??> ${singleSet.getMinorSortDir()?lower_case}</#if>
</#if>
</#if>
</select>
</select>
</#if>
</#if>
...
@@ -242,3 +260,8 @@ TARGET=PSDATAENTITY
...
@@ -242,3 +260,8 @@ TARGET=PSDATAENTITY
</#if>
</#if>
<#return false>
<#return false>
</#function>
</#function>
<#comment>输出数据集分组</#comment>
<#macro outputGroup singleSet>
<#list singleSet.getPSDEDataSetGroupParams() as groupParam><#if groupParam_index gt 0>,</#if><#if groupParam.isEnableGroup()><#if groupParam.getGroupCode()??>${groupParam.getGroupCode()}<#else>${groupParam.getName()}</#if><#else>${groupParam.getGroupCode()}</#if> as "${groupParam.getName()?lower_case}"</#list>