SELECT
s.time AS TIME,
'tts投诉' AS sugesstWall,
r.region_name AS courseName,
c.center_name AS centerName,
cr.class_name AS className,
tscc.course_name AS courseName,
stu.true_name AS studentName,
stu.phone AS studentPhone,
CASE s.flag
WHEN 0 THEN '投诉'
WHEN 1 THEN '建议'
ELSE '表扬'
END AS flag ,
st.type_name AS type_name,
s.obj_name AS obj_name,
dep.dept_name AS deptName,
tel.name AS titleName,
s.content AS content
FROM
suggest s
LEFT JOIN center c ON c.center_id = s.center_id
LEFT JOIN city ON city.city_id=c.city_id
LEFT JOIN region r ON city.region_id=r.region_id
LEFT JOIN suggest_type st ON st.type_id = s.suggest_type
LEFT JOIN student stu ON s.student_id=stu.student_id
LEFT JOIN classroom cr ON stu.class_id=cr.class_id
LEFT JOIN series_class sc ON sc.series_class_id = cr.series_class_id
LEFT JOIN tsc_course tscc ON sc.course_id = tscc.course_id
LEFT JOIN employee e ON e.employee_id=s.obj_id
LEFT JOIN dept dep ON e.dept_id=dep.dept_id
LEFT JOIN title tel ON tel.title_id=e.title_id
WHERE 1=1
AND s.time >= '2016-09-01 00:00:00'
AND s.time < '2016-10-01 00:00:00'
网友评论