List<PlanSoPO> listPageWithProductOrCode(@Param("args") PageQueryArgs args);
mapper类里是怎么定义的
PageQueryArgs这个是一个实体类,这个实体类里有一个Map对象叫filters
我想在xml中使用这个实体里的Map对象作为参数
目前我是这样写的
<if test="args.filters.code != null and args.filters.code != ''">
AND code = #{args.filters.code}
</if>
我每用一个参数就要args.filters.xxx
我觉得太长了,有没有什么简便的写法?
直接传map对象进去,不就可以了#{code}
如果你的parameterType指向了那个实体类,里面的变量可以在if里直接用的。
<select id="findNotices" parameterType="com..manage.entity.NoticeEntity">
<if test="noticeName!=null and noticeName!=''">
and NOTICENAME=#{noticeName}
</if> `