目录
一:SQL查询
分析(涉及到的表):
会议信息表:t_oa_meeting_info
会议反馈表:t_oa_meeting_feedback
SELECT * from t_oa_meeting_info where FIND_IN_SET(2,CONCAT(canyuze,',',liexize,',',zhuchiren))
and state=4
SELECT
IFNULL(f.result,-1) result,t1.*
FROM
(SELECT * from t_oa_meeting_info where FIND_IN_SET(2,CONCAT(canyuze,',',liexize,',',zhuchiren)) and state=4) t1
LEFT JOIN t_oa_meeting_feedback f on t1.id=f.meetingId
and f.personId=2
ORDER BY result;
二:是否参会
分析(涉及到的表):
用户表:t_oa_user
会议信息表:t_oa_meeting_info
会议反馈表:t_oa_meeting_feedback
SELECT CONCAT(canyuze,',',liexize,',',zhuchiren) from
t_oa_meeting_info where id=12
1,再拿到相对应的人
SELECT * from t_oa_user
where
FIND_IN_SET(id, (SELECT CONCAT(canyuze,',',liexize,',',zhuchiren)
from
t_oa_meeting_info where id=12))
,2,拿到对应的反馈情况(未读、参加、不参加)
SELECT * from t_oa_user where FIND_IN_SET(id, (SELECT CONCAT(canyuze,',',liexize,',',zhuchiren) from
t_oa_meeting_info where id=12))
3、根据 会议信息反馈情况进行分组
select
t.result,GROUP_CONCAT(t.name) names
from
(select
t1.name,IFNULL(f.result,-1) result
from
(SELECT * from t_oa_user where FIND_IN_SET(id, (SELECT CONCAT(canyuze,',',liexize,',',zhuchiren) from
t_oa_meeti