diff --git a/README.md b/README.md index 346f1dd..4349c70 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ ---------------------------------------------------------------------------- 참고 쿼리 ---------------------------------------------------------------------------- -# 일상기록 삭제 +# 일상기록 삭제 - 일부 delete from tbl_bf_daily_nutrition where smc_no = 73; delete from tbl_bf_daily_nutrition_1 where smc_no = 73; delete from tbl_bf_daily_nutrition_2 where smc_no = 73; @@ -23,6 +23,23 @@ delete from tbl_bf_daily_nutrition_9 where smc_no = 73; delete from tbl_bf_daily_nutrition_10 where smc_no = 73; + + +# 일상기록 삭제 - 전체 +delete from tbl_bf_daily_nutrition; +delete from tbl_bf_daily_nutrition_1; +delete from tbl_bf_daily_nutrition_2; +delete from tbl_bf_daily_nutrition_3; +delete from tbl_bf_daily_nutrition_4; +delete from tbl_bf_daily_nutrition_5; +delete from tbl_bf_daily_nutrition_6; +delete from tbl_bf_daily_nutrition_7; +delete from tbl_bf_daily_nutrition_8; +delete from tbl_bf_daily_nutrition_9; +delete from tbl_bf_daily_nutrition_10; + + + # 동기화 관련 select * from tbl_bf_family where member_id = 'renamaestro'; select smc_no, member_id from tbl_bf_family_baby where member_id = 'renamaestro'; @@ -69,22 +86,22 @@ order by DATE_FORMAT(b.reg_dt, '%Y-%m-%d %H') asc; #메모리 - 타임라인(모유, 각 카테고리별 수치 및 시간간격 계산해야됨.) SELECT - DATE_FORMAT(b.reg_dt, '%Y-%m-%d %H:%i:%s') as reg_date, - TIMEDIFF(b.reg_dt, LAG(b.reg_dt) OVER (ORDER BY b.reg_dt) ) AS time_diff, - d.title, - b.dn_no, - d.cd_no, - CASE - when b.dn_no = '627' then (select eat_qty from tbl_bf_daily_nutrition_1 tn1 where tn1.dn_no = b.dn_no) -- 모유 - when b.dn_no = '618' then (select eat_qty from tbl_bf_daily_nutrition_2 tn1 where tn1.dn_no = b.dn_no) -- 분유 - END AS time_val +DATE_FORMAT(b.reg_dt, '%Y-%m-%d %H:%i:%s') as reg_date, +TIMEDIFF(b.reg_dt, LAG(b.reg_dt) OVER (ORDER BY b.reg_dt) ) AS time_diff, +d.title, +b.dn_no, +d.cd_no, +CASE +when d.cd_no = 'BF_NU_TP_1' then (select eat_qty from tbl_bf_daily_nutrition_1 tn1 where tn1.dn_no = b.dn_no) -- 모유 +when d.cd_no = 'BF_NU_TP_2' then (select eat_qty from tbl_bf_daily_nutrition_2 tn1 where tn1.dn_no = b.dn_no) -- 분유 +END AS time_val FROM tbl_bf_family_match a INNER JOIN tbl_bf_daily_nutrition b on a.smc_no = b.smc_no INNER JOIN tbl_bf_family_match c on a.smc_no = c.smc_no INNER JOIN tbl_code_item_str d on b.nutirition_cd_no = d.cd_no WHERE - a.member_id = '1642861413918' - and DATE_FORMAT(b.reg_dt,'%Y-%m-%d') = STR_TO_DATE('2022-02-15','%Y-%m-%d') ; +a.member_id = '1642861413918' +and DATE_FORMAT(b.reg_dt,'%Y-%m-%d') = STR_TO_DATE('2022-02-17','%Y-%m-%d') ; # 기록 카테고리 종류 - 기록 타임라인 노출값 - 103p diff --git a/dml_20220205.txt b/dml_20220205.txt index 50bc83d..c2a10d5 100644 --- a/dml_20220205.txt +++ b/dml_20220205.txt @@ -1,54 +1,137 @@ --- tbl_code_group 테이블 데이터 +-- tbl_code_group 테이블 데이터 -------------------------------------------------------------------------- INSERT INTO tbl_code_group -(cg_cd, title, reg_dt, mod_dt, sys_member_id) + (cg_cd, title, reg_dt, mod_dt, sys_member_id) VALUES -('BF_RECORD_CATEGORY', '기록카테고리', now(), null, 'so2'); + ('BF_RECORD_CATEGORY', '기록카테고리', now(), null, 'so2'); --- tbl_code_item 테이블 데이터 + + +-- tbl_code_item 테이블 데이터 -------------------------------------------------------------------------- +DELETE FROM tbl_code_item WHERE cg_cd = 'BF_RECORD_CATEGORY'; INSERT INTO tbl_code_item - (cd_no, title, order_no, cg_cd, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id) + (title, order_no, cg_cd, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id) VALUES - ('78', '모유', '1', 'BF_RECORD_CATEGORY', '1', '', '', '2022-02-05 00:00:00', null, 'so2'); - + ('모유', '1', 'BF_RECORD_CATEGORY', '1', '', '', '2022-02-05 00:00:00', null, 'so2'); INSERT INTO tbl_code_item - (cd_no, title, order_no, cg_cd, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id) + (title, order_no, cg_cd, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id) VALUES - ('79', '젖병', '2', 'BF_RECORD_CATEGORY', '2', '', '', '2022-02-05 00:00:00', null, 'so2'); - + ('간식', '2', 'BF_RECORD_CATEGORY', '3', '', '', '2022-02-05 00:00:00', null, 'so2'); INSERT INTO tbl_code_item - (cd_no, title, order_no, cg_cd, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id) + (title, order_no, cg_cd, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id) VALUES - ('80', '간식', '3', 'BF_RECORD_CATEGORY', '3', '', '', '2022-02-05 00:00:00', null, 'so2'); - + ('대소변', '3', 'BF_RECORD_CATEGORY', '6', '', '', '2022-02-05 00:00:00', null, 'so2'); INSERT INTO tbl_code_item - (cd_no, title, order_no, cg_cd, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id) + (title, order_no, cg_cd, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id) VALUES - ('81', '홈메이드 이유식', '4', 'BF_RECORD_CATEGORY', '4', '', '', '2022-02-05 00:00:00', null, 'so2'); - + ('병원', '4', 'BF_RECORD_CATEGORY', '11', '', '', '2022-02-05 00:00:00', null, 'so2'); INSERT INTO tbl_code_item - (cd_no, title, order_no, cg_cd, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id) + (title, order_no, cg_cd, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id) VALUES - ('82', '시판 이유식', '5', 'BF_RECORD_CATEGORY', '5', '', '', '2022-02-05 00:00:00', null, 'so2'); - + ('생활', '5', 'BF_RECORD_CATEGORY', '12', '', '', '2022-02-05 00:00:00', null, 'so2'); INSERT INTO tbl_code_item - (cd_no, title, order_no, cg_cd, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id) + (title, order_no, cg_cd, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id) VALUES - ('83', '대소변', '6', 'BF_RECORD_CATEGORY', '6', '', '', '2022-02-05 00:00:00', null, 'so2'); - + ('발달과정성취', '6', 'BF_RECORD_CATEGORY', '13', '', '', '2022-02-05 00:00:00', null, 'so2'); INSERT INTO tbl_code_item - (cd_no, title, order_no, cg_cd, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id) + (title, order_no, cg_cd, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id) VALUES - ('84', '예방접종', '7', 'BF_RECORD_CATEGORY', '7', '', '', '2022-02-05 00:00:00', null, 'so2'); - + ('수면', '7', 'BF_RECORD_CATEGORY', '5', '', '', '2022-02-05 00:00:00', null, 'so2'); INSERT INTO tbl_code_item - (cd_no, title, order_no, cg_cd, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id) + (title, order_no, cg_cd, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id) VALUES - ('85', '병원', '8', 'BF_RECORD_CATEGORY', '8', '', '', '2022-02-05 00:00:00', null, 'so2'); - + ('시판이유식', '8', 'BF_RECORD_CATEGORY', '10', '', '', '2022-02-05 00:00:00', null, 'so2'); INSERT INTO tbl_code_item - (cd_no, title, order_no, cg_cd, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id) + (title, order_no, cg_cd, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id) +VALUES + ('예방접종', '9', 'BF_RECORD_CATEGORY', '7', '', '', '2022-02-05 00:00:00', null, 'so2'); +INSERT INTO tbl_code_item + (title, order_no, cg_cd, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id) +VALUES + ('유축', '10', 'BF_RECORD_CATEGORY', '14', '', '', '2022-02-05 00:00:00', null, 'so2'); +INSERT INTO tbl_code_item + (title, order_no, cg_cd, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id) +VALUES + ('젖병', '11', 'BF_RECORD_CATEGORY', '2', '', '', '2022-02-05 00:00:00', null, 'so2'); +INSERT INTO tbl_code_item + (title, order_no, cg_cd, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id) +VALUES + ('체온', '12', 'BF_RECORD_CATEGORY', '15', '', '', '2022-02-05 00:00:00', null, 'so2'); +INSERT INTO tbl_code_item + (title, order_no, cg_cd, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id) +VALUES + ('홈메이드 이유식', '13', 'BF_RECORD_CATEGORY', '9', '', '', '2022-02-05 00:00:00', null, 'so2'); + + + +-- tbl_code_item_str 테이블 -------------------------------------------------------------------------- +delete from tbl_code_item_str where cg_cd = 'BF_NU_TP'; +INSERT INTO tbl_code_item_str + (cd_no, title, order_no, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id, cg_cd) VALUES - ('86', '생활', '9', 'BF_RECORD_CATEGORY', '9', '', '', '2022-02-05 00:00:00', null, 'so2'); + ('BF_NU_TP_1', '모유', '1', '1', '', '', '2021-03-26 07:17:04', null, 'renamaestro', 'BF_NU_TP'); + +INSERT INTO tbl_code_item_str + (cd_no, title, order_no, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id, cg_cd) +VALUES + ('BF_NU_TP_3', '간식', '2', '3', '', '', '2021-03-26 07:17:24', null, 'renamaestro', 'BF_NU_TP'); + +INSERT INTO tbl_code_item_str + (cd_no, title, order_no, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id, cg_cd) +VALUES + ('BF_NU_TP_6', '대소변', '3', '6', '', '', '2021-04-08 18:27:59', null, 'renamaestro', 'BF_NU_TP'); + +INSERT INTO tbl_code_item_str + (cd_no, title, order_no, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id, cg_cd) +VALUES + ('BF_NU_TP_11', '병원', '4', '11', '', '', '2021-01-28 00:00:00', null, 'so2', 'BF_NU_TP'); + +INSERT INTO tbl_code_item_str + (cd_no, title, order_no, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id, cg_cd) +VALUES + ('BF_NU_TP_12', '생활', '5', '12', '', '', '2021-01-28 00:00:00', null, 'so2', 'BF_NU_TP'); + +INSERT INTO tbl_code_item_str + (cd_no, title, order_no, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id, cg_cd) +VALUES + ('BF_NU_TP_13', '발달과정성취', '6', '13', '', '', '2021-01-28 00:00:00', null, 'so2', 'BF_NU_TP'); + +INSERT INTO tbl_code_item_str + (cd_no, title, order_no, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id, cg_cd) +VALUES + ('BF_NU_TP_5', '수면', '7', '5', '', '', '2021-03-26 07:17:40', null, 'renamaestro', 'BF_NU_TP'); + +INSERT INTO tbl_code_item_str + (cd_no, title, order_no, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id, cg_cd) +VALUES + ('BF_NU_TP_10', '시판이유식', '8', '10', '', '', '2021-04-08 18:29:15', null, 'renamaestro', 'BF_NU_TP'); + +INSERT INTO tbl_code_item_str + (cd_no, title, order_no, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id, cg_cd) +VALUES + ('BF_NU_TP_7', '예방접종', '9', '7', '', '', '2021-04-08 18:28:17', null, 'renamaestro', 'BF_NU_TP'); + +INSERT INTO tbl_code_item_str + (cd_no, title, order_no, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id, cg_cd) +VALUES + ('BF_NU_TP_14', '유축', '10', '14', '', '', '2021-01-28 00:00:00', null, 'so2', 'BF_NU_TP'); + +INSERT INTO tbl_code_item_str + (cd_no, title, order_no, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id, cg_cd) +VALUES + ('BF_NU_TP_2', '젖병', '11', '2', '', '', '2021-03-26 07:17:12', null, 'renamaestro', 'BF_NU_TP'); + +INSERT INTO tbl_code_item_str + (cd_no, title, order_no, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id, cg_cd) +VALUES + ('BF_NU_TP_15', '체온', '12', '15', '', '', '2021-01-28 00:00:00', null, 'so2', 'BF_NU_TP'); + +INSERT INTO tbl_code_item_str + (cd_no, title, order_no, val_1, ci_explain, ci_link, reg_dt, mod_dt, sys_member_id, cg_cd) +VALUES + ('BF_NU_TP_9', '홈메이드이유식', '13', '9', '', '', '2021-04-08 18:28:56', null, 'renamaestro', 'BF_NU_TP'); + + + -- tbl_code_item_str 부모질병관련 코드 수정 delete from tbl_code_item_str where cg_cd = 'BF_BABY_DISEASE'; diff --git a/src/main/webapp/WEB-INF/views/ftl/m/bf_daily_nutrition/include_bf_nu_tp_10.ftl b/src/main/webapp/WEB-INF/views/ftl/m/bf_daily_nutrition/include_bf_nu_tp_10.ftl index 8765318..2ca2b26 100644 --- a/src/main/webapp/WEB-INF/views/ftl/m/bf_daily_nutrition/include_bf_nu_tp_10.ftl +++ b/src/main/webapp/WEB-INF/views/ftl/m/bf_daily_nutrition/include_bf_nu_tp_10.ftl @@ -46,10 +46,10 @@

제공량을 선택해주세요

diff --git a/src/main/webapp/WEB-INF/views/ftl/m/bf_daily_nutrition/include_bf_nu_tp_3.ftl b/src/main/webapp/WEB-INF/views/ftl/m/bf_daily_nutrition/include_bf_nu_tp_3.ftl index 61de82a..a1d446b 100644 --- a/src/main/webapp/WEB-INF/views/ftl/m/bf_daily_nutrition/include_bf_nu_tp_3.ftl +++ b/src/main/webapp/WEB-INF/views/ftl/m/bf_daily_nutrition/include_bf_nu_tp_3.ftl @@ -32,12 +32,10 @@

제공량을 선택해주세요