Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dcs-doc-expand
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
INET-TWO
server
dcs-doc-expand
Commits
67bc9f68
Commit
67bc9f68
authored
Nov 06, 2024
by
wangyangyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
借阅单:借阅单统计
parent
a4ae3239
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
17 deletions
+28
-17
ExtBorrowingFormSearchVo.java
...dcs/document/common/otherVo/ExtBorrowingFormSearchVo.java
+5
-0
SqlConstants.java
...va/com/inet/dcs/document/core/constants/SqlConstants.java
+4
-2
ExtBorrowingFormServiceImpl.java
...cument/core/service/impl/ExtBorrowingFormServiceImpl.java
+19
-14
EXT_BORROWING_FORM_COUNT.sql
...-core/src/main/resources/sql/EXT_BORROWING_FORM_COUNT.sql
+0
-1
No files found.
inet-doc-expand-common/src/main/java/com/inet/dcs/document/common/otherVo/ExtBorrowingFormSearchVo.java
View file @
67bc9f68
...
@@ -44,6 +44,11 @@ public class ExtBorrowingFormSearchVo {
...
@@ -44,6 +44,11 @@ public class ExtBorrowingFormSearchVo {
*/
*/
private
Boolean
borrowingDateIs
;
private
Boolean
borrowingDateIs
;
/**
* 文件类型
*/
private
Boolean
fileSubtypeNameIs
;
//查询条件
//查询条件
...
...
inet-doc-expand-core/src/main/java/com/inet/dcs/document/core/constants/SqlConstants.java
View file @
67bc9f68
...
@@ -24,7 +24,7 @@ public class SqlConstants {
...
@@ -24,7 +24,7 @@ public class SqlConstants {
"\t\tui.NAME AS dxBorrowingUserInfoName,\n"
+
"\t\tui.NAME AS dxBorrowingUserInfoName,\n"
+
//"\t\tCONCAT(YEAR(bf.BORROWING_DATE),'-01-01 00:00:00') AS borrowingDate ,\n" +
//"\t\tCONCAT(YEAR(bf.BORROWING_DATE),'-01-01 00:00:00') AS borrowingDate ,\n" +
"\t\tYEAR(bf.BORROWING_DATE) AS borrowingDate ,\n"
+
"\t\tYEAR(bf.BORROWING_DATE) AS borrowingDate ,\n"
+
"\t\td.NAME AS fileName ,\n"
+
//
"\t\td.NAME AS fileName ,\n" +
"\t\tmd.DISPLAY_NAME AS fileSubtypeName\n"
+
"\t\tmd.DISPLAY_NAME AS fileSubtypeName\n"
+
"FROM\n"
+
"FROM\n"
+
"\t\tEXT_BORROWING_FORM bf\n"
+
"\t\tEXT_BORROWING_FORM bf\n"
+
...
@@ -62,13 +62,15 @@ public class SqlConstants {
...
@@ -62,13 +62,15 @@ public class SqlConstants {
public
static
String
SQL_GROUP_USER
=
", dxBorrowingUserInfoName "
;
public
static
String
SQL_GROUP_USER
=
", dxBorrowingUserInfoName "
;
//年度
//年度
public
static
String
SQL_GROUP_DATE
=
", borrowingDate "
;
public
static
String
SQL_GROUP_DATE
=
", borrowingDate "
;
//文件类型
public
static
String
SQL_GROUP_FILE
=
", fileSubtypeName "
;
//最终sql 其中两个属性需要替换
//最终sql 其中两个属性需要替换
// REPLACE_GROUP_ATTR 分组属性
// REPLACE_GROUP_ATTR 分组属性
// REPLACE_WHERE_ATTR 过滤条件
// REPLACE_WHERE_ATTR 过滤条件
public
static
String
SQL_SEARCH
=
"SELECT "
+
SQL_GROUP_STATE
public
static
String
SQL_SEARCH
=
"SELECT "
+
SQL_GROUP_STATE
+
REPLACE_GROUP_ATTR
+
REPLACE_GROUP_ATTR
+
" , "
//四种状态数量
//四种状态数量
+
SQL_STATE
+
SQL_BORROW_STATE
+
SQL_RETURN_STATE
+
SQL_PROCESS_STATE
+
SQL_STATE
+
SQL_BORROW_STATE
+
SQL_RETURN_STATE
+
SQL_PROCESS_STATE
+
" FROM ("
+
" FROM ("
...
...
inet-doc-expand-core/src/main/java/com/inet/dcs/document/core/service/impl/ExtBorrowingFormServiceImpl.java
View file @
67bc9f68
package
com
.
inet
.
dcs
.
document
.
core
.
service
.
impl
;
package
com
.
inet
.
dcs
.
document
.
core
.
service
.
impl
;
import
cn.hutool.core.util.BooleanUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.inet.dcs.document.common.otherVo.ExtBorrowingFormCountVo
;
import
com.inet.dcs.document.common.otherVo.ExtBorrowingFormCountVo
;
import
com.inet.dcs.document.common.otherVo.ExtBorrowingFormSearchVo
;
import
com.inet.dcs.document.common.otherVo.ExtBorrowingFormSearchVo
;
...
@@ -72,21 +73,25 @@ public class ExtBorrowingFormServiceImpl<V extends ExtBorrowingFormVO> implement
...
@@ -72,21 +73,25 @@ public class ExtBorrowingFormServiceImpl<V extends ExtBorrowingFormVO> implement
//状态分组自带
//状态分组自带
String
replace_group_attr
=
" "
;
String
replace_group_attr
=
" "
;
//借阅部门
//借阅部门
if
(
searchVo
.
getDxBorrowingOrgIs
(
))
{
if
(
BooleanUtil
.
isTrue
(
searchVo
.
getDxBorrowingOrgIs
()
))
{
replace_group_attr
=
replace_group_attr
+
SqlConstants
.
SQL_GROUP_ORG
;
replace_group_attr
=
replace_group_attr
+
SqlConstants
.
SQL_GROUP_ORG
;
}
}
//借阅人
//借阅人
if
(
searchVo
.
getDxBorrowingUserInfoIdIs
(
))
{
if
(
BooleanUtil
.
isTrue
(
searchVo
.
getDxBorrowingUserInfoIdIs
()
))
{
replace_group_attr
=
replace_group_attr
+
SqlConstants
.
SQL_GROUP_USER
;
replace_group_attr
=
replace_group_attr
+
SqlConstants
.
SQL_GROUP_USER
;
}
}
//项目
//项目
if
(
searchVo
.
getDxContextIdIs
(
))
{
if
(
BooleanUtil
.
isTrue
(
searchVo
.
getDxContextIdIs
()
))
{
replace_group_attr
=
replace_group_attr
+
SqlConstants
.
SQL_GROUP_CONTEXT
;
replace_group_attr
=
replace_group_attr
+
SqlConstants
.
SQL_GROUP_CONTEXT
;
}
}
//年度
//年度
if
(
searchVo
.
getBorrowingDateIs
(
))
{
if
(
BooleanUtil
.
isTrue
(
searchVo
.
getBorrowingDateIs
()
))
{
replace_group_attr
=
replace_group_attr
+
SqlConstants
.
SQL_GROUP_DATE
;
replace_group_attr
=
replace_group_attr
+
SqlConstants
.
SQL_GROUP_DATE
;
}
}
//文件类型
if
(
BooleanUtil
.
isTrue
(
searchVo
.
getFileSubtypeNameIs
()))
{
replace_group_attr
=
replace_group_attr
+
SqlConstants
.
SQL_GROUP_FILE
;
}
//过滤条件
//过滤条件
String
replace_where_attr
=
""
;
String
replace_where_attr
=
""
;
...
@@ -122,15 +127,15 @@ public class ExtBorrowingFormServiceImpl<V extends ExtBorrowingFormVO> implement
...
@@ -122,15 +127,15 @@ public class ExtBorrowingFormServiceImpl<V extends ExtBorrowingFormVO> implement
replace_where_attr
=
replace_where_attr
+
" borrowingDate >= '"
+
searchVo
.
getBorrowingDateStart
()
+
"'"
;
replace_where_attr
=
replace_where_attr
+
" borrowingDate >= '"
+
searchVo
.
getBorrowingDateStart
()
+
"'"
;
}
}
//文件名称
//文件名称
if
(!
StrUtil
.
isEmpty
(
searchVo
.
getFileName
()))
{
//
if (!StrUtil.isEmpty(searchVo.getFileName())) {
if
(
isAddAnd
)
{
//
if (isAddAnd) {
replace_where_attr
=
replace_where_attr
+
" and "
;
//
replace_where_attr = replace_where_attr + " and ";
}
//
}
isAddAnd
=
true
;
//
isAddAnd = true;
replace_where_attr
=
replace_where_attr
+
" fileName = '"
+
searchVo
.
getFileName
()
+
"'"
;
//
replace_where_attr = replace_where_attr + " fileName = '" + searchVo.getFileName() + "'";
}
//
}
//文件类型
//文件类型
if
(!
StrUtil
.
isEmpty
(
searchVo
.
get
DxContextId
()))
{
if
(!
StrUtil
.
isEmpty
(
searchVo
.
get
FileSubtypeName
()))
{
if
(
isAddAnd
)
{
if
(
isAddAnd
)
{
replace_where_attr
=
replace_where_attr
+
" and "
;
replace_where_attr
=
replace_where_attr
+
" and "
;
}
}
...
@@ -139,9 +144,9 @@ public class ExtBorrowingFormServiceImpl<V extends ExtBorrowingFormVO> implement
...
@@ -139,9 +144,9 @@ public class ExtBorrowingFormServiceImpl<V extends ExtBorrowingFormVO> implement
}
}
String
finalSql
=
SqlConstants
.
SQL_SEARCH
.
replaceAll
(
SqlConstants
.
REPLACE_GROUP_ATTR
,
replace_group_attr
);
String
finalSql
=
SqlConstants
.
SQL_SEARCH
.
replaceAll
(
SqlConstants
.
REPLACE_GROUP_ATTR
,
replace_group_attr
);
//.replace(SqlConstants.REPLACE_WHERE_ATTR, replace_where_attr);
//.replace(SqlConstants.REPLACE_WHERE_ATTR, replace_where_attr);
if
(!
StrUtil
.
isEmpty
(
replace_where_attr
)){
if
(!
StrUtil
.
isEmpty
(
replace_where_attr
))
{
finalSql
=
finalSql
+
" HAVING "
+
replace_where_attr
;
finalSql
=
finalSql
+
" HAVING "
+
replace_where_attr
;
}
}
...
...
inet-doc-expand-core/src/main/resources/sql/EXT_BORROWING_FORM_COUNT.sql
View file @
67bc9f68
...
@@ -19,7 +19,6 @@ FROM
...
@@ -19,7 +19,6 @@ FROM
bf
.
STATE
AS
STATE
,
bf
.
STATE
AS
STATE
,
ui
.
NAME
AS
dxBorrowingUserInfoName
,
ui
.
NAME
AS
dxBorrowingUserInfoName
,
YEAR
(
bf
.
BORROWING_DATE
)
AS
borrowingDate
,
YEAR
(
bf
.
BORROWING_DATE
)
AS
borrowingDate
,
d
.
NAME
AS
fileName
,
md
.
DISPLAY_NAME
AS
fileSubtypeName
md
.
DISPLAY_NAME
AS
fileSubtypeName
FROM
FROM
EXT_BORROWING_FORM
bf
EXT_BORROWING_FORM
bf
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment