my goods data like under code:
goods_brand goods_panentclass goods_sonclass goodssonclass1 goodssonclass2... salseamount salesDate
BrandA ClassA ClassA_a ClassA_a_1 ClassA_a_1_1 10000 2019-01-01
BrandA ClassA ClassA_a ClassA_a_1 ClassA_a_1_2 10000 2020-01-01
BrandA>ClassA>ClassA_a>ClassA_a_1....
i want get every goods class's summay of sales money. and summed by year,for example 2019 ,2020.
the class of goods is a tree structure. every level summay is be hoped to sum.
are you have some good suggestion?