在mapper中对条件进行筛选
<select id="projectList" parameterType="java.util.HashMap" resultType="java.util.HashMap">
select id,city,environment_plandate
from table
<where>
<if test="city != null">and city = #{city}</if>
<if test= 'year == "2020"'>and left(environment_plandate,4) = 2018 </if>
</where>
order by id desc
</select>
在mapper文件中做判断筛选
最新推荐文章于 2023-07-12 15:56:01 发布