SQL 修改

This commit is contained in:
cwchen 2025-08-22 10:06:10 +08:00
parent 6543215b70
commit 183106222f
1 changed files with 9 additions and 6 deletions

View File

@ -29,12 +29,15 @@
</select> </select>
<select id="selectProOrgByTeamId" resultType="com.bonus.system.api.domain.SysUser"> <select id="selectProOrgByTeamId" resultType="com.bonus.system.api.domain.SysUser">
select bsc.pro_id as proId,po.company_id as companyId,po.name as companyName, select bsc."pro_id" as proId,
bp.company_id as orgId from bm_sub_relation bsr po."company_id" as companyId,
left join bm_sub_contract bsc on bsc.id = bsr.sub_contract_id and bsc.is_active = 1 po.NAME as companyName,
left join bm_project bp on bp.id = bsc.pro_id and bp.is_active = 1 bp."company_id" as orgId
LEFT JOIN pm_organization po on po.id = bp.company_id and po.IS_ACTIVE = 1 from "ynrealname"."bm_sub_relation" bsr
where bsr.is_active = 1 and bsr.type = 3 and bsr.value = #{teamId} left join "ynrealname"."bm_sub_contract" bsc on bsc."id" = bsr."sub_contract_id" and bsc."is_active" = 1
left join "ynrealname"."bm_project" bp on bp."id" = bsc."pro_id" and bp."is_active" = 1
LEFT JOIN "ynrealname"."pm_organization" po on po.ID = bp."company_id" and po.IS_ACTIVE = 1
where bsr."is_active" = 1 and bsr."type" = 3 and bsr."value" = #{teamId}
</select> </select>
<select id="getSubCompany" resultType="com.bonus.system.api.domain.SelectBean"> <select id="getSubCompany" resultType="com.bonus.system.api.domain.SelectBean">