数据库资产授权基本信息查找

master
lwj 2024-09-02 19:45:04 +08:00
parent 0dfcd35fff
commit 4e1f6aadc5
3 changed files with 23 additions and 1 deletions

View File

@ -24,4 +24,7 @@ public interface AccreditMapper {
List<Integer> findUserTableIds(@Param("userId") Long userId);
List<Integer> findDeptTableIds(@Param("deptId") Long deptId);
Accredit findAccreditBasic(@Param("tableId") Long tableId);
}

View File

@ -18,7 +18,11 @@ public class AccreditServiceImpl implements AccreditService{
@Override
public Accredit findAccredit(Long tableId) {
return accreditMapper.findAccredit(tableId);
Accredit accredit = accreditMapper.findAccredit(tableId);
if(accredit==null){
return accreditMapper.findAccreditBasic(tableId);
}
return accredit;
}
@Override

View File

@ -123,5 +123,20 @@
select table_id from middle where dept_id=#{deptId}
</select>
<select id="findAccreditBasic" resultType="com.muyu.domain.Accredit" resultMap="Accredit">
-- 根据
SELECT source.data_resource_name,source.database_name,source.data_sources_system_name,
-- table1.table_name tableNameS,
table2.id,
table2.basic_id,
table2.table_name tableNameB,
table2.data_num,
table2.table_remark
FROM source
left join table_info AS table1 ON table1.basic_id = source.id
left join table_info AS table2 ON table2.parent_id=table1.id
WHERE table1.id=#{tableId}
</select>
</mapper>