测试查询


Application 中增加注解 @MapperScan

@MapperScan(basePackages = "com.lusifer.spring.boot.mybatis.mapper")

JUnit 测试代码

@RunWith(SpringRunner.class)
@SpringBootTest
public class GamingServerDatabaseApplicationTests {
    @Autowired
    private ChannelMapper channelMapper;

    @Test
    public void contextLoads() {
        List<Channel> channels = channelMapper.selectAll();
        System.out.println(channels);
    }
}

results matching ""

    No results matching ""