共享奖合计计算
SELECT
	*
FROM
	ek_temp_gx_zs_cs B
LEFT JOIN 
(SELECT
	Z.`给奖人编号`,
	Z.`计奖代数`,
	SUM(Z.`个人团队`) AS 层合计
FROM
	ek_temp_gx_zs_cs Z
	GROUP BY Z.`给奖人编号`,Z.`计奖代数`) A ON A.`给奖人编号` = B.`给奖人编号` AND A.`计奖代数` = B.`计奖代数`


共享奖追溯导出
SELECT
	U.USER_NAME,
	U.REAL_NAME,
	U2.USER_NAME,
	U2.REAL_NAME,
	G.ORI_BONUS 
FROM
	AR_CALC_BONUS_GX G
	LEFT JOIN AR_USER U ON U.ID = G.USER_ID
	LEFT JOIN AR_USER U2 ON U2.ID = G.FROM_USER_ID
WHERE
	G.PERIOD_NUM = 160