diff --git a/src/main/java/com/yutou/common/databases/SQLiteManager.java b/src/main/java/com/yutou/common/databases/SQLiteManager.java index e583091..fc92a5e 100644 --- a/src/main/java/com/yutou/common/databases/SQLiteManager.java +++ b/src/main/java/com/yutou/common/databases/SQLiteManager.java @@ -7,6 +7,7 @@ import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.util.DateUtils; import com.yutou.biliapi.bean.live.database.LiveConfigDatabaseBean; +import com.yutou.bilibili.Tools.DateFormatUtils; import com.yutou.common.inter.ISqlDatabaseBean; import com.yutou.common.utils.Log; import lombok.Data; @@ -114,8 +115,8 @@ public abstract class SQLiteManager { continue; } Object value = json.get(key); - if ("sql_time".equals(key) && value instanceof Date) { - statement.setLong(i++, ((Date) value).getTime()); + if ("sql_time".equals(key)) { + statement.setLong(i++, DateFormatUtils.getInstance().parse(value.toString(),DateFormatUtils.DEFAULT_PATTERN).getTime()); continue; } if (value instanceof String) { @@ -127,7 +128,7 @@ public abstract class SQLiteManager { } else if (value instanceof Boolean) { statement.setBoolean(i++, (Boolean) value); } else if (value instanceof Date) { - statement.setTimestamp(i++, new Timestamp(((Date) value).getTime())); + statement.setLong(i++, (Long) value); } else { statement.setObject(i++, value); }