环境:Spring+Springboot+Mybatis+jpa
Application
@MapperScan("com.text.mapper")
@ComponentScan(basePackages = {"com.text.service","com.text.serviceInfo","com.text.web","com.text.web","com.text.dao"})
public class ProjectmanagerApplication {
public static void main(String[] args) {
SpringApplication.run(ProjectmanagerApplication.class, args);
}
}
dao
@Component
public abstract class TestUserDao extends BaseDao<TestUser> {
@Autowired
public TestUserMapper testUserMapper;
public List<TestUser> Sel(int id) {
return testUserMapper.Sel(id);
}
}