[loadOriginal] select fnc_update_sum_3years_uri(:s_id, ':taisyo_ym', '', '', '', ':tok_cat_cd', '', '', '', '', '', '', '', '', '', ':login_id', ':eig_cd', ':eig_cd') [load_grdList] select 0 as kbn_i , (case(':sum_kbn')when('hdcat')then(w.hin_dcat_cd)when('hcat')then(w.hin_cat_cd)when('tcat')then(w.tok_cat_cd)else(w.tok_cd)end) as tok_cd , (case(':sum_kbn')when('hdcat')then(h14.han_name)when('hcat')then(h05.han_name)when('tcat')then(h35.han_name)else((case when(mt.tok_rnm != '')then(mt.tok_rnm)else(w.tok_nm)end))end) as tok_nm , 1 as row_kbn_i , '売上' as row_kbn , round(w.uri_kon_01 / :tani_i, :dp_i) as kon_01 , round(w.uri_kon_02 / :tani_i, :dp_i) as kon_02 , round(w.uri_kon_03 / :tani_i, :dp_i) as kon_03 , round(w.uri_kon_04 / :tani_i, :dp_i) as kon_04 , round(w.uri_kon_05 / :tani_i, :dp_i) as kon_05 , round(w.uri_kon_06 / :tani_i, :dp_i) as kon_06 , round(w.uri_kon_07 / :tani_i, :dp_i) as kon_07 , round(w.uri_kon_08 / :tani_i, :dp_i) as kon_08 , round(w.uri_kon_09 / :tani_i, :dp_i) as kon_09 , round(w.uri_kon_10 / :tani_i, :dp_i) as kon_10 , round(w.uri_kon_11 / :tani_i, :dp_i) as kon_11 , round(w.uri_kon_12 / :tani_i, :dp_i) as kon_12 , round(w.uri_kon_total / :tani_i, :dp_i) as kon_total from w_sum_3years_uri w left join m_tokui mt on (mt.tok_cd = w.tok_cd) left join m_hanyo h14 on (h14.mst_kbn = '14' and h14.han_cd = w.hin_dcat_cd) left join m_hanyo h05 on (h05.mst_kbn = '05' and h05.han_cd = w.hin_cat_cd) left join m_hanyo h35 on (h35.mst_kbn = '35' and h35.han_cd = w.tok_cat_cd) where 1 = 1 and w.s_id = :s_id and w.sum_kbn = ':sum_kbn' and ':chk_uri_gaku' = '1' --TODO and w.suryo_kon_total != 0 union all select 0 as kbn_i , (case(':sum_kbn')when('hdcat')then(w.hin_dcat_cd)when('hcat')then(w.hin_cat_cd)when('tcat')then(w.tok_cat_cd)else(w.tok_cd)end) as tok_cd , (case(':sum_kbn')when('hdcat')then(h14.han_name)when('hcat')then(h05.han_name)when('tcat')then(h35.han_name)else((case when(mt.tok_rnm != '')then(mt.tok_rnm)else(w.tok_nm)end))end) as tok_nm , 2 as row_kbn_i , '粗利' as row_kbn , round(w.ara_kon_01 / :tani_i, :dp_i) as kon_01 , round(w.ara_kon_02 / :tani_i, :dp_i) as kon_02 , round(w.ara_kon_03 / :tani_i, :dp_i) as kon_03 , round(w.ara_kon_04 / :tani_i, :dp_i) as kon_04 , round(w.ara_kon_05 / :tani_i, :dp_i) as kon_05 , round(w.ara_kon_06 / :tani_i, :dp_i) as kon_06 , round(w.ara_kon_07 / :tani_i, :dp_i) as kon_07 , round(w.ara_kon_08 / :tani_i, :dp_i) as kon_08 , round(w.ara_kon_09 / :tani_i, :dp_i) as kon_09 , round(w.ara_kon_10 / :tani_i, :dp_i) as kon_10 , round(w.ara_kon_11 / :tani_i, :dp_i) as kon_11 , round(w.ara_kon_12 / :tani_i, :dp_i) as kon_12 , round(w.ara_kon_total / :tani_i, :dp_i) as kon_total from w_sum_3years_uri w left join m_tokui mt on (mt.tok_cd = w.tok_cd) left join m_hanyo h14 on (h14.mst_kbn = '14' and h14.han_cd = w.hin_dcat_cd) left join m_hanyo h05 on (h05.mst_kbn = '05' and h05.han_cd = w.hin_cat_cd) left join m_hanyo h35 on (h35.mst_kbn = '35' and h35.han_cd = w.tok_cat_cd) where 1 = 1 and w.s_id = :s_id and w.sum_kbn = ':sum_kbn' and ':chk_ara_gaku' = '1' --TODO and w.suryo_kon_total != 0 union all select 1 as kbn_i , '' as tok_cd , '総合計' as tok_nm , 1 as row_kbn_i , '売上' as row_kbn , round(w.uri_kon_01 / :tani_i, :dp_i) as kon_01 , round(w.uri_kon_02 / :tani_i, :dp_i) as kon_02 , round(w.uri_kon_03 / :tani_i, :dp_i) as kon_03 , round(w.uri_kon_04 / :tani_i, :dp_i) as kon_04 , round(w.uri_kon_05 / :tani_i, :dp_i) as kon_05 , round(w.uri_kon_06 / :tani_i, :dp_i) as kon_06 , round(w.uri_kon_07 / :tani_i, :dp_i) as kon_07 , round(w.uri_kon_08 / :tani_i, :dp_i) as kon_08 , round(w.uri_kon_09 / :tani_i, :dp_i) as kon_09 , round(w.uri_kon_10 / :tani_i, :dp_i) as kon_10 , round(w.uri_kon_11 / :tani_i, :dp_i) as kon_11 , round(w.uri_kon_12 / :tani_i, :dp_i) as kon_12 , round(w.uri_kon_total / :tani_i, :dp_i) as kon_total from w_sum_3years_uri w left join m_tokui mt on (mt.tok_cd = w.tok_cd) left join m_hanyo h14 on (h14.mst_kbn = '14' and h14.han_cd = w.hin_dcat_cd) left join m_hanyo h35 on (h35.mst_kbn = '35' and h35.han_cd = w.tok_cat_cd) where 1 = 1 and w.s_id = :s_id and w.sum_kbn = 'total' and ':chk_uri_gaku' = '1' --TODO and w.suryo_kon_total != 0 union all select 1 as kbn_i , '' as tok_cd , '総合計' as tok_nm , 2 as row_kbn_i , '粗利' as row_kbn , round(w.ara_kon_01 / :tani_i, :dp_i) as kon_01 , round(w.ara_kon_02 / :tani_i, :dp_i) as kon_02 , round(w.ara_kon_03 / :tani_i, :dp_i) as kon_03 , round(w.ara_kon_04 / :tani_i, :dp_i) as kon_04 , round(w.ara_kon_05 / :tani_i, :dp_i) as kon_05 , round(w.ara_kon_06 / :tani_i, :dp_i) as kon_06 , round(w.ara_kon_07 / :tani_i, :dp_i) as kon_07 , round(w.ara_kon_08 / :tani_i, :dp_i) as kon_08 , round(w.ara_kon_09 / :tani_i, :dp_i) as kon_09 , round(w.ara_kon_10 / :tani_i, :dp_i) as kon_10 , round(w.ara_kon_11 / :tani_i, :dp_i) as kon_11 , round(w.ara_kon_12 / :tani_i, :dp_i) as kon_12 , round(w.ara_kon_total / :tani_i, :dp_i) as kon_total from w_sum_3years_uri w left join m_tokui mt on (mt.tok_cd = w.tok_cd) left join m_hanyo h14 on (h14.mst_kbn = '14' and h14.han_cd = w.hin_dcat_cd) left join m_hanyo h35 on (h35.mst_kbn = '35' and h35.han_cd = w.tok_cat_cd) where 1 = 1 and w.s_id = :s_id and w.sum_kbn = 'total' and ':chk_ara_gaku' = '1' --TODO and w.suryo_kon_total != 0 order by kbn_i, tok_cd, row_kbn_i