"SELECT t1.openid from qywxDepartmentUserLink as t1 INNER JOIN qywxDepartment as t2 on t1.departmentId = t2.departmentId and t2.name like "+"'%"+param.getDepartmentName()+"%'");
SELECT IFNULL(SUM(t1.playNum),0) as playNumSum,IFNULL(SUM(t1.commendNum),0) as commendNumSum,
IFNULL(SUM(t1.collectionNum),0) as collectionNumSum,IFNULL(SUM(t1.commentNum),0) as commentNumSum,
IFNULL(SUM(t1.reSendNum),0) as reSendNumSum,IFNULL(SUM(t1.recommendNum),0) as recommendNumSum,
IFNULL(SUM(t1.effectResult),0) as effectResultSum,t1.userId,
t2.title as taskTitle,t3.name as userName,t4.name as departmentName,t5.departmentId as dpId,t5.department
from video as t1 INNER JOIN task as t2 on t2.id = t1.taskId
LEFT JOIN user as t3 on t1.userId = t3.id
LEFT JOIN qywxDepartment as t4 on t3.main_department = t4.departmentId
LEFT JOIN (SELECT t.*,d.name as department from qywxDepartmentUserLink t left join qywxDepartment d on t.departmentId = d.departmentId) as t5 on t3.openid = t5.openid