SELECT
	(
		SELECT
			CASE
		WHEN media_id = 1 THEN
			'头条'
		WHEN media_id = 2 THEN
			'快手'
		WHEN media_id = 3 THEN
			'头条内广'
		ELSE
			''
		END
		FROM
			ctop_project
		WHERE
			id = t1.project_id
	) AS '媒体',
	(
		SELECT
			project_name
		FROM
			ctop_project
		WHERE
			id = t1.project_id
	) AS '项目',
	CONCAT('`',t1.account_id,'`' )  AS '账户id',
	(
		SELECT
			realname
		FROM
			sys_user
		WHERE
			id = t1.transferor
	) AS '转户人',
	(
		SELECT
			realname
		FROM
			sys_user
		WHERE
			id = t1.assignee
	) AS '受让人',
	t1.transferor_date AS '转户人绩效统计截止日期',
	t1.assignee_date AS '受让人绩效统计开始日期'
FROM
	ctop_transfer_account t1
WHERE
	t1.transferor_date >= '2022-01-01'
AND t1.transferor_date <= '2022-01-31'
and t1.transferor in(
SELECT user_id  from user_company WHERE company_id = '4b10089775c040119e139087517aed88'
)
ORDER BY
	t1.account_id





	select company_name,
       project_name,
       user.realname,
       leader.realname,
       concat('`',account_id,'`') as account_id,
       account_name,
       charge
from (select company_name, project_name, user_id, leader_id, account_id, account_name, charge
      from application.app_kuaishou_account_report_busi_m
      where stat_mon = 202206
        and company_id = '4b10089775c040119e139087517aed88') a
         left join `jeecg-boot`.sys_user user
                   on a.user_id = user.id
         left join `jeecg-boot`.sys_user leader
                   on a.leader_id = leader.id
