mybatis流程

当然首先要有对应实体和数据库
创建class user
然后去usermapper声明一个方法

List listAll();

然后去写出resource的mapper-usermapper.xml写出这个sql





    


然后使用这个方法

@GetMapping("/testxml")
    public List selectAll(){
        return userMapper.listAll();
    }

你可能感兴趣的:(mybatis)