select
t.ITEMCODE as '指标代码',
t.ITEMCODE_CN as'指标名称',
t.reporttype as '汇报种类' ,
t.yearmonth as '日期',
t.unitcode as '公司代码',
t.CENTERCODE as '地区代码',
t.CURRENTVALUE as '年累计',
t1.CURRENTVALUE as '去年同期累计',
case when t.ITEMCODE_CN like '承保利润%' then '承保利润'
when t.ITEMCODE_CN like '已赚保费%' then '已赚保费'
when t.ITEMCODE_CN like '原保险保费收入%' then '原保险保费收入'
when t.ITEMCODE_CN like '分保费收入%' then '分保费收入'
when t.ITEMCODE_CN like'业务及管理费%'then '业务及管理费'
when t.ITEMCODE_CN like'手续费%'then '手续费'
when t.ITEMCODE_CN like'赔款支出%'then '赔款支出'
when t.ITEMCODE_CN like'赔付支出-分保赔付支出%'then '赔付支出-分保赔付支出'
when t.ITEMCODE_CN like'摊回未决赔款准备金%'then '摊回未决赔款准备金'
when t.ITEMCODE_CN like'摊回赔付支出-赔款支出%'then '摊回赔付支出-赔款支出'
when t.ITEMCODE_CN like'摊回分保费用%'then '摊回分保费用'
when t.ITEMCODE_CN like'营业税金及附加-保险业务%'then '营业税金及附加-保险业务'
when t.ITEMCODE_CN like'提取未到期责任准备金%'then '提取未到期责任准备金'
when t.ITEMCODE_CN like'提取未决赔款准备金%'then '提取未决赔款准备金'
when t.ITEMCODE_CN like'分出保费%'then '分出保费'
when t.ITEMCODE_CN like'分保费用%'then '分保费用'
when t.ITEMCODE_CN like'应收保费%'then '应收保费'
when t.ITEMCODE_CN like'未到期责任准备金%'then '未到期责任准备金'
when t.ITEMCODE_CN like'未决赔款准备金%'then '未决赔款准备金'
when t.ITEMCODE_CN like'签单保费%'then '签单保费'
when t.ITEMCODE_CN like'保险金额%'then'保险金额'
when t.ITEMCODE_CN like'已决赔款%'then '已决赔款'
when t.ITEMCODE_CN like'未决赔款%'then '未决赔款'
when t.ITEMCODE_CN like'签单数量%'then '签单数量'
when t.ITEMCODE_CN like'保单保费%'then '保单保费'
when t.ITEMCODE_CN like'批增保费%'then '批增保费'
when t.ITEMCODE_CN like'批减保费%'then '批减保费'
when t.ITEMCODE_CN like'已决赔付件数%'then '已决赔付件数'
when t.ITEMCODE_CN like'未决赔付件数%'then '未决赔付件数'
end,
case when t.ITEMCODE_CN like '%企业财产保险' then '企业财产保险'
when t.ITEMCODE_CN like '%家庭财产保险' then '家庭财产保险'
when t.ITEMCODE_CN like '%机动车辆保险' then '机动车辆保险'
when t.ITEMCODE_CN like '%工程保险' then '工程保险'
when t.ITEMCODE_CN like '%责任保险' then '责任保险'
when t.ITEMCODE_CN like '%信用保险' then '信用保险'
when t.ITEMCODE_CN like '%保证保险' then '保证保险'
when t.ITEMCODE_CN like '%船舶保险' then '船舶保险'
when t.ITEMCODE_CN like '%货运险' then '货运险'
when t.ITEMCODE_CN like '%特殊风险保险' then'特殊风险保险'
when t.ITEMCODE_CN like '%农业保险'then'农业保险'
when t.ITEMCODE_CN like '%健康险'then'健康险'
when t.ITEMCODE_CN like '%意外伤害险'then'意外伤害险'
end
from mysql.vdatabases2011_n t
left join
mysql.vdatabases2011_n t1
on DATE_SUB(t.yearmonth, INTERVAL 1 YEAR)=t1.yearmonth
and t.ITEMCODE=t1.ITEMCODE
and t.centercode=t1.centercode
and t.unitcode = t1.unitcode
left join
mysql.vdatabases2011_n t2
on DATE_SUB(t.yearmonth, INTERVAL 1 MONTH)=t2.yearmonth
and t.ITEMCODE=t2.ITEMCODE
and t.centercode=t2.centercode
and t.unitcode = t1.unitcode