interface CityMapper { City selectCityById(long id); } public class City { private Long id; private String name; private String state; private String country; : }
id = #{id}") City selectCityById(long id); } public class City { : } @SpringBootApplication public class DemoApplication implements CommandLineRunner { final private CityMapper mapper; public DemoApplication(CityMapper mapper) { this.mapper = mapper; } public static void main(String... args) { SpringApplication.run(DemoApplication.class, args); } public void run(String... args) throws Exception { City city = mapper.selectCityById(1); : } }
id = #{id}") City selectCityById(long id); } public class City { : } @SpringBootApplication public class DemoApplication implements CommandLineRunner { final private CityMapper mapper; public DemoApplication(CityMapper mapper) { this.mapper = mapper; } public static void main(String... args) { SpringApplication.run(DemoApplication.class, args); } public void run(String... args) throws Exception { City city = mapper.selectCityById(1); : } } ͨͬͨ͜Ε͚ͩʂ