[loadOriginal] select fnc_load_basv3110(:s_id, :shiji_no, ':login_id') [updateOriginal] select fnc_update_basv3110(:s_id) [deleteOriginal] delete from w_basv3110 where s_id = :s_id; delete from w_basv3110_m where s_id = :s_id; delete from w_basv3110_shiyou where s_id = :s_id; delete from w_basv3110_shiyou2 where s_id = :s_id; delete from w_basv3110_file where s_id = :s_id; [doDelete] select fnc_delete_basv3110(:shiji_no, ':login_id') [loadNewKey] select shiji_no as w_new_den_no from w_basv3110 where s_id = :s_id [loadJucyu] select um.jucyu_su as suryo , uh.tan_cd as eigyou_tan_cd , um.nonyu_ymd , uh.tok_cd , uh.tok_nm , um.hin_cd , um.hin_nm , um.jucyu_su , um.tanka , um.kingaku , um.size_l , um.size_w , um.size_h , um.syotei_ymd , um.koyu_nm , um.sunpo_kbn , um.color_cd , um.meisai_biko , um.meisai_biko2 , um.hosoku3 , um.hosoku4 , um.hosoku5 , um.weight , uh.biko2 --, uh.den_kbn , um.repeat_kbn as den_kbn , um.mock_flg , um.size_free from t_uri_m um left join t_uri uh on (uh.den_no = um.den_no) where um.den_no = :jucyu_no and um.row_no = :jucyu_row_no [addFile] insert into w_basv3110_file (s_id, file_kind, row_no, file_name, del_flg, cre_id, cre_time, upd_id, upd_time) values( :s_id , :w_file_kind , (select COALESCE(max(row_no),-1) + 1 from w_basv3110_file where s_id = :s_id) --row , ':w_file_name' , 0 --del_flg , ':login_id' --cre_id , now() --cre_time , ':login_id' --upd_id , now() --upd_time ) [getShiyouWorkCount] select (select COALESCE(max(row_no),-1) + 1 from w_basv3110_shiyou where s_id = :s_id) as w_shiyou1_max_row_no , (select COALESCE(max(row_no),-1) + 1 from w_basv3110_shiyou2 where s_id = :s_id) as w_shiyou2_max_row_no [copyZairyo] --delete from w_basv3110_shiyou where s_id = :s_id and ':w_copy_mode' != 'syukka'; --delete from w_basv3110_shiyou2 where s_id = :s_id and ':w_copy_mode' != 'sekkei'; insert into w_basv3110_shiyou ( s_id , row_no , hin_cd , hin_nm , suryo , tanka , kingaku , sir_cd , sir_nm , hacyu_irai_su , hacyu_irai_ymd , hacyu_no , hacyu_row_no , size_l , size_w , size_h , size_free , meisai_biko , meisai_biko2 , set_su , hacyu_irai_flg --#23890 2022.05.12 MOD STT , color_cd , color_nm , sir_loc_no , sir_loc_nm --#23890 2022.05.12 MOD END -- , iko_key , del_flg , cre_id , cre_time , upd_id , upd_time ) select :s_id -- , t.row_no , :w_shiyou1_max_row_no + (select count(*) from t_shiyou_zairyo t2 where t2.shiji_no = t.shiji_no and COALESCE(t2.shiyou_zairyo_kbn_sub,'') = '' and t2.row_no < t.row_no) --row_no , t.hin_cd , t.hin_nm , t.suryo , t.tanka , t.kingaku , t.sir_cd , t.sir_nm , null --hacyu_irai_su , null --hacyu_irai_ymd , null --hacyu_no , null --hacyu_row_no , t.size_l , t.size_w , t.size_h , t.size_free , t.meisai_biko , t.meisai_biko2 , (case when(t.set_su is not null)then(t.set_su)else( case when(:w_suryo != 0)then(round(t.suryo / :w_suryo,0))else(null)end )end) --set_su , 0 --hacyu_irai_flg --#23890 2022.05.12 MOD STT , t.color_cd , t.color_nm , t.sir_loc_no , hloc.han_name as sir_loc_nm --#23890 2022.05.12 MOD END -- , t.iko_key , 0 --del_flg , ':login_id' --cre_id , now() --cre_time , ':login_id' --upd_id , now() --upd_time from t_shiyou_zairyo t --#23890 2022.05.12 MOD STT left join v_hanyo_all hloc on (hloc.mst_kbn = 'loc' and hloc.han_cd = t.sir_loc_no) --#23890 2022.05.12 MOD END where t.shiji_no = :w_shiji_no and COALESCE(t.shiyou_zairyo_kbn_sub,'') = '' and ':w_copy_mode' != 'syukka' ; --セット数0はNULLにする update w_basv3110_shiyou set set_su = null where s_id = :s_id and set_su = 0 ; insert into w_basv3110_shiyou2 ( s_id , row_no , hin_cd , hin_nm , suryo , tanka , kingaku , sir_cd , sir_nm , hacyu_irai_su , hacyu_irai_ymd , hacyu_no , hacyu_row_no , size_l , size_w , size_h , size_free , meisai_biko , meisai_biko2 , set_su , hacyu_irai_flg --#23890 2022.05.12 MOD STT , color_cd , color_nm , sir_loc_no , sir_loc_nm --#23890 2022.05.12 MOD END -- , iko_key , del_flg , cre_id , cre_time , upd_id , upd_time ) select :s_id -- , t.row_no , :w_shiyou2_max_row_no + (select count(*) from t_shiyou_zairyo t2 where t2.shiji_no = t.shiji_no and t2.shiyou_zairyo_kbn_sub = '2' and t2.row_no < t.row_no) --row_no , t.hin_cd , t.hin_nm , t.suryo , t.tanka , t.kingaku , t.sir_cd , t.sir_nm , null --hacyu_irai_su , null --hacyu_irai_ymd , null --hacyu_no , null --hacyu_row_no , t.size_l , t.size_w , t.size_h , t.size_free , t.meisai_biko , t.meisai_biko2 , (case when(t.set_su is not null)then(t.set_su)else( case when(:w_suryo != 0)then(round(t.suryo / :w_suryo,0))else(null)end )end) --set_su , 0 --hacyu_irai_flg --#23890 2022.05.12 MOD STT , t.color_cd , t.color_nm , t.sir_loc_no , hloc.han_name as sir_loc_nm --#23890 2022.05.12 MOD END -- , t.iko_key , 0 --del_flg , ':login_id' --cre_id , now() --cre_time , ':login_id' --upd_id , now() --upd_time from t_shiyou_zairyo t --#23890 2022.05.12 MOD STT left join v_hanyo_all hloc on (hloc.mst_kbn = 'loc' and hloc.han_cd = t.sir_loc_no) --#23890 2022.05.12 MOD END where t.shiji_no = :w_shiji_no and t.shiyou_zairyo_kbn_sub = '2' and ':w_copy_mode' != 'sekkei' ; --セット数0はNULLにする update w_basv3110_shiyou2 set set_su = null where s_id = :s_id and set_su = 0 ;