Compare commits
No commits in common. "c5f5f1df97a9eb0e8066a416193e6a99b21945a8" and "b49833510873da585c372b6dd133393a926f2a39" have entirely different histories.
c5f5f1df97
...
b498335108
|
@ -1,7 +1,6 @@
|
||||||
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;
|
||||||
|
@ -82,9 +81,6 @@ 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 = "手机号")
|
||||||
|
@ -107,7 +103,5 @@ 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,43 +43,42 @@
|
||||||
property="securityUserList" />
|
property="securityUserList" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<select id="getServiceProjectByEnterprisesUnitId" resultMap="ServiceProjectDTOResultMap">
|
<select id="getServiceProjectByEnterprisesUnitId" resultMap="ServiceProjectDTOResultMap">
|
||||||
SELECT sp.*,
|
SELECT
|
||||||
IF(mpu.snow_flake_id IS NOT NULL,
|
sp.*,
|
||||||
json_object('name', mpu.NAME, 'sex', mpu.sex, 'telephone', mpu.telephone, 'idCard', mpu.id_card),
|
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',
|
||||||
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'
|
left join security_unit su1 on sp.security_unit_id = su1.snow_flake_id
|
||||||
FROM service_project sp
|
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_unit su1 on sp.security_unit_id = su1.snow_flake_id
|
left join security_user su on su.service_project_id = sp.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 AND
|
WHERE
|
||||||
mpu.identity = 'project_manager'
|
sp.delete_flag = 0
|
||||||
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 sp.create_time DESC
|
ORDER BY
|
||||||
|
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
|
||||||
|
@ -171,7 +170,6 @@
|
||||||
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
|
||||||
|
@ -201,7 +199,6 @@
|
||||||
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