2019-07-29.sql 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. -- Add/modify columns
  2. alter table PL_MAJOR_OLD_NEW add old_major_status number(2);
  3. -- Add comments to the columns
  4. comment on column PL_MAJOR_OLD_NEW.old_major_status
  5. is '旧专业的状态:转专业、并专业、停考专业';
  6. insert into frame_dict (DICT_NAME, DICT_VALUE, DICT_TEXT, DICT_ORDER)
  7. values ('old_major_status', '0', '转专业', '0');
  8. insert into frame_dict (DICT_NAME, DICT_VALUE, DICT_TEXT, DICT_ORDER)
  9. values ('old_major_status', '1', '并专业', '1');
  10. insert into frame_dict (DICT_NAME, DICT_VALUE, DICT_TEXT, DICT_ORDER)
  11. values ('old_major_status', '2', '停考专业', '2');
  12. create sequence SEQ_BY_APPLY_AUDIT;
  13. create sequence SEQ_BY_DIAPLMA;
  14. -- Add/modify columns
  15. alter table BY_APPLY modify by_photo VARCHAR2(150);
  16. -- Add/modify columns
  17. alter table KJ_UNIFIED_SCORE_DETAIL modify cert_no VARCHAR2(50);
  18. alter table kj_college_score_detail add major_code varchar2(10);
  19. create or replace view unified_layout_view as
  20. select c.id course_id,
  21. c.course_code,
  22. c.course_name,
  23. c.special_flag,
  24. reg.cert_no,
  25. reg.id reg_id,
  26. reg.std_name,
  27. 1 num,
  28. t.exam_first_day,
  29. t.exam_second_day,
  30. t.exam_third_day,
  31. enrol.enrol_agent_id exam_area_id,
  32. org3.org_name exam_area_name,
  33. kwgx.exam_point_id,
  34. reg.school_id,
  35. org1.org_code school_code,
  36. org1.org_name school_name,
  37. reg.assist_id,
  38. org2.org_code help_code,
  39. org2.org_name help_name,
  40. enrol.exam_time_id,
  41. enrol.exam_batch,
  42. enrol.id enrol_id,
  43. enrol.ticket_no,
  44. enrol.status
  45. from std_enrol enrol
  46. inner join (
  47. select r.exam_area_id,r.exam_time_id,r.exam_point_id from kw_exam_relation r,kw_exam_point p
  48. where r.exam_point_id=p.id and r.exam_time_id=p.exam_time_id
  49. ) kwgx on kwgx.exam_time_id=enrol.exam_time_id and kwgx.exam_area_id=enrol.enrol_agent_id
  50. left join pl_course c on enrol.course_id = c.id
  51. left join std_reg_info reg on reg.id = enrol.std_reg_id
  52. left join pl_exam_time t on enrol.exam_time_id = t.id
  53. left join cf_organization org1 on org1.id = reg.school_id
  54. left join cf_organization org2 on org2.id = reg.assist_id
  55. left join cf_organization org3 on org3.id = enrol.enrol_agent_id
  56. where enrol.exam_time_id = (select exam_time_id from cf_operate_time where oper_type = 16
  57. and start_time<=sysdate and end_time>=sysdate)
  58. and enrol.status >= 1;