Commit d99b0c80 authored by 王东's avatar 王东

指标计算承保字段调整

parent 244832a7
This diff is collapsed.
......@@ -7,11 +7,11 @@ SELECT
s1.`applicationname` as `applicationname`
,s1.`agentid` as `agentid`
,s1.`time` as `time`
,SPLIT_INDEX(s1.`quantile`,';',0) as `quantile50`
,SPLIT_INDEX(s1.`quantile`,';',1) as `quantile75`
,SPLIT_INDEX(s1.`quantile`,';',2) as `quantile95`
,SPLIT_INDEX(s1.`quantile`,';',3) as `quantile99`
,s1.`createtime` as `createtime`
,cast(SPLIT_INDEX(s1.`quantile`,';',0) as bigint ) as `quantile50`
,cast(SPLIT_INDEX(s1.`quantile`,';',1) as bigint ) as `quantile75`
,cast(SPLIT_INDEX(s1.`quantile`,';',2) as bigint ) as `quantile95`
,cast(SPLIT_INDEX(s1.`quantile`,';',3) as bigint ) as `quantile99`
,cast(s1.`createtime` as bigint ) as `createtime`
from (
select
d1.`applicationName` as `applicationname`
......@@ -20,11 +20,6 @@ from (
,CastToTagIndexUDF(LISTAGG(d1.`elapsed`,';') ) as `quantile` -- 拼接
,cast(DateTimeToLongUDF(LOCALTIMESTAMP ) as varchar) as `createtime`
from RZ_ODS.RZ_SOURCE_KAFKA_RZ.RZDATA d1
where
UPPER(RIGHT(d1.`rpc`,3)) not in ('.JS')
and UPPER(RIGHT(d1.`rpc`,4)) not in ('.JPG','.ICO','.CSS','.TTF','.PNG','.PNG','.JPG','.TXT','.MP4','.MP3','.PDF','.DWR')
and UPPER(RIGHT(d1.`rpc`,5)) not in ('.JSON','.HTML','.LESS','.JPEG')
and UPPER(RIGHT(d1.`rpc`,6)) not in ('.WOFF2')
group by
d1.`applicationName`
,d1.`agentId`
......@@ -38,11 +33,11 @@ insert into RZ_DM.RZ_DM_KAFKA.QUANTILE_APP
SELECT
s1.`applicationname` as `applicationname`
,s1.`time` as `time`
,SPLIT_INDEX(s1.`quantile`,';',0) as `quantile50`
,SPLIT_INDEX(s1.`quantile`,';',1) as `quantile75`
,SPLIT_INDEX(s1.`quantile`,';',2) as `quantile95`
,SPLIT_INDEX(s1.`quantile`,';',3) as `quantile99`
,s1.`createtime` as `createtime`
,cast(SPLIT_INDEX(s1.`quantile`,';',0) as bigint ) as `quantile50`
,cast(SPLIT_INDEX(s1.`quantile`,';',1) as bigint ) as `quantile75`
,cast(SPLIT_INDEX(s1.`quantile`,';',2) as bigint ) as `quantile95`
,cast(SPLIT_INDEX(s1.`quantile`,';',3) as bigint ) as `quantile99`
,cast(s1.`createtime` as bigint ) as `createtime`
from (
select
d1.`applicationName` as `applicationname`
......@@ -50,11 +45,6 @@ from (
,CastToTagIndexUDF(LISTAGG(d1.`elapsed`,';') ) as `quantile` -- 拼接
,cast(DateTimeToLongUDF(LOCALTIMESTAMP ) as varchar) as `createtime`
from RZ_ODS.RZ_SOURCE_KAFKA_RZ.RZDATA d1
where
UPPER(RIGHT(d1.`rpc`,3)) not in ('.JS')
and UPPER(RIGHT(d1.`rpc`,4)) not in ('.JPG','.ICO','.CSS','.TTF','.PNG','.PNG','.JPG','.TXT','.MP4','.MP3','.PDF','.DWR')
and UPPER(RIGHT(d1.`rpc`,5)) not in ('.JSON','.HTML','.LESS','.JPEG')
and UPPER(RIGHT(d1.`rpc`,6)) not in ('.WOFF2')
group by
d1.`applicationName`
,tumble(d1.row_time, interval '1' minute)
......
......@@ -10,12 +10,12 @@ select
else 1024
end
) as `rpc`
,cast(DateTimeToLongUDF(tumble_end(s1.row_time, interval '1' minute)) as varchar) as `time`
,cast(AVG(cast(s1.elapsed as decimal(18,2)) ) as varchar) as `averageelapsed`
,cast(sum(1) as varchar) as `total`
,cast(sum(if(s1.status = '200',1,0)) as varchar) as `suctotal`
,cast(sum(if(s1.status = '200' is not true,1,0)) as varchar) as `errortotal`
,cast(DateTimeToLongUDF(LOCALTIMESTAMP ) as varchar) as `createtime`
,cast(DateTimeToLongUDF(tumble_end(s1.row_time, interval '1' minute)) as varchar ) as `time`
,cast(AVG(cast(s1.elapsed as decimal(18,2)) ) as bigint) as `averageelapsed`
,cast(sum(1) as bigint) as `total`
,cast(sum(if(s1.status = '200',1,0)) as bigint) as `suctotal`
,cast(sum(if(s1.status = '200' is not true,1,0)) as bigint) as `errortotal`
,cast(DateTimeToLongUDF(LOCALTIMESTAMP ) as bigint) as `createtime`
from RZ_ODS.RZ_SOURCE_KAFKA_RZ.RZDATA s1
where
UPPER(RIGHT(s1.`rpc`,3)) not in ('.JS')
......@@ -36,12 +36,12 @@ insert into RZ_DM.RZ_DM_KAFKA.RUNSTATUS_AGENTID
select
s1.applicationName as `applicationname`
,s1.agentId as `agentid`
,cast(DateTimeToLongUDF(tumble_end(s1.row_time, interval '1' minute)) as varchar) as `time`
,cast(AVG(cast(s1.elapsed as decimal(18,2)) ) as varchar) as `averageelapsed`
,cast(sum(1) as varchar) as `total`
,cast(sum(if(s1.status = '200',1,0)) as varchar) as `suctotal`
,cast(sum(if(s1.status = '200' is not true,1,0)) as varchar) as `errortotal`
,cast(DateTimeToLongUDF(LOCALTIMESTAMP ) as varchar) as `createtime`
,cast(DateTimeToLongUDF(tumble_end(s1.row_time, interval '1' minute)) as varchar ) as `time`
,cast(AVG(cast(s1.elapsed as decimal(18,2)) ) as bigint) as `averageelapsed`
,cast(sum(1) as bigint) as `total`
,cast(sum(if(s1.status = '200',1,0)) as bigint) as `suctotal`
,cast(sum(if(s1.status = '200' is not true,1,0)) as bigint) as `errortotal`
,cast(DateTimeToLongUDF(LOCALTIMESTAMP ) as bigint) as `createtime`
from RZ_ODS.RZ_SOURCE_KAFKA_RZ.RZDATA s1
group by
s1.applicationName
......@@ -54,12 +54,12 @@ group by
insert into RZ_DM.RZ_DM_KAFKA.RUNSTATUS_APP
select
s1.applicationName as `applicationname`
,cast(DateTimeToLongUDF(tumble_end(s1.row_time, interval '1' minute)) as varchar) as `time`
,cast(AVG(cast(s1.elapsed as decimal(18,2)) ) as varchar) as `averageelapsed`
,cast(sum(1) as varchar) as `total`
,cast(sum(if(s1.status = '200',1,0)) as varchar) as `suctotal`
,cast(sum(if(s1.status = '200' is not true,1,0)) as varchar) as `errortotal`
,cast(DateTimeToLongUDF(LOCALTIMESTAMP ) as varchar) as `createtime`
,cast(DateTimeToLongUDF(tumble_end(s1.row_time, interval '1' minute)) as varchar ) as `time`
,cast(AVG(cast(s1.elapsed as decimal(18,2)) ) as bigint) as `averageelapsed`
,cast(sum(1) as bigint) as `total`
,cast(sum(if(s1.status = '200',1,0)) as bigint) as `suctotal`
,cast(sum(if(s1.status = '200' is not true,1,0)) as bigint) as `errortotal`
,cast(DateTimeToLongUDF(LOCALTIMESTAMP ) as bigint) as `createtime`
from RZ_ODS.RZ_SOURCE_KAFKA_RZ.RZDATA s1
group by
s1.applicationName
......
......@@ -13,3 +13,11 @@ create table RUNSTATUS_AGENTID(
)
;
来源:
endtime 3:16:27
推送:
time: 3:17:00 + 1
createtime: 3:20:00
\ No newline at end of file
......@@ -51,92 +51,60 @@
{
"endorseNo": "123" ,
"policyNo": "123123",
"businessNo": "21321",
"policyCreatDate": "1675353600000",
"businessOffice": "123",
"businessOfficeName": "123123",
"productCode": "0521",
"businessNatureCode": "b",
"startTime": "1675353600000",
"endTime": "1675353600000",
"netPremium": "313.32",
"premium": "332.12",
"plcCar05": {
"licensePlateNo": "123123",
"frameNo": "12321",
"vehicleId": "cx",
"newVehicleFlag":"xcbs",
"vehiclecode": "123213",
"carBrandCode": "123213",
"newCarFlag": "0",
"carKindCode": "A0",
"carKindName": "客车",
"carUserNatureCode": "8A",
"carUserNature": "家庭自用",
"actualvalue": "实际价值"
},
"plcApplicant": [{
"customerName": "李志强"
}],
"plcPublicInsurant": [{
"customerName": "李强"
}],
"newPolicyFlag": "0",
"autoTransrenewFlag": "0",
"transferPolicyFlag": "1",
"transrenewFlag": "0",
"plcSolution": [{
"PlcRation": {
"artifSelfPricesRat": "0.8801" ,
"artifReviewPrem": "123"
},
"plcCoins": {
"coinsCalculationPercent": "123"
},
"plcCommissionDetail": [{
"agentFee": "28.2",
"agentNetFee": "28.2"
}]
}],
"saleaman": "87503064-0",
"saleamanName": "123213",
"businessChannelCode": "03",
"businessChannelName": "12321",
"recordClerkCode": "123213",
"recordClerkName": "12332",
"staCurAmount": "1000000",
"staCurTaxFee": "18.8" ,
"policySort":"111",
"businessType": "123123"
"systemName":"流计算平台",
"systemCode":"D030",
"sendTime":"2023-02-16 14:36:53",
"msgCode":"carpolicy",
"msgName":"新核心车险保单信息",
"data":
[{
"frameNo":"LZZABLMF5HC240184" , \\车架号
"agentComCode":"370811197903140038" , \\代理机构代码
"licenseNo":"鲁H53D13" ,\\车牌号
"endDate":"1708066800000" ,\\终保时间
"newPolicyFlag":"0" ,\\新保标识
"policyNo":"6605072023370801003619" ,\\保单号
"policySort":"0" ,\\保单种类
"ownerId":"370811197903140038" ,\\归属业务员代码
"artifSelfPricesRat":"1" ,\\自主定价系数
"ownerName":"张营" ,\\归属业务员名称
"modelCode":"LYGAXD0046" ,\\车型
"comCode":"3708010007" ,\\保单归属机构代码
"insuredName":"山东布鲁沐市政工程有限公司" ,\\被保人名称
"transferPolicyFlag":"1" ,\\转保标识
"riskCode":"0507" ,\\险种代码
"agentNetFee":"82.53" ,\\手续费不含税金额
"agentComName":"张营" ,\\代理机构名称
"businessNature":"v" ,\\业务来源
"useNatureCode":"8B" ,\\车辆使用性质
"appliName":"山东布鲁沐市政工程有限公司" ,\\投保人名称
"newChnlType":"08" ,\\清分后渠道
"carKindCode":"T7" ,\\车辆种类
"sumPremium":"2063.21" ,\\不含税保费
"underWriteEndDate":"1676529412664" ,\\核保通过时间
"hpersonName":"",\\寿险营销员名称
"autoTransreNewFlag":"0" ,\\自动续保标识
"agentRegNo":"",\\寿险营销员代码
"transreNewFlag":"0" ,\\续保标识
"comName":"山东济宁城区支公司货车专营咨询服务一团队" ,\\保单归属机构名称
"startDate":"1676530800000" ,\\起保时间
"newVehicleFlag":"0" ,\\新车标识
"energyCode":"0" ,\\能源种类编码
"fuelType":"燃油" ,\\能源种类名称
"secondHandCarFlag":"1" ,\\是否二手车
"amount":"200000" ,\\保额
"coinsRate":"1.0000" ,\\联保比例
"tonCount":"13.78" ,\\(吨)核定载质量
"seatCount":"2" ,\\核定载客数
"riskScore":"46" ,\\众享分
"underwritingScore":"69" ,\\尊享分
"signDate":"1676529412664" ,\\签单日期
"proposalNo":"6205072023370801005071" ,\\投保单号
"engineNo":"" ,\\发动机号
"purchasePrice":"336000" ,\\新车购置价
"renewalPolicyNo":"" ,\\上年保单号
"claimAdjustValue":"0.9" ,\\NCD系数
"finalRatio":"0.9" ,\\折扣率
"subMarket":"211115" \\细分市场代码
}]
}
\ No newline at end of file
======================================保单SQL=============================================
INSERT INTO TABLE_NAME
SELECT
case when policyNo != '' then policyNo else businessNo end AS policyNo
,businessNo
,policyCreatDate
,businessOffice
,businessOfficeName
,productCode
,businessNatureCode
,startTime
,endTime
,netPremium
,premium
,plcCar05
,plcApplicant
,plcPublicInsurant
,newPolicyFlag
,autoTransrenewFlag
,transferPolicyFlag
,transrenewFlag
,plcSolution
,saleaman
,saleamanName
,businessChannelCode
,policySort
,businessType
FROM TABLE_NAME
;
\ No newline at end of file
......@@ -349,6 +349,7 @@ from (
,d1.`no` as `no`
from ZB_ODS.ZB_ODS_KAFKA.CBDATA d1
where d1.`COMNAME` is not null
and d1.`uwConclueDate` = DATE_FORMAT(LOCALTIMESTAMP,'yyyyMMdd')
and left(d1.risk,2) <>'05'
) s1
......
This source diff could not be displayed because it is too large. You can view the blob instead.
-- ZB_ODS_CBDATA ZB_ODS_指标加工承保业务数据
-- 保费计算
-- 车险非车都可能存在联保,非车也可能即共又联
-- 1、非车险共保我方保费系数 = 承保保费 * plcSolution[1].plcCoins.plcCoinsBasicInformation[1].coinsRate(系数)
-- coinsRate 有值 ,系数 = coinsRate
-- coinsRate 无值 ,系数 = 1
-- 备注:只有在非车险共保我方保费时存在系数得字段
-- 2、汇率换算 = 承保保费 * sigAndStaExchangeRate (汇率)
-- 备注:批单不用计算,sta开头得字段是被转过汇率得
-- 3、条件: 车险 或 (非车险 并且 plcSolution[1].plcCoins.plcCoinsBasicInformation[1].coinsIdentity(共保我方) =1)
insert into ZB_ODS.ZB_ODS_KAFKA.CBDATA
select
......@@ -27,9 +16,9 @@ select
,t1.LEVEL4COMDESC as `LEVEL4COMDESC` --
,t1.LEVEL5COMDESC as `LEVEL5COMDESC` --
,s1.productCode as `risk` -- 险种代码
,t3.RISKNAME as `riskname` --
,t3.CLASSCODE as `classcode` -- 险类代码
,t3.CLASSNAME as `classname` --
,t3.GROUPCODE as `classcode` -- 险类代码
,t3.CATEGORYCODE as `categorycode` -- 大类代码下钻一层
,t3.CLASSCODE as `classcodereal` -- 险类代码(大类代码下钻第二层)
,s1.businessChannelCode as `chnl` -- 业务渠道
,t2.NEWCHNLTYPEDESC as `chnlname` --
,s1.businessNatureCode as `businessNatureCode` -- 业务来源
......@@ -132,11 +121,8 @@ from (
) s1
left join ODS.ODS_MYSQL.CD_COM_ALL for system_time as of s1.proctime as t1 on s1.businessOffice = t1.COMCODE
left join ZB_ODS.ZB_ODS_MYSQL.CD_NEWCHNLTYPE for system_time as of s1.proctime as t2 on s1.businessChannelCode = t2.NEWCHNLTYPE
left join ZB_ODS.ZB_ODS_MYSQL.CD_REALTIME_RISK for system_time as of s1.proctime as t3 on s1.productCode = t3.RISKCODE
--left join ZB_ODS.ZB_ODS_MYSQL.CD_REALTIME_RISK for system_time as of s1.proctime as t3 on s1.productCode = t3.RISKCODE
left join ZB_ODS.ZB_ODS_MYSQL.CD_CLASSRISK for system_time as of s1.proctime as t3 on s1.productCode = t3.RISKCODE
left join ZB_ODS.ZB_ODS_MYSQL.CD_BUSINESSNATURE for system_time as of s1.proctime as t4 on s1.businessNatureCode = t4.CODE
;
\ No newline at end of file
-- RZ_DM_QUANTILE ZB_DM_单位时间内访问时间排序
-- QUANTILE_AGENTID 单位时间内访问时间排序按应用统计
insert into RZ_DM.RZ_DM_KAFKA.QUANTILE_AGENTID
SELECT
s1.`applicationname` as `applicationname`
,s1.`agentid` as `agentid`
,s1.`time` as `time`
,cast(SPLIT_INDEX(s1.`quantile`,';',0) as bigint ) as `quantile50`
,cast(SPLIT_INDEX(s1.`quantile`,';',1) as bigint ) as `quantile75`
,cast(SPLIT_INDEX(s1.`quantile`,';',2) as bigint ) as `quantile95`
,cast(SPLIT_INDEX(s1.`quantile`,';',3) as bigint ) as `quantile99`
,cast(s1.`createtime` as bigint ) as `createtime`
from (
select
d1.`applicationName` as `applicationname`
,d1.`agentId` as `agentid`
,cast(DateTimeToLongUDF(tumble_end(d1.row_time, interval '1' minute)) as varchar) as `time`
,CastToTagIndexUDF(LISTAGG(d1.`elapsed`,';') ) as `quantile` -- 拼接
,cast(DateTimeToLongUDF(LOCALTIMESTAMP ) as varchar) as `createtime`
from RZ_ODS.RZ_SOURCE_KAFKA_RZ.RZDATA d1
group by
d1.`applicationName`
,d1.`agentId`
,tumble(d1.row_time, interval '1' minute)
) s1
;
-- QUANTILE_APP 单位时间内访问时间排序按集群统计
insert into RZ_DM.RZ_DM_KAFKA.QUANTILE_APP
SELECT
s1.`applicationname` as `applicationname`
,s1.`time` as `time`
,cast(SPLIT_INDEX(s1.`quantile`,';',0) as bigint ) as `quantile50`
,cast(SPLIT_INDEX(s1.`quantile`,';',1) as bigint ) as `quantile75`
,cast(SPLIT_INDEX(s1.`quantile`,';',2) as bigint ) as `quantile95`
,cast(SPLIT_INDEX(s1.`quantile`,';',3) as bigint ) as `quantile99`
,cast(s1.`createtime` as bigint ) as `createtime`
from (
select
d1.`applicationName` as `applicationname`
,cast(DateTimeToLongUDF(tumble_end(d1.row_time, interval '1' minute)) as varchar) as `time`
,CastToTagIndexUDF(LISTAGG(d1.`elapsed`,';') ) as `quantile` -- 拼接
,cast(DateTimeToLongUDF(LOCALTIMESTAMP ) as varchar) as `createtime`
from RZ_ODS.RZ_SOURCE_KAFKA_RZ.RZDATA d1
group by
d1.`applicationName`
,tumble(d1.row_time, interval '1' minute)
) s1
;
`actualData` row(
`prplcreplevy` array<row(
`prplreplevyclaim` row(
`prplreplevyobject` array<row( `subjectTypeName` STRING, `subjectTypeCode` STRING )> ) )>, `prplpersondetail` array<row( `verifyLoss` STRING, `prplsdisabilityassess` row( `nonlocalIdentFlag` STRING ), `PrpLHospital` row( `hospitalName` STRING, `treatedType` STRING, `crippleDegreeOneName` STRING, `crippleDegreeOne` STRING ), `prplperson` row( `originPaidRate` STRING ) )>, `prplproplossdetail` array<row( `verifyLoss` STRING, `prplproploss` row( `paidRate` STRING ) )>, `prplflag` row( `subCertiTypeName` STRING, `subCertiType` STRING ), `prplaccident` row( `accidentDealTypeName` STRING, `accidentDealType` STRING, `damageTypeName` STRING, `damageTypeCode` STRING ), `damageCode` STRING, `damageName` STRING, `prplcertify` row( `completeDate` STRING ), `prplcrecase` array<row( `recaseDate` STRING )>, `prplendcase` array<row( `closeCaseDate` STRING )>, `prplccompensate` array<row( `sumDutyPaid` STRING, `sumThisPaid` STRING, `compensateVericDate` STRING )>,
`prplclaim` array<row( `prplclaimloss` row( `claimNo` STRING, `claimInputDate` STRING ), `sumclaim` STRING, `claimDate` STRING )>, `prplccheck` row( `checkDate` STRING ), `prplcdamage` row( `damageCourse` STRING, `damageName` STRING, `prpldamageaddress` row( `latitude` STRING, `longitude` STRING ) ),
`prplcarlossdetail` array<row( `verifyLoss` STRING, `prplcarcertain` row( `injurySiteCode` STRING ), `prplrepairfactory` array<row( `repairFactoryName` STRING )>, `indemnityDutyRate` STRING, `prplcar` row( `carModelCode` STRING, `brandCode` STRING ) )>, `prplpolicy` STRING, `prplcregist` array<row( `thridClaimComName` STRING, `thridClaimComCode` STRING, `prpllinker` row( `linkerPhoneNo` STRING, `linkerName` STRING ), `prplreporter` row( `reporterMobileNo` STRING, `reporterName` STRING ), `deptName` STRING, `deptCode` STRING, `registNo` STRING, `policyNo` STRING )>, `damageAddress` STRING, `reportDate` STRING, `damageStartDate` STRING, `accidentNo` STRING ), `log_time` STRING, `nodeCode` STRING, proctime as PROCTIME()
\ No newline at end of file
{
"BATCHID": "469256318156063900",
"MESSAGE": "数据字典获取成功",
"DICTDATALIST": [
{
"NODECODE": "BOOLEAN",
"NODEDESC": "加密规则"
},
{
"NODECODE": "Date",
"NODEDESC": "日期"
},
{
"NODECODE": "NUMBER",
"NODEDESC": "数字"
},
{
"NODECODE": "STRING",
"NODEDESC": "字符"
}
],
"FLAG": true
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment