如题所述
1. 自定义对象也用@param注解.
2. 在mapper.xml中使用的时候,#{对象别名.属性名},如#{user.id}
注意,使用了@pram注解的话在mapper.xml不加parameterType。
public List selectAllUsers(
@Param("user") UserExtension user,
@Param("begin") int begin,
@Param("end") int end);
mybatis中多条件删除例子如下:
delete from tb_duty where
( dscd=#{item.dscd},
and unit_id=#{item.unitId},
and year=#{item.year},
and month=#{item.month},
and flag=#{item.flag} )
2. 在mapper.xml中使用的时候,#{对象别名.属性名},如#{user.id}
注意,使用了@pram注解的话在mapper.xml不加parameterType。
public List selectAllUsers(
@Param("user") UserExtension user,
@Param("begin") int begin,
@Param("end") int end);
mybatis中多条件删除例子如下:
delete from tb_duty where
( dscd=#{item.dscd},
and unit_id=#{item.unitId},
and year=#{item.year},
and month=#{item.month},
and flag=#{item.flag} )
温馨提示:答案为网友推荐,仅供参考