Mybatis plus使用xml编写sql,需要添加条件时,使用map传值时,xml文件内怎么获取Map当中的属性值
Mapper层,添加 @Param("query") ,这个query用于后面xml的编写
<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>
浙公网安备 33010602011771号