select * from u_archive_file where archive_id = #{archiveId} and is_element = 0 order by sort
select *
from u_archives_auto
where is_deleted = 0
select count(id) from u_archives_auto u where u.is_deleted = 0
and u.project_id = #{vo.projectId}
and (u.name like concat('%',#{vo.queryValue},'%') or u.file_number like concat('%',#{vo.queryValue},'%'))
and u.is_auto_file = #{vo.isAutoFile}
and u.is_archive = #{vo.isArchive}
and (u.is_archive is null or u.is_archive != 1)
and u.is_auto_file = #{vo.isAutoFile}
and u.node_id in
#{nodeId}
select * from u_archives_auto u LEFT JOIN m_archive_tree_contract m ON u.node_id = m.id where u.is_deleted = 0
and u.project_id = #{vo.projectId}
and (u.name like concat('%',#{vo.queryValue},'%') or u.file_number like concat('%',#{vo.queryValue},'%'))
and u.is_archive = #{vo.isArchive}
and (u.is_archive is null or u.is_archive != 1)
and u.is_auto_file = #{vo.isAutoFile}
and u.node_id in
#{nodeId}
order by m.tree_sort,u.auto_file_sort is null ,u.auto_file_sort,u.file_number is null,
SUBSTRING_INDEX(u.file_number, '_', 1), SUBSTRING_INDEX(u.file_number, '_', -1) + 0 ,u.create_time asc
limit #{current}, #{size}
select * from u_archives_auto u LEFT JOIN m_archive_tree_contract m ON u.node_id = m.id
where u.is_deleted = 0 and u.page_n = 0
and u.project_id = #{vo.projectId}
and (u.name like concat('%',#{vo.queryValue},'%') or u.file_number like concat('%',#{vo.queryValue},'%'))
and u.is_archive = #{vo.isArchive}
and (u.is_archive is null or u.is_archive != 1)
and u.is_auto_file = #{vo.isAutoFile}
and u.node_id in
#{nodeId}
order by m.tree_sort,u.auto_file_sort is null ,u.auto_file_sort,u.file_number is null,
SUBSTRING_INDEX(u.file_number, '_', 1), SUBSTRING_INDEX(u.file_number, '_', -1) + 0 ,u.create_time asc
limit #{current}, #{size}
update u_archives_auto set node_id = #{nodeId},tree_sort = #{nodeSort} where
id in
#{id}
/**把未锁定案卷的文件关联去掉*/
update u_archive_file
set archive_id = null,
is_archive=0
where is_deleted = 0
and archive_id in (
select id
from u_archives_auto
where project_id = #{projectId}
and is_auto_file
!=1
and is_deleted=0
and is_lock!=1
);
/**把未锁定案卷去掉*/
update u_archives_auto
set is_deleted=1
where project_id = #{projectId}
and is_auto_file!=1
and is_deleted=0
and is_lock!=1;
update u_archive_file
set archive_id = null,
is_archive=0
WHERE is_deleted = 0
AND archive_id IN (
select id
from u_archives_auto
where project_id = #{projectId}
and is_auto_file!=1
and is_deleted=0
and is_lock!=1
and node_id in (
SELECT id FROM m_archive_tree_contract
WHERE project_id = #{projectId}
AND ( contract_id is null OR tree_code = #{treeCode} )
AND ( contract_id = #{contractId} OR tree_code = #{treeCode} )
)
);
update u_archives_auto
set is_deleted=1
where project_id = #{projectId}
and is_auto_file!=1
and is_deleted=0
and is_lock!=1
and node_id in (
SELECT id FROM m_archive_tree_contract
WHERE project_id = #{projectId}
AND ( contract_id is null OR tree_code = #{treeCode} )
AND ( contract_id = #{contractId} OR tree_code = #{treeCode} )
);
update u_archive_file
set archive_id = null,
is_archive=0
WHERE is_deleted = 0
AND archive_id IN (
SELECT id
FROM u_archives_auto
WHERE project_id = #{projectId}
AND is_auto_file
!= 1
AND is_deleted = 0
AND is_lock != 1
AND node_id IN (
SELECT id FROM m_archive_tree_contract
WHERE
is_deleted = 0
AND project_id = #{projectId}
AND ancestors IS NOT NULL
AND ancestors LIKE concat(''
, #{ancestors}
, '%')
OR id = #{nodeId}
)
);
update u_archives_auto
set is_deleted=1
where project_id = #{projectId}
AND is_auto_file != 1
AND is_deleted = 0
AND is_lock != 1
AND node_id IN (
SELECT id FROM m_archive_tree_contract
WHERE
is_deleted = 0 AND project_id = #{projectId}
AND ancestors IS NOT NULL
AND ancestors LIKE concat(''
, #{ancestors}
, '%')
OR id = #{nodeId}
);
select pdf_page_url
from u_archive_file
where is_deleted = 0 and pdf_page_url!= file_url
and archive_id in (
select id
from u_archives_auto
where project_id = #{projectId}
and is_auto_file
!=1
and is_deleted=0
and is_lock!=1
)
select pdf_page_url
from u_archive_file
where is_deleted = 0 and pdf_page_url!= file_url
and archive_id in (
select id
from u_archives_auto
where project_id = #{projectId}
and is_auto_file
!=1
and is_deleted=0
and is_lock!=1
and node_id in (
SELECT id FROM m_archive_tree_contract
WHERE is_deleted = 0
AND project_id = #{projectId}
AND ( contract_id = #{contractId}
OR tree_code = #{treeCode} )
)
);
select pdf_page_url
from u_archive_file
where is_deleted = 0 and pdf_page_url!= file_url
and archive_id in (
SELECT id
FROM u_archives_auto
WHERE project_id = #{projectId}
AND is_auto_file
!= 1
AND is_deleted = 0
AND is_lock != 1
AND node_id IN (
SELECT id FROM m_archive_tree_contract
WHERE
is_deleted = 0
AND project_id = #{projectId}
AND ancestors IS NOT NULL
AND ancestors LIKE concat(''
, #{ancestors}
, '%')
OR id = #{nodeId}
)
);
select out_url
from u_archives_auto
where project_id = #{projectId}
and is_auto_file!=1
and is_deleted=0
and is_lock!=1
select out_url
from u_archives_auto
where project_id = #{projectId}
and is_auto_file!=1
and is_deleted=0
and is_lock!=1
and node_id in (
SELECT id FROM m_archive_tree_contract
WHERE project_id = #{projectId}
AND ( contract_id is null OR tree_code = #{treeCode} )
AND ( contract_id = #{contractId} OR tree_code = #{treeCode} )
)
select out_url
from u_archives_auto
where project_id = #{projectId}
AND is_auto_file != 1
AND is_deleted = 0
AND is_lock != 1
AND node_id IN (
SELECT id FROM m_archive_tree_contract
WHERE project_id = #{projectId}
AND ancestors IS NOT NULL
AND ancestors LIKE concat(''
, #{ancestors}
, '%')
OR id = #{nodeId}
)
select *
from u_archives_auto
where project_id = #{projectId} and is_deleted = 0;
select uaa.*
from m_archive_tree_contract matc left join u_archives_auto uaa on matc.id = uaa.node_id left join
u_archive_file uaf on uaa.id = uaf.archive_id
where uaa.is_deleted = 0 and uaa.is_archive = 1
and matc.project_id = #{vo.projectId}
and uaa.contract_id = #{vo.contractId} and matc.contract_id = #{vo.contractId}
and uaa.name like concat('%',#{vo.queryValue},'%')
and uaf.file_name like concat('%',#{vo.queryValue},'%')
and uaa.storage_time in
#{storageTime}
and uaa.secret_level in
#{secretLevel}
and uaa.carrier_type in
#{carrierType}
and
#{year} BETWEEN DATE_FORMAT(uaa.start_date,'%Y') and DATE_FORMAT(uaa.end_date ,'%Y')
and
#{month} BETWEEN DATE_FORMAT(uaa.start_date,'%c') and DATE_FORMAT(uaa.end_date ,'%c')
GROUP BY uaa.id
order by uaa.tree_sort,uaa.auto_file_sort,uaa.file_number asc
select uaa.*
from m_archive_tree_contract matc left join u_archives_auto uaa on matc.id = uaa.node_id
where uaa.is_deleted = 0 and uaa.is_archive = 1
and (uaa.name like concat('%',#{vo.queryValue},'%') or uaa.file_number like concat('%',#{vo.queryValue},'%'))
and (
uaa.name like concat('%',#{query},'%')
)
and matc.project_id = #{vo.projectId}
and uaa.contract_id = #{vo.contractId} and matc.contract_id = #{vo.contractId}
and uaa.storage_time in
#{storageTime}
and uaa.secret_level in
#{secretLevel}
and uaa.carrier_type in
#{carrierType}
and
#{year} BETWEEN DATE_FORMAT(uaa.start_date,'%Y') and DATE_FORMAT(uaa.end_date ,'%Y')
and
#{month} BETWEEN DATE_FORMAT(uaa.start_date,'%c') and DATE_FORMAT(uaa.end_date ,'%c')
GROUP BY uaa.id
order by uaa.tree_sort,uaa.auto_file_sort,uaa.file_number asc
select uaa.* from
(SELECT id FROM m_archive_tree_contract WHERE project_id =#{vo.projectId}
and 1=2
or ancestors like concat('%',#{nodeId},'%') or id = #{nodeId}
) matc left join u_archives_auto uaa on matc.id = uaa.node_id left join u_archive_file uaf on uaa.id =
uaf.archive_id
where uaa.is_deleted = 0 and uaa.is_archive = 1
and uaa.contract_id = #{vo.contractId}
and uaa.name like concat('%',#{vo.queryValue},'%')
and (
uaa.name like concat('%',#{query},'%')
)
and uaf.file_name like concat('%',#{vo.queryValue},'%')
and uaa.storage_time in
#{storageTime}
and uaa.secret_level in
#{secretLevel}
and uaa.carrier_type in
#{carrierType}
and
#{year} BETWEEN DATE_FORMAT(uaa.start_date,'%Y') and DATE_FORMAT(uaa.end_date ,'%Y')
and
#{month} BETWEEN DATE_FORMAT(uaa.start_date,'%c') and DATE_FORMAT(uaa.end_date ,'%c')
GROUP BY uaa.id
order by uaa.tree_sort,uaa.auto_file_sort,uaa.file_number asc
select uaa.* from
(SELECT id FROM m_archive_tree_contract WHERE project_id =#{vo.projectId}
and 1=2
or ancestors like concat('%',#{nodeId},'%') or id = #{nodeId}
) matc left join u_archives_auto uaa on matc.id = uaa.node_id
where uaa.is_deleted = 0 and uaa.is_archive = 1
and (uaa.name like concat('%',#{vo.queryValue},'%') or uaa.file_number like concat('%',#{vo.queryValue},'%'))
and uaa.contract_id = #{vo.contractId}
and uaa.storage_time in
#{storageTime}
and uaa.secret_level in
#{secretLevel}
and uaa.carrier_type in
#{carrierType}
and
#{year} BETWEEN DATE_FORMAT(uaa.start_date,'%Y') and DATE_FORMAT(uaa.end_date ,'%Y')
and
#{month} BETWEEN DATE_FORMAT(uaa.start_date,'%c') and DATE_FORMAT(uaa.end_date ,'%c')
GROUP BY uaa.id
order by uaa.tree_sort,uaa.auto_file_sort,uaa.file_number asc
select uaa.id,uaa.name,uaa.file_number,uaa.unit,uaa.storage_time,uaa.secret_level,uaa.start_date,uaa.end_date
from
(SELECT id FROM m_archive_tree_contract WHERE project_id =#{vo.projectId}
and ancestors like concat('%',#{vo.nodeId},'%')
) matc left join u_archives_auto uaa on matc.id = uaa.node_id
where uaa.is_deleted = 0 and uaa.is_archive = 1
and uaa.contract_id = #{vo.contractId}
GROUP BY uaa.id
order by uaa.tree_sort,uaa.auto_file_sort,uaa.file_number asc
select uaa.id from
(SELECT id FROM m_archive_tree_contract WHERE project_id =#{vo.projectId}
and ancestors like concat('%',#{vo.nodeId},'%')
) matc left join u_archives_auto uaa on matc.id = uaa.node_id
where uaa.is_deleted = 0 and uaa.is_archive = 1
and uaa.contract_id = #{vo.contractId}
and uaa.name like concat('%',#{vo.queryValue},'%') or uaa.file_number like concat('%',#{vo.queryValue},'%')
and uaa.storage_time in
#{storageTime}
and uaa.secret_level in
#{secretLevel}
and uaa.carrier_type in
#{carrierType}
and
#{year} BETWEEN DATE_FORMAT(uaa.start_date,'%Y') and DATE_FORMAT(uaa.end_date ,'%Y')
and
#{month} BETWEEN DATE_FORMAT(uaa.start_date,'%c') and DATE_FORMAT(uaa.end_date ,'%c')
GROUP BY uaa.id
order by uaa.tree_sort,uaa.auto_file_sort,uaa.file_number asc
select uaa.id from
(SELECT id FROM m_archive_tree_contract WHERE project_id =#{vo.projectId}
and ancestors like concat('%',#{vo.nodeId},'%')
) matc left join u_archives_auto uaa on matc.id = uaa.node_id left join u_archive_file uaf on uaa.id =
uaf.archive_id
where uaa.is_deleted = 0 and uaa.is_archive = 1
and uaa.contract_id = #{vo.contractId}
and uaf.file_name like concat('%',#{vo.queryValue},'%')
and uaa.storage_time in
#{storageTime}
and uaa.secret_level in
#{secretLevel}
and uaa.carrier_type in
#{carrierType}
and
#{year} BETWEEN DATE_FORMAT(uaa.start_date,'%Y') and DATE_FORMAT(uaa.end_date ,'%Y')
and
#{month} BETWEEN DATE_FORMAT(uaa.start_date,'%c') and DATE_FORMAT(uaa.end_date ,'%c')
GROUP BY uaa.id
order by uaa.tree_sort,uaa.auto_file_sort,uaa.file_number asc
select uaa.id,uaa.name,uaa.file_number,uaa.unit from
(SELECT id FROM m_archive_tree_contract WHERE project_id =#{vo.projectId}
and ancestors like concat('%',#{vo.nodeId},'%')
) matc left join u_archives_auto uaa on matc.id = uaa.node_id
where uaa.is_deleted = 0 and uaa.is_archive = 1
and uaa.contract_id = #{vo.contractId}
GROUP BY uaa.id
order by uaa.tree_sort,uaa.auto_file_sort,uaa.file_number asc
-- order by uaa.id
select uaa.id from
(SELECT id FROM m_archive_tree_contract WHERE project_id =#{vo.projectId}
and ancestors like concat('%',#{vo.nodeId},'%')
) matc left join u_archives_auto uaa on matc.id = uaa.node_id
where uaa.is_deleted = 0 and uaa.is_archive = 1
and uaa.contract_id = #{vo.contractId}
and uaa.name like concat('%',#{vo.queryValue},'%')
and uaa.storage_time in
#{storageTime}
and uaa.secret_level in
#{secretLevel}
and uaa.carrier_type in
#{carrierType}
and
#{year} BETWEEN DATE_FORMAT(uaa.start_date,'%Y') and DATE_FORMAT(uaa.end_date ,'%Y')
and
#{month} BETWEEN DATE_FORMAT(uaa.start_date,'%c') and DATE_FORMAT(uaa.end_date ,'%c')
GROUP BY uaa.id
order by uaa.tree_sort,uaa.auto_file_sort,uaa.file_number asc
-- order by uaa.id
select uaa.id from
(SELECT id FROM m_archive_tree_contract WHERE project_id =#{vo.projectId}
and ancestors like concat('%',#{vo.nodeId},'%')
) matc left join u_archives_auto uaa on matc.id = uaa.node_id left join u_archive_file uaf on uaa.id =
uaf.archive_id
where uaa.is_deleted = 0 and uaa.is_archive = 1
and uaa.contract_id = #{vo.contractId}
and uaa.name like concat('%',#{vo.queryValue},'%')
and uaf.file_name like concat('%',#{vo.queryValue},'%')
and uaa.storage_time in
#{storageTime}
and uaa.secret_level in
#{secretLevel}
and uaa.carrier_type in
#{carrierType}
and
#{year} BETWEEN DATE_FORMAT(uaa.start_date,'%Y') and DATE_FORMAT(uaa.end_date ,'%Y')
and
#{month} BETWEEN DATE_FORMAT(uaa.start_date,'%c') and DATE_FORMAT(uaa.end_date ,'%c')
GROUP BY uaa.id
order by uaa.tree_sort,uaa.auto_file_sort,uaa.file_number asc
-- order by uaa.id
SELECT uaa.id, matc.tree_code as 'contractType'
FROM m_archive_tree_contract matc
left join u_archives_auto uaa on uaa.node_id = matc.id
WHERE uaa.project_id = #{projectId}
and uaa.is_deleted = #{type}
and uaa.is_destroy = #{type}
SELECT CASE uaa.storage_time WHEN '1' THEN '10年' WHEN '2' THEN '30年' ELSE '永久' END as name,
COUNT(uaa.storage_time) as value
FROM m_archive_tree_contract matc left join u_archives_auto uaa
on uaa.node_id =matc.id
WHERE matc.project_id =#{projectId} and uaa.is_deleted =0
GROUP BY uaa.storage_time
select uaa.id,uaa.file_number,uaa.name,uaa.file_size,CASE uaa.storage_time WHEN '1' THEN '10年' WHEN '2' THEN
'30年' ELSE '永久' END as storageTimeValue
from(
select id from m_archive_tree_contract
where project_id = #{vo.projectId} and ancestors like concat('%', #{vo.nodeId}, '%') and is_deleted = 0 or id =
#{vo.nodeId}
) matc
left join u_archives_auto uaa on matc.id = uaa.node_id
where
uaa.is_deleted = 0 and uaa.is_destroy = 0
uaa.is_deleted = 1 and uaa.is_destroy = 1
and uaa.storage_time = #{vo.storageTime}
and uaa.unit = #{vo.filingUnit}
and uaa.update_user = #{vo.destroyUser}
and uaa.file_size < 81920
and uaa.file_size < 153600
and uaa.file_size < 204800
and uaa.file_size BETWEEN 204800 and 512000
and uaa.file_size > 512000
and uaa.is_archive = 1
order by uaa.tree_sort,uaa.auto_file_sort,uaa.file_number asc
SELECT unit
FROM u_archives_auto
WHERE project_id = #{projectId}
and is_deleted = 0
AND unit is not NULL
GROUP BY unit
SELECT *
FROM blade_dict_biz
WHERE code = 'storage_type'
AND parent_id > 0
AND tenant_id = 000000
SELECT br.role_name
FROM blade_role br
WHERE br.id = (
SELECT role_id
FROM m_project_assignment_user
WHERE project_id = #{projectId}
AND contract_id = #{contractId}
AND user_id = #{userId}
)
SELECT id,real_name FROM blade_user WHERE id IN (SELECT uaa.update_user FROM u_archives_auto uaa
WHERE uaa.is_deleted = 1 AND uaa.is_destroy = 1 and project_id = #{projectId}
GROUP BY uaa.update_user )
select sum(uaa.file_size) from u_archives_auto uaa WHERE uaa.project_id = #{projectId} and is_deleted = 0
select *
from u_archives_auto uaa WHERE uaa.id = #{id} and is_deleted = 0
SELECT matc1.*
FROM m_archive_tree_contract matc1
WHERE matc1.parent_id in (select id from m_archive_tree_contract
WHERE parent_id = (select id from m_archive_tree_contract WHERE parent_id = 0 and project_id = #{projectId} and is_deleted = 0)
and is_deleted = 0 and tree_code is NULL)
and matc1.is_deleted = 0
select SUBSTRING_INDEX(SUBSTRING_INDEX(atc.ancestors,",",4),",",-1) as masterNode,uaa.*
from (select * from m_archive_tree_contract WHERE is_deleted = 0 and ancestors like concat('%',#{node},'%')) atc
join u_archives_auto uaa on atc.id = uaa.node_id and uaa.is_deleted = 0
select id,file_name,pdf_file_url,archive_id,project_id FROM u_archive_file
WHERE is_element = 0 and is_deleted = 0 and archive_id in
#{id}
select * from u_archive_file where is_deleted = 0
and archive_id in
#{id}
order by sort,create_time
select id,name
from u_archives_auto
where id in
#{id}
select * from m_archive_tree_contract WHERE is_deleted = 0 and parent_id = #{firstNode}
select * from m_archive_tree_contract WHERE is_deleted = 0 and parent_id in
#{id}
select * from m_archive_tree_contract WHERE is_deleted = 0 and parent_id =
(select id from m_archive_tree_contract
WHERE project_id = #{projectId} and is_deleted = 0 and parent_id = 0)
and tree_code is null
and tree_code = #{nodeType}
select
concat(matc.ancestors,',',matc.id) as ancestors,
uaa.id,uaa.name,uaa.page_n ,uaa.remark ,uaa.file_number,uaa.unit,uaa.start_date,uaa.end_date,
(select bdb.dict_value from blade_dict_biz bdb WHERE bdb.is_sealed = 0 and bdb.code = 'storage_period' and bdb.dict_key = uaa.storage_time limit 1 ) as storageTimeValue
from m_archive_tree_contract matc right join u_archives_auto uaa on matc.id = uaa.node_id
WHERE uaa.is_deleted = 0 and matc.is_deleted = 0 and uaa.is_apply = #{isApply} and matc.ancestors like concat("%",#{firstNode},"%")
order by uaa.tree_sort
select uaa.id ,uaa.file_number,uaa.name ,uaa.unit,
if((select count(1) from u_archive_expert_inspection aei where aei.is_deleted =0 and aei.archive_id = uaa.id and aei.conclusion_id = #{conclusionId}
and aei.expert_id = #{userId}) > 0,'已抽检','未抽检') as inspectStatusName,
(CASE when (select count(1) from u_archive_expert_inspection aei where aei.is_deleted =0 and aei.archive_id = uaa.id and aei.conclusion_id = #{conclusionId}
and aei.expert_id = #{userId} and is_pass = 1) = 1 then '合格'
when (select count(1) from u_archive_expert_inspection aei where aei.is_deleted =0 and aei.archive_id = uaa.id and aei.conclusion_id = #{conclusionId}
and aei.expert_id = #{userId} and is_pass = 0) > 0 then '整改' else null end) as updateStatusName
from m_archive_tree_contract atc right join u_archives_auto uaa on atc.id = uaa.node_id
WHERE uaa.is_apply = 1 and uaa.project_id = #{projectId} and atc.project_id = #{projectId} and atc.is_deleted = 0 and uaa.is_deleted =0
and (atc.id =#{id} or FIND_IN_SET(#{id}, atc.ancestors))
and uaa.name like concat('%',#{searchValue},'%')
and (select COUNT(1) from u_archive_file uaf WHERE uaf.archive_id = uaa.id and uaf.file_name like concat('%',#{searchValue},'%'))
select uaa.id ,uaa.file_number,uaa.name ,uaa.unit,
if((select count(1) from u_archive_expert_inspection aei where aei.is_deleted =0 and aei.archive_id = uaa.id and aei.conclusion_id = #{conclusionId}
and aei.expert_id = #{userId}) > 0,'已抽检','未抽检') as inspectStatusName,
(CASE when (select count(1) from u_archive_expert_inspection aei where aei.is_deleted =0 and aei.archive_id = uaa.id and aei.conclusion_id = #{conclusionId}
and aei.expert_id = #{userId} and is_pass = 1) = 1 then '合格'
when (select count(1) from u_archive_expert_inspection aei where aei.is_deleted =0 and aei.archive_id = uaa.id and aei.conclusion_id = #{conclusionId}
and aei.expert_id = #{userId} and is_pass = 0) > 0 then '整改' else null end) as updateStatusName
from m_archive_tree_contract atc right join u_archives_auto uaa on atc.id = uaa.node_id
WHERE uaa.is_apply = 1 and uaa.project_id = #{projectId} and atc.project_id = #{projectId} and atc.is_deleted = 0 and uaa.is_deleted =0
and (atc.id =#{id} or FIND_IN_SET(#{id}, atc.ancestors))
and FIND_IN_SET(#{userId}, uaa.expert_id)
and uaa.name like concat('%',#{searchValue},'%')
and (select COUNT(1) from u_archive_file uaf WHERE uaf.archive_id = uaa.id and uaf.file_name like concat('%',#{searchValue},'%'))
select id,expert_id
from u_archives_auto where is_deleted = 0 and is_apply = 1 and node_id in
#{id}
SELECT COUNT(1) from u_archives_auto
WHERE project_id = #{projectId} and is_deleted = 0 and FIND_IN_SET(#{userId},expert_id)
SELECT COUNT(1)
from (SELECT DISTINCT (archive_id)
from u_archive_expert_inspection
WHERE project_id = #{projectId}
and is_deleted = 0
and expert_id = #{userId}
and conclusion_id = #{conclusionId}
) a
select aei.id,aei.archive_name ,aei.opinion , aei.archive_id,expert_name,file_id,aei.is_pass,aei.conclusion_id,
(case when unit_type = 1 then '施工' when unit_type = 2 then '监理' else '业主' end) as unitName,
(select uaf.pdf_file_url from u_archive_file uaf where uaf.id = aei.file_id) as filePdf
from u_archive_expert_inspection aei
WHERE project_id = #{projectId} and is_deleted = 0 and is_pass = 0 and conclusion_id = #{conclusionId}
and expert_id = #{userId}
order BY update_time DESC
SELECT (case when contract_id is null then '3' when contract_id = -1 then '3' else (SELECT contract_type from m_contract_info mci WHERE mci.id = uaa.contract_id) end) as unitType,
uaa.*
from u_archives_auto uaa WHERE project_id = #{projectId} and is_deleted = 0 and is_apply = 1
select * from u_archive_conclusion where project_id = #{projectId} and expert_id = #{userId}
select
uaa.id,uaa.name,uaa.page_n ,uaa.remark ,uaa.file_number,
(select bdb.dict_value from blade_dict_biz bdb WHERE bdb.is_sealed = 0 and bdb.code = 'storage_period' and bdb.dict_key = uaa.storage_time limit 1 ) as storageTimeValue
from u_archives_auto uaa where id in
#{id}
order by FIELD(uaa.id,
#{id}
)
select uaf.file_name ,uaf.file_url,0 as sourceType,uaf.node_id,
(select uaa.name from u_archives_auto uaa WHERE uaa.id = uaf.archive_id) as archive_name,
(select GROUP_CONCAT(uai.opinion) from u_archive_inspection uai WHERE uai.file_id = uaf.id) as allopinion
from u_archive_file uaf join m_archive_tree_contract atc on uaf.node_id = atc.id
where uaf.project_id = #{projectId} and uaf.is_deleted = 0 and uaf.rectification = #{rec}
and atc.is_deleted = 0
and (atc.id = #{nodeId} or FIND_IN_SET(#{nodeId}, atc.ancestors))
select GROUP_CONCAT(aei.opinion) as allopinion,aei.archive_name ,aei.node_id,1 as sourceType,
(select uaf.file_name from u_archive_file uaf WHERE uaf.id = aei.file_id) as fileName,
(select uaf.file_url from u_archive_file uaf WHERE uaf.id = aei.file_id) as fileUrl
from m_archive_tree_contract atc join u_archive_expert_inspection aei on aei.node_id = atc.id
where atc.project_id = #{projectId} and atc.is_deleted = 0 and aei.is_deleted = 0 and aei.is_pass = 0
and atc.is_deleted = 0
and (atc.id = #{nodeId} or FIND_IN_SET(#{nodeId}, atc.ancestors))
GROUP by aei.file_id
select uaa.id,uaa.name,uaa.file_number,uaa.unit,uaa.storage_time,uaa.secret_level,uaa.start_date,uaa.end_date
from
(SELECT id FROM m_archive_tree_contract WHERE project_id =#{projectId}
and ancestors like concat('%',#{nodeId},'%')
) matc left join u_archives_auto uaa on matc.id = uaa.node_id
where uaa.is_deleted = 0 and uaa.is_archive = 1
GROUP BY uaa.id
order by uaa.tree_sort,uaa.auto_file_sort,uaa.file_number asc
update u_archive_file set is_archive = 0 ,archive_id = null where
id in
#{id}
update u_archives_auto set is_deleted = 1 ,is_destroy = 1 ,update_user = #{userId} where
id in
#{id}
select a.id,a.project_id,a.contract_id,a.name,a.file_number,a.unit,a.start_date,a.end_date,a.storage_time,a.secret_level,b.real_name,a.update_time,
a.auto_file_sort,a.create_time,a.file_n,a.rollor,a.node_id,a.page_n ,c.file_url,c.pdf_file_url from u_archives_auto as a join blade_user as b on a.update_user=b.id
join u_archive_file as c on a.id=c.archive_id
where a.project_id=#{projId} and a.contract_id in
#{item.cqContractId}
select *
from u_archives_auto
where project_id = #{projectId}
and is_auto_file!=1
and is_deleted=0
and
out_id in
#{id}
select *
from u_archives_auto
where is_deleted = 0
select id,node_name,parent_id,out_id
from m_archive_tree_contract
where project_id = #{projectId} and is_deleted = 0 and
out_id in
#{id}
select id,utime,out_id,pdf_page_url
from u_archive_file
where project_id = #{projectId} and is_deleted = 0 and
out_id in
#{id}
SELECT id,file_id
FROM u_metadata_file
WHERE file_id IN
#{fileId}
ORDER BY file_id, create_time DESC