Mapper层,添加 @Param("query") ,这个query用于后面xml的编写
ClassroomStructureVO getScheduleByCycleAndClass(@Param("query") Map<String, Object> query);
xml文件,通过query.字段名,就能够得到Map内对应的Object数据
<select id="getScheduleByCycleAndClass" parameterType="map" resultMap="SelectResultMap">
SELECT *
FROM *
<where>
1 = 1
<if test="query.cycleId != null">
and FC.CYCLE_ID = #{query.cycleId}
</if>
</where>
</select>