代码提交

This commit is contained in:
luozhun 2024-12-19 14:29:26 +08:00
parent b086e5a49f
commit 7656519f5b
2 changed files with 43 additions and 34 deletions

View File

@ -1,6 +1,7 @@
package com.changhu.pojo.dto; package com.changhu.pojo.dto;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import com.changhu.common.db.enums.EducationLevel;
import com.changhu.common.db.enums.ServiceProjectType; import com.changhu.common.db.enums.ServiceProjectType;
import com.changhu.common.db.enums.Sex; import com.changhu.common.db.enums.Sex;
import com.changhu.pojo.model.LegalPersonInfo; import com.changhu.pojo.model.LegalPersonInfo;
@ -81,6 +82,9 @@ public class ServiceProjectDTO {
static class SecurityUserInfo { static class SecurityUserInfo {
@Schema(description = "id") @Schema(description = "id")
private Long snowFlakeId; private Long snowFlakeId;
@JSONField(serializeUsing = MinioPrefixSerializer.class)
@Schema(description = "照片")
private String photo;
@Schema(description = "名字") @Schema(description = "名字")
private String name; private String name;
@Schema(description = "手机号") @Schema(description = "手机号")
@ -103,5 +107,7 @@ public class ServiceProjectDTO {
private String remark; private String remark;
@Schema(description = "创建时间") @Schema(description = "创建时间")
private String createTime; private String createTime;
@Schema(description = "文化程度")
private EducationLevel educationLevel;
} }
} }

View File

@ -43,42 +43,43 @@
property="securityUserList" /> property="securityUserList" />
</resultMap> </resultMap>
<select id="getServiceProjectByEnterprisesUnitId" resultMap="ServiceProjectDTOResultMap"> <select id="getServiceProjectByEnterprisesUnitId" resultMap="ServiceProjectDTOResultMap">
SELECT SELECT sp.*,
sp.*, IF(mpu.snow_flake_id IS NOT NULL,
IF(mpu.snow_flake_id IS NOT NULL,json_object( 'name', mpu.NAME, 'sex', mpu.sex, 'telephone', mpu.telephone, 'idCard', mpu.id_card ),NULL) AS 'projectManagerInfo', json_object('name', mpu.NAME, 'sex', mpu.sex, 'telephone', mpu.telephone, 'idCard', mpu.id_card),
json_object( NULL) AS 'projectManagerInfo',
'name',su1.name, json_object(
'socialCode',su1.social_code, 'name', su1.name,
'businessLicense',su1.business_license, 'socialCode', su1.social_code,
'legalPersonInfo',su1.legal_person_info, 'businessLicense', su1.business_license,
'address',su1.address, 'legalPersonInfo', su1.legal_person_info,
'nature',su1.nature 'address', su1.address,
) as 'securityUnitInfo', 'nature', su1.nature
if(COUNT(su.snow_flake_id)>0,JSON_ARRAYAGG(json_object( ) as 'securityUnitInfo',
'snowFlakeId',su.snow_flake_id, if(COUNT(su.snow_flake_id) > 0, JSON_ARRAYAGG(json_object(
'name',su.name, 'snowFlakeId', su.snow_flake_id,
'telephone',su.telephone, 'photo', su.photo,
'workPost',su.work_post, 'name', su.name,
'sex',su.sex, 'telephone', su.telephone,
'nativePlace',su.native_place, 'workPost', su.work_post,
'idCard',su.id_card, 'sex', su.sex,
'dateOfBirth',su.date_of_birth, 'nativePlace', su.native_place,
'securityNumber',su.security_number, 'idCard', su.id_card,
'homeAddress',su.home_address, 'dateOfBirth', su.date_of_birth,
'remark',su.remark, 'securityNumber', su.security_number,
'createTime',su.create_time 'homeAddress', su.home_address,
)),JSON_ARRAY()) as 'securityUserList' 'remark', su.remark,
FROM 'educationLevel', su.education_level,
service_project sp 'createTime', su.create_time
left join security_unit su1 on sp.security_unit_id = su1.snow_flake_id )), JSON_ARRAY()) as 'securityUserList'
LEFT JOIN mini_program_user mpu ON sp.project_manager_mini_program_user_id = mpu.snow_flake_id AND mpu.identity = 'project_manager' FROM service_project sp
left join security_user su on su.service_project_id = sp.snow_flake_id and su.delete_flag = 0 left join security_unit su1 on sp.security_unit_id = su1.snow_flake_id
WHERE LEFT JOIN mini_program_user mpu ON sp.project_manager_mini_program_user_id = mpu.snow_flake_id AND
sp.delete_flag = 0 mpu.identity = 'project_manager'
left join security_user su on su.service_project_id = sp.snow_flake_id and su.delete_flag = 0
WHERE sp.delete_flag = 0
AND sp.enterprises_unit_id = #{enterprisesUnitId} AND sp.enterprises_unit_id = #{enterprisesUnitId}
group by sp.snow_flake_id group by sp.snow_flake_id
ORDER BY ORDER BY sp.create_time DESC
sp.create_time DESC
</select> </select>
<resultMap id="SecurityUnitUseStatisticsDTOResultMap" type="com.changhu.pojo.dto.SecurityUnitUseStatisticsDTO"> <resultMap id="SecurityUnitUseStatisticsDTOResultMap" type="com.changhu.pojo.dto.SecurityUnitUseStatisticsDTO">
<result <result
@ -170,6 +171,7 @@
TIMESTAMPDIFF(YEAR, su.date_of_birth, CURDATE()) AS 'age', TIMESTAMPDIFF(YEAR, su.date_of_birth, CURDATE()) AS 'age',
su.id_card, su.id_card,
su.telephone, su.telephone,
su.education_level,
eu.name as 'enterprisesUnitName', eu.name as 'enterprisesUnitName',
suu.name as 'securityUnitName', suu.name as 'securityUnitName',
su.security_number su.security_number
@ -199,6 +201,7 @@
TIMESTAMPDIFF(YEAR, su.date_of_birth, CURDATE()) AS 'age', TIMESTAMPDIFF(YEAR, su.date_of_birth, CURDATE()) AS 'age',
su.id_card, su.id_card,
su.telephone, su.telephone,
su.education_level,
eu.name as 'enterprisesUnitName', eu.name as 'enterprisesUnitName',
suu.name as 'securityUnitName', suu.name as 'securityUnitName',
su.security_number su.security_number