(不能用#,只能用$)
<select id="getList" resultType="map">
SELECT * FROM test
<where>
<foreach collection="jsonObject.keys" item="key" separator="and">
<if test="jsonObject[key] != null and jsonObject[key] != '' and 'courseName'==key">
courseName like "%"#{jsonObject[${key}]}"%"
</if>
</foreach>
</where>
<if test="jsonObject.pageNum != null and jsonObject.pageSize != ''">
limit ${jsonObject.pageNum},${jsonObject.pageSize}
</if>
</select>
springboot分页sql
最新推荐文章于 2023-09-27 17:24:34 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)