@ -98,6 +98,46 @@ public interface ArchivesSummaryRepository extends JpaRepository<ArchivesSummary
ArchivesSummaryfindByTagNo(Stringtid);
@Query(nativeQuery=true,
countQuery="SELECT count(1) FROM archives_summary asy "+
"INNER JOIN archives_case_cartoning acc on asy.archives_id = acc.parent_id "+
"INNER JOIN archives_case ace on acc.case_id = ace.id "+
"INNER JOIN device_archives_tag dat on ace.folder_location = dat.position "+
"INNER JOIN device_info di on dat.device_info_id = di.id "+
"INNER JOIN storeroom room on room.id = di.storeroom_id "+
"WHERE di.storeroom_code = ?1 and ace.folder_location like ?2 group by asy.archives_id ",
value="SELECT DISTINCT asy.archives_id,di.storeroom_code as storeCode,asy.maintitle AS filename,asy.archive_no as fileno,asy.create_time as makedate,asy.category_id as filetype,"+
"asy.barcode as filecode,asy.retention as keepday,ace.folder_location_details as position,"+
"ace.folder_location as location,asy.create_by as editdate,ace.storage_type as storageType,asy.child as enclosure "+
"FROM archives_summary asy "+
"INNER JOIN archives_case_cartoning acc on asy.archives_id = acc.parent_id "+
"INNER JOIN archives_case ace on acc.case_id = ace.id "+
"INNER JOIN device_archives_tag dat on ace.folder_location = dat.position "+
"INNER JOIN device_info di on dat.device_info_id = di.id "+
"INNER JOIN storeroom room on room.id = di.storeroom_id "+
"WHERE di.storeroom_code = ?1 and ace.folder_location like ?2 ")
countQuery="SELECT count(1) FROM archives_summary asy "+
"INNER JOIN archives_case_cartoning acc on asy.archives_id = acc.parent_id "+
"INNER JOIN archives_case ace on acc.case_id = ace.id "+
"INNER JOIN device_archives_tag dat on ace.folder_location = dat.position "+
"INNER JOIN device_info di on dat.device_info_id = di.id "+
"INNER JOIN storeroom room on room.id = di.storeroom_id "+
"WHERE if(?1 = 0,(asy.maintitle like ?2 or asy.archive_no like ?2),(asy.maintitle = ?2 or asy.archive_no = ?2)) group by asy.archives_id ",
value="SELECT DISTINCT asy.archives_id,di.storeroom_code as storeCode,asy.maintitle AS filename,asy.archive_no as fileno,asy.create_time as makedate,asy.category_id as filetype,"+
"asy.barcode as filecode,asy.retention as keepday,ace.folder_location_details as position,"+
"ace.folder_location as location,asy.create_by as editdate,ace.storage_type as storageType,asy.child as enclosure "+
"FROM archives_summary asy "+
"INNER JOIN archives_case_cartoning acc on asy.archives_id = acc.parent_id "+
"INNER JOIN archives_case ace on acc.case_id = ace.id "+
"INNER JOIN device_archives_tag dat on ace.folder_location = dat.position "+
"INNER JOIN device_info di on dat.device_info_id = di.id "+
"INNER JOIN storeroom room on room.id = di.storeroom_id "+
"WHERE if(?1 = 0,(asy.maintitle like ?2 or asy.archive_no like ?2),(asy.maintitle = ?2 or asy.archive_no = ?2))")
@ -466,7 +466,7 @@ public class ArchivesServiceImpl implements ArchivesService {
entityManager.createNativeQuery("update "+archivesTypeP.getEnName()+" set child = (select count(1) from "
+archivesType.getEnName()+" where parent_id ='"+dto.getParentsId()+"') where id = '"+dto.getParentsId()+"'").executeUpdate();
entityManager.createNativeQuery("update archives_summary set child = (select count(1) from "
+archivesType.getEnName()+" where parent_id ='"+dto.getParentsId()+"') where archives_id = '"+dto.getParentsId()+"'").executeUpdate();
+archivesType.getEnName()+" where parent_id ='"+dto.getParentsId()+"' and is_delete_time is not null) where archives_id = '"+dto.getParentsId()+"'").executeUpdate();
}
}
@ -652,6 +652,8 @@ public class ArchivesServiceImpl implements ArchivesService {