select * from sm_pub_filesystem where pk_doc = '2a786927-8b4a-4ff7-b623-a05f0c55894a';
3、基于查询到的内容中filepath字段的pk进行二次查询定位
select storepath,name,filepath from sm_pub_filesystem smfile left join bap_fs_header header on smfile.pk_doc = header.path left join bap_fs_body fbody on header.guid = fbody.headid where smfile.filepath like '01A11000000001PD3E%'
select storepath,name,filepath from sm_pub_filesystem smfile left join bap_fs_header header on smfile.pk_doc = header.path left join bap_fs_body fbody on header.guid = fbody.headid where smfile.filepath like '%人员编码%'
select pk_doc from sm_pub_filesystem where filepath like '%文件名%' select guid from bap_fs_header where path='上个sql查的pk_doc' select * from bap_fs_body where headid='上个sql查到的guid'
N合一
select * from bap_fs_body where headid in(select guid from bap_fs_header where path in(select pk_doc from sm_pub_filesystem where filepath like '%文件名%'))
2 个回复
nccloud
1、首先基于报错信息,排查文件服务器配置是否正常。如果是微服务模式,确保文件服务器业务服务已启动、已注册到注册中心,且环境类型正确。
2、基于报错信息,得知文件路径为“2a786927-8b4a-4ff7-b623-a05f0c55894a”,登录数据库查询文件信息
3、基于查询到的内容中filepath字段的pk进行二次查询定位
4、基于得出的storepath,确认文件再数据库中存在以及保存在文件服务器的具体路径。
5、基于这个路径,登录文件服务器,查看确认对应路径下是否存在相应附件。
扩展.基于人员编码查询该人员上传的附件
nccloud
select pk_doc from sm_pub_filesystem where filepath like '%文件名%'
select guid from bap_fs_header where path='上个sql查的pk_doc'
select * from bap_fs_body where headid='上个sql查到的guid'
N合一
select * from bap_fs_body where headid in(select guid from bap_fs_header where path in(select pk_doc from sm_pub_filesystem where filepath like '%文件名%'))