Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hp-smart
Overview
Overview
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
platform
hp-smart
Commits
f96ceae4
Commit
f96ceae4
authored
Jan 25, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.定时备份数据库BUG修复
parent
d1edf618
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletions
+11
-1
HPSqlConstant.java
...ain/java/com/baosight/hpjx/hp/constant/HPSqlConstant.java
+2
-0
ServiceHPKC010A.java
...java/com/baosight/hpjx/hp/kc/service/ServiceHPKC010A.java
+3
-0
HPKC010A.xml
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC010A.xml
+6
-1
No files found.
src/main/java/com/baosight/hpjx/hp/constant/HPSqlConstant.java
View file @
f96ceae4
...
...
@@ -140,6 +140,8 @@ public class HPSqlConstant {
*/
public
class
HPKC010A
{
// 按日期删除
public
static
final
String
DELETE_BY_TIME
=
"HPKC009.deleteByTime"
;
// 备份数量
public
static
final
String
BACKUP
=
"HPKC010A.backup"
;
}
...
...
src/main/java/com/baosight/hpjx/hp/kc/service/ServiceHPKC010A.java
View file @
f96ceae4
...
...
@@ -31,6 +31,9 @@ public class ServiceHPKC010A extends ServiceBase {
try
{
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"dateProc"
,
LocalDate
.
now
().
minusDays
(
1
).
format
(
DateUtils
.
SHORT_DATE
));
// 清除数据
dao
.
delete
(
HPSqlConstant
.
HPKC010A
.
DELETE_BY_TIME
,
queryMap
);
// 备份数据
dao
.
insert
(
HPSqlConstant
.
HPKC010A
.
BACKUP
,
queryMap
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
inInfo
.
setMsg
(
"备份数据成功"
);
...
...
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC010A.xml
View file @
f96ceae4
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap
namespace=
"
tHpkc010a
"
>
<sqlMap
namespace=
"
HPKC010A
"
>
<sql
id=
"column"
>
ID as "id",
...
...
@@ -109,6 +109,11 @@
<include
refid=
"condition"
/>
</select>
<!-- 按时间删除数据 -->
<delete
id=
"deleteByTime"
>
DELETE FROM ${hpjxSchema}.T_HPKC010A WHERE DATE_PROC = #dateProc#
</delete>
<!-- 备份数据 -->
<insert
id=
"backup"
>
INSERT INTO ${hpjxSchema}.T_HPKC010A (
...
...
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