SysAreaService.java 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package com.bofeng.service;
  2. import com.bofeng.dao.SysAreaMapper;
  3. import com.bofeng.entity.SysArea;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.stereotype.Service;
  6. import org.springframework.transaction.annotation.Transactional;
  7. import java.util.List;
  8. @Service
  9. @Transactional(readOnly = true)
  10. public class SysAreaService {
  11. @Autowired
  12. private SysAreaMapper sysAreaMapper;
  13. public List<SysArea> selectProvince() {
  14. List<SysArea> lst = sysAreaMapper.selectProvince();
  15. if (lst != null && lst.size() > 0) {
  16. return lst;
  17. }
  18. return null;
  19. }
  20. public List<SysArea> selectCityByProvince(Long areaId) {
  21. List<SysArea> lst = sysAreaMapper.selectCityByProvince(areaId);
  22. if (lst != null && lst.size() > 0) {
  23. return lst;
  24. }
  25. return null;
  26. }
  27. public List<SysArea> selectAreaByCity(Long areaId) {
  28. List<SysArea> lst = sysAreaMapper.selectAreaByCity(areaId);
  29. if (lst != null && lst.size() > 0) {
  30. return lst;
  31. }
  32. return null;
  33. }
  34. }