代码提交
This commit is contained in:
parent
b086e5a49f
commit
7656519f5b
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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),
|
||||||
|
NULL) AS 'projectManagerInfo',
|
||||||
json_object(
|
json_object(
|
||||||
'name',su1.name,
|
'name', su1.name,
|
||||||
'socialCode',su1.social_code,
|
'socialCode', su1.social_code,
|
||||||
'businessLicense',su1.business_license,
|
'businessLicense', su1.business_license,
|
||||||
'legalPersonInfo',su1.legal_person_info,
|
'legalPersonInfo', su1.legal_person_info,
|
||||||
'address',su1.address,
|
'address', su1.address,
|
||||||
'nature',su1.nature
|
'nature', su1.nature
|
||||||
) as 'securityUnitInfo',
|
) as 'securityUnitInfo',
|
||||||
if(COUNT(su.snow_flake_id)>0,JSON_ARRAYAGG(json_object(
|
if(COUNT(su.snow_flake_id) > 0, JSON_ARRAYAGG(json_object(
|
||||||
'snowFlakeId',su.snow_flake_id,
|
'snowFlakeId', su.snow_flake_id,
|
||||||
'name',su.name,
|
'photo', su.photo,
|
||||||
'telephone',su.telephone,
|
'name', su.name,
|
||||||
'workPost',su.work_post,
|
'telephone', su.telephone,
|
||||||
'sex',su.sex,
|
'workPost', su.work_post,
|
||||||
'nativePlace',su.native_place,
|
'sex', su.sex,
|
||||||
'idCard',su.id_card,
|
'nativePlace', su.native_place,
|
||||||
'dateOfBirth',su.date_of_birth,
|
'idCard', su.id_card,
|
||||||
'securityNumber',su.security_number,
|
'dateOfBirth', su.date_of_birth,
|
||||||
'homeAddress',su.home_address,
|
'securityNumber', su.security_number,
|
||||||
'remark',su.remark,
|
'homeAddress', su.home_address,
|
||||||
'createTime',su.create_time
|
'remark', su.remark,
|
||||||
)),JSON_ARRAY()) as 'securityUserList'
|
'educationLevel', su.education_level,
|
||||||
FROM
|
'createTime', su.create_time
|
||||||
service_project sp
|
)), JSON_ARRAY()) as 'securityUserList'
|
||||||
|
FROM service_project sp
|
||||||
left join security_unit su1 on sp.security_unit_id = su1.snow_flake_id
|
left join security_unit su1 on sp.security_unit_id = su1.snow_flake_id
|
||||||
LEFT JOIN mini_program_user mpu ON sp.project_manager_mini_program_user_id = mpu.snow_flake_id AND mpu.identity = 'project_manager'
|
LEFT JOIN mini_program_user mpu ON sp.project_manager_mini_program_user_id = mpu.snow_flake_id AND
|
||||||
|
mpu.identity = 'project_manager'
|
||||||
left join security_user su on su.service_project_id = sp.snow_flake_id and su.delete_flag = 0
|
left join security_user su on su.service_project_id = sp.snow_flake_id and su.delete_flag = 0
|
||||||
WHERE
|
WHERE sp.delete_flag = 0
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue