Commit 389dd2b5 authored by 朱晨阳's avatar 朱晨阳

查询省市区接口

parent 80283fda
......@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.FinancingInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigInteger;
import java.util.List;
import java.util.Map;
......@@ -32,4 +33,6 @@ public interface FinancingInfoMapper extends BaseMapper<FinancingInfo> {
List<Map<String,Object>> selectRegion();
List<Map<String,Object>> selectRegionByParentCode(String parentCode, String level);
}
......@@ -118,4 +118,15 @@
PARENT_ID = '0'
</select>
<select id="selectRegionByParentCode" resultType="java.util.Map">
select
REGION_NAME regionName,
REGION_CODE regionCode
from
systemctl_region
where
PARENT_REGION_CODE = #{parentCode} and LEVEL = #{level}
</select>
</mapper>
......@@ -11,6 +11,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.math.BigInteger;
import java.util.List;
import java.util.Map;
......@@ -29,7 +30,13 @@ public class CommonController {
return ResponseHelper.buildResponse(financingInfoService.selectRegion());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/selectRegionByParentCode")
@ApiOperation(httpMethod = "GET", value = "查询省市区", notes = "查询省市区")
public ResponseModel<List<Map<String,Object>>> selectRegionByParentCode(@RequestParam(value = "parentCode", defaultValue = "0") String parentCode,
@RequestParam(value = "level", defaultValue = "1") String level) {
return ResponseHelper.buildResponse(financingInfoService.selectRegionByParentCode(parentCode, level));
}
}
......@@ -42,6 +42,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import javax.annotation.Resource;
import java.math.BigInteger;
import java.util.*;
import java.util.stream.Collectors;
......@@ -130,11 +131,15 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
return page;
}
public List<Map<String,Object>> selectRegion(){
return financingInfoMapper.selectRegion();
}
public List<Map<String,Object>> selectRegionByParentCode(String parentCode, String level){
return financingInfoMapper.selectRegionByParentCode(parentCode, level);
}
/**
* 列表查询 示例
......
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