西藏巴青项目

biz_v_appointment_resource.sql 1.0KB

123456789101112131415161718
  1. -- 可预约资源视图(预约服务列表)
  2. -- 依赖:biz_tech_resource.expert_rating(见 biz_tech_resource_alter_expert_rating.sql)
  3. CREATE OR REPLACE VIEW `v_appointment_resource` AS
  4. SELECT id, resource_type, resource_name, photo_file_url, affiliated_unit, contact_phone, introduction,
  5. detail_address, service_start_time, service_end_time, service_area, fee_standard,
  6. service_weekdays, max_daily_appointments, NULL AS expert_rating,
  7. sys_user_id, assigned_login_name, publish_time
  8. FROM biz_medical_resource
  9. WHERE del_flag = '0' AND publish_status = 1 AND resource_type IN ('004001', '004003')
  10. UNION ALL
  11. SELECT id, resource_type, resource_name, photo_file_url, affiliated_unit, contact_phone, introduction,
  12. detail_address, service_start_time, service_end_time, service_area, fee_standard,
  13. service_weekdays, NULL AS max_daily_appointments, expert_rating,
  14. sys_user_id, assigned_login_name, publish_time
  15. FROM biz_tech_resource
  16. WHERE del_flag = '0' AND publish_status = 1 AND resource_type = '004005';