Commit f96ceae4 by 宋祥

1.定时备份数据库BUG修复

parent d1edf618
......@@ -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";
}
......
......@@ -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("备份数据成功");
......
<?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 (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment