Commit 9738cae8 authored by wangtao's avatar wangtao

区域查询接口增加返回参数

parent 9468eed1
...@@ -32,8 +32,22 @@ public class BaseAreaInfoServiceImpl implements BaseAreaInfoService { ...@@ -32,8 +32,22 @@ public class BaseAreaInfoServiceImpl implements BaseAreaInfoService {
private BaseAreaInfoMapper baseAreaInfoMapper; private BaseAreaInfoMapper baseAreaInfoMapper;
/**
* 根据区划类型查询对应集合(含子集)
* @param type
* @return
*/
public List<BaseAreaInfoPO> selectByType(Integer type){ public List<BaseAreaInfoPO> selectByType(Integer type){
return baseAreaInfoMapper.selectByType(type); List<BaseAreaInfoPO> list = baseAreaInfoMapper.selectByType(type);
if (list.size() > 0){
list.stream().forEach(item ->{
List<BaseAreaInfoPO> areaInfoPOList = baseAreaInfoMapper.selectListByParentCode(item.getId());
if (areaInfoPOList.size() > 0){
item.setAreaInfoPOList(areaInfoPOList);
}
});
}
return list;
} }
} }
...@@ -39,4 +39,6 @@ public interface BaseAreaInfoMapper { ...@@ -39,4 +39,6 @@ public interface BaseAreaInfoMapper {
List<BaseAreaInfoPO> selectAllArea(Integer type); List<BaseAreaInfoPO> selectAllArea(Integer type);
List<AreaDetailPOExt> selectAllJoinDetail(String crossName, Integer isSignal, Integer isStart, Integer isSend); List<AreaDetailPOExt> selectAllJoinDetail(String crossName, Integer isSignal, Integer isStart, Integer isSend);
List<BaseAreaInfoPO> selectListByParentCode(Integer parentCode);
} }
...@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @author duanruiming * @author duanruiming
...@@ -46,4 +47,10 @@ public class BaseAreaInfoPO { ...@@ -46,4 +47,10 @@ public class BaseAreaInfoPO {
/** 修改时间 */ /** 修改时间 */
@ApiModelProperty(value = "修改时间",notes = "") @ApiModelProperty(value = "修改时间",notes = "")
private Date gmtModified ; private Date gmtModified ;
/**
* 用于封装子集数据
*/
List<BaseAreaInfoPO> areaInfoPOList;
} }
...@@ -131,4 +131,10 @@ ...@@ -131,4 +131,10 @@
ORDER BY t_cross.id ORDER BY t_cross.id
</select> </select>
<select id="selectListByParentCode" resultType="net.wanji.databus.po.BaseAreaInfoPO">
select <include refid="baseColumnList"/>
from t_base_area_info
where parent_code = #{parentCode}
</select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment