insert into pt_sup_person(sup_name,id_card,sex,age,phone,post,face_path,is_active)
values(#{name},#{idCard},#{sex},#{age},#{phone},#{postName},#{faceUrl},'1')
insert into
sys_user(parent_uuid,dept_id,user_name,nick_name,password,id_card,user_type,phonenumber,status,del_flag,login_type,create_by,sex)
values(#{supUuid},#{deptId},#{phone},#{name},#{password},#{idCard},'05',#{phone},'1','0','1,2,3',#{createUserId},#{sex})
INSERT INTO lk_sup_person (pro_id, uuid, sup_uuid,sup_persion_id, status)
VALUES (#{proId}, #{uuid}, #{supUuid},#{id}, '0')
insert into pt_cons_information(pro_id, uuid, from_type, information_type, information_path, information_name,
information_size, information_user_id, information_user_name, is_active)
values(#{proId}, #{uuid}, #{fromType}, #{informationType}, #{filePath}, #{fileName}, #{fileSize},
#{createUserId}, #{createUser}, '1')
insert into sys_user_role(user_id, role_id)
values(#{id}, #{roleId})
update pt_sup_info_data
set sup_name = #{unitName},
sup_address = #{unitAddress},
legal_name = #{corporateName},
legal_phone = #{corporatePhone},
sup_code = #{socialUnifiedCreditCode}
where id = #{supId}
update lk_pro_sup
set status = #{status}
where pro_id = #{proId} and sup_uuid = #{supUuid}
select status
from lk_pro_sup
where pro_id = #{proId} and sup_uuid = #{supUuid}
update pt_sup_person
sup_name = #{name},
id_card = #{idCard},
sex = #{sex},
age = #{age},
phone = #{phone},
post = #{postName},
face_path = #{faceUrl},
where sup_user_id = #{id}
update lk_sup_person
set is_exist_file = '1'
where uuid = #{uuid}
update pt_sup_info
set comm_user_name=#{directorsName}
where sup_id=#{supId}
update sys_user
set nick_name=#{directorsName}
where user_id=#{commUserId}
update pt_project_info
set sup_user_name=#{directorsName}
where sup_user_id=#{supId}
update pt_sup_info_data set is_active = '0' where id in
#{addressId}
update pt_sup_info set is_active = '0' where sup_id in
#{addressId}
delete from sys_user where id_card = #{idCard} and phonenumber = #{phone} and del_flag = '0'
delete from lk_sup_person where pro_id = #{proId} and sup_uuid = #{supUuid} and sup_persion_id = #{userId}
delete from pt_sup_person where sup_user_id = #{supId} and is_active = 1
update sys_user set del_flag = '2' where user_id=#{userId}
select (@rowNum := @rowNum + 1) as exportId,
psi.id as supId,
psi.uuid as supUuid,
psi.sup_name as unitName,
psi.sup_address as unitAddress,
psi.legal_name as corporateName,
psi.legal_phone as corporatePhone,
psi.sup_code as socialUnifiedCreditCode,
IFNULL(us.num ,0) userNum,
IFNULL(pro.num ,0) status
from (select @rowNum := 0) r,
pt_sup_info_data psi
left join (
select count(1) num , sup_unit_id
from pt_project_info
where sup_unit_id is not null and sup_unit_id!='' and is_active=1
GROUP BY sup_unit_id
)pro on pro.sup_unit_id=psi.id
left join(
select count(1) num ,unit_id
FROM pt_sup_info
where is_active=1
GROUP BY unit_id
)us on us.unit_id=psi.id
where psi.is_active = 1
and psi.sup_name like concat('%',#{unitName},'%')
select (@rowNum := @rowNum + 1) as exportId,
sup_id supId,
comm_user_id commUserId,
comm_user_name directorsName,
comm_user_phone directorsPhone,
comm_user_code commUserCode,
IFNULL(pro.num,0) status
from (select @rowNum := 0) r,
pt_sup_info psi
left join (
select count(1) num , sup_user_id
from pt_project_info
where sup_user_id is not null and sup_user_id!='' and is_active=1
GROUP BY sup_user_id
)pro on pro.sup_user_id=psi.sup_id
where is_active=1 and unit_id=#{unitId}
and comm_user_name like concat('%',#{directorsName},'%')
SELECT
psi.sup_id as supId,
psi.uuid as supUuid,
ppi.pro_name as proName,
psi.sup_name as supName,
psi.sup_code as supCode,
psi.legal_name as legalName,
psi.legal_phone as legalPhone,
#{dataType} as status,
lps.status as intoStatus,
lps.task_id as taskId,
lps.proc_inst_id as procInsId,
ppi.pro_id as proId
FROM lk_pro_sup lps
LEFT JOIN pt_sup_info psi ON lps.sup_uuid = psi.uuid AND psi.is_active = '1'
LEFT JOIN pt_project_info ppi ON lps.pro_id = ppi.pro_id AND ppi.is_active = '1'
WHERE lps.status != '0'
AND lps.status = #{status}
AND lps.proc_inst_id IN (
#{item}
)
and lps.status = #{status}
AND ppi.pro_name like concat('%',#{proName},'%')
AND ppi.sup_unit_name like concat('%',#{supName},'%')
AND ppi.pro_id = #{proId}
select count(1) from sys_user where phonenumber = #{phone} and del_flag = '0'
select dept_id from sys_dept where type = '1' and del_flag = '0'
select role_id from sys_role where role_key = 'sup_person' and del_flag = '0'
select count(1)
from pt_sup_info_data
where is_active=1 and id!=#{supId} and sup_name=#{supName}
select pro_id proId,sup_unit_name supervisorUnit
from pt_project_info
where is_active=1 and sup_unit_id=#{id}
select pro_id proId,sup_user_name supervisorUnit
from pt_project_info
where is_active=1 and sup_user_id=#{id}
select count(1)
from pt_sup_info
where is_active=1 and unit_id=#{id}
select sup_persion_id
from lk_sup_person
where pro_id = #{proId} and sup_uuid = #{supUuid} and sup_persion_id = #{userId}
select comm_user_id userId
from pt_sup_info
where sup_id=#{supId}
select
(@rowNum := @rowNum + 1) as exportId,
lsp.pro_id as proId,
lsp.sup_uuid as supUuid,
lsp.uuid as uuid,
lsp.status as status,
lsp.into_status as intoStatus,
lsp.out_status as outStatus,
lsp.task_id_into as taskId,
lsp.proc_inst_id_into as procInsId,
sup_user_id as id,
sup_name as name,
if(sex = '0','男','女') as sex,
age,
phone,
id_card as idCard,
sdd.dict_label as postName,
face_path as faceUrl
from (select @rowNum := 0) r,pt_sup_person psp
left join (select sup_persion_id,pro_id,sup_uuid,uuid,status,into_status,out_status,task_id_into,proc_inst_id_into from lk_sup_person lpsp where lpsp.pro_id = #{proId}) lsp
on
psp.sup_user_id = lsp.sup_persion_id
left join sys_dict_data sdd on sdd.dict_value = psp.post and sdd.dict_type = 'sys_sup_post' and sdd.status = '0'
where psp.is_active = '1' and lsp.status = '0'
and lsp.sup_uuid = (select uuid from pt_sup_info where
sup_id = #{supId})
and lsp.sup_uuid = #{supUuid}
and psp.sup_name like concat('%', #{supervisorName}, '%')
and psp.sup_name like concat('%', #{name}, '%')
and lsp.into_status = #{intoStatus}
select
(@rowNum := @rowNum + 1) as exportId,
lsp.pro_id as proId,
lsp.sup_uuid as supUuid,
lsp.uuid as uuid,
lsp.status as status,
lsp.into_status as intoStatus,
lsp.out_status as outStatus,
lsp.task_id_into as taskId,
lsp.proc_inst_id_into as procInsId,
sup_user_id as id,
sup_name as name,
if(sex = '0','男','女') as sex,
age,
phone,
id_card as idCard,
sdd.dict_label as postName,
face_path as faceUrl
from (select @rowNum := 0) r,pt_sup_person psp
left join lk_sup_person lsp
on
psp.sup_user_id = lsp.sup_persion_id
left join sys_dict_data sdd on sdd.dict_value = psp.post and sdd.dict_type = 'sys_sup_post' and sdd.status = '0'
where psp.is_active = '1' and lsp.status = '0'
and lsp.sup_uuid = (select uuid from pt_sup_info where
sup_id = #{supId})
and psp.sup_name like concat('%', #{supervisorName}, '%')
and psp.sup_name like concat('%', #{name}, '%')
and lsp.into_status = #{intoStatus}
select
lsp.pro_id as proId,
lsp.sup_uuid as supUuid,
lsp.uuid as uuid,
lsp.status as status,
lsp.into_status as intoStatus,
lsp.out_status as outStatus,
lsp.task_id_out as taskId,
lsp.proc_inst_id_out as procInsId,
sup_user_id as id,
sup_name as name,
if(sex = '0','男','女') as sex,
age,
phone,
id_card as idCard,
sdd.dict_label as postName,
face_path as faceUrl
from pt_sup_person psp
left join (select sup_persion_id,pro_id,sup_uuid,uuid,status,into_status,out_status,proc_inst_id_out,task_id_out from lk_sup_person lpsp where lpsp.pro_id = #{proId}) lsp
on
psp.sup_user_id = lsp.sup_persion_id
left join sys_dict_data sdd on sdd.dict_value = psp.post and sdd.dict_type = 'sys_sup_post' and sdd.status = '0'
where psp.is_active = '1' and lsp.into_status='3' and lsp.out_status in ('0','5')
and lsp.sup_uuid = (select uuid from pt_sup_info where
sup_id = #{supId})
and lsp.sup_uuid = #{supUuid}
and psp.sup_name like concat('%', #{supervisorName}, '%')
and psp.sup_name like concat('%', #{name}, '%')
and lsp.out_status = #{outStatus}
select
lsp.pro_id as proId,
lsp.sup_uuid as supUuid,
lsp.uuid as uuid,
lsp.status as status,
lsp.into_status as intoStatus,
lsp.out_status as outStatus,
lsp.task_id_out as taskId,
lsp.proc_inst_id_out as procInsId,
sup_user_id as id,
sup_name as name,
if(sex = '0','男','女') as sex,
age,
phone,
id_card as idCard,
sdd.dict_label as postName,
face_path as faceUrl
from pt_sup_person psp
left join lk_sup_person lsp
on
psp.sup_user_id = lsp.sup_persion_id
left join sys_dict_data sdd on sdd.dict_value = psp.post and sdd.dict_type = 'sys_sup_post' and sdd.status = '0'
where psp.is_active = '1' and lsp.into_status='3' and lsp.out_status in ('0','5')
and lsp.sup_uuid = (select uuid from pt_sup_info where
sup_id = #{supId})
and psp.sup_name like concat('%', #{supervisorName}, '%')
and psp.sup_name like concat('%', #{name}, '%')
and lsp.out_status = #{outStatus}
select
lsp.pro_id as proId,
lsp.sup_uuid as supUuid,
lsp.uuid as uuid,
lsp.status as status,
lsp.into_status as intoStatus,
lsp.out_status as outStatus,
lsp.task_id_out as taskId,
lsp.proc_inst_id_out as procInsId,
sup_user_id as id,
sup_name as name,
if(sex = '0','男','女') as sex,
age,
phone,
id_card as idCard,
sdd.dict_label as postName,
face_path as faceUrl
from pt_sup_person psp
left join (select sup_persion_id,pro_id,sup_uuid,uuid,status,into_status,out_status,task_id_out,proc_inst_id_out from lk_sup_person lpsp where lpsp.pro_id = #{proId}) lsp
on
psp.sup_user_id = lsp.sup_persion_id
left join sys_dict_data sdd on sdd.dict_value = psp.post and sdd.dict_type = 'sys_sup_post' and sdd.status = '0'
where psp.is_active = '1' and lsp.out_status in ('1','2','3','4')
and lsp.sup_uuid = (select uuid from pt_sup_info where
sup_id = #{supId})
and lsp.sup_uuid = #{supUuid}
and psp.sup_name like concat('%', #{supervisorName}, '%')
and psp.sup_name like concat('%', #{name}, '%')
and lsp.out_status = #{outStatus}
select
lsp.pro_id as proId,
lsp.sup_uuid as supUuid,
lsp.uuid as uuid,
lsp.status as status,
lsp.into_status as intoStatus,
lsp.out_status as outStatus,
lsp.task_id_out as taskId,
lsp.proc_inst_id_out as procInsId,
sup_user_id as id,
sup_name as name,
if(sex = '0','男','女') as sex,
age,
phone,
id_card as idCard,
sdd.dict_label as postName,
face_path as faceUrl
from pt_sup_person psp
left join lk_sup_person lsp
on
psp.sup_user_id = lsp.sup_persion_id
left join sys_dict_data sdd on sdd.dict_value = psp.post and sdd.dict_type = 'sys_sup_post' and sdd.status = '0'
where psp.is_active = '1' and lsp.out_status in ('1','2','3','4')
and lsp.sup_uuid = (select uuid from pt_sup_info where
sup_id = #{supId})
and psp.sup_name like concat('%', #{supervisorName}, '%')
and psp.sup_name like concat('%', #{name}, '%')
and lsp.out_status = #{outStatus}
select
lsp.pro_id as proId,
lsp.sup_uuid as supUuid,
lsp.uuid as uuid,
lsp.status as status,
lsp.into_status as intoStatus,
lsp.out_status as outStatus,
lsp.task_id_out as taskId,
lsp.proc_inst_id_out as procInsId,
lsp.task_id_into as taskId,
lsp.proc_inst_id_into as procInsId,
sup_user_id as id,
sup_name as name,
if(sex = '0','男','女') as sex,
age,
phone,
id_card as idCard,
sdd.dict_label as postName,
face_path as faceUrl
from pt_sup_person psp
left join lk_sup_person lsp
on
psp.sup_user_id = lsp.sup_persion_id
left join sys_dict_data sdd on sdd.dict_value = psp.post and sdd.dict_type = 'sys_sup_post' and sdd.status = '0'
where psp.is_active = '1'
and psp.sup_name like concat('%', #{supervisorName}, '%')
and psp.sup_name like concat('%', #{name}, '%')
and lsp.into_status = #{status}
and lsp.into_status = #{status}
AND lsp.proc_inst_id_into IN (
#{item}
)
and lsp.out_status != '0' and lsp.into_status = '3'
and lsp.out_status = #{status}
and lsp.out_status = #{status}
AND lsp.proc_inst_id_out IN (
#{item}
)