|  |  |  | 
|---|
|  |  |  | this.dao = dao; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 保存实体 | 
|---|
|  |  |  | * @param po 实体 | 
|---|
|  |  |  | * @return 数量 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public int save(BaDistrict po){ | 
|---|
|  |  |  | return this.dao.insert(po) ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 保存修改实体 | 
|---|
|  |  |  | * @param po 实体 | 
|---|
|  |  |  | * @return 数量 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public int update(BaDistrict po){ | 
|---|
|  |  |  | return this.dao.updateByPrimaryKeySelective(po) ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 保存修改实体 | 
|---|
|  |  |  | * @param id 实体ID | 
|---|
|  |  |  | * @return 数量 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public int delete(Long id){ | 
|---|
|  |  |  | return this.dao.deleteLogicById(id) ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | * @param firstLevel 第一级行下区 level | 
|---|
|  |  |  | * @return 所有行政区划集合 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public List<BaDistrict> getAll(byte firstLevel){ | 
|---|
|  |  |  | public List<BaDistrict> selectAllByLevel(byte firstLevel){ | 
|---|
|  |  |  | List<BaDistrict> list = this.dao.selectByLevel(firstLevel) ; | 
|---|
|  |  |  | if(list != null && list.size() > 0){ | 
|---|
|  |  |  | for(BaDistrict po : list){ | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 得到一个行政区 | 
|---|
|  |  |  | * @param id 行政区ID | 
|---|
|  |  |  | * @return 行政区实体 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public BaDistrict selectById(Long id){ | 
|---|
|  |  |  | return this.dao.selectByPrimaryKey(id) ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 得到下级行政区划 | 
|---|
|  |  |  | * @param po 上级行政区划 | 
|---|
|  |  |  | */ | 
|---|