From 1fcb577bcdf2dde3699b9da14202237535fb3e4f Mon Sep 17 00:00:00 2001 From: "nik.n" Date: Tue, 16 Jan 2024 10:19:55 +0900 Subject: [PATCH 1/2] =?UTF-8?q?'crm=5Fhistory=E4=BF=AE=E6=AD=A3'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rds_mysql/stored_procedure/internal02/crm_history.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rds_mysql/stored_procedure/internal02/crm_history.sql b/rds_mysql/stored_procedure/internal02/crm_history.sql index 5607741d..7bd53bf8 100644 --- a/rds_mysql/stored_procedure/internal02/crm_history.sql +++ b/rds_mysql/stored_procedure/internal02/crm_history.sql @@ -74,7 +74,7 @@ BEGIN UPDATE $$target_table$$ tt INNER JOIN $$target_table$$_make_history_tmp mht ON tt.Id = mht.Id - AND tt.start_datetime = mht.min_start_datetime + AND tt.$$target_column$$ = mht.min_start_datetime SET end_datetime = mht.max_start_datetime - INTERVAL 1 SECOND , upd_user = CURRENT_USER() From 8ca8d34cd42b0888ff222528dc192cd89a3e78bc Mon Sep 17 00:00:00 2001 From: "nik.n" Date: Tue, 16 Jan 2024 13:29:00 +0900 Subject: [PATCH 2/2] =?UTF-8?q?'=E5=A4=89=E6=95=B0=E5=90=8D=E5=A4=89?= =?UTF-8?q?=E6=9B=B4'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rds_mysql/stored_procedure/internal02/crm_history.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rds_mysql/stored_procedure/internal02/crm_history.sql b/rds_mysql/stored_procedure/internal02/crm_history.sql index 7bd53bf8..156d61f7 100644 --- a/rds_mysql/stored_procedure/internal02/crm_history.sql +++ b/rds_mysql/stored_procedure/internal02/crm_history.sql @@ -52,7 +52,7 @@ BEGIN CREATE TEMPORARY TABLE $$target_table$$_make_history_tmp SELECT Id - , MIN($$target_column$$) AS min_start_datetime + , MIN($$target_column$$) AS min_systemmodstamp , MAX(start_datetime) AS max_start_datetime FROM $$target_table$$ @@ -74,7 +74,7 @@ BEGIN UPDATE $$target_table$$ tt INNER JOIN $$target_table$$_make_history_tmp mht ON tt.Id = mht.Id - AND tt.$$target_column$$ = mht.min_start_datetime + AND tt.$$target_column$$ = mht.min_systemmodstamp SET end_datetime = mht.max_start_datetime - INTERVAL 1 SECOND , upd_user = CURRENT_USER()