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

补充数据集排序

上级 ae4d3740
......@@ -119,7 +119,23 @@ TARGET=PSDATAENTITY
<#if de.getDefaultPSDEDataSet()??>
<#assign deDefaultDataSet=de.getDefaultPSDEDataSet()>
<#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">
<#if enableGroup || enableOrderby>
select <#if enableGroup><@outputGroup deDefaultDataSet/><#else>*</#if> from (
</#if>
select t1.* from (
<#if deDefaultDataSet.getPSDEDataQueries()??>
<#list deDefaultDataSet.getPSDEDataQueries() as defaultDQ>
......@@ -129,8 +145,17 @@ TARGET=PSDATAENTITY
<include refid="${defaultDQ.getCodeName()}" />
</#list>
</#if>
) t1
where ${MajorField.getName()?lower_case}=<#noparse>#{</#noparse>${MajorkeyField.codeName?lower_case}<#noparse>}</#noparse>
) t1
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>
</#if>
</#if>
......@@ -145,19 +170,19 @@ TARGET=PSDATAENTITY
<#if resultSet??>
<#list resultSet as singleSet>
<#if singleSet.getPSDEDataQueries()??>
<#assign enableOrderby=false>
<#if singleSet.getMajorSortPSDEField()?? || singleSet.getMinorSortPSDEField()??>
<#assign enableOrderby=true>
</#if>
<#assign enableGroup=false>
<#if singleSet.isEnableGroup()>
<#list singleSet.getPSDEDataSetGroupParams() as groupParam>
<#if groupParam.isEnableGroup()>
<#assign enableGroup=true>
<#break>
<#assign enableOrderby=false>
<#if singleSet.getMajorSortPSDEField()?? || singleSet.getMinorSortPSDEField()??>
<#assign enableOrderby=true>
</#if>
<#assign enableGroup=false>
<#if singleSet.isEnableGroup()>
<#list singleSet.getPSDEDataSetGroupParams() as groupParam>
<#if groupParam.isEnableGroup()>
<#assign enableGroup=true>
<#break>
</#if>
</#list>
</#if>
</#list>
</#if>
<!--数据集合[${singleSet.getCodeName()}]-->
<select id="search${singleSet.getCodeName()}" parameterType="${pub.getPKGCodeName()}.core.${de.getPSSystemModule().getCodeName()?lower_case}.filter.${de.codeName}SearchContext" <#if singleSet.isEnableGroup()>resultType="java.util.HashMap"<#else>resultMap="${de.codeName}ResultMap"</#if>>
<#if enableGroup || enableOrderby>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册