#### 日期:2019-01-18
#### 需求方:佘宇阳
#### 数据输出方式:excel
#### created by:汪国强

SELECT
    t.teacher_no  教师编号,
    (  SELECT  group_concat(  subject_name  )  FROM  SUBJECT  WHERE  subject_id  IN  (  SELECT          subject_id  FROM  teacher_subject_rel  WHERE  teacher_id  =  t.teacher_id  )  )  学科名称,
    (select  group_concat(grade_rank)  from  teacher_grade_rank_rel  where  teacher_id=t.teacher_id)  年级,
    (case  when  (select  count(*)  
                                from  lesson_plan  
                            where  teacher_id  =  t.teacher_id  and  adjust_start_time  >=  '2019-01-    01'  and  adjust_start_time  <  '2019-01-18'
                                          and  lesson_type  =  1  and  status  in  (3,5)  and              solve_status  <>  6)  >  1  
    then  '是'  else  '否'  end)  消课记录
FROM
    view_teacher  t
WHERE
    t.teacher_no  in  ('MA234281','MA636452','MA181474')
文档更新时间: 2019-03-08 11:44   作者:admin