日期:2014-05-16 浏览次数:20355 次
<select id="querySqlByParams" resultType="java.util.Map" statementType="STATEMENT"> select * from (${sql} <where> <foreach collection="params.keys" item="k" index="index" separator=" and "> <if test="null!=params[k]"> ${k}=${params[k]} </if> </foreach> </where> ) </select>