TeamMemberService { public boolean insertSelective(TeamMember teamMember) throws Exception { LOG.info("insertSelective({})", teamMember.toString()); try (SqlSession sqlSession = MyBatisUtil.getSqlSession()) { TeamMemberMapper teamMemberMapper = sqlSession.getMapper(TeamMemberMapper.class); teamMemberMapper.insertSelective(teamMember); sqlSession.commit(); } catch (Exception e) { LOG.error(e.getMessage(), e); throw new Exception(e); } return true; }  List<TeamMember> queryList(String teamId); boolean insertSelective(TeamMember teamMember); void deleteByPrimaryKey(String id);  }
@Test public void insertSelective() throws Exception { TeamMember teamMember = new TeamMember(); teamMember.setTeamId("teamId"); teamMember.setTeamName("teamName"); teamMember.setCreateBy("createBy"); teamMember.setMember("member"); teamMember.setInviter(1); Boolean ret = teamMemberService.insertSelective(teamMember); assertTrue(ret); List<TeamMember> teamMemberList = teamMemberService.queryList("teamId"); assertEquals(teamMemberList.size(), 1); for (TeamMember member : teamMemberList) { assertEquals(member.getTeamName(), teamMember.getTeamName()); assertEquals(member.getTeamId(), teamMember.getTeamId()); assertEquals(member.getCreateBy(), teamMember.getCreateBy()); assertEquals(member.getMember(), teamMember.getMember()); assertEquals(member.getInviter(), teamMember.getInviter()); LOG.info("member.createTime:{}, member.updateTime:{}", member.getCreateTime(), member.getUpdateTime()); } }