1. Query data records (all records where the data of a field integral in the query table is smaller than the passed parameter consumintegral)
<select id="myshops4" parameterClass="int" resultMap="exchangemap">
<![CDATA[
select * from exchange_goods where integral < #consumeIntegral# order by addtime desc limit 4
]]>
</select>
Reference document: http://yjhexy.iteye.com/blog/465150