From 0b5e0653d7aa663625b2d770eb5e580bc55f2f7e Mon Sep 17 00:00:00 2001 From: yuusuke_kanamura Date: Thu, 11 Jul 2024 11:31:35 +0900 Subject: [PATCH 01/12] =?UTF-8?q?feat:HCP=E3=82=A6=E3=82=A7=E3=83=96?= =?UTF-8?q?=E5=80=8B=E5=88=A5=E8=A8=AD=E5=AE=9A=E3=83=9E=E3=83=83=E3=83=94?= =?UTF-8?q?=E3=83=B3=E3=82=B0=E3=83=AA=E3=82=B9=E3=83=88=E3=81=AE=E4=BD=9C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- s3/data/hcp_web/settings/configmap.config | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 s3/data/hcp_web/settings/configmap.config diff --git a/s3/data/hcp_web/settings/configmap.config b/s3/data/hcp_web/settings/configmap.config new file mode 100644 index 00000000..f4aee336 --- /dev/null +++ b/s3/data/hcp_web/settings/configmap.config @@ -0,0 +1,4 @@ +/* medパス社データ */ +hcp_web_medpass_user_mst_[0-9]{14}\.(CSV|csv) hcp_web_medpass_user_mst.txt +/* Parantir ウェブアクセスログデータ */ +hcpweb_accesslog_[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}\.(CSV|csv) hcpweb_accesslog.txt \ No newline at end of file From 0506f20484fe90575955942f770c600d22e32d87 Mon Sep 17 00:00:00 2001 From: yuusuke_kanamura Date: Thu, 11 Jul 2024 11:32:48 +0900 Subject: [PATCH 02/12] =?UTF-8?q?feat:HCP=E3=82=A6=E3=82=A7=E3=83=96=20Vie?= =?UTF-8?q?w=E3=82=AA=E3=83=97=E3=82=B7=E3=83=A7=E3=83=B3=E3=83=81?= =?UTF-8?q?=E3=82=A7=E3=83=83=E3=82=AF=E5=AF=BE=E8=B1=A1=E3=82=B9=E3=82=AD?= =?UTF-8?q?=E3=83=BC=E3=83=9E=E5=90=8D=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- s3/config/view_check/check_target_schemas.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s3/config/view_check/check_target_schemas.json b/s3/config/view_check/check_target_schemas.json index c8ec5d7f..07b1df0e 100644 --- a/s3/config/view_check/check_target_schemas.json +++ b/s3/config/view_check/check_target_schemas.json @@ -1,3 +1,3 @@ { - "check_target_schemas": ["custom01", "custom02", "custom03", "custom04"] + "check_target_schemas": ["custom01", "custom02", "custom03", "custom04","custom05"] } From 8a7fb7381c5b65a19cefaa4261c299cc9a85c784 Mon Sep 17 00:00:00 2001 From: yuusuke_kanamura Date: Thu, 11 Jul 2024 11:35:09 +0900 Subject: [PATCH 03/12] =?UTF-8?q?feat:HCP=E3=82=A6=E3=82=A7=E3=83=96=20?= =?UTF-8?q?=E5=80=8B=E5=88=A5=E8=A8=AD=E5=AE=9A=E3=83=95=E3=82=A1=E3=82=A4?= =?UTF-8?q?=E3=83=AB=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_medpass_user_mst.txt | 13 +++++++++++++ s3/data/hcp_web/settings/hcpweb_accesslog.txt | 13 +++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 s3/data/hcp_web/settings/hcp_web_medpass_user_mst.txt create mode 100644 s3/data/hcp_web/settings/hcpweb_accesslog.txt diff --git a/s3/data/hcp_web/settings/hcp_web_medpass_user_mst.txt b/s3/data/hcp_web/settings/hcp_web_medpass_user_mst.txt new file mode 100644 index 00000000..31448f96 --- /dev/null +++ b/s3/data/hcp_web/settings/hcp_web_medpass_user_mst.txt @@ -0,0 +1,13 @@ +hcp_web +, +utf-8 +" +LF +1 +39 +Sub,UserName,FamilyName,GivenName,FamilyNameKana,GivenNameKana,BirthDate,Gender,CreateDate,LastUpdate,Job,Job_CareMgr,FacilityPrefecture,Workplace,School,GraduationYear,DoctorLicenseRegistYear,Service,SpecialistQualification,RawMailAddress,TestUser,MDBFacilityCode,FacilityPrefectureCode,FacilityMunicipalityCode,FacilityFullName,FacilityNameAbbr,CustomizedFacilityName,FacilityAddress,FacilityTelNumber,MDBFacilityPostalCode,MDBPersonalCode,MDBService,MDBServiceCategory,MDBWorkingDepartment,MDBGender,MDBOldSchool,MDBSubmitYear,MDBAllFacilityCode,RpOriginalAttributes +Sub,UserName,FamilyName,GivenName,FamilyNameKana,GivenNameKana,BirthDate_org,Gender,CreateDate_org,LastUpdate_org,Job,Job_CareMgr,FacilityPrefecture,Workplace,School,GraduationYear,DoctorLicenseRegistYear,Service,SpecialistQualification,RawMailAddress,TestUser,MDBFacilityCode,FacilityPrefectureCode,FacilityMunicipalityCode,FacilityFullName,FacilityNameAbbr,CustomizedFacilityName,FacilityAddress,FacilityTelNumber,MDBFacilityPostalCode,MDBPersonalCode,MDBService,MDBServiceCategory,MDBWorkingDepartment,MDBGender,MDBOldSchool,MDBSubmitYear,MDBAllFacilityCode,RpOriginalAttributes +src06.hcp_web_medpass_user_mst +org06.hcp_web_medpass_user_mst +hcp_web_medpass_user_mst_ex.sql + diff --git a/s3/data/hcp_web/settings/hcpweb_accesslog.txt b/s3/data/hcp_web/settings/hcpweb_accesslog.txt new file mode 100644 index 00000000..d5bb453e --- /dev/null +++ b/s3/data/hcp_web/settings/hcpweb_accesslog.txt @@ -0,0 +1,13 @@ +hcp_web +, +utf-8 +" +LF +1 +178 +id,browser,campaign,carrier,click_context,date_time,duplicate_events,duplicated_from,evar1,evar10,evar16,evar24,evar4,evar54,evar55,evar71,evar73,evar74,evar8,evar9,event_list,exclude_hit,filename,first_hit_page_url,first_hit_ref_type,first_hit_referrer,first_hit_time_gmt,geo_city,geo_country,geo_dma,geo_region,hit_source,hit_time_gmt,hitid_high,hitid_low,last_hit_time_gmt,mobile_id,mobiledevice,os,page_event,page_event_var1,page_event_var2,page_url,pagename,paid_search,post_campaign,post_channel,post_cust_hit_time_gmt,post_evar1,post_evar10,post_evar100,post_evar11,post_evar12,post_evar13,post_evar14,post_evar15,post_evar16,post_evar17,post_evar18,post_evar19,post_evar2,post_evar20,post_evar21,post_evar22,post_evar23,post_evar24,post_evar25,post_evar26,post_evar27,post_evar28,post_evar29,post_evar3,post_evar30,post_evar31,post_evar32,post_evar33,post_evar34,post_evar35,post_evar36,post_evar37,post_evar38,post_evar39,post_evar4,post_evar40,post_evar41,post_evar42,post_evar43,post_evar44,post_evar45,post_evar46,post_evar47,post_evar48,post_evar49,post_evar5,post_evar50,post_evar51,post_evar52,post_evar53,post_evar54,post_evar55,post_evar56,post_evar57,post_evar58,post_evar59,post_evar6,post_evar60,post_evar61,post_evar62,post_evar63,post_evar64,post_evar65,post_evar66,post_evar67,post_evar68,post_evar69,post_evar7,post_evar70,post_evar71,post_evar72,post_evar73,post_evar74,post_evar75,post_evar76,post_evar77,post_evar78,post_evar79,post_evar8,post_evar80,post_evar81,post_evar82,post_evar83,post_evar84,post_evar85,post_evar86,post_evar87,post_evar88,post_evar89,post_evar9,post_evar90,post_evar91,post_evar92,post_evar93,post_evar94,post_evar95,post_evar96,post_evar97,post_evar98,post_evar99,post_event_list,post_mobiledevice,post_page_event,post_page_url,post_pagename,post_referrer,post_search_engine,post_visid_high,post_visid_low,post_visid_type,ref_domain,ref_type,referrer,sampled_hit,secondary_hit,truncated_hit,user_agent,user_server,username,va_closer_detail,va_finder_detail,visid_new,visit_num,visit_page_num,visit_ref_domain,visit_ref_type,visit_referrer,visit_search_engine,visit_start_page_url,visit_start_time_gmt +id,browser,campaign,carrier,click_context,date_time_org,duplicate_events,duplicated_from,evar1,evar10,evar16,evar24,evar4,evar54,evar55,evar71,evar73,evar74,evar8,evar9,event_list,exclude_hit,filename,first_hit_page_url,first_hit_ref_type,first_hit_referrer,first_hit_time_gmt,geo_city,geo_country,geo_dma,geo_region,hit_source,hit_time_gmt,hitid_high,hitid_low,last_hit_time_gmt,mobile_id,mobiledevice,os,page_event,page_event_var1,page_event_var2,page_url,pagename,paid_search,post_campaign,post_channel,post_cust_hit_time_gmt,post_evar1,post_evar10,post_evar100,post_evar11,post_evar12,post_evar13,post_evar14,post_evar15,post_evar16,post_evar17,post_evar18,post_evar19,post_evar2,post_evar20,post_evar21,post_evar22,post_evar23,post_evar24,post_evar25,post_evar26,post_evar27,post_evar28,post_evar29_org,post_evar3,post_evar30,post_evar31,post_evar32,post_evar33,post_evar34,post_evar35,post_evar36,post_evar37,post_evar38,post_evar39,post_evar4,post_evar40,post_evar41,post_evar42,post_evar43,post_evar44,post_evar45,post_evar46,post_evar47,post_evar48,post_evar49,post_evar5,post_evar50,post_evar51,post_evar52,post_evar53,post_evar54,post_evar55,post_evar56,post_evar57,post_evar58,post_evar59,post_evar6,post_evar60,post_evar61,post_evar62,post_evar63,post_evar64,post_evar65,post_evar66,post_evar67,post_evar68,post_evar69,post_evar7,post_evar70,post_evar71,post_evar72,post_evar73,post_evar74,post_evar75,post_evar76,post_evar77,post_evar78,post_evar79,post_evar8,post_evar80,post_evar81,post_evar82,post_evar83,post_evar84,post_evar85,post_evar86,post_evar87,post_evar88,post_evar89,post_evar9,post_evar90,post_evar91,post_evar92,post_evar93,post_evar94,post_evar95,post_evar96,post_evar97,post_evar98,post_evar99,post_event_list,post_mobiledevice,post_page_event,post_page_url,post_pagename,post_referrer,post_search_engine,post_visid_high,post_visid_low,post_visid_type,ref_domain,ref_type,referrer,sampled_hit,secondary_hit,truncated_hit,user_agent,user_server,username,va_closer_detail,va_finder_detail,visid_new,visit_num,visit_page_num,visit_ref_domain,visit_ref_type,visit_referrer,visit_search_engine,visit_start_page_url,visit_start_time_gmt +src06.hcp_web_access_log +org06.hcp_web_access_log +hcp_web_accsess_log_ex.sql + From 6ee8085a075d52102ed7fcd66dbf484ed28972ff Mon Sep 17 00:00:00 2001 From: yuusuke_kanamura Date: Thu, 11 Jul 2024 12:53:31 +0900 Subject: [PATCH 04/12] =?UTF-8?q?feat:HCP=E3=82=A6=E3=82=A7=E3=83=96=20?= =?UTF-8?q?=E6=8B=A1=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; From 473328c639ca722dbb23cb26d17e1fc2e0bf70bf Mon Sep 17 00:00:00 2001 From: yuusuke_kanamura Date: Thu, 11 Jul 2024 14:45:01 +0900 Subject: [PATCH 05/12] =?UTF-8?q?feat:SQL=E3=81=AE=E4=BA=88=E7=B4=84?= =?UTF-8?q?=E8=AA=9E=E3=82=92=E5=A4=A7=E6=96=87=E5=AD=97=E3=81=AB=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=80=81JST=E5=A4=89=E6=8F=9B=E3=81=AB=E3=81=A4?= =?UTF-8?q?=E3=81=84=E3=81=A6=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../settings/hcp_web_accsess_log_ex.sql | 14 ++++++++------ .../settings/hcp_web_medpass_user_mst_ex.sql | 18 +++++++++--------- 2 files changed, 17 insertions(+), 15 deletions(-) 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 index 454fc632..b09e56ec 100644 --- a/s3/data/hcp_web/settings/hcp_web_accsess_log_ex.sql +++ b/s3/data/hcp_web/settings/hcp_web_accsess_log_ex.sql @@ -1,9 +1,11 @@ -/* date_time(日付型)がnullのレコードを抽出し、date_time(文字型) を日付型に変換してセットする。 */ -update src06.hcp_web_access_log set +/* date_time(日付型)がNULLのレコードを抽出し、date_time(文字型) を日付型に変換してセットする。 */ +/* date_time(文字型) はUTCの日付を取得するため、date_time(日付型)はMeDaCAのポリシーに合わせてJSTに変換する */ +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); +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(日付型) がNULLのレコードを抽出し、post_evar29(文字型)を日付型に変換してセットする。 */ +/* date_time(文字型) はUTCの日付を取得するため、date_time(日付型)はMeDaCAのポリシーに合わせてJSTに変換する */ +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 +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 index f53d0acd..7042aa2d 100644 --- 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 @@ -1,14 +1,14 @@ -/* 生年月日(日付型)がnullのレコードを抽出し、生年月日(文字型) を日付型に変換してセットする。 */ -update src06.hcp_web_medpass_user_mst set +/* 生年月日(日付型)が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; +WHERE BirthDate_org IS NOT NULL and BirthDate IS NULL; -/* 登録日時(日付型) がnullのレコードを抽出し、登録日時(文字型)を日付型に変換してセットする。 */ -update src06.hcp_web_medpass_user_mst set +/* 登録日時(日付型) が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; +WHERE CreateDate_org IS NOT NULL and CreateDate IS NULL; -/* 最終更新日時(日付型) がnullのレコードを抽出し、最終更新日時(文字型)を日付型に変換してセットする。 */ -update src06.hcp_web_medpass_user_mst set +/* 最終更新日時(日付型) が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; +WHERE LastUpdate_org IS NOT NULL and LastUpdate IS NULL; From bc7795ee3dabaec950d47836a415aba483f10fe2 Mon Sep 17 00:00:00 2001 From: yuusuke_kanamura Date: Thu, 11 Jul 2024 14:46:03 +0900 Subject: [PATCH 06/12] =?UTF-8?q?feat:hcp=5Fweb=5Faccess=5Flog=E3=82=B3?= =?UTF-8?q?=E3=83=A1=E3=83=B3=E3=83=88=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- s3/data/hcp_web/settings/hcp_web_accsess_log_ex.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 index b09e56ec..d1f59b83 100644 --- a/s3/data/hcp_web/settings/hcp_web_accsess_log_ex.sql +++ b/s3/data/hcp_web/settings/hcp_web_accsess_log_ex.sql @@ -4,8 +4,8 @@ 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(文字型)を日付型に変換してセットする。 */ -/* date_time(文字型) はUTCの日付を取得するため、date_time(日付型)はMeDaCAのポリシーに合わせてJSTに変換する */ +/* post_evar29(日付型)がNULLのレコードを抽出し、post_evar29(文字型)を日付型に変換してセットする。 */ +/* post_evar29(文字型)はUTCの日付を取得するため、post_evar29(日付型)はMeDaCAのポリシーに合わせてJSTに変換する */ 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 From d3d3b95f343ce9948fd3c306cf294e87c1c94b94 Mon Sep 17 00:00:00 2001 From: yuusuke_kanamura Date: Thu, 11 Jul 2024 14:56:06 +0900 Subject: [PATCH 07/12] =?UTF-8?q?feat:=E5=85=A8=E8=A7=92=E3=82=B9=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B9=E3=82=92=E5=8D=8A=E8=A7=92=E3=82=B9=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B9=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- s3/data/hcp_web/settings/hcp_web_accsess_log_ex.sql | 8 ++++---- s3/data/hcp_web/settings/hcp_web_medpass_user_mst_ex.sql | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) 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 index d1f59b83..ba682ead 100644 --- a/s3/data/hcp_web/settings/hcp_web_accsess_log_ex.sql +++ b/s3/data/hcp_web/settings/hcp_web_accsess_log_ex.sql @@ -1,11 +1,11 @@ /* date_time(日付型)がNULLのレコードを抽出し、date_time(文字型) を日付型に変換してセットする。 */ /* date_time(文字型) はUTCの日付を取得するため、date_time(日付型)はMeDaCAのポリシーに合わせてJSTに変換する */ 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); +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(文字型)を日付型に変換してセットする。 */ /* post_evar29(文字型)はUTCの日付を取得するため、post_evar29(日付型)はMeDaCAのポリシーに合わせてJSTに変換する */ 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 +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 index 7042aa2d..6b002b68 100644 --- 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 @@ -1,14 +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; +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; +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; +WHERE LastUpdate_org IS NOT NULL and LastUpdate IS NULL; From 21126da1bae2515a1ce48020424f03b2505ad51f Mon Sep 17 00:00:00 2001 From: yuusuke_kanamura Date: Tue, 16 Jul 2024 09:06:34 +0900 Subject: [PATCH 08/12] =?UTF-8?q?feat:=E6=8B=A1=E5=BC=B5SQL=E3=81=AE?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- s3/data/hcp_web/settings/hcp_web_accsess_log_ex.sql | 12 ++++++++++-- .../hcp_web/settings/hcp_web_medpass_user_mst_ex.sql | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) 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 index ba682ead..6b3d9d00 100644 --- a/s3/data/hcp_web/settings/hcp_web_accsess_log_ex.sql +++ b/s3/data/hcp_web/settings/hcp_web_accsess_log_ex.sql @@ -1,11 +1,19 @@ /* date_time(日付型)がNULLのレコードを抽出し、date_time(文字型) を日付型に変換してセットする。 */ /* date_time(文字型) はUTCの日付を取得するため、date_time(日付型)はMeDaCAのポリシーに合わせてJSTに変換する */ UPDATE src06.hcp_web_access_log SET -date_time = STR_TO_DATE(date_time_org, '%Y-%m-%d %H:%i:%s') + INTERVAL 9 HOUR + date_time = IF ( + medaca_common.convert_to_date(date_time_org, '%Y-%m-%d %H:%i:%s') IS NULL, + NULL, + medaca_common.convert_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(文字型)を日付型に変換してセットする。 */ /* post_evar29(文字型)はUTCの日付を取得するため、post_evar29(日付型)はMeDaCAのポリシーに合わせてJSTに変換する */ UPDATE src06.hcp_web_access_log SET -post_evar29 = STR_TO_DATE(post_evar29_org, '%Y-%m-%dT%H:%i:%s') + INTERVAL 9 HOUR + post_evar29 = IF ( + medaca_common.convert_to_date(post_evar29_org, '%Y-%m-%dT%H:%i:%s.%fZ') IS NULL, + NULL, + medaca_common.convert_to_date(post_evar29_org, '%Y-%m-%dT%H:%i:%s.%fZ') + 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 index 6b002b68..a097ce00 100644 --- 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 @@ -5,10 +5,10 @@ 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') +CreateDate = STR_TO_DATE(CreateDate_org, '%Y-%m-%dT%H:%i:%s+09:00') 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') +LastUpdate = STR_TO_DATE(LastUpdate_org, '%Y-%m-%dT%H:%i:%s+09:00') WHERE LastUpdate_org IS NOT NULL and LastUpdate IS NULL; From 8f0e0ec65fe7785a56995703adee3521d6831d2c Mon Sep 17 00:00:00 2001 From: yuusuke_kanamura Date: Tue, 16 Jul 2024 10:25:43 +0900 Subject: [PATCH 09/12] =?UTF-8?q?feat:=E3=82=B9=E3=83=88=E3=82=A2=E3=83=89?= =?UTF-8?q?=E3=83=95=E3=82=A1=E3=83=B3=E3=82=AF=E3=82=B7=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E3=81=AE=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../medaca_common/convert_to_date.sql | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 rds_mysql/stored_procedure/medaca_common/convert_to_date.sql diff --git a/rds_mysql/stored_procedure/medaca_common/convert_to_date.sql b/rds_mysql/stored_procedure/medaca_common/convert_to_date.sql new file mode 100644 index 00000000..e5bcf3dd --- /dev/null +++ b/rds_mysql/stored_procedure/medaca_common/convert_to_date.sql @@ -0,0 +1,17 @@ +-- A5M2で実行時に[SQL] - [スラッシュ(/)のみの行でSQLを区切る]に変えてから実行する +CREATE FUNCTION medaca_common.convert_to_date(date_string VARCHAR(255), _format VARCHAR(50)) RETURNS datetime + DETERMINISTIC +BEGIN + DECLARE converted_date DATETIME; + + DECLARE EXIT HANDLER FOR SQLEXCEPTION + BEGIN + -- エラー発生時にNULLを返す + RETURN NULL; + END; + + -- 日付変換の実行 + SET converted_date = STR_TO_DATE(date_string, _format); + + RETURN converted_date; +END \ No newline at end of file From fa68ea7d8a4425cc565786c161096635a7858fb7 Mon Sep 17 00:00:00 2001 From: yuusuke_kanamura Date: Wed, 17 Jul 2024 10:12:40 +0900 Subject: [PATCH 10/12] =?UTF-8?q?feat:=E6=96=87=E5=AD=97=E5=9E=8B=E9=A0=85?= =?UTF-8?q?=E7=9B=AE(=5Forg)=E3=81=8CNULL=E5=88=A4=E5=AE=9A=E3=81=AE?= =?UTF-8?q?=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- s3/data/hcp_web/settings/hcp_web_accsess_log_ex.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 index 6b3d9d00..67571273 100644 --- a/s3/data/hcp_web/settings/hcp_web_accsess_log_ex.sql +++ b/s3/data/hcp_web/settings/hcp_web_accsess_log_ex.sql @@ -6,7 +6,7 @@ UPDATE src06.hcp_web_access_log SET NULL, medaca_common.convert_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); +WHERE ins_date >= (now() - INTERVAL 1 YEAR); /* post_evar29(日付型)がNULLのレコードを抽出し、post_evar29(文字型)を日付型に変換してセットする。 */ /* post_evar29(文字型)はUTCの日付を取得するため、post_evar29(日付型)はMeDaCAのポリシーに合わせてJSTに変換する */ @@ -16,4 +16,4 @@ UPDATE src06.hcp_web_access_log SET NULL, medaca_common.convert_to_date(post_evar29_org, '%Y-%m-%dT%H:%i:%s.%fZ') + 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 +WHERE ins_date >= (now() - INTERVAL 1 YEAR); \ No newline at end of file From 54c3646cc4bc9a6839f536533fd6b66c1da2fa5d Mon Sep 17 00:00:00 2001 From: yuusuke_kanamura Date: Wed, 17 Jul 2024 10:13:49 +0900 Subject: [PATCH 11/12] =?UTF-8?q?feat:NULL=E5=88=A4=E5=AE=9A=E3=81=AE?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../settings/hcp_web_medpass_user_mst_ex.sql | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) 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 index a097ce00..eb63fb09 100644 --- 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 @@ -1,14 +1,23 @@ /* 生年月日(日付型)が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; + BirthDate = IF( + medaca_common.convert_to_date(BirthDate_org, '%Y-%m-%d')IS NULL, + NULL, + medaca_common.convert_to_date(BirthDate_org, '%Y-%m-%d') +); /* 登録日時(日付型) がNULLのレコードを抽出し、登録日時(文字型)を日付型に変換してセットする。 */ UPDATE src06.hcp_web_medpass_user_mst SET -CreateDate = STR_TO_DATE(CreateDate_org, '%Y-%m-%dT%H:%i:%s+09:00') -WHERE CreateDate_org IS NOT NULL and CreateDate IS NULL; +CreateDate = IF( + medaca_common.convert_to_date(CreateDate_org, '%Y-%m-%dT%H:%i:%s+09:00')IS NULL, + NULL, + medaca_common.convert_to_date(CreateDate_org, '%Y-%m-%dT%H:%i:%s+09:00') +); /* 最終更新日時(日付型) がNULLのレコードを抽出し、最終更新日時(文字型)を日付型に変換してセットする。 */ UPDATE src06.hcp_web_medpass_user_mst SET -LastUpdate = STR_TO_DATE(LastUpdate_org, '%Y-%m-%dT%H:%i:%s+09:00') -WHERE LastUpdate_org IS NOT NULL and LastUpdate IS NULL; +LastUpdate = IF( + medaca_common.convert_to_date(LastUpdate_org, '%Y-%m-%dT%H:%i:%s+09:00')IS NULL, + NULL, + medaca_common.convert_to_date(LastUpdate_org, '%Y-%m-%dT%H:%i:%s+09:00') +); From 9dbff34bf56dc32f9c380a793ca1dcae75eb5cf4 Mon Sep 17 00:00:00 2001 From: "shimoda.m@nds-tyo.co.jp" Date: Wed, 17 Jul 2024 10:34:18 +0900 Subject: [PATCH 12/12] =?UTF-8?q?feat:=20=E6=8B=A1=E5=BC=B5SQL=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../settings/hcp_web_accsess_log_ex.sql | 8 +++---- .../settings/hcp_web_medpass_user_mst_ex.sql | 22 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) 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 index 67571273..d7d27ded 100644 --- a/s3/data/hcp_web/settings/hcp_web_accsess_log_ex.sql +++ b/s3/data/hcp_web/settings/hcp_web_accsess_log_ex.sql @@ -1,14 +1,14 @@ -/* date_time(日付型)がNULLのレコードを抽出し、date_time(文字型) を日付型に変換してセットする。 */ +/* date_time(文字型) を日付型に変換してセットする。 */ /* date_time(文字型) はUTCの日付を取得するため、date_time(日付型)はMeDaCAのポリシーに合わせてJSTに変換する */ UPDATE src06.hcp_web_access_log SET date_time = IF ( - medaca_common.convert_to_date(date_time_org, '%Y-%m-%d %H:%i:%s') IS NULL, - NULL, + medaca_common.convert_to_date(date_time_org, '%Y-%m-%d %H:%i:%s') IS NULL, + NULL, medaca_common.convert_to_date(date_time_org, '%Y-%m-%d %H:%i:%s') + INTERVAL 9 HOUR ) WHERE ins_date >= (now() - INTERVAL 1 YEAR); -/* post_evar29(日付型)がNULLのレコードを抽出し、post_evar29(文字型)を日付型に変換してセットする。 */ +/* post_evar29(文字型)を日付型に変換してセットする。 */ /* post_evar29(文字型)はUTCの日付を取得するため、post_evar29(日付型)はMeDaCAのポリシーに合わせてJSTに変換する */ UPDATE src06.hcp_web_access_log SET post_evar29 = IF ( 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 index eb63fb09..a3de3b99 100644 --- 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 @@ -1,23 +1,23 @@ -/* 生年月日(日付型)がNULLのレコードを抽出し、生年月日(文字型) を日付型に変換してセットする。 */ +/* 生年月日(文字型) を日付型に変換してセットする。文字型のデータがNULLの場合はNULLをセットする */ UPDATE src06.hcp_web_medpass_user_mst SET - BirthDate = IF( - medaca_common.convert_to_date(BirthDate_org, '%Y-%m-%d')IS NULL, +BirthDate = IF( + BirthDate_org IS NULL, NULL, medaca_common.convert_to_date(BirthDate_org, '%Y-%m-%d') ); -/* 登録日時(日付型) がNULLのレコードを抽出し、登録日時(文字型)を日付型に変換してセットする。 */ +/* 登録日時(文字型)を日付型に変換してセットする。文字型のデータがNULLの場合はNULLをセットする */ UPDATE src06.hcp_web_medpass_user_mst SET CreateDate = IF( - medaca_common.convert_to_date(CreateDate_org, '%Y-%m-%dT%H:%i:%s+09:00')IS NULL, - NULL, - medaca_common.convert_to_date(CreateDate_org, '%Y-%m-%dT%H:%i:%s+09:00') + CreateDate_org IS NULL, + NULL, + medaca_common.convert_to_date(CreateDate_org, '%Y-%m-%dT%H:%i:%s+09:00') ); -/* 最終更新日時(日付型) がNULLのレコードを抽出し、最終更新日時(文字型)を日付型に変換してセットする。 */ +/* 最終更新日時(文字型)を日付型に変換してセットする。文字型のデータがNULLの場合はNULLをセットする */ UPDATE src06.hcp_web_medpass_user_mst SET LastUpdate = IF( - medaca_common.convert_to_date(LastUpdate_org, '%Y-%m-%dT%H:%i:%s+09:00')IS NULL, - NULL, - medaca_common.convert_to_date(LastUpdate_org, '%Y-%m-%dT%H:%i:%s+09:00') + LastUpdate_org IS NULL, + NULL, + medaca_common.convert_to_date(LastUpdate_org, '%Y-%m-%dT%H:%i:%s+09:00') );