170 lines
5.6 KiB
XML
170 lines
5.6 KiB
XML
<?xml version="1.0"?>
|
|
<root>
|
|
<LabelType>搜索类</LabelType>
|
|
<LabelIntro>
|
|
</LabelIntro>
|
|
<OutType>sin</OutType>
|
|
<LabelDataType>sql_sysquery</LabelDataType>
|
|
<attributes>
|
|
<name>fieldName</name>
|
|
<default>title</default>
|
|
<intro>搜索条件字段名</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>fieldValue</name>
|
|
<default>
|
|
</default>
|
|
<intro>搜索条件字段值</intro>
|
|
</attributes>
|
|
<LabelSqlString>SELECT TOP 1 * FROM PE_SpecialInfos</LabelSqlString>
|
|
<LabelTemplate><![CDATA[<?xml version="1.0" encoding="utf-8"?>
|
|
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pe="labelproc" exclude-result-prefixes="pe">
|
|
<xsl:output method="html" />
|
|
<xsl:param name="specialCategoryId" />
|
|
<xsl:param name="specialId" />
|
|
<xsl:param name="fieldName" />
|
|
<xsl:param name="fieldValue" />
|
|
<xsl:param name="titleLength" />
|
|
<xsl:param name="bindStyle"/>
|
|
<xsl:param name="outputQty"/>
|
|
<xsl:template match="/">
|
|
<xsl:choose>
|
|
<xsl:when test="count(/NewDataSet/Table) = 0">
|
|
<li style="color:red">没有任何相关搜索结果!</li>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
{PE.Label id="专题搜索_<xsl:value-of select="$bindStyle"/>" titleLength="<xsl:value-of select="$titleLength" />" queryCond="SELECT TOP @pagesize *
|
|
FROM
|
|
PE_CommonModel CM
|
|
INNER JOIN PE_SpecialInfos SI ON (CM.GeneralID = SI.GeneralID)
|
|
WHERE
|
|
<xsl:choose>
|
|
<xsl:when test="$specialCategoryId > 0">
|
|
SI.SpecialID IN (SELECT S.SpecialID FROM PE_Specials S WHERE S.SpecialCategoryID = <xsl:value-of select="$specialCategoryId" />) AND
|
|
</xsl:when>
|
|
<xsl:when test="$specialId > 0">
|
|
SI.SpecialID = <xsl:value-of select="$specialId"/> AND
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
CM.Status = 99
|
|
<xsl:choose>
|
|
<xsl:when test="$fieldName = 'title'">
|
|
AND CM.Title LIKE '%<xsl:value-of select="$fieldValue" />%'
|
|
</xsl:when>
|
|
<xsl:when test="$fieldName = 'inputer'">
|
|
AND CM.Inputer = '<xsl:value-of select="$fieldValue" />'
|
|
</xsl:when>
|
|
<xsl:when test="$fieldName = 'keyword'">
|
|
AND CM.GeneralID IN (
|
|
SELECT
|
|
KWRS.GeneralID
|
|
FROM
|
|
PE_Keywords KW
|
|
INNER JOIN PE_KeywordRelationShip KWRS ON (KW.KeywordID = KWRS.KeywordID)
|
|
WHERE
|
|
KW.KeywordText = '<xsl:value-of select="$fieldValue" />')
|
|
</xsl:when>
|
|
</xsl:choose>
|
|
AND CM.GeneralID NOT IN (
|
|
SELECT TOP @startrow ICM.GeneralID FROM PE_CommonModel ICM
|
|
INNER JOIN PE_SpecialInfos ISI ON (ICM.GeneralID = ISI.GeneralID)
|
|
WHERE
|
|
<xsl:choose>
|
|
<xsl:when test="$specialCategoryId > 0">
|
|
ISI.SpecialID IN (SELECT S.SpecialID FROM PE_Specials S WHERE S.SpecialCategoryID = <xsl:value-of select="$specialCategoryId" />) AND
|
|
</xsl:when>
|
|
<xsl:when test="$specialId > 0">
|
|
ISI.SpecialID = <xsl:value-of select="$specialId"/> AND
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
ICM.Status = 99
|
|
<xsl:choose>
|
|
<xsl:when test="$fieldName = 'title'">
|
|
AND ICM.Title LIKE '%<xsl:value-of select="$fieldValue" />%'
|
|
</xsl:when>
|
|
<xsl:when test="$fieldName = 'inputer'">
|
|
AND ICM.Inputer = '<xsl:value-of select="$fieldValue" />'
|
|
</xsl:when>
|
|
<xsl:when test="$fieldName = 'keyword'">
|
|
AND ICM.GeneralID IN (
|
|
SELECT
|
|
KWRS.GeneralID
|
|
FROM
|
|
PE_Keywords KW
|
|
INNER JOIN PE_KeywordRelationShip KWRS ON (KW.KeywordID = KWRS.KeywordID)
|
|
WHERE
|
|
KW.KeywordText = '<xsl:value-of select="$fieldValue" />')
|
|
</xsl:when>
|
|
</xsl:choose>
|
|
ORDER BY ICM.UpdateTime DESC)
|
|
ORDER BY CM.UpdateTime DESC
|
|
</xsl:otherwise>
|
|
</xsl:choose>" queryCount="SELECT COUNT (ICM.GeneralID) FROM PE_CommonModel ICM
|
|
INNER JOIN PE_SpecialInfos ISI ON (ICM.GeneralID = ISI.GeneralID)
|
|
WHERE
|
|
<xsl:choose>
|
|
<xsl:when test="$specialCategoryId > 0">
|
|
ISI.SpecialID IN (SELECT S.SpecialID FROM PE_Specials S WHERE S.SpecialCategoryID = <xsl:value-of select="$specialCategoryId" />) AND
|
|
</xsl:when>
|
|
<xsl:when test="$specialId > 0">
|
|
ISI.SpecialID = <xsl:value-of select="$specialId"/> AND
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
ICM.Status = 99
|
|
<xsl:choose>
|
|
<xsl:when test="$fieldName = 'title'">
|
|
AND ICM.Title LIKE '%<xsl:value-of select="$fieldValue" />%'
|
|
</xsl:when>
|
|
<xsl:when test="$fieldName = 'inputer'">
|
|
AND ICM.Inputer = '<xsl:value-of select="$fieldValue" />'
|
|
</xsl:when>
|
|
<xsl:when test="$fieldName = 'keyword'">
|
|
AND ICM.GeneralID IN (
|
|
SELECT
|
|
KWRS.GeneralID
|
|
FROM
|
|
PE_Keywords KW
|
|
INNER JOIN PE_KeywordRelationShip KWRS ON (KW.KeywordID = KWRS.KeywordID)
|
|
WHERE
|
|
KW.KeywordText = '<xsl:value-of select="$fieldValue" />')
|
|
</xsl:when>
|
|
</xsl:choose>" page="true" pagesize="<xsl:value-of select="$outputQty"/>" urlpage="true" /}
|
|
</xsl:template>
|
|
</xsl:transform>]]></LabelTemplate>
|
|
<attributes>
|
|
<name>titleLength</name>
|
|
<default>20</default>
|
|
<intro>标题最多显示字符数</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>specialCategoryId</name>
|
|
<default>0</default>
|
|
<intro>专题类别ID</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>specialId</name>
|
|
<default>0</default>
|
|
<intro>专题</intro>
|
|
</attributes>
|
|
<EnabelAjax>False</EnabelAjax>
|
|
<attributes>
|
|
<name>outputQty</name>
|
|
<datatype>supersql</datatype>
|
|
<default>30</default>
|
|
<intro>分页大小</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>bindStyle</name>
|
|
<datatype>supersql</datatype>
|
|
<default>普通式</default>
|
|
<intro>内容呈现样式</intro>
|
|
</attributes>
|
|
<IsXsltSql>false</IsXsltSql>
|
|
<IsXsltCountSql>false</IsXsltCountSql>
|
|
</root> |