[loadOriginal] select fnc_update_sum_3years_uri(:s_id, ':taisyo_ym', '', '', '', ':tok_cat_cd', ':tok_cd', ':tok_cd', ':hin_dcat_cd', ':hin_dcat_cd', ':hin_cat_cd', ':hin_cat_cd', ':hin_cd', ':hin_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)when('hin')then(w.hin_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)when('hin')then(w.hin_nm)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)when('hin')then(w.hin_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)when('hin')then(w.hin_nm)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 --#23664 2022.04.25 MOD STT 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)when('hin')then(w.hin_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)when('hin')then(w.hin_nm)else((case when(mt.tok_rnm != '')then(mt.tok_rnm)else(w.tok_nm)end))end) as tok_nm , 3 as row_kbn_i , '数量' as row_kbn , w.suryo_kon_01 as kon_01 , w.suryo_kon_02 as kon_02 , w.suryo_kon_03 as kon_03 , w.suryo_kon_04 as kon_04 , w.suryo_kon_05 as kon_05 , w.suryo_kon_06 as kon_06 , w.suryo_kon_07 as kon_07 , w.suryo_kon_08 as kon_08 , w.suryo_kon_09 as kon_09 , w.suryo_kon_10 as kon_10 , w.suryo_kon_11 as kon_11 , w.suryo_kon_12 as kon_12 , w.suryo_kon_total 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_suryo' = '1' and w.suryo_kon_total != 0 --#23664 2022.04.25 MOD END 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 --#23664 2022.04.25 MOD STT union all select 1 as kbn_i , '' as tok_cd , '総合計' as tok_nm , 3 as row_kbn_i , '数量' as row_kbn , w.suryo_kon_01 as kon_01 , w.suryo_kon_02 as kon_02 , w.suryo_kon_03 as kon_03 , w.suryo_kon_04 as kon_04 , w.suryo_kon_05 as kon_05 , w.suryo_kon_06 as kon_06 , w.suryo_kon_07 as kon_07 , w.suryo_kon_08 as kon_08 , w.suryo_kon_09 as kon_09 , w.suryo_kon_10 as kon_10 , w.suryo_kon_11 as kon_11 , w.suryo_kon_12 as kon_12 , w.suryo_kon_total 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_suryo' = '1' and w.suryo_kon_total != 0 --#23664 2022.04.25 MOD END order by kbn_i, tok_cd, tok_nm, row_kbn_i