Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
long-tern-care-service
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hubin
long-tern-care-service
Commits
f1e1cf19
Commit
f1e1cf19
authored
Apr 22, 2021
by
zhangch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化省市区数据加载问题,增加树形结构返回数据以及一次性返回全部数据接口
parent
78baaeee
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
177 additions
and
2 deletions
+177
-2
DisableController.java
...n/java/com/hungraim/ltc/controller/DisableController.java
+24
-1
FndDistrictMapper.java
...src/main/java/com/hungraim/ltc/dao/FndDistrictMapper.java
+32
-0
DisableService.java
...rc/main/java/com/hungraim/ltc/service/DisableService.java
+16
-1
DisableServiceImpl.java
...ava/com/hungraim/ltc/service/impl/DisableServiceImpl.java
+12
-0
FndDistrictMapper.xml
...y-service/src/main/resources/mapper/FndDistrictMapper.xml
+57
-0
DistrictTreeVo.java
...java/com/hungraim/ltc/pojo/vo/disable/DistrictTreeVo.java
+35
-0
SvrProgramListVo.java
...com/hungraim/ltc/pojo/vo/governance/SvrProgramListVo.java
+1
-0
No files found.
apply/apply-service/src/main/java/com/hungraim/ltc/controller/DisableController.java
View file @
f1e1cf19
...
...
@@ -4,6 +4,7 @@ import cn.hutool.core.util.StrUtil;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.hungraim.ltc.pojo.vo.disable.DisableExamineInfoVO
;
import
com.hungraim.ltc.pojo.vo.disable.DisableVO
;
import
com.hungraim.ltc.pojo.vo.disable.DistrictTreeVo
;
import
com.hungraim.ltc.service.DisableService
;
import
com.hungraim.ltc.pojo.entity.disable.*
;
import
com.hungraim.ltc.util.Result
;
...
...
@@ -41,6 +42,28 @@ public class DisableController {
}
/**
* 获取所有省市区街道数据
*
* @return 返回树形结构省市区数据
*/
@RequestMapping
(
"/allDistrict"
)
public
Result
allDistrict
()
{
List
<
DistrictTreeVo
>
districtTreeVos
=
disableService
.
allDistrict
();
return
Result
.
success
(
districtTreeVos
);
}
/**
* 获取所有省市区街道数据,以树形结构返回
*
* @return 返回树形结构省市区数据
*/
@RequestMapping
(
"/allTreeDistrict"
)
public
Result
allTreeDistrict
()
{
List
<
DistrictTreeVo
>
districtTreeVos
=
disableService
.
getAllDistrictTreeData
();
return
Result
.
success
(
districtTreeVos
);
}
/**
* 查询所有父机构
*/
@RequestMapping
(
"/fndOrganRoot"
)
...
...
@@ -84,7 +107,7 @@ public class DisableController {
* 查询护理机构下所有子机构id
*
* @param organId 机构id
* @return 机构及所有子机构id,
以逗号分隔,
如果没有子机构则只返回机构id
* @return 机构及所有子机构id,
以逗号分隔,
如果没有子机构则只返回机构id
*/
@RequestMapping
(
"/subsidiariesOrganId"
)
public
Result
<
String
>
subsidiariesOrganId
(
String
organId
)
{
...
...
apply/apply-service/src/main/java/com/hungraim/ltc/dao/FndDistrictMapper.java
View file @
f1e1cf19
...
...
@@ -2,9 +2,13 @@ package com.hungraim.ltc.dao;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.hungraim.ltc.pojo.entity.disable.ChFndDistrict
;
import
com.hungraim.ltc.pojo.vo.disable.DistrictTreeVo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* 省市区Mapper
*
...
...
@@ -13,4 +17,32 @@ import org.springframework.stereotype.Repository;
@Mapper
@Repository
public
interface
FndDistrictMapper
extends
BaseMapper
<
ChFndDistrict
>
{
/**
* 获取所有地区的树形结构数据
*
* @return 返回树形结构数据
*/
List
<
DistrictTreeVo
>
getAllDistrictTreeData
();
/**
* 根据parentCode查询节点
*
* @return 返回节点列表
*/
List
<
DistrictTreeVo
>
getAreaChildByParentCode
(
@Param
(
"districtCode"
)
String
districtCode
,
@Param
(
"districtLevel"
)
Integer
districtLevel
);
/**
* 根据parendtCode查询街道数据
*
* @return 返回节点列表
*/
List
<
DistrictTreeVo
>
getStreetList
(
@Param
(
"districtCode"
)
String
districtCode
);
/**
* 一次性加载出所有的数据,包括街道数据
*
* @return 返回数据列表
*/
List
<
DistrictTreeVo
>
getAllDistrictAndStreetData
();
}
apply/apply-service/src/main/java/com/hungraim/ltc/service/DisableService.java
View file @
f1e1cf19
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.hungraim.ltc.pojo.vo.disable.DisableExamineInfoVO
;
import
com.hungraim.ltc.pojo.vo.disable.DisableVO
;
import
com.hungraim.ltc.pojo.entity.disable.*
;
import
com.hungraim.ltc.pojo.vo.disable.DistrictTreeVo
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
...
...
@@ -80,9 +81,23 @@ public interface DisableService {
* 查询护理机构下所有子机构id
*
* @param organId 机构id
* @return 机构及所有子机构id,
以逗号分隔,
如果没有子机构则只返回机构id
* @return 机构及所有子机构id,
以逗号分隔,
如果没有子机构则只返回机构id
*/
String
subsidiariesOrganId
(
String
organId
);
void
updateDisable
(
ChDisableApply
chDisableApply
);
/**
* 获取所有省市区街道数据
*
* @return 返回树形结构省市区数据
*/
List
<
DistrictTreeVo
>
allDistrict
();
/**
* 获取所有省市区街道数据,以树形结构返回
*
* @return 返回树形结构省市区数据
*/
List
<
DistrictTreeVo
>
getAllDistrictTreeData
();
}
apply/apply-service/src/main/java/com/hungraim/ltc/service/impl/DisableServiceImpl.java
View file @
f1e1cf19
...
...
@@ -9,6 +9,7 @@ import com.hungraim.ltc.pojo.entity.assessment.ChAprTask;
import
com.hungraim.ltc.pojo.entity.disable.*
;
import
com.hungraim.ltc.pojo.vo.disable.DisableExamineInfoVO
;
import
com.hungraim.ltc.pojo.vo.disable.DisableVO
;
import
com.hungraim.ltc.pojo.vo.disable.DistrictTreeVo
;
import
com.hungraim.ltc.pojo.vo.disable.ExamineRecord
;
import
com.hungraim.ltc.service.DisableService
;
import
org.apache.commons.lang.StringUtils
;
...
...
@@ -206,4 +207,14 @@ public class DisableServiceImpl implements DisableService {
public
void
updateDisable
(
ChDisableApply
chDisableApply
)
{
disableApplyMapper
.
updateById
(
chDisableApply
);
}
@Override
public
List
<
DistrictTreeVo
>
allDistrict
()
{
return
districtMapper
.
getAllDistrictAndStreetData
();
}
@Override
public
List
<
DistrictTreeVo
>
getAllDistrictTreeData
()
{
return
districtMapper
.
getAllDistrictTreeData
();
}
}
\ No newline at end of file
apply/apply-service/src/main/resources/mapper/FndDistrictMapper.xml
0 → 100644
View file @
f1e1cf19
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.hungraim.ltc.dao.FndDistrictMapper"
>
<resultMap
id=
"areawithChildMap"
type=
"com.hungraim.ltc.pojo.vo.disable.DistrictTreeVo"
>
<id
column=
"DISTRICT_CODE"
property=
"districtCode"
/>
<result
column=
"DISTRICT_LEVEL"
property=
"districtLevel"
/>
<result
column=
"DISTRICT_NAME"
property=
"districtName"
/>
<result
column=
"PARENT_DISTIRCT_CODE"
property=
"parentDistrictCode"
/>
<collection
property=
"childDistrict"
column=
"{districtCode=DISTRICT_CODE,districtLevel=DISTRICT_LEVEL}"
select=
"com.hungraim.ltc.dao.FndDistrictMapper.getAreaChildByParentCode"
>
</collection>
<collection
property=
"childStreet"
column=
"DISTRICT_CODE"
select=
"com.hungraim.ltc.dao.FndDistrictMapper.getStreetList"
>
</collection>
</resultMap>
<resultMap
id=
"streetMap"
type=
"com.hungraim.ltc.pojo.vo.disable.DistrictTreeVo"
>
<id
column=
"STREET_CODE"
property=
"districtCode"
/>
<result
column=
"STREET_NAME"
property=
"districtName"
/>
<result
column=
"AREA_CODE"
property=
"parentDistrictCode"
/>
</resultMap>
<sql
id=
"Base_column"
>
DISTRICT_CODE,DISTRICT_LEVEL,DISTRICT_NAME,PARENT_DISTIRCT_CODE
</sql>
<select
id=
"getAreaChildByParentCode"
resultMap=
"areawithChildMap"
>
SELECT
<include
refid=
"Base_column"
/>
FROM CH_FND_DISTRICT
WHERE PARENT_DISTIRCT_CODE = #{districtCode} AND DISTRICT_LEVEL = #{districtLevel} + 1 AND IS_VALID = 'Y'
</select>
<select
id=
"getAllDistrictTreeData"
resultMap=
"areawithChildMap"
>
SELECT
<include
refid=
"Base_column"
/>
FROM CH_FND_DISTRICT WHERE PARENT_DISTIRCT_CODE IS NULL AND IS_VALID = 'Y' AND DISTRICT_LEVEL = 1
</select>
<select
id=
"getStreetList"
resultMap=
"streetMap"
>
SELECT *
FROM CH_FND_STREET
WHERE AREA_CODE = #{districtCode}
AND IS_VALID = 0
</select>
<select
id=
"getAllDistrictAndStreetData"
resultType=
"com.hungraim.ltc.pojo.vo.disable.DistrictTreeVo"
>
SELECT DISTRICT_CODE districtCode,
DISTRICT_LEVEL districtLevel,
DISTRICT_NAME districtName,
PARENT_DISTIRCT_CODE parentDistrictCode
FROM CH_FND_DISTRICT
WHERE IS_VALID = 'Y'
UNION
SELECT STREET_CODE districtCode,
NULL districtLevel,
STREET_NAME districtName,
AREA_CODE parentDistrictCode
FROM CH_FND_STREET
WHERE IS_VALID = 0
</select>
</mapper>
\ No newline at end of file
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/disable/DistrictTreeVo.java
0 → 100644
View file @
f1e1cf19
package
com
.
hungraim
.
ltc
.
pojo
.
vo
.
disable
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
DistrictTreeVo
{
/**
* 区域code
*/
private
String
districtCode
;
/**
* 区域级别:1省2地级市3县4街道
*/
private
Integer
districtLevel
=
4
;
/**
* 区域名称
*/
private
String
districtName
;
/**
* 父级id
*/
private
String
parentDistrictCode
;
/**
* 省市区子节点
*/
private
List
<
DistrictTreeVo
>
childDistrict
;
/**
* 街道子节点
*/
private
List
<
DistrictTreeVo
>
childStreet
;
}
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/governance/SvrProgramListVo.java
View file @
f1e1cf19
...
...
@@ -78,6 +78,7 @@ public class SvrProgramListVo {
/**
* 创建时间(分配时间)
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
effTime
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment