From 6ee8085a075d52102ed7fcd66dbf484ed28972ff Mon Sep 17 00:00:00 2001 From: yuusuke_kanamura Date: Thu, 11 Jul 2024 12:53:31 +0900 Subject: [PATCH] =?UTF-8?q?feat:HCP=E3=82=A6=E3=82=A7=E3=83=96=20=E6=8B=A1?= =?UTF-8?q?=E5=BC=B5SQL=E3=81=AE=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hcp_web/settings/hcp_web_accsess_log_ex.sql | 9 +++++++++ .../settings/hcp_web_medpass_user_mst_ex.sql | 14 ++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 s3/data/hcp_web/settings/hcp_web_accsess_log_ex.sql create mode 100644 s3/data/hcp_web/settings/hcp_web_medpass_user_mst_ex.sql diff --git a/s3/data/hcp_web/settings/hcp_web_accsess_log_ex.sql b/s3/data/hcp_web/settings/hcp_web_accsess_log_ex.sql new file mode 100644 index 00000000..454fc632 --- /dev/null +++ b/s3/data/hcp_web/settings/hcp_web_accsess_log_ex.sql @@ -0,0 +1,9 @@ +/* date_time(日付型)がnullのレコードを抽出し、date_time(文字型) を日付型に変換してセットする。 */ +update src06.hcp_web_access_log set +date_time = STR_TO_DATE(date_time_org, '%Y-%m-%d %H:%i:%s') + INTERVAL 9 HOUR +where date_time_org is not null and date_time is null and ins_date >= (now() - INTERVAL 1 YEAR); + +/* post_evar29(日付型) がnullのレコードを抽出し、post_evar29(文字型)を日付型に変換してセットする。 */ +update src06.hcp_web_access_log set +post_evar29 = STR_TO_DATE(post_evar29_org, '%Y-%m-%dT%H:%i:%s') + INTERVAL 9 HOUR +where post_evar29_org is not null and post_evar29 is null and ins_date >= (now() - INTERVAL 1 YEAR); \ No newline at end of file diff --git a/s3/data/hcp_web/settings/hcp_web_medpass_user_mst_ex.sql b/s3/data/hcp_web/settings/hcp_web_medpass_user_mst_ex.sql new file mode 100644 index 00000000..f53d0acd --- /dev/null +++ b/s3/data/hcp_web/settings/hcp_web_medpass_user_mst_ex.sql @@ -0,0 +1,14 @@ +/* 生年月日(日付型)がnullのレコードを抽出し、生年月日(文字型) を日付型に変換してセットする。 */ +update src06.hcp_web_medpass_user_mst set +BirthDate = STR_TO_DATE(BirthDate_org, '%Y-%m-%d') +where BirthDate_org is not null and BirthDate is null; + +/* 登録日時(日付型) がnullのレコードを抽出し、登録日時(文字型)を日付型に変換してセットする。 */ +update src06.hcp_web_medpass_user_mst set +CreateDate = STR_TO_DATE(CreateDate_org, '%Y-%m-%dT%H:%i:%s') +where CreateDate_org is not null and CreateDate is null; + +/* 最終更新日時(日付型) がnullのレコードを抽出し、最終更新日時(文字型)を日付型に変換してセットする。 */ +update src06.hcp_web_medpass_user_mst set +LastUpdate = STR_TO_DATE(LastUpdate_org, '%Y-%m-%dT%H:%i:%s') +where LastUpdate_org is not null and LastUpdate is null;