class TeamService {

  public boolean delete(String id) throws Exception {
    LOG.info("delete({})", id);
    try (SqlSession sqlSession = MyBatisUtil.getSqlSession()) {
      TeamMapper teamMapper = sqlSession.getMapper(TeamMapper.class);
      teamMapper.deleteByPrimaryKey(id);

      TeamMemberMapper teamMemberMapper = sqlSession.getMapper(TeamMemberMapper.class);
      TeamMember teamMember = new TeamMember();
      teamMember.setTeamId(id);
      teamMemberMapper.deleteSelective(teamMember);
      sqlSession.commit();
    } catch (Exception e) {
      LOG.error(e.getMessage(), e);
      throw new Exception(e);
    }
    return true;
  }

}