报表1:审批表
#DROP VIEW IF EXISTS approve_channel_grp ;
#CREATE VIEW approve_channel_grp as
SELECT
date as '日期',
channel '渠道',
#count(apply_id) '进件量',
#sum(case when approve_status = -6 then 1 else 0 end) '报告没选',
#concat(TRUNCATE(sum(case when approve_status = -6 then 1 else 0 end)/count(apply_id)*100, 2),'%') '报告没选%',
count(apply_id)-sum(case when approve_status = -6 then 1 else 0 end) '审批量',
#sum(case when tab.loan_n = 1 then 1 else 0 end) '续贷审批',
#concat(TRUNCATE(sum(case when tab.loan_n = 1 then 1 else 0 end)/count(apply_id)*100, 2),'%') '续贷%',
#sum(case when approve_status = 1 then 1 else 0 end) '待审核',
sum(case when approve_status = -1 then 1 else 0 end) '规则拒绝',
concat(TRUNCATE(sum(case when approve