nxdt-system/bonus-modules/bonus-project/src/main/resources/mapper/system/AdmissionRequestMapper.xml

710 lines
27 KiB
XML
Raw Normal View History

2025-01-16 16:16:53 +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.bonus.project.mapper.AdmissionRequestMapper">
<insert id="insertPersonEnterInfo" useGeneratedKeys="true" keyProperty="consUserId">
INSERT INTO pt_cons_person (cons_name, sex, age, phone, native, id_card, nation, home_address, address, post, work_type, face_path, person_type, create_time, update_time, is_active) VALUES (#{consName},#{sex},#{age},#{phone},#{natives},#{idCard},#{nation},#{homeAddress},#{address},#{post},#{workType},#{facePath},'2',now(),now(),'1')
</insert>
<insert id="addConsInformation">
INSERT INTO pt_cons_information
(uuid,
pro_id,
from_type,
information_type,
information_path,
information_name,
information_size,
information_user_id,
information_user_name,
create_time,
is_active)
VALUES (#{uuid},
#{proId},
#{fromType},
#{informationType},
#{filePath},
#{fileName},
#{fileSize},
#{createId},
#{createUser},
now(),
'1')
</insert>
<insert id="addPersonnelMaterials">
INSERT INTO lk_cont_person
(pro_id,
cont_uuid,
cons_persion_id,
sub_uuid,
uuid,
admission_date,
into_status,
out_status)
VALUES (#{bean.proId},
#{bean.contUuid},
#{bean.consUserId},
#{bean.subUuid},
#{bean.uuid},
now(),
'0',
'0')
</insert>
<insert id="addUserName" useGeneratedKeys="true" keyProperty="id">
INSERT INTO sys_user
(user_name,
nick_name,
dept_id,
id_card,
phonenumber,
password,
user_type,
parent_uuid,
status,
del_flag,
create_by,
create_time,
login_type,
sex)
VALUES (#{phone},
#{consName},
#{deptId},
#{idCard},
#{phone},
#{password},
#{userType},
#{parentUuid},
'1',
'0',
#{createId},
now(),
'1,2,3',
#{sex})
</insert>
<update id="delPerson">
update pt_cons_person set is_active = '0' where cons_user_id = #{id}
</update>
<delete id="delFlowConfiguration">
UPDATE pt_flow_process
SET is_active = '0'
WHERE examine_id IN
<foreach item="addressId" collection="array" open="(" separator="," close=")">
#{addressId}
</foreach>
</delete>
<delete id="delPtCheckConfigurationDetails">
DELETE FROM pt_check_configuration_details
WHERE examine_id = #{examineId}
</delete>
<delete id="delFileById">
UPDATE pt_cons_information
SET is_active = '0'
WHERE uuid = #{uuid}
</delete>
<select id="admissionRequestList" resultType="com.bonus.project.domain.AdmissionRequest">
SELECT lkc.id AS id,
lkc.uuid AS uuid,
lkc.pro_id AS proId,
lkc.cont_uuid AS contUuid,
lkc.cons_persion_id AS consPersonId,
lkc.cont_uuid AS contUuid,
lkc.sub_uuid AS subUuid,
lkc.admission_date AS admissionDate,
lkc.departure_date AS departureDate,
lkc.status AS status,
lkc.task_id AS taskId,
lkc.user_id AS userId,
pcp.cons_user_id AS "consUserId",
pcp.task_id AS "taskId",
pcp.cons_name AS "consName",
pcp.sex AS "sex",
pcp.age AS "age",
pcp.phone AS "phone",
pcp.native AS "natives",
pcp.id_card AS "idCard",
pcp.nation AS "nation",
pcp.home_address AS "homeAddress",
pcp.address AS "address",
pcp.post AS "post",
IFNULL(pcp.work_type, '暂无') AS "workType",
pcp.face_path AS "facePath",
pcp.person_type AS "personType",
pcp.create_time AS "createTime",
pcp.update_time AS "updateTime"
FROM lk_cont_person lkc
LEFT JOIN pt_cons_person pcp ON lkc.cons_persion_id = pcp.cons_user_id
AND pcp.is_active = '1'
where lkc.pro_id = #{bean.proId}
<if test="bean.consName != null and bean.consName != ''">
AND pcp.cons_name = #{bean.consName}
</if>
<if test="userType != null">
<choose>
<when test="userType == '03'">
and lkc.sub_uuid = #{parentUuid}
</when>
<when test="userType == '02'">
and lkc.cont_uuid = #{parentUuid}
</when>
</choose>
</if>
</select>
<select id="selectAdmissionRequestList" resultType="com.bonus.project.domain.AdmissionRequest">
SELECT
lkc.id AS id,
lkc.uuid AS uuid,
lkc.pro_id AS proId,
lkc.cont_uuid AS contUuid,
lkc.cons_persion_id AS consPersonId,
lkc.cont_uuid AS contUuid,
lkc.sub_uuid AS subUuid,
lkc.admission_date AS admissionDate,
lkc.departure_date AS departureDate,
lkc.status AS status,
lkc.task_id AS taskId,
lkc.user_id AS userId,
pcp.cons_user_id AS consUserId,
pcp.task_id AS taskId,
pcp.cons_name AS consName,
pcp.sex AS sex,
pcp.age AS age,
pcp.phone AS phone,
pcp.native AS natives,
pcp.id_card AS idCard,
pcp.nation AS nation,
pcp.home_address AS homeAddress,
pcp.address AS address,
pcp.post AS post,
IFNULL(pcp.work_type, '暂无') AS workType,
pcp.face_path AS facePath,
pcp.person_type AS personType,
pcp.create_time AS createTime,
pcp.update_time AS updateTime
FROM
lk_cont_person lkc
LEFT JOIN
pt_cons_person pcp ON lkc.cons_persion_id = pcp.cons_user_id
AND pcp.is_active = '1'
WHERE lkc.pro_id = #{bean.proId}
<if test="bean.consName != null and bean.consName != ''">
AND pcp.cons_name = #{bean.consName}
</if>
AND ( lkc.user_id =#{userId}
<if test="taskIds != null and taskIds.size() > 0">
OR lkc.id IN
<foreach item="taskId" collection="taskIds" open="(" separator="," close=")">
#{taskId}
</foreach>
</if>
)
</select>
<select id="getData" resultType="com.bonus.project.domain.AdmissionRequest">
SELECT
2025-02-14 09:46:46 +08:00
pcp.cons_user_id AS consUserId,
pcp.task_id AS taskId,
pcp.cons_name AS consName,
pcp.sex AS sex,
pcp.age AS age,
pcp.phone AS phone,
pcp.native AS natives,
su.id_card AS idCard,
pcp.nation AS nation,
pcp.home_address AS homeAddress,
pcp.address AS address,
pcp.post AS post,
IFNULL(work_type, '暂无') AS workType,
pcp.face_path AS facePath,
pcp.person_type AS personType,
pcp.create_time AS createTime,
pcp.update_time AS updateTime
2025-01-16 16:16:53 +08:00
FROM
2025-02-14 09:46:46 +08:00
pt_cons_person pcp
left join sys_user su on pcp.phone = su.phonenumber
2025-01-16 16:16:53 +08:00
WHERE is_active = '1' and cons_user_id = #{consUserId}
</select>
<select id="getFile" resultType="com.bonus.common.entity.SysFileInfo">
SELECT
information_id as id,
information_path AS filePath,
information_name AS name,
information_path AS url,
information_name AS fileName
FROM
pt_cons_information
where is_active = '1'
and uuid = #{uuid}
and information_type = #{informationType}
and from_type = #{fromType};
</select>
<select id="getContPersonByProIdAndOtherId" resultType="com.bonus.project.domain.AdmissionRequest">
SELECT
lkc.id AS id,
lkc.uuid AS uuid,
lkc.pro_id AS proId,
lkc.cont_uuid AS contUuid,
lkc.cons_persion_id AS consPersonId,
lkc.cont_uuid AS contUuid,
lkc.sub_uuid AS subUuid,
lkc.admission_date AS admissionDate,
lkc.departure_date AS departureDate,
lkc.into_status as intoStatus,
2025-02-19 16:35:47 +08:00
#{dataType} as status,
2025-01-16 16:16:53 +08:00
lkc.task_id AS taskId,
lkc.proc_inst_id AS procInsId,
pcp.cons_user_id AS consUserId,
pcp.cons_name AS consName,
if(pcp.sex = 0,'男','女') AS sex,
pcp.age AS age,
pcp.phone AS phone,
pcp.native AS natives,
pcp.id_card AS idCard,
pcp.nation AS nation,
pcp.home_address AS homeAddress,
pcp.address AS address,
sdd.dict_label AS post,
IFNULL(pcp.work_type, '暂无') AS workType,
pcp.face_path AS facePath,
pcp.person_type AS personType,
pcp.create_time AS createTime,
pcp.update_time AS updateTime
FROM
lk_cont_person lkc
LEFT JOIN
pt_cons_person pcp ON lkc.cons_persion_id = pcp.cons_user_id
AND pcp.is_active = '1'
LEFT JOIN sys_dict_data sdd ON pcp.post = sdd.dict_value AND sdd.dict_type = 'sys_cons_post'
<where>
<if test="proId != null and proId != ''">
AND lkc.pro_id = #{proId}
</if>
<if test="consName != null and consName != ''">
AND pcp.cons_name = #{consName}
</if>
<if test="userType == '02' or userType == 02">
AND lkc.cont_uuid = #{contUuid} and (lkc.sub_uuid is null or lkc.sub_uuid = '')
</if>
<if test="userType == '03' or userType == 03">
AND lkc.sub_uuid = #{subUuid}
</if>
<if test="status != null and status != '' and status != 1 and status != '1' and status != '2' and status != 2 ">
AND lkc.into_status = #{status}
</if>
<if test='dataType==1'>
AND lkc.proc_inst_id IN (
<foreach collection="proInsId" item="item" separator=",">
#{item}
</foreach>
)
</if>
<if test="status==2 or status=='2'">
and lkc.into_status = #{status}
</if>
2025-01-16 16:16:53 +08:00
</where>
</select>
<select id="listPersonnelInformation" resultType="com.bonus.project.domain.AdmissionRequest">
SELECT
lkc.id AS id,
lkc.uuid AS uuid,
lkc.pro_id AS proId,
lkc.cont_uuid AS contUuid,
lkc.cons_persion_id AS consPersonId,
lkc.cont_uuid AS contUuid,
lkc.sub_uuid AS subUuid,
lkc.admission_date AS admissionDate,
lkc.departure_date AS departureDate,
case lkc.into_status
when '1' then '待审批'
when '2' then '审批中'
when '3' then '已通过'
when '4' then '已驳回'
when '5' then '已撤回'
end as status,
lkc.task_id_out AS `taskId`,
lkc.proc_inst_id_out as procInsId,
pcp.cons_user_id AS consUserId,
pcp.cons_name AS consName,
if(pcp.sex = '0', '男', '女') AS sex,
pcp.age AS age,
pcp.phone AS phone,
pcp.native AS natives,
pcp.id_card AS idCard,
pcp.nation AS nation,
pcp.home_address AS homeAddress,
pcp.address AS address,
sdd.dict_label AS post,
IFNULL(pcp.work_type, '暂无') AS workType,
pcp.face_path AS facePath,
pcp.person_type AS personType,
pcp.create_time AS createTime,
pcp.update_time AS updateTime
FROM
lk_cont_person lkc
LEFT JOIN
pt_cons_person pcp ON lkc.cons_persion_id = pcp.cons_user_id
AND pcp.is_active = '1'
left join sys_dict_data sdd on sdd.dict_value = pcp.post and sdd.dict_type = 'sys_cons_post' and sdd.status =
'0'
WHERE
lkc.into_status = '3' and lkc.out_status = '0'
<if test="bean.proId != null and bean.proId != ''">
and lkc.pro_id = #{bean.proId}
</if>
<if test="bean.userType == '02' or bean.userType == 02">
AND lkc.cont_uuid = #{bean.contUuid} and (lkc.sub_uuid is null or lkc.sub_uuid = '')
</if>
<if test="bean.userType == '03' or bean.userType == 03">
AND lkc.sub_uuid = #{bean.subUuid}
</if>
<if test="bean.consName != null and bean.consName != ''">
AND pcp.cons_name like concat('%',#{bean.consName},'%')
</if>
<if test="bean.status != null and bean.status != ''">
AND lkc.into_status = #{bean.status}
</if>
</select>
<select id="listEntranceOfPersonnel" resultType="com.bonus.project.domain.AdmissionRequest">
SELECT
lkc.id AS id,
lkc.uuid AS uuid,
lkc.pro_id AS proId,
lkc.cont_uuid AS contUuid,
lkc.cons_persion_id AS consPersonId,
lkc.sub_uuid AS subUuid,
lkc.admission_date AS admissionDate,
lkc.departure_date AS departureDate,
lkc.out_status as intoStatus,
2025-02-20 13:29:19 +08:00
#{bean.dataType} as status,
2025-01-16 16:16:53 +08:00
lkc.task_id_out AS taskId,
lkc.proc_inst_id_out as procInsId,
pcp.cons_user_id AS consUserId,
pcp.cons_name AS consName,
if(pcp.sex = '0', '男', '女') AS sex,
pcp.age AS age,
pcp.phone AS phone,
pcp.native AS natives,
pcp.id_card AS idCard,
pcp.nation AS nation,
pcp.home_address AS homeAddress,
pcp.address AS address,
sdd.dict_label AS post,
IFNULL(pcp.work_type, '暂无') AS workType,
pcp.face_path AS facePath,
pcp.person_type AS personType,
pcp.create_time AS createTime,
pcp.update_time AS updateTime,
lkc.exit_reason as reason
FROM
lk_cont_person lkc
2025-02-20 13:29:19 +08:00
LEFT JOIN pt_cons_person pcp ON lkc.cons_persion_id = pcp.cons_user_id AND pcp.is_active = '1'
left join sys_dict_data sdd on sdd.dict_value = pcp.post and sdd.dict_type = 'sys_cons_post' and sdd.status ='0'
WHERE lkc.into_status = '3' AND lkc.out_status != '0'
2025-01-16 16:16:53 +08:00
<if test="bean.proId != null and bean.proId != ''">
and lkc.pro_id = #{bean.proId}
</if>
<if test="bean.userType == '02' or bean.userType == 02">
AND lkc.cont_uuid = #{bean.contUuid} and (lkc.sub_uuid is null or lkc.sub_uuid = '')
</if>
<if test="bean.userType == '03' or bean.userType == 03">
AND lkc.sub_uuid = #{bean.subUuid}
</if>
<if test="bean.consName != null and bean.consName != ''">
AND pcp.cons_name = #{bean.consName}
</if>
<if test="bean.status != null and bean.status != '' and bean.status != 1 and bean.status != '1'
and bean.status != '2' and bean.status != 2 ">
2025-01-16 16:16:53 +08:00
AND lkc.into_status = #{bean.status}
</if>
<if test='bean.dataType==1'>
AND lkc.proc_inst_id_out IN (
<foreach collection="bean.proInsId" item="item" separator=",">
#{item}
</foreach>
)
</if>
<if test="bean.status==2 or bean.status=='2'">
and lkc.into_status = #{bean.status}
</if>
2025-01-16 16:16:53 +08:00
</select>
<select id="checkUserNameUnique" resultType="com.bonus.project.domain.AdmissionRequest">
SELECT pcp.cons_name AS consName,
pcp.id_card AS idCard,
pcp.cons_user_id as id,
lcp.uuid
FROM pt_cons_person pcp
2025-02-13 16:38:54 +08:00
LEFT JOIN lk_cont_person lcp ON lcp.pro_id = #{proId} AND lcp.cons_persion_id = pcp.cons_user_id
2025-01-16 16:16:53 +08:00
WHERE pcp.phone = #{phone} AND pcp.is_active = '1'
<if test="consUserId != null and consUserId != ''">
and pcp.cons_user_id != #{consUserId}
</if>
2025-02-13 16:38:54 +08:00
limit 1
2025-01-16 16:16:53 +08:00
</select>
<select id="checkUserTypeNameUnique" resultType="com.bonus.project.domain.AdmissionRequest">
SELECT user_id AS id
FROM sys_user
WHERE phonenumber = #{phone}
AND del_flag = '0'
2025-02-08 17:50:59 +08:00
limit 1
2025-01-16 16:16:53 +08:00
</select>
<select id="checkUserType" resultType="com.bonus.project.domain.AdmissionRequest">
SELECT user_id AS id
FROM sys_user
WHERE phonenumber = #{phone}
AND user_type = #{userType}
AND del_flag = '0'
2025-02-08 17:50:59 +08:00
limit 1
2025-01-16 16:16:53 +08:00
</select>
<select id="getDeptId" resultType="java.lang.String">
select
dept_id
from sys_dept
where type = #{type}
</select>
<select id="getRoleId" resultType="java.lang.String">
select
role_id
from sys_role
where role_key = #{type}
</select>
<select id="getFlowSaveXml" resultType="com.bonus.project.domain.FlowSaveXml">
SELECT pfp.examine_name AS examineName,
pfp.examine_type AS examineType,
pfp.business_type AS businessType,
pfp.examine_mark AS examineMark,
pfp.send_from AS ccPersons,
pfp.definition_key AS definitionKey,
lpec.pro_id AS proId
FROM pt_flow_process pfp
LEFT JOIN lk_pro_examine_configuration lpec ON pfp.examine_id = lpec.examine_id
WHERE pfp.examine_id = #{id}
</select>
<select id="getFlowProcess" resultType="com.bonus.project.domain.FlowProcess">
SELECT node_name AS nodeName,
check_person AS checkPersonId,
examine_type AS examineTypes,
deptId AS deptId,
final_judgment AS finalJudgment
FROM pt_check_configuration_details
WHERE examine_id = #{id} and version = #{version}
ORDER BY sort
</select>
<select id="getListFlowConfiguration" resultType="com.bonus.project.domain.FlowSaveXml">
SELECT pfp.examine_id AS examineId,
pfp.definition_key AS definitionKey,
pfp.examine_name AS examineName,
if(pfp.examine_type = '1', '专用审批流', '通用审批流') AS examineType,
pfp.examine_mark AS examineMark,
sdd.dict_label AS businessType,
pfp.status AS status,
pfp.update_time AS updateTime,
IFNULL(ppi.pro_name, '全部工程') AS proName,
su.nick_name AS createUser,
pfp.version
FROM pt_flow_process pfp
LEFT JOIN sys_dict_data sdd
ON pfp.business_type = sdd.dict_value AND sdd.dict_type = 'sys_approval_type'
LEFT JOIN lk_pro_examine_configuration lpec ON pfp.examine_id = lpec.examine_id
LEFT JOIN pt_project_info ppi ON lpec.pro_id = ppi.pro_id AND ppi.is_active = '1'
LEFT JOIN sys_user su ON pfp.create_id = su.user_id AND su.del_flag = '0'
WHERE pfp.is_active = '1'
<if test="examineName != null and examineName != ''">
AND pfp.examine_name LIKE concat('%', #{examineName}, '%')
</if>
<if test="examineType != null and examineType != ''">
AND pfp.examine_type = #{examineType}
</if>
<if test="businessType != null and businessType != ''">
AND pfp.business_type = #{businessType}
</if>
<if test="params.beginTime != null and params.beginTime != ''">
and pfp.create_time between #{params.beginTime} and #{params.endTime}
</if>
</select>
<insert id="addCheckTask" parameterType="com.bonus.project.domain.CheckTaskDo">
insert into pt_check_task(
task_name,process_id,process_state,int_task,ext_task,is_pass,create_user,create_id,version
)
values (
#{taskName},#{processId},#{processState},#{taskId},#{extTask},#{isPass},#{createUser},#{createId},#{version}
)
</insert>
<insert id="addPtFlowProcess" useGeneratedKeys="true" keyProperty="examineId">
insert into pt_flow_process(
send_from,examine_name,examine_type,business_type,examine_mark,create_time,update_time,is_active,status,create_id
)
values (
#{ccPersons},#{examineName},#{examineType},#{businessType},#{examineMark},now(),now(),'1','0',#{createId}
)
</insert>
<insert id="lkProExamineConfiguration">
insert into lk_pro_examine_configuration(
pro_id,examine_id,business_type
)
values (
#{proId},#{examineId},#{businessType}
)
</insert>
<select id="getVersionByexamineId" resultType="string">
select version from pt_flow_process where examine_id = #{examineId}
</select>
<select id="judgeIsFileComplete" resultType="java.lang.Integer">
<if test="userType == '01'">
select
count(1)
from lk_sup_person lsp
left join pt_sup_person psp on lsp.sup_persion_id = psp.sup_user_id
where pro_id = #{proId} and sup_uuid = #{supUuid} and is_exist_file = '0' and psp.is_active = '1'
</if>
<if test="userType == '02' or userType == '03'">
select
count(1)
from lk_cont_person lcp
left join pt_cons_person pcp on lcp.cons_persion_id = pcp.cons_user_id
where pro_id = #{proId} and cont_uuid = #{consUuid} and is_exist_file = '0' and pcp.is_active = '1'
<if test="userType == '03'">
and sub_uuid = #{subUuid}
</if>
</if>
</select>
<select id="selectIsExistFlow" resultType="java.lang.Integer">
select count(1) from pt_flow_process pfp
left join lk_pro_examine_configuration lpec on pfp.examine_id = lpec.examine_id
where pfp.examine_type = #{examineType} and lpec.business_type = #{businessType}
<if test="proId != null and proId != ''">
and lpec.pro_id = #{proId}
</if>
</select>
<insert id="addPtCheckConfigurationDetails">
insert into pt_check_configuration_details(
examine_id,node_name,check_person,examine_type,final_judgment,create_time,is_active,sort,deptId,version
)
values (
#{examineId},#{nodeName},#{checkPerson},#{examineTypes},#{finalJudgment},now(),'1',#{sort},#{deptId},#{version}
)
</insert>
<insert id="addRoleLink">
insert into sys_user_role(
user_id,role_id
)
values (
#{id},#{roleId}
)
</insert>
<update id="updateContPerson" parameterType="string">
update pt_cons_person set task_id = #{taskId} where cons_user_id = #{id}
</update>
<update id="updateLinkStatus">
<if test="userType == '02'">
update lk_pro_cont set into_status = #{status},admission_date = #{admissionDate} where pro_id = #{proId}
and cont_uuid =
#{consUuid}
</if>
<if test="userType == '03'">
update lk_cont_sub set into_status = #{status},admission_date = #{admissionDate} where pro_id = #{proId}
and cont_uuid =
#{consUuid} and
sub_uuid = #{subUuid}
</if>
</update>
<update id="changeFlowStatus">
update pt_flow_process set status = #{status} where examine_id = #{examineId}
</update>
<update id="updatePtFlowProcess">
update pt_flow_process
set examine_name = #{examineName},
examine_type = #{examineType},
business_type = #{businessType},
examine_mark = #{examineMark},
send_from = #{ccPersons},
create_id = #{createId},
version = version +1
where examine_id = #{examineId}
</update>
<update id="updatedefinitionKey">
update pt_flow_process set definition_key = #{definitionKey} where examine_id = #{examineId}
</update>
<update id="updatePersonEnterInfo">
update pt_cons_person
<set>
<if test="consName != null and consName != ''">
cons_name = #{consName},
</if>
<if test="sex != null and sex != ''">
sex = #{sex},
</if>
<if test="age != null">
age = #{age},
</if>
<if test="phone != null and phone != ''">
phone = #{phone},
</if>
<if test="natives != null and natives != ''">
native = #{natives},
</if>
<if test="idCard != null and idCard != ''">
id_card = #{idCard},
</if>
<if test="nation != null and nation != ''">
nation = #{nation},
</if>
<if test="homeAddress != null and homeAddress != ''">
home_address = #{homeAddress},
</if>
<if test="address != null and address != ''">
address = #{address},
</if>
<if test="post != null and post != ''">
post = #{post},
</if>
<if test="workType != null and workType != ''">
work_type = #{workType},
</if>
<if test="facePath != null and facePath != ''">
face_path = #{facePath},
</if>
</set>
where cons_user_id = #{consUserId}
</update>
<update id="updatePersonnelStatus">
update lk_cont_person
set into_status = '0',
is_exist_file = '1'
where uuid = #{uuid}
</update>
<update id="updatePersonStatus">
update lk_cont_person
set into_status = '0',
out_status = '0',
admission_date = null,
departure_date = null
where uuid = #{uuid}
</update>
<update id="updateSysUserInfo">
UPDATE sys_user
SET
<if test="phone != null and phone != ''">user_name = #{phone},</if>
<if test="consName != null and consName != ''">nick_name = #{consName},</if>
<if test="deptId != null and deptId != ''">dept_id = #{deptId},</if>
<if test="idCard != null and idCard != ''">id_card = #{idCard},</if>
<if test="phone != null and phone != ''">phonenumber = #{phone},</if>
<if test="password != null and password != ''">password = #{password},</if>
<if test="parentUuid != null and parentUuid != ''">parent_uuid = #{parentUuid},</if>
del_flag = '0'
WHERE phonenumber = #{phone} and del_flag = '0'
order by user_id desc
limit 1
</update>
</mapper>