mapper接口添加更新@Update注解和方法
@Update("update emp set username = #{username},name = #{name},gender = #{gender},image = #{image}," +
"jop = #{job},entrydate = #{entrydate},dept_id = #{deptId},update_time = #{updateTime}")
public void update(User user);
添加一个测试方法
@Test
public void empUpdate(){
User user = new User();
user.setId(8);
user.setUsername("Tom1");
user.setName("汤姆");
user.setImage("2.jpg");
user.setGender((short)1);
user.setJob((short)1);
user.setEntrydate(LocalDate.of(2000,1,1));
user.setUpdateTime(LocalDateTime.now());
user.setDeptId(1);
empMapper.update(user);
System.out.println(user.getId());
}