feat(SecurityUnitUseStatisticsDTO): 增加地区信息字段- 在 SecurityUnitUseStatisticsDTO 中添加省、市、区/县、街道名称字段

- 修改 OpenApiMapper.xml,加入地区信息的 SQL 查询
This commit is contained in:
luozhun 2024-11-20 10:40:00 +08:00
parent 8abdda276a
commit 4f9c69f3bd
2 changed files with 19 additions and 1 deletions

View File

@ -49,4 +49,13 @@ public class SecurityUnitUseStatisticsDTO {
@Schema(description = "项目经理联系方式")
private String serviceProjectManagerTelephone;
@Schema(description = "")
private String provinceName;
@Schema(description = "")
private String cityName;
@Schema(description = "区/县")
private String districtsName;
@Schema(description = "街道")
private String streetName;
}

View File

@ -50,13 +50,22 @@
sp.id_number,
su.legal_person_info as 'securityUnitLegalPersonInfo',
mpu.name as 'serviceProjectManagerName',
mpu.telephone as 'serviceProjectManagerTelephone'
mpu.telephone as 'serviceProjectManagerTelephone',
ad1.name as 'provinceName',
ad2.name as 'cityName',
ad3.name as 'districtsName',
ad4.name as 'streetName'
from police_unit pu
join enterprises_unit eu on pu.snow_flake_id = eu.police_unit_id and eu.delete_flag = 0
join service_project sp on eu.snow_flake_id = sp.enterprises_unit_id and sp.delete_flag = 0
join security_unit su on sp.security_unit_id = su.snow_flake_id and su.delete_flag = 0
LEFT join mini_program_user mpu on sp.project_manager_mini_program_user_id = mpu.snow_flake_id
LEFT join security_user suu on suu.service_project_id = sp.snow_flake_id and suu.delete_flag = 0
left join administrative_division ad1 on eu.province = ad1.code and ad1.delete_flag = 0
left join administrative_division ad2 on eu.city = ad2.code and ad2.delete_flag = 0
left join administrative_division ad3 on eu.districts = ad3.code and ad3.delete_flag = 0
left join administrative_division ad4 on eu.street = ad4.code and ad4.delete_flag = 0
where pu.delete_flag = 0
<choose>
<when test="level==1">