删除单个
Integer deleteOne(@Param("id") String id);
===>
<delete id="deleteOne"> delete from tb_user where id=#{id}; </delete>
===>
@Test public void deleteOne(){ DeleteMapper mapper = getMapper(); Integer integer = mapper.deleteOne("7"); System.out.println(integer); }
批量删除,批量删除只能用${}获取参数
Integer deleteMore(@Param("ids") String ids);
===>
<delete id="deleteMore"> delete from tb_user where id in (${ids}); </delete>
===>
@Test public void DeleteMore(){ DeleteMapper mapper = getMapper(); Integer integer = mapper.deleteMore("7,8,9"); System.out.println(integer); }