mirror of
https://github.com/sismics/docs.git
synced 2025-12-14 18:26:17 +00:00
Return file count on GET /document/list
This commit is contained in:
@@ -145,7 +145,8 @@ public class DocumentDao {
|
||||
Map<String, Object> parameterMap = new HashMap<String, Object>();
|
||||
List<String> criteriaList = new ArrayList<String>();
|
||||
|
||||
StringBuilder sb = new StringBuilder("select distinct d.DOC_ID_C c0, d.DOC_TITLE_C c1, d.DOC_DESCRIPTION_C c2, d.DOC_CREATEDATE_D c3, d.DOC_LANGUAGE_C c4, s.SHA_ID_C is not null c5 ");
|
||||
StringBuilder sb = new StringBuilder("select distinct d.DOC_ID_C c0, d.DOC_TITLE_C c1, d.DOC_DESCRIPTION_C c2, d.DOC_CREATEDATE_D c3, d.DOC_LANGUAGE_C c4, s.SHA_ID_C is not null c5, ");
|
||||
sb.append(" (select count(f.FIL_ID_C) from T_FILE f where f.FIL_DELETEDATE_D is null and f.FIL_IDDOC_C = d.DOC_ID_C) c6 ");
|
||||
sb.append(" from T_DOCUMENT d ");
|
||||
sb.append(" left join T_SHARE s on s.SHA_IDDOCUMENT_C = d.DOC_ID_C and s.SHA_DELETEDATE_D is null ");
|
||||
|
||||
@@ -211,6 +212,7 @@ public class DocumentDao {
|
||||
documentDto.setCreateTimestamp(((Timestamp) o[i++]).getTime());
|
||||
documentDto.setLanguage((String) o[i++]);
|
||||
documentDto.setShared((Boolean) o[i++]);
|
||||
documentDto.setFileCount(((Number) o[i++]).intValue());
|
||||
documentDtoList.add(documentDto);
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,8 @@ public class DocumentDto {
|
||||
*/
|
||||
private Boolean shared;
|
||||
|
||||
private Integer fileCount;
|
||||
|
||||
/**
|
||||
* Getter de id.
|
||||
*
|
||||
@@ -146,4 +148,20 @@ public class DocumentDto {
|
||||
public void setLanguage(String language) {
|
||||
this.language = language;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter of fileCount.
|
||||
* @return fileCount
|
||||
*/
|
||||
public Integer getFileCount() {
|
||||
return fileCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter of fileCount.
|
||||
* @param fileCount fileCount
|
||||
*/
|
||||
public void setFileCount(Integer fileCount) {
|
||||
this.fileCount = fileCount;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user