You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

109 lines
5.7 KiB

-- ============================================================
-- 查询 efcode_cp_plan (字典值转描述)
-- ============================================================
SELECT
p.id AS ID,
p.plan_date AS ,
CASE p.plan_type
WHEN 1 THEN '日常计划'
WHEN 2 THEN '专项计划'
ELSE CONCAT('未知(', p.plan_type, ')')
END AS ,
CASE p.plan_time
WHEN 1 THEN '上午'
WHEN 2 THEN '下午'
WHEN 3 THEN '其他'
ELSE CONCAT('未知(', p.plan_time, ')')
END AS ,
p.plan_actual_date AS ,
CASE p.plan_actual_time
WHEN 1 THEN '上午'
WHEN 2 THEN '下午'
WHEN 3 THEN '其他'
ELSE CONCAT('未知(', p.plan_actual_time, ')')
END AS ,
p.enforce_content AS ,
p.enterprise_name AS ,
p.enterprise_number AS ,
p.enforce_user_names AS ,
p.bureau_dept_name AS ,
CASE p.is_public
WHEN 1 THEN ''
WHEN 0 THEN ''
ELSE CONCAT('未知(', p.is_public, ')')
END AS ,
CASE p.is_union
WHEN 1 THEN ''
WHEN 0 THEN ''
ELSE CONCAT('未知(', p.is_union, ')')
END AS ,
p.union_bureau_dept_names AS ,
CASE p.reserve_status
WHEN 0 THEN '草稿'
WHEN 1 THEN '待预约(未发起联合)'
WHEN 2 THEN '预约中'
WHEN 3 THEN '预约完成'
WHEN 4 THEN '重新预约中'
WHEN 5 THEN '待预约(还有位置可加入)'
WHEN 6 THEN '待预约(人数已满)'
ELSE CONCAT('未知(', p.reserve_status, ')')
END AS ,
p.task_id AS ID,
CASE p.system_reserved
WHEN 1 THEN ''
WHEN 0 THEN ''
ELSE CONCAT('未知(', p.system_reserved, ')')
END AS ,
CASE p.manual_reserved
WHEN 1 THEN ''
WHEN 0 THEN ''
ELSE CONCAT('未知(', p.manual_reserved, ')')
END AS ,
CASE p.is_delete
WHEN 0 THEN ''
WHEN 1 THEN ''
ELSE CONCAT('未知(', p.is_delete, ')')
END AS ,
p.create_by AS _ID,
p.create_time AS ,
p.update_time AS ,
p.remark AS
FROM efcode_cp_plan p
ORDER BY p.create_time DESC;
-- ============================================================
-- 查询 efcode_cp_reserve (字典值转描述)
-- ============================================================
SELECT
r.id AS ID,
r.plan_id AS ID,
r.plan_group_id AS ID,
r.reserve_time AS ,
CASE r.op_status
WHEN 1 THEN '同意'
WHEN 2 THEN '拒绝'
WHEN 3 THEN '待确认'
WHEN 4 THEN '超期取消'
ELSE CONCAT('未知(', r.op_status, ')')
END AS ,
r.op_order AS ,
r.op_time AS ,
r.op_message AS ,
r.op_set_date AS ,
CASE r.op_set_time
WHEN 1 THEN '上午'
WHEN 2 THEN '下午'
WHEN 3 THEN '其他'
ELSE CONCAT('未知(', r.op_set_time, ')')
END AS ,
CASE r.res_from
WHEN 1 THEN '系统匹配'
WHEN 0 THEN '手动匹配'
ELSE CONCAT('未知(', r.res_from, ')')
END AS ,
r.create_by AS _ID,
r.create_time AS ,
r.update_time AS
FROM efcode_cp_reserve r
ORDER BY r.plan_group_id ASC, r.op_order ASC;