MyBatis模糊查询

/**
* 测试模糊查询
* @param mohu
* @return
*/
  //模糊查询
    List getUserByName(@Param("mohuName") String mohuName);

映射文件mapper.xml:


    @Test
    public void testGetUserByName(){
        SqlSession sqlSession = sqlSessionUtils.getSqlSession();
        SelectMapper mapper = sqlSession.getMapper(SelectMapper.class);
        List a = mapper.getUserByName("a");
        System.out.println(a);
    }

你可能感兴趣的:(mybatis,mybatis,java,数据库)