Пример #1
0
 public void save(City country) {
   if (country.getId() != null) {
     cityMapper.updateByPrimaryKey(country);
   } else {
     cityMapper.insert(country);
   }
 }
Пример #2
0
 public City getById(Integer id) {
   return cityMapper.selectByPrimaryKey(id);
 }
Пример #3
0
 public void deleteById(Integer id) {
   cityMapper.deleteByPrimaryKey(id);
 }
Пример #4
0
 public List<City> getAll(City city) {
   if (city.getPage() != null && city.getRows() != null) {
     PageHelper.startPage(city.getPage(), city.getRows(), "id");
   }
   return cityMapper.selectAll();
 }