PersonMapper.xml

    <!-- 更新数据 -->
    <update id="update" parameterType="com.itbto.mode1.Person">
        update person set name = #{name},gender = #{gender}, person_addr = #{personAddr}, birthday = #{birthday}
            where person_id = #{personId}
    </update>

    <!-- 删除数据 -->   
    <delete id="delete" parameterType="java.lang.Integer">
        delete p from person p where p.person_id=#{id};
    </delete>

测试

@Test
public void testUpdate(){  
    SqlSession session = sessionFactory.openSession();

    Person p = new Person();
    p.setPersonId(2);
    p.setName("三姓家奴");
    p.setGender(1);
    p.setPersonAddr("东汉");
    p.setBirthday(new Date());

    try {
        int count = session.update("com.itbto.mapper.PersonMapper.update", p);
        session.commit();
        System.out.println(count);
    } catch (Exception e) {
        e.printStackTrace();
        session.rollback();
    } finally{
        session.close();
    }
}

@Test
public void testDelete(){  
    SqlSession session = sessionFactory.openSession();
    try {
        int count = session.update("com.itbto.mapper.PersonMapper.delete", 5);
        session.commit();
        System.out.println(count);
    } catch (Exception e) {
        e.printStackTrace();
        session.rollback();
    } finally{
        session.close();
    }
}