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.ProjectMapper">
|
|
|
|
|
<insert id="addDirectors" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
insert into sys_user(user_name, nick_name, phonenumber, password, user_type,
|
|
|
|
|
status, del_flag, create_by, create_time, login_type, dept_id,parent_uuid, id_card)
|
|
|
|
|
values (#{directorsPhone}, #{directorsName}, #{directorsPhone}, #{password},
|
|
|
|
|
'01', '1', '0', #{createPerson}, #{createTime}, '1,2,3', #{deptId},#{uuid},#{directorsIdCard})
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="addSupervisoryUnit">
|
2025-02-10 15:42:24 +08:00
|
|
|
insert into pt_sup_info
|
|
|
|
|
(sup_name, unit_id,unit_uuid, sup_address, legal_name, legal_phone, sup_code, comm_user_id, comm_user_name,
|
|
|
|
|
comm_user_phone, create_user, create_id, uuid, create_time)
|
|
|
|
|
values (#{unitName}, #{jlId},#{jlUuid},#{unitAddress}, #{corporateName}, #{corporatePhone}, #{socialUnifiedCreditCode}, #{id},
|
|
|
|
|
#{directorsName}, #{directorsPhone}, #{createPerson}, #{createPersonId}, #{uuid}, #{createTime})
|
2025-01-16 16:16:53 +08:00
|
|
|
</insert>
|
2025-02-10 15:42:24 +08:00
|
|
|
|
|
|
|
|
<insert id="addSupervisoryUnitUser" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
insert into pt_sup_info_data(
|
|
|
|
|
uuid, sup_name, sup_address, legal_name, legal_phone, sup_code, create_time,
|
|
|
|
|
update_time, create_id, create_user, is_active
|
|
|
|
|
)values (#{uuid},#{unitName},#{unitAddress},#{corporateName},#{corporatePhone},#{socialUnifiedCreditCode},
|
|
|
|
|
now(),now(),#{createPersonId},#{createPerson},1)
|
|
|
|
|
</insert>
|
|
|
|
|
|
2025-01-16 16:16:53 +08:00
|
|
|
<insert id="addConsUnit">
|
|
|
|
|
insert into pt_cont_info(cont_name, cont_address, legal_name, legal_phone, sup_code, con_usert_id,
|
|
|
|
|
comm_usert_name, comm_usert_phone, create_user, create_id, uuid)
|
|
|
|
|
values (#{consName}, #{consAddress}, #{corporateName}, #{corporatePhone}, #{socialUnifiedCreditCode}, #{id},
|
|
|
|
|
#{contractorPrincipal},
|
|
|
|
|
#{contractorPrincipalPhone}, #{createPerson}, #{createPersonId}, #{uuid})
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="addConsPerson" keyProperty="id" useGeneratedKeys="true">
|
|
|
|
|
insert into sys_user(user_name, nick_name, phonenumber, password, user_type,
|
|
|
|
|
status, del_flag, create_by, create_time, login_type, dept_id,parent_uuid,id_card)
|
|
|
|
|
values (#{contractorPrincipalPhone}, #{contractorPrincipal}, #{contractorPrincipalPhone}, #{password},
|
|
|
|
|
'02', '1', '0', #{createPerson}, #{createTime}, '1,2,3', #{deptId},#{uuid},#{contractorPrincipalIdCard})
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="addProInfo" useGeneratedKeys="true" keyProperty="proId">
|
|
|
|
|
insert into pt_project_info(pro_name,pro_user_id, pro_user_name, pro_user_phone, pro_type, is_outsource,
|
2025-02-10 15:42:24 +08:00
|
|
|
plan_start_time, plan_end_time, sup_unit_id, sup_unit_name,
|
|
|
|
|
sup_user_id,sup_user_name,
|
|
|
|
|
pro_status, create_user, create_id, uuid)
|
2025-01-16 16:16:53 +08:00
|
|
|
values (#{proName}, #{proLeaderId},#{proLeader}, #{proLeaderPhone}, #{proType}, #{isOutsourcing}, #{startDate},
|
2025-02-10 15:42:24 +08:00
|
|
|
#{endDate}, #{supervisorUnitId}, #{supervisorUnit},
|
|
|
|
|
#{supervisorUnitUserId},#{supervisorUnitUser},
|
|
|
|
|
'1', #{createPerson}, #{createPersonId}, #{uuid})
|
2025-01-16 16:16:53 +08:00
|
|
|
</insert>
|
|
|
|
|
<insert id="addSupervisoryProject">
|
|
|
|
|
insert into lk_pro_sup(pro_id, sup_uuid, uuid)
|
|
|
|
|
values (#{proId}, #{supUuid}, #{relateUuid})
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="addConsProject">
|
|
|
|
|
insert into lk_pro_cont(pro_id, cont_uuid, uuid,sup_uuid)
|
|
|
|
|
values (#{proId}, #{consId}, #{relateUuid},#{supUuid})
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="addMaterialProject">
|
|
|
|
|
insert into lk_pro_cont_material(pro_id, material_id, cont_id)
|
|
|
|
|
values (#{proId}, #{materialId}, #{consId})
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="addAddressProject">
|
|
|
|
|
insert into lk_pro_address(pro_id, address_id)
|
|
|
|
|
values (#{proId}, #{proAddressId})
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="batchUserPost">
|
|
|
|
|
insert into sys_user_post(user_id, post_id) values
|
|
|
|
|
<foreach item="item" index="index" collection="list" separator=",">
|
|
|
|
|
(#{item.userId},#{item.postId})
|
|
|
|
|
</foreach>
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="batchUserRole">
|
|
|
|
|
insert into sys_user_role(user_id, role_id) values
|
|
|
|
|
<foreach item="item" index="index" collection="list" separator=",">
|
|
|
|
|
(#{item.userId},#{item.roleId})
|
|
|
|
|
</foreach>
|
|
|
|
|
</insert>
|
2025-01-22 15:08:21 +08:00
|
|
|
<insert id="addSupPersonToPsi" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
insert into pt_sup_person(sup_name, phone, post, is_active)
|
|
|
|
|
values (#{name}, #{phone}, '1','1')
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="addSupPersonToLk">
|
|
|
|
|
insert into lk_sup_person(uuid,pro_id, sup_persion_id,sup_uuid,status,is_exist_file)
|
|
|
|
|
values (#{uuid}, #{proId},#{id},#{supUuid},'0','0')
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="addConsPersonToPcp" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
insert into pt_cons_person(cons_name, phone, post, is_active)
|
2025-02-08 18:30:21 +08:00
|
|
|
values (#{name}, #{phone},'0', '1')
|
2025-01-22 15:08:21 +08:00
|
|
|
</insert>
|
|
|
|
|
<insert id="addConsPersonToLk">
|
|
|
|
|
insert into lk_cont_person(uuid,pro_id, cons_persion_id,cont_uuid,is_exist_file)
|
|
|
|
|
values (#{uuid}, #{proId},#{id},#{consUuid},'0')
|
|
|
|
|
</insert>
|
2025-02-10 15:42:24 +08:00
|
|
|
|
2025-01-16 16:16:53 +08:00
|
|
|
<update id="preparation">
|
|
|
|
|
update pt_project_info
|
|
|
|
|
set pro_status = '2'
|
|
|
|
|
where pro_id = #{proId};
|
|
|
|
|
</update>
|
|
|
|
|
<update id="updateProjectInfo">
|
|
|
|
|
update pt_project_info
|
|
|
|
|
set pro_name = #{proName},
|
|
|
|
|
pro_user_name = #{proLeader},
|
|
|
|
|
pro_user_id = #{proLeaderId},
|
|
|
|
|
pro_user_phone = #{proLeaderPhone},
|
|
|
|
|
is_outsource = #{isOutsourcing},
|
|
|
|
|
pro_type = #{proType},
|
|
|
|
|
plan_start_time = #{startDate},
|
|
|
|
|
plan_end_time = #{endDate},
|
|
|
|
|
sup_unit_id = #{supervisorUnitId},
|
|
|
|
|
sup_unit_name = #{supervisorUnit},
|
|
|
|
|
create_user = #{createPerson},
|
2025-02-10 15:42:24 +08:00
|
|
|
create_id = #{createPersonId},
|
|
|
|
|
sup_user_id = #{supervisorUnitUserId},
|
|
|
|
|
sup_user_name = #{supervisorUnitUser}
|
2025-01-16 16:16:53 +08:00
|
|
|
where pro_id = #{proId}
|
|
|
|
|
</update>
|
|
|
|
|
<update id="updateUserStatus">
|
|
|
|
|
update sys_user
|
|
|
|
|
set status = '0'
|
|
|
|
|
where parent_uuid in (select cont_uuid from lk_pro_cont where pro_id = #{proId})
|
|
|
|
|
or parent_uuid in (select sup_uuid from lk_pro_sup where pro_id = #{proId});
|
|
|
|
|
</update>
|
|
|
|
|
<update id="editProInfo">
|
|
|
|
|
update pt_project_info
|
|
|
|
|
set plan_start_time = #{startDate},
|
|
|
|
|
plan_end_time = #{endDate}
|
|
|
|
|
where pro_id = #{proId}
|
|
|
|
|
</update>
|
|
|
|
|
<delete id="del">
|
|
|
|
|
delete
|
|
|
|
|
from pt_project_info
|
|
|
|
|
where pro_id = #{proId}
|
|
|
|
|
</delete>
|
|
|
|
|
<delete id="delConsProject">
|
|
|
|
|
delete
|
|
|
|
|
from lk_pro_cont
|
|
|
|
|
where pro_id = #{proId}
|
|
|
|
|
</delete>
|
|
|
|
|
<delete id="delAddressProject">
|
|
|
|
|
delete
|
|
|
|
|
from lk_pro_address
|
|
|
|
|
where pro_id = #{proId}
|
|
|
|
|
</delete>
|
|
|
|
|
<delete id="delMaterialProject">
|
|
|
|
|
delete
|
|
|
|
|
from lk_pro_cont_material
|
|
|
|
|
where pro_id = #{proId}
|
|
|
|
|
</delete>
|
|
|
|
|
<delete id="delSupervisoryProject">
|
|
|
|
|
delete
|
|
|
|
|
from lk_pro_sup
|
|
|
|
|
where pro_id = #{proId}
|
|
|
|
|
</delete>
|
2025-01-22 15:08:21 +08:00
|
|
|
<delete id="delSupPersonToPsi">
|
|
|
|
|
delete
|
|
|
|
|
from pt_sup_person
|
|
|
|
|
where sup_user_id = (select sup_persion_id from lk_sup_person where pro_id = #{proId})
|
|
|
|
|
</delete>
|
|
|
|
|
<delete id="delSupPersonToLk">
|
|
|
|
|
delete
|
|
|
|
|
from lk_sup_person
|
|
|
|
|
where pro_id = #{proId}
|
|
|
|
|
</delete>
|
|
|
|
|
<delete id="delConsPersonToPcp">
|
|
|
|
|
delete
|
|
|
|
|
from pt_cons_person
|
|
|
|
|
where cons_user_id in (select cons_persion_id from lk_cont_person where pro_id = #{proId})
|
|
|
|
|
</delete>
|
|
|
|
|
<delete id="delConsPersonToLk">
|
|
|
|
|
delete
|
|
|
|
|
from lk_cont_person
|
|
|
|
|
where pro_id = #{proId}
|
|
|
|
|
</delete>
|
2025-01-16 16:16:53 +08:00
|
|
|
|
|
|
|
|
<select id="selectPostList" resultType="com.bonus.project.domain.Project">
|
|
|
|
|
select
|
|
|
|
|
(@rowNum := @rowNum + 1) as exportId,
|
|
|
|
|
ppi.pro_id as proId,
|
|
|
|
|
ppi.pro_name as proName,
|
|
|
|
|
ppi.pro_user_name as proLeader,
|
|
|
|
|
ppi.pro_user_phone as proLeaderPhone,
|
|
|
|
|
sdd.dict_label as proType,
|
|
|
|
|
ppi.plan_start_time as startDate,
|
|
|
|
|
ppi.plan_end_time as endDate,
|
|
|
|
|
sdd1.dict_label as proStatus,
|
|
|
|
|
ppi.create_user as createPerson,
|
|
|
|
|
ppi.create_time as createTime
|
|
|
|
|
from (select @rowNum := 0) r,pt_project_info ppi
|
|
|
|
|
left join sys_dict_data sdd on sdd.dict_value = ppi.pro_type and sdd.dict_type = 'sys_pro_type' and
|
|
|
|
|
sdd.status = '0'
|
|
|
|
|
left join sys_dict_data sdd1 on sdd1.dict_value = ppi.pro_status and sdd1.dict_type = 'sys_pro_status' and
|
|
|
|
|
sdd1.status = '0'
|
|
|
|
|
where ppi.pro_status = '1'
|
|
|
|
|
<if test="proName != null and proName != ''">
|
|
|
|
|
and ppi.pro_name like concat('%', #{proName}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="proLeader != null and proLeader != ''">
|
|
|
|
|
and ppi.pro_user_name like concat('%', #{proLeader}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createPerson != null and createPerson != ''">
|
|
|
|
|
and ppi.create_user like concat('%', #{createPerson}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="proType != null and proType != ''">
|
|
|
|
|
and ppi.pro_type = #{proType}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="startDate != null and startDate != '' ">
|
|
|
|
|
and DATE(ppi.create_time) between #{startDate} and #{endDate}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="proStatus != null and proStatus != ''">
|
|
|
|
|
and ppi.pro_status = #{proStatus}
|
|
|
|
|
</if>
|
|
|
|
|
order by ppi.create_time desc
|
|
|
|
|
</select>
|
|
|
|
|
<select id="checkIsExistUnitName" resultType="java.lang.Integer">
|
|
|
|
|
select count(1)
|
|
|
|
|
from pt_sup_info
|
|
|
|
|
where sup_name = #{unitName}
|
|
|
|
|
and is_active = '1'
|
|
|
|
|
<if test="supId != null and supId != ''">
|
|
|
|
|
and sup_id != #{supId}
|
|
|
|
|
</if>
|
|
|
|
|
limit 1
|
|
|
|
|
</select>
|
|
|
|
|
<select id="checkIsExistDirectors" resultType="com.bonus.common.entity.SysUser">
|
|
|
|
|
select user_id as userId,
|
|
|
|
|
user_name as userName
|
|
|
|
|
from sys_user
|
2025-02-10 15:42:24 +08:00
|
|
|
where phonenumber = #{directorsPhone} and del_flag = '0'
|
2025-01-16 16:16:53 +08:00
|
|
|
limit 1
|
|
|
|
|
</select>
|
|
|
|
|
<select id="checkIsExistConsName" resultType="java.lang.Integer">
|
|
|
|
|
select count(1)
|
|
|
|
|
from pt_cont_info
|
|
|
|
|
where cont_name = #{consName}
|
|
|
|
|
and is_active = '1'
|
|
|
|
|
<if test="consId != null and consId != ''">
|
|
|
|
|
and cont_id != #{consId}
|
|
|
|
|
</if>
|
|
|
|
|
limit 1
|
|
|
|
|
</select>
|
|
|
|
|
<select id="checkIsExistConsPerson" resultType="com.bonus.common.entity.SysUser">
|
|
|
|
|
select user_id as userId,
|
|
|
|
|
user_name as userName
|
|
|
|
|
from sys_user
|
|
|
|
|
where phonenumber = #{contractorPrincipalPhone}
|
|
|
|
|
and del_flag = '0'
|
|
|
|
|
and status = '0'
|
|
|
|
|
limit 1
|
|
|
|
|
</select>
|
|
|
|
|
<select id="checkIsExistProName" resultType="java.lang.Integer">
|
|
|
|
|
select count(1)
|
|
|
|
|
from pt_project_info
|
|
|
|
|
where pro_name = #{proName}
|
|
|
|
|
and is_active = '1'
|
|
|
|
|
<if test="proId != '0' and proId != '' and proId != null">
|
|
|
|
|
and pro_id != #{proId}
|
|
|
|
|
</if>
|
|
|
|
|
limit 1
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectPostDetailsById" resultType="com.bonus.project.domain.Project">
|
|
|
|
|
select ppi.pro_id as proId,
|
|
|
|
|
ppi.pro_name as proName,
|
|
|
|
|
ppi.pro_user_name as proLeader,
|
|
|
|
|
ppi.pro_user_id as proLeaderId,
|
|
|
|
|
ppi.pro_user_phone as proLeaderPhone,
|
|
|
|
|
sdd.dict_label as proTypeName,
|
|
|
|
|
sdd.dict_value as proType,
|
|
|
|
|
ppi.plan_start_time as startDate,
|
|
|
|
|
ppi.plan_end_time as endDate,
|
|
|
|
|
IFNULL(ppi.sup_unit_id, '') as supervisorUnitId,
|
|
|
|
|
ppi.sup_unit_name as supervisorUnit,
|
2025-02-10 15:42:24 +08:00
|
|
|
IFNULL(ppi.sup_user_id, '') as supervisorUnitUserId,
|
|
|
|
|
ppi.sup_user_name as supervisorUnitUser,
|
2025-01-16 16:16:53 +08:00
|
|
|
ppi.pro_status as proStatus,
|
|
|
|
|
ppi.create_user as createPerson,
|
|
|
|
|
ppi.create_time as createTime
|
|
|
|
|
from pt_project_info ppi
|
|
|
|
|
left join sys_dict_data sdd
|
|
|
|
|
on sdd.dict_value = ppi.pro_type and sdd.dict_type = 'sys_pro_type' and
|
|
|
|
|
sdd.status = '0'
|
|
|
|
|
where ppi.pro_id = #{proId}
|
|
|
|
|
and ppi.is_active = '1'
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectConsArrByProId" resultType="com.bonus.project.domain.Contractor">
|
|
|
|
|
select pci.cont_id as value,
|
|
|
|
|
pci.cont_name as label
|
|
|
|
|
from pt_cont_info pci
|
|
|
|
|
left join lk_pro_cont lpc
|
|
|
|
|
on pci.uuid = lpc.cont_uuid
|
|
|
|
|
where lpc.pro_id = #{proId}
|
|
|
|
|
and pci.is_active = '1'
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectProAddressByProId" resultType="com.bonus.project.domain.Address">
|
|
|
|
|
select ppa.address_id as value,
|
|
|
|
|
ppa.pro_address as label,
|
|
|
|
|
ppa.lon as lon,
|
|
|
|
|
ppa.lat as lat
|
|
|
|
|
from pt_pro_address ppa
|
|
|
|
|
left join lk_pro_address lpa
|
|
|
|
|
on ppa.address_id = lpa.address_id
|
|
|
|
|
where lpa.pro_id = #{proId}
|
|
|
|
|
and ppa.is_active = '1'
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectMaterialArrByProId" resultType="java.lang.String">
|
|
|
|
|
select pmt.material_id as value
|
|
|
|
|
from pt_material_template pmt
|
|
|
|
|
left join lk_pro_cont_material lpm
|
|
|
|
|
on pmt.material_id = lpm.material_id
|
|
|
|
|
where lpm.pro_id = #{proId}
|
|
|
|
|
and lpm.cont_id = #{consId}
|
|
|
|
|
and pmt.is_active = '1'
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getConsUuid" resultType="java.lang.String">
|
|
|
|
|
select uuid
|
|
|
|
|
from pt_cont_info
|
|
|
|
|
where cont_id = #{consId}
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getSupUuid" resultType="java.lang.String">
|
|
|
|
|
select uuid
|
|
|
|
|
from pt_sup_info
|
|
|
|
|
where sup_id = #{supervisorUnitId} and is_active = '1'
|
|
|
|
|
</select>
|
|
|
|
|
<select id="checkIsExistIdCard" resultType="java.lang.Integer">
|
|
|
|
|
select count(1)
|
|
|
|
|
from sys_user
|
|
|
|
|
where id_card = #{idCard}
|
|
|
|
|
and del_flag = '0'
|
|
|
|
|
limit 1
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getConsNum" resultType="java.lang.String">
|
|
|
|
|
select
|
|
|
|
|
count(1)
|
|
|
|
|
from lk_pro_cont
|
|
|
|
|
where pro_id = #{proId}
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getSubNum" resultType="java.lang.String">
|
|
|
|
|
select
|
|
|
|
|
count(1)
|
|
|
|
|
from lk_cont_sub lcs
|
|
|
|
|
left join pt_sub_info psi on lcs.sub_uuid = psi.uuid
|
|
|
|
|
where pro_id = #{proId} and psi.is_active = '1'
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getPresentNum" resultType="java.lang.String">
|
|
|
|
|
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 into_status = '2' and out_status != '2' and pcp.is_active = '1'
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getSpecialJobsNum" resultType="java.lang.String">
|
|
|
|
|
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 into_status = '2' and out_status != '2' and pcp.work_type is not null
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getEquipmentNum" resultType="java.lang.String">
|
|
|
|
|
select
|
|
|
|
|
count(1)
|
|
|
|
|
from pt_pro_tools
|
|
|
|
|
where pro_id = #{proId} and is_active = '1'
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getSpecialEquipmentNum" resultType="java.lang.String">
|
|
|
|
|
select
|
|
|
|
|
count(1)
|
|
|
|
|
from pt_pro_tools
|
|
|
|
|
where pro_id = #{proId} and is_active = '1' and tools_type = '2'
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getSupervisorNum" resultType="java.lang.String">
|
|
|
|
|
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 psp.is_active = '1'
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectPhone" resultType="com.bonus.common.core.domain.BaseBean">
|
|
|
|
|
SELECT
|
|
|
|
|
su.phonenumber AS uuid,
|
|
|
|
|
ppi.pro_name AS proName,
|
|
|
|
|
su.user_type AS userType
|
|
|
|
|
FROM
|
|
|
|
|
lk_pro_sup lps
|
|
|
|
|
LEFT JOIN pt_project_info ppi ON lps.pro_id = ppi.pro_id
|
|
|
|
|
LEFT JOIN sys_user su ON lps.sup_uuid = su.parent_uuid
|
|
|
|
|
WHERE
|
|
|
|
|
lps.pro_id = #{proId}
|
|
|
|
|
AND su.user_type = '01' UNION ALL
|
|
|
|
|
SELECT
|
|
|
|
|
su.phonenumber AS uuid,
|
|
|
|
|
ppi.pro_name AS proName,
|
|
|
|
|
su.user_type AS userType
|
|
|
|
|
FROM
|
|
|
|
|
lk_pro_cont lpc
|
|
|
|
|
LEFT JOIN pt_project_info ppi ON lpc.pro_id = ppi.pro_id
|
|
|
|
|
LEFT JOIN sys_user su ON lpc.cont_uuid = su.parent_uuid
|
|
|
|
|
WHERE
|
|
|
|
|
lpc.pro_id = #{proId}
|
|
|
|
|
AND su.user_type = '02'
|
|
|
|
|
</select>
|
2025-01-22 15:08:21 +08:00
|
|
|
<select id="getSupPerson" resultType="com.bonus.project.domain.SubPerson">
|
|
|
|
|
select
|
|
|
|
|
sup_id as supId,
|
|
|
|
|
uuid as supUuid,
|
|
|
|
|
comm_user_name as name,
|
|
|
|
|
comm_user_phone as phone
|
|
|
|
|
from pt_sup_info
|
|
|
|
|
where sup_id = #{supervisorUnitId}
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getConsPerson" resultType="com.bonus.project.domain.SubPerson">
|
|
|
|
|
select
|
|
|
|
|
cont_id as consId,
|
|
|
|
|
uuid as consUuid,
|
|
|
|
|
comm_usert_name as name,
|
|
|
|
|
comm_usert_phone as phone
|
|
|
|
|
from pt_cont_info
|
|
|
|
|
where cont_id = #{consId}
|
|
|
|
|
</select>
|
2025-02-10 15:42:24 +08:00
|
|
|
<select id="getSupervisoryUnitById" resultType="com.bonus.project.domain.SupervisoryUnit">
|
|
|
|
|
select id jlId, uuid jlUuid, sup_name unitName, sup_address unitAddress, legal_name corporateName, legal_phone corporatePhone,
|
|
|
|
|
sup_code socialUnifiedCreditCode
|
|
|
|
|
from pt_sup_info_data
|
|
|
|
|
where id=#{jlId}
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getSupervisoryUnitUser" resultType="java.lang.Integer">
|
|
|
|
|
select count(1)
|
|
|
|
|
from pt_sup_info_data
|
|
|
|
|
where sup_name=#{unitName}
|
|
|
|
|
AND is_active=1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</select>
|
2025-01-16 16:16:53 +08:00
|
|
|
</mapper>
|