要把<procedure>、<select> 放在 <sql >的后面,如下:
<sql id="getOrderYchdCountsql">
select workid workId,
orgrowid,
orgName,
dataValue,
remark
from order_ychd where alarmType = $alarmType$
and dateData >= '$startDate$'
and dateData < '$endDate$'
]]>
</sql>
<procedure id="getOrderYchdByPage"
parameterClass="map"
resultClass="orderYchd">
{call ams_query_page('select aa.* from (
<include refid="getOrderYchdByPagesql" />
) aa ',$start$,$end$)}
</procedure>
<select id="getOrderYchdCount"
parameterClass="map"
resultClass="int">
select count(1) from (
<include refid="getOrderYchdCountsql" />
) sss
</select>