Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
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
YZG
yzg-util
Commits
ee4b0523
Commit
ee4b0523
authored
Dec 15, 2021
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
下载视频
parent
f1ec68ae
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
3 deletions
+26
-3
YzgFileDaoImpl.java
...a/com/yanzuoguang/cloud/file/dao/impl/YzgFileDaoImpl.java
+26
-3
No files found.
yzg-util-file/src/main/java/com/yanzuoguang/cloud/file/dao/impl/YzgFileDaoImpl.java
View file @
ee4b0523
...
@@ -5,6 +5,7 @@ import com.yanzuoguang.cloud.vo.YzgFileVo;
...
@@ -5,6 +5,7 @@ import com.yanzuoguang.cloud.vo.YzgFileVo;
import
com.yanzuoguang.cloud.vo.req.YzgFileStatusReqVo
;
import
com.yanzuoguang.cloud.vo.req.YzgFileStatusReqVo
;
import
com.yanzuoguang.dao.DaoConst
;
import
com.yanzuoguang.dao.DaoConst
;
import
com.yanzuoguang.dao.impl.BaseDaoImpl
;
import
com.yanzuoguang.dao.impl.BaseDaoImpl
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.vo.MapRow
;
import
com.yanzuoguang.util.vo.MapRow
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -18,6 +19,8 @@ import java.util.List;
...
@@ -18,6 +19,8 @@ import java.util.List;
*/
*/
@Component
@Component
public
class
YzgFileDaoImpl
extends
BaseDaoImpl
implements
YzgFileDao
,
InitializingBean
{
public
class
YzgFileDaoImpl
extends
BaseDaoImpl
implements
YzgFileDao
,
InitializingBean
{
private
static
final
String
GET_COUNT_SQL
=
"GET_COUNT_SQL"
;
private
static
final
String
UPDATE_STATUS_SQL
=
"UPDATE_STATUS_SQL"
;
private
static
final
String
QUERY_TABLE_SQL
=
"SHOW TABLES LIKE 'Yzg_File'"
;
private
static
final
String
QUERY_TABLE_SQL
=
"SHOW TABLES LIKE 'Yzg_File'"
;
private
static
final
String
CREATE_TABLE_SQL
=
"CREATE TABLE Yzg_File ( "
+
private
static
final
String
CREATE_TABLE_SQL
=
"CREATE TABLE Yzg_File ( "
+
" fileId VARCHAR(32) NOT NULL COMMENT '编号', "
+
" fileId VARCHAR(32) NOT NULL COMMENT '编号', "
+
...
@@ -47,6 +50,15 @@ public class YzgFileDaoImpl extends BaseDaoImpl implements YzgFileDao, Initializ
...
@@ -47,6 +50,15 @@ public class YzgFileDaoImpl extends BaseDaoImpl implements YzgFileDao, Initializ
getSql
(
DaoConst
.
LOAD
)
getSql
(
DaoConst
.
LOAD
)
.
addCode
(
"{ORDER}"
,
"ORDER BY createDate DESC"
)
.
addCode
(
"{ORDER}"
,
"ORDER BY createDate DESC"
)
;
;
table
.
add
(
GET_COUNT_SQL
,
"SELECT COUNT(1) FROM Yzg_File WHERE 1=1"
)
.
add
(
YzgFileVo
.
class
,
"a."
);
table
.
add
(
UPDATE_STATUS_SQL
,
"UPDATE Yzg_File AS a SET a.fileId=a.fileId {FIELD} WHERE a.fileId=@fileId"
)
.
addPara
(
"fileStatus"
,
",a.fileStatus=CASE WHEN @fileStatus>a.fileStatus THEN @fileStatus ELSE a.fileStatus END"
)
.
addPara
(
"fileRow"
,
",a.fileRow=CASE WHEN @fileRow>a.fileRow THEN @fileRow ELSE a.fileRow END"
)
.
addPara
(
"errorMessage"
,
",a.errorMessage=@errorMessage"
)
;
}
}
/**
/**
...
@@ -77,8 +89,14 @@ public class YzgFileDaoImpl extends BaseDaoImpl implements YzgFileDao, Initializ
...
@@ -77,8 +89,14 @@ public class YzgFileDaoImpl extends BaseDaoImpl implements YzgFileDao, Initializ
*/
*/
@Override
@Override
public
int
getUserCompanyCount
(
YzgFileVo
req
)
{
public
int
getUserCompanyCount
(
YzgFileVo
req
)
{
if
(
StringHelper
.
isEmpty
(
req
.
getCompanyId
(),
req
.
getCreateUserId
()))
{
return
0
;
return
0
;
}
}
YzgFileVo
countReq
=
new
YzgFileVo
();
countReq
.
setCompanyId
(
req
.
getCompanyId
());
countReq
.
setCreateUserId
(
req
.
getCreateUserId
());
return
StringHelper
.
toInt
(
queryCell
(
GET_COUNT_SQL
,
countReq
));
}
/**
/**
* 获取导出文件数量
* 获取导出文件数量
...
@@ -88,8 +106,13 @@ public class YzgFileDaoImpl extends BaseDaoImpl implements YzgFileDao, Initializ
...
@@ -88,8 +106,13 @@ public class YzgFileDaoImpl extends BaseDaoImpl implements YzgFileDao, Initializ
*/
*/
@Override
@Override
public
int
getCallbackCount
(
YzgFileVo
req
)
{
public
int
getCallbackCount
(
YzgFileVo
req
)
{
if
(
StringHelper
.
isEmpty
(
req
.
getCompanyId
(),
req
.
getCreateUserId
()))
{
return
0
;
return
0
;
}
}
YzgFileVo
countReq
=
new
YzgFileVo
();
countReq
.
setCallbackMQ
(
req
.
getCallbackMQ
());
return
StringHelper
.
toInt
(
queryCell
(
GET_COUNT_SQL
,
countReq
));
}
/**
/**
* 修改文件状态
* 修改文件状态
...
@@ -99,6 +122,6 @@ public class YzgFileDaoImpl extends BaseDaoImpl implements YzgFileDao, Initializ
...
@@ -99,6 +122,6 @@ public class YzgFileDaoImpl extends BaseDaoImpl implements YzgFileDao, Initializ
*/
*/
@Override
@Override
public
int
updateStatus
(
YzgFileStatusReqVo
req
)
{
public
int
updateStatus
(
YzgFileStatusReqVo
req
)
{
return
0
;
return
this
.
updateSql
(
UPDATE_STATUS_SQL
,
req
)
;
}
}
}
}
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