提交 b08ae984 编写于 作者: zhouweidong's avatar zhouweidong

补充数据集排序

上级 ae4d3740
...@@ -119,7 +119,23 @@ TARGET=PSDATAENTITY ...@@ -119,7 +119,23 @@ TARGET=PSDATAENTITY
<#if de.getDefaultPSDEDataSet()??> <#if de.getDefaultPSDEDataSet()??>
<#assign deDefaultDataSet=de.getDefaultPSDEDataSet()> <#assign deDefaultDataSet=de.getDefaultPSDEDataSet()>
<#if deDefaultDataSet.getPSDEDataQueries()??> <#if deDefaultDataSet.getPSDEDataQueries()??>
<#assign enableOrderby=false>
<#if deDefaultDataSet.getMajorSortPSDEField()?? || deDefaultDataSet.getMinorSortPSDEField()??>
<#assign enableOrderby=true>
</#if>
<#assign enableGroup=false>
<#if deDefaultDataSet.isEnableGroup()>
<#list deDefaultDataSet.getPSDEDataSetGroupParams() as groupParam>
<#if groupParam.isEnableGroup()>
<#assign enableGroup=true>
<#break>
</#if>
</#list>
</#if>
<select id="selectBy${srfcaseformat(MajorField.codeName,'l_u2lC')?cap_first}" resultMap="${de.codeName}ResultMap"> <select id="selectBy${srfcaseformat(MajorField.codeName,'l_u2lC')?cap_first}" resultMap="${de.codeName}ResultMap">
<#if enableGroup || enableOrderby>
select <#if enableGroup><@outputGroup deDefaultDataSet/><#else>*</#if> from (
</#if>
select t1.* from ( select t1.* from (
<#if deDefaultDataSet.getPSDEDataQueries()??> <#if deDefaultDataSet.getPSDEDataQueries()??>
<#list deDefaultDataSet.getPSDEDataQueries() as defaultDQ> <#list deDefaultDataSet.getPSDEDataQueries() as defaultDQ>
...@@ -131,6 +147,15 @@ TARGET=PSDATAENTITY ...@@ -131,6 +147,15 @@ TARGET=PSDATAENTITY
</#if> </#if>
) t1 ) t1
where ${MajorField.getName()?lower_case}=<#noparse>#{</#noparse>${MajorkeyField.codeName?lower_case}<#noparse>}</#noparse> where ${MajorField.getName()?lower_case}=<#noparse>#{</#noparse>${MajorkeyField.codeName?lower_case}<#noparse>}</#noparse>
<#if enableGroup || enableOrderby>
)t1
<#if enableGroup>
group by <#assign groupIndex = 0 ><#list deDefaultDataSet.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 enableOrderby>
order by <#if deDefaultDataSet.getMajorSortPSDEField()??>${deDefaultDataSet.getMajorSortPSDEField().getName()?lower_case}</#if> <#if deDefaultDataSet.getMajorSortDir()??> ${deDefaultDataSet.getMajorSortDir()?lower_case}</#if> <#if deDefaultDataSet.getMinorSortPSDEField()??>, ${deDefaultDataSet.getMinorSortPSDEField().getName()?lower_case} </#if> <#if deDefaultDataSet.getMinorSortDir()??> ${deDefaultDataSet.getMinorSortDir()?lower_case}</#if>
</#if>
</#if>
</select> </select>
</#if> </#if>
</#if> </#if>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册