2026-03-19 18:00:55 +08:00
|
|
|
<?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.zcloud.primeport.persistence.mapper.ClosedAreaPersonApplyMapper">
|
|
|
|
|
|
|
|
|
|
<select id="getCorpUserList" resultType="com.zcloud.primeport.persistence.dataobject.UserDto">
|
|
|
|
|
SELECT
|
|
|
|
|
u.id user_id,
|
|
|
|
|
u.username user_name,
|
|
|
|
|
u.`name`,
|
|
|
|
|
u.corpinfo_id corpId,
|
|
|
|
|
c.corp_name,
|
2026-03-23 11:21:11 +08:00
|
|
|
d.id dept_Id,
|
2026-03-19 18:00:55 +08:00
|
|
|
d.`name` dept_Name,
|
|
|
|
|
u.phone,
|
2026-03-23 11:21:11 +08:00
|
|
|
u.user_avatar_url user_face_url,
|
2026-03-19 18:00:55 +08:00
|
|
|
u.rz_flag,
|
|
|
|
|
u.employment_flag,
|
|
|
|
|
u.user_id_card,
|
|
|
|
|
IFNULL( vehicle_tmp.vehicle_count, 0 ) vehicle_count,
|
|
|
|
|
IFNULL(cafpa.mkmj_permission,2) mkmj_permission
|
|
|
|
|
FROM
|
|
|
|
|
`user` AS u
|
|
|
|
|
LEFT JOIN corp_info c ON u.corpinfo_id = c.id
|
|
|
|
|
LEFT JOIN department d ON u.department_id = d.id
|
|
|
|
|
LEFT JOIN closed_area_fgs_person_auth cafpa on cafpa.user_id = u.user_id and cafpa.delete_enum = 'FALSE'
|
|
|
|
|
LEFT JOIN (
|
|
|
|
|
SELECT
|
|
|
|
|
va.employee_vehicle_user_id,
|
|
|
|
|
COUNT( va.id ) vehicle_count
|
|
|
|
|
FROM
|
|
|
|
|
`vehicle_apply` va
|
|
|
|
|
WHERE
|
|
|
|
|
va.audit_flag = 2
|
|
|
|
|
AND va.vehicle_belong_type = 3
|
|
|
|
|
AND va.delete_enum = 'FALSE'
|
|
|
|
|
GROUP BY
|
|
|
|
|
va.employee_vehicle_user_id
|
|
|
|
|
) vehicle_tmp ON u.user_id = vehicle_tmp.employee_vehicle_user_id
|
|
|
|
|
WHERE
|
|
|
|
|
u.delete_enum = 'FALSE'
|
|
|
|
|
AND u.main_corp_flag = 0
|
|
|
|
|
AND u.corpinfo_id = #{params.corpinfoId}
|
2026-03-20 16:14:27 +08:00
|
|
|
<if test="params.deptId != null">
|
|
|
|
|
AND u.department_id = #{params.deptId}
|
2026-03-19 18:00:55 +08:00
|
|
|
</if>
|
2026-03-20 16:14:27 +08:00
|
|
|
<if test="params.name != null and params.name != ''">
|
|
|
|
|
AND u.name like CONCAT('%', #{params.name}, '%')
|
2026-03-19 18:00:55 +08:00
|
|
|
</if>
|
|
|
|
|
ORDER BY
|
|
|
|
|
u.department_id
|
|
|
|
|
</select>
|
|
|
|
|
<select id="listPage" resultType="com.zcloud.primeport.persistence.dataobject.ClosedAreaPersonApplyDO">
|
|
|
|
|
select * from closed_area_person_apply c
|
|
|
|
|
where c.delete_enum = 'FALSE'
|
2026-03-20 16:14:27 +08:00
|
|
|
<if test="params.processOrRecord != null">
|
|
|
|
|
<if test="params.processOrRecord == 1">
|
2026-03-19 18:00:55 +08:00
|
|
|
AND c.audit_flag = 1
|
|
|
|
|
</if>
|
2026-03-20 16:14:27 +08:00
|
|
|
<if test="params.processOrRecord == 2">
|
2026-03-19 18:00:55 +08:00
|
|
|
AND c.audit_flag != 1
|
|
|
|
|
</if>
|
|
|
|
|
</if>
|
2026-03-20 16:14:27 +08:00
|
|
|
<if test="params.personBelongType != null">
|
|
|
|
|
<if test="params.personBelongType == 4">
|
2026-03-19 18:00:55 +08:00
|
|
|
AND c.person_belong_type = 4
|
|
|
|
|
</if>
|
2026-03-24 17:18:28 +08:00
|
|
|
<if test="params.personBelongType == 1">
|
|
|
|
|
AND c.person_belong_type = 1
|
|
|
|
|
</if>
|
|
|
|
|
<if test="params.personBelongType == 2">
|
|
|
|
|
AND c.person_belong_type = 2
|
|
|
|
|
</if>
|
|
|
|
|
<if test="params.personBelongType == 3">
|
|
|
|
|
AND c.person_belong_type = 3
|
|
|
|
|
</if>
|
|
|
|
|
<if test="params.personBelongType == -1">
|
2026-03-19 18:00:55 +08:00
|
|
|
AND c.person_belong_type != 4
|
|
|
|
|
</if>
|
|
|
|
|
</if>
|
2026-03-20 16:14:27 +08:00
|
|
|
<if test="params.applyPersonUserName != null and params.applyPersonUserName != ''">
|
|
|
|
|
AND c.apply_person_user_name like CONCAT('%', #{params.applyPersonUserName}, '%')
|
2026-03-19 18:00:55 +08:00
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|
|
|
|
|
|