|
|
@ -3,6 +3,14 @@ |
|
|
|
<mapper namespace="com.ccic.safeliab.dao.ServiceStatMapper"> |
|
|
|
<mapper namespace="com.ccic.safeliab.dao.ServiceStatMapper"> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 通用查询映射结果 --> |
|
|
|
<!-- 通用查询映射结果 --> |
|
|
|
|
|
|
|
<resultMap id="customerMap" type="com.ccic.safeliab.entity.Customer"> |
|
|
|
|
|
|
|
<id column="customer_id" property="customerId"/> |
|
|
|
|
|
|
|
<result column="customer_no" property="customerNo"/> |
|
|
|
|
|
|
|
<result column="customer_name" property="customerName"/> |
|
|
|
|
|
|
|
<result column="type_pname" property="typePname"/> |
|
|
|
|
|
|
|
<result column="contacts" property="contacts"/> |
|
|
|
|
|
|
|
<result column="contacts_phone" property="contactsPhone"/> |
|
|
|
|
|
|
|
</resultMap> |
|
|
|
<resultMap id="statResultMap" type="com.ccic.safeliab.vo.ServiceStatVO"> |
|
|
|
<resultMap id="statResultMap" type="com.ccic.safeliab.vo.ServiceStatVO"> |
|
|
|
<id column="policy_id" property="policyId"/> |
|
|
|
<id column="policy_id" property="policyId"/> |
|
|
|
<result column="policy_number" property="policyNumber"/> |
|
|
|
<result column="policy_number" property="policyNumber"/> |
|
|
@ -18,6 +26,10 @@ |
|
|
|
<result column="service_status_name" property="serviceStatusName"/> |
|
|
|
<result column="service_status_name" property="serviceStatusName"/> |
|
|
|
</resultMap> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<resultMap id="PolicyServiceResultMap" type="com.ccic.safeliab.vo.ServiceStatisticsVO"> |
|
|
|
|
|
|
|
<result property="policy_number" column="policyNumber"/> |
|
|
|
|
|
|
|
</resultMap> |
|
|
|
|
|
|
|
|
|
|
|
<sql id="selectPageColumn"> |
|
|
|
<sql id="selectPageColumn"> |
|
|
|
SELECT |
|
|
|
SELECT |
|
|
|
p.policy_id, |
|
|
|
p.policy_id, |
|
|
@ -99,6 +111,33 @@ |
|
|
|
</where> |
|
|
|
</where> |
|
|
|
</sql> |
|
|
|
</sql> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectServiceCustomerPage" resultMap="customerMap"> |
|
|
|
|
|
|
|
SELECT DISTINCT |
|
|
|
|
|
|
|
a.customer_id, |
|
|
|
|
|
|
|
a.customer_no, |
|
|
|
|
|
|
|
a.customer_name, |
|
|
|
|
|
|
|
a.type_pname, |
|
|
|
|
|
|
|
a.contacts, |
|
|
|
|
|
|
|
a.contacts_phone, |
|
|
|
|
|
|
|
a.changed_at |
|
|
|
|
|
|
|
FROM |
|
|
|
|
|
|
|
tbl_customer a |
|
|
|
|
|
|
|
LEFT JOIN tbl_service b ON b.customer_id = a.customer_id |
|
|
|
|
|
|
|
WHERE |
|
|
|
|
|
|
|
1 = 1 |
|
|
|
|
|
|
|
<if test="customer.typePid != null and customer.typePid != ''"> |
|
|
|
|
|
|
|
AND a.type_pid = #{customer.typePid} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="customer.keyword != null and customer.keyword != ''"> |
|
|
|
|
|
|
|
AND (a.customer_name LIKE '%'||#{customer.keyword}||'%' OR a.customer_no LIKE '%'||#{customer.keyword}||'%') |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="customer.insuranceId != null and customer.insuranceId != ''"> |
|
|
|
|
|
|
|
AND b.insurance_id = #{customer.insuranceId} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
AND A.customer_no is not null |
|
|
|
|
|
|
|
order by a.changed_at desc, a.customer_id desc |
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<select id="selectPage" resultMap="statResultMap"> |
|
|
|
<select id="selectPage" resultMap="statResultMap"> |
|
|
|
<include refid="selectPageColumn" /> |
|
|
|
<include refid="selectPageColumn" /> |
|
|
|
<include refid="baseQuery" /> |
|
|
|
<include refid="baseQuery" /> |
|
|
@ -109,4 +148,184 @@ |
|
|
|
<include refid="baseQuery" /> |
|
|
|
<include refid="baseQuery" /> |
|
|
|
</select> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getOrganByParam" resultType="com.ccic.safeliab.entity.Organ"> |
|
|
|
|
|
|
|
select organ_id,organ_name,parent_id,feature,is_sup from tbl_organ |
|
|
|
|
|
|
|
where status=1 and organ_type=3 |
|
|
|
|
|
|
|
<if test="map.organId!=null and map.organId!=''"> |
|
|
|
|
|
|
|
and parent_id = #{map.organId} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.organName!=null and map.organName!=''"> |
|
|
|
|
|
|
|
and organ_name like concat('%',#{map.organName},'%') |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.oneOrganId!=null and map.oneOrganId!=''"> |
|
|
|
|
|
|
|
and organ_id = #{map.oneOrganId} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
order by changed_at desc limit 20 |
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getCustomerStatistics" resultType="com.ccic.safeliab.vo.EnterpriseArchivesVO"> |
|
|
|
|
|
|
|
SELECT |
|
|
|
|
|
|
|
a.customer_no customerNo, |
|
|
|
|
|
|
|
a.type_name typeName, |
|
|
|
|
|
|
|
b.social_credit_code socialCreditCode, |
|
|
|
|
|
|
|
b.legal_person legalPerson, |
|
|
|
|
|
|
|
a.contacts contacts, |
|
|
|
|
|
|
|
a.email, |
|
|
|
|
|
|
|
a.contacts_phone contactsPhone, |
|
|
|
|
|
|
|
a.type_pname typePname, |
|
|
|
|
|
|
|
a.business_scope businessScope, |
|
|
|
|
|
|
|
a.org_registration_address orgRegistrationAddress |
|
|
|
|
|
|
|
FROM |
|
|
|
|
|
|
|
tbl_customer a |
|
|
|
|
|
|
|
LEFT JOIN tbl_customer_addon b on a.customer_id = b.customer_id |
|
|
|
|
|
|
|
where a.customer_id = #{customerId} |
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getPolicyStatistics" resultType="com.ccic.safeliab.vo.PolicyStatisticsVO"> |
|
|
|
|
|
|
|
SELECT |
|
|
|
|
|
|
|
policy_number policyNumber, |
|
|
|
|
|
|
|
insur_customer_name insurCustomerName, |
|
|
|
|
|
|
|
customer_name customerName, |
|
|
|
|
|
|
|
due_premium duePremium, |
|
|
|
|
|
|
|
start_date startDate, |
|
|
|
|
|
|
|
done_date doneDate, |
|
|
|
|
|
|
|
policy_status_name policyStatusName, |
|
|
|
|
|
|
|
premium_rate premiumRate, |
|
|
|
|
|
|
|
sum_insured sumInsured |
|
|
|
|
|
|
|
from tbl_policy |
|
|
|
|
|
|
|
where customer_id = #{customerId} |
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getHivePolicyCoverageStatistics" resultType="com.ccic.safeliab.entity.HivePolicyCoverage"> |
|
|
|
|
|
|
|
SELECT |
|
|
|
|
|
|
|
clausecode, |
|
|
|
|
|
|
|
coverage_type coverageType, |
|
|
|
|
|
|
|
product_element_name productElementName, |
|
|
|
|
|
|
|
sum_insured sumInsured |
|
|
|
|
|
|
|
FROM |
|
|
|
|
|
|
|
hive_policy_coverage |
|
|
|
|
|
|
|
where policy_no = #{policyNumber} |
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getHivePolicyInnerCoInsurerStatistics" resultType="com.ccic.safeliab.entity.HivePolicyInnerCoInsurer"> |
|
|
|
|
|
|
|
SELECT |
|
|
|
|
|
|
|
inner_co_org_code innerCoOrgCode, |
|
|
|
|
|
|
|
share_rate shareRate |
|
|
|
|
|
|
|
FROM |
|
|
|
|
|
|
|
hive_policy_inner_co_insurer |
|
|
|
|
|
|
|
where policy_no = #{policyNumber} |
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getHiveClaimStatistics" resultType="com.ccic.safeliab.vo.HiveClaimStatisticsVO"> |
|
|
|
|
|
|
|
SELECT |
|
|
|
|
|
|
|
PolicyNo policyno, |
|
|
|
|
|
|
|
REPORTTIME reporttime, |
|
|
|
|
|
|
|
CLAIMTIME claimtime, |
|
|
|
|
|
|
|
TASKTYPE tasktype, |
|
|
|
|
|
|
|
CLAIMLOSS claimloss, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sumLossApproval sumlossapproval, |
|
|
|
|
|
|
|
peopleLossApproval peoplelossapproval, |
|
|
|
|
|
|
|
medicSumApprv medicsumapprv, |
|
|
|
|
|
|
|
OSSAPPROVAL ossapproval, |
|
|
|
|
|
|
|
accidentSumAPRV accidentsumaprv, |
|
|
|
|
|
|
|
LOSSAPPROVAL lossapproval, |
|
|
|
|
|
|
|
lawSumApprv lawsumapprv, |
|
|
|
|
|
|
|
accidentRSSumApprv accidentrssumapprv, |
|
|
|
|
|
|
|
otherSumApprv othersumapprv, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TotalAmtCharg totalamtcharg, |
|
|
|
|
|
|
|
bankPayTime bankpaytime, |
|
|
|
|
|
|
|
ENDCASEDATE endcasedate, |
|
|
|
|
|
|
|
peopleMdieSumCharg peoplemdiesumcharg, |
|
|
|
|
|
|
|
medicSumCharg medicsumcharg, |
|
|
|
|
|
|
|
'' lossinjurycharg, |
|
|
|
|
|
|
|
accidentRSSumCharg accidentrssumcharg, |
|
|
|
|
|
|
|
LOSSCharg losscharg, |
|
|
|
|
|
|
|
lawSumCharg lawsumcharg, |
|
|
|
|
|
|
|
hive_claim hiveClaim, |
|
|
|
|
|
|
|
otherSumCharg othersumcharg |
|
|
|
|
|
|
|
FROM |
|
|
|
|
|
|
|
hive_claim |
|
|
|
|
|
|
|
where customer_id = #{customerId} |
|
|
|
|
|
|
|
order by PolicyNo asc |
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectPolicyByService" resultMap="PolicyServiceResultMap"> |
|
|
|
|
|
|
|
SELECT |
|
|
|
|
|
|
|
policy_number |
|
|
|
|
|
|
|
FROM |
|
|
|
|
|
|
|
tbl_service |
|
|
|
|
|
|
|
WHERE |
|
|
|
|
|
|
|
customer_id = #{customerId} |
|
|
|
|
|
|
|
GROUP BY |
|
|
|
|
|
|
|
policy_number |
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getAccidentPreventionStatistics" resultType="com.ccic.safeliab.vo.AccidentPreventionVO"> |
|
|
|
|
|
|
|
SELECT |
|
|
|
|
|
|
|
a.completed_at completedAt, |
|
|
|
|
|
|
|
a.service_name serviceName, |
|
|
|
|
|
|
|
b.service_object_name serviceObjectName, |
|
|
|
|
|
|
|
a.service_range serviceRange, |
|
|
|
|
|
|
|
a.executed_organ_name executedOrganName, |
|
|
|
|
|
|
|
CASE |
|
|
|
|
|
|
|
WHEN a.service_report_url IS NOT NULL THEN '已上传' |
|
|
|
|
|
|
|
ELSE '未上传' |
|
|
|
|
|
|
|
END AS uploadStatus |
|
|
|
|
|
|
|
FROM |
|
|
|
|
|
|
|
tbl_service a |
|
|
|
|
|
|
|
LEFT JOIN tbl_service_relation b on b.service_id = a.service_id |
|
|
|
|
|
|
|
where a.customer_id = #{customerId} |
|
|
|
|
|
|
|
and a.policy_number = #{policyNumber} |
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getRiskStatistics" resultType="com.ccic.safeliab.entity.Risk"> |
|
|
|
|
|
|
|
SELECT |
|
|
|
|
|
|
|
risk_number riskNumber, |
|
|
|
|
|
|
|
risk_name riskName, |
|
|
|
|
|
|
|
risk_content riskontent, |
|
|
|
|
|
|
|
discovered_address discoveredAddress, |
|
|
|
|
|
|
|
risk_grade riskGrade, |
|
|
|
|
|
|
|
status, |
|
|
|
|
|
|
|
discovered_at discoveredAt |
|
|
|
|
|
|
|
FROM |
|
|
|
|
|
|
|
tbl_risk a |
|
|
|
|
|
|
|
where a.service_id in (SELECT service_id |
|
|
|
|
|
|
|
FROM |
|
|
|
|
|
|
|
tbl_service |
|
|
|
|
|
|
|
WHERE |
|
|
|
|
|
|
|
customer_id = #{customerId} and policy_number = #{policyNumber}) |
|
|
|
|
|
|
|
and a.policy_number = #{policyNumber} |
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getHazardInvestigationStatistics" resultType="com.ccic.safeliab.vo.HazardInvestigationVO"> |
|
|
|
|
|
|
|
SELECT |
|
|
|
|
|
|
|
a.hidden_number hiddenNumber, |
|
|
|
|
|
|
|
d.description, |
|
|
|
|
|
|
|
a.classify_name hiddenDangerType, |
|
|
|
|
|
|
|
c.danger_type_name dangerTypeName, |
|
|
|
|
|
|
|
d.risk_grade riskGrade, |
|
|
|
|
|
|
|
a.discovered_at discoveredAt, |
|
|
|
|
|
|
|
CASE |
|
|
|
|
|
|
|
WHEN a.examine_status = 1 THEN '待审核' |
|
|
|
|
|
|
|
WHEN a.examine_status = 2 THEN '审核中(上级审核)' |
|
|
|
|
|
|
|
WHEN a.examine_status = 3 THEN '审核成功' |
|
|
|
|
|
|
|
WHEN a.examine_status = 4 THEN '审核失败' |
|
|
|
|
|
|
|
END AS correctionStatus |
|
|
|
|
|
|
|
FROM |
|
|
|
|
|
|
|
tbl_hidden_danger a |
|
|
|
|
|
|
|
LEFT JOIN tbl_service b on b.service_id = a.service_id |
|
|
|
|
|
|
|
LEFT JOIN tbl_service_item c on c.service_id = a.service_id |
|
|
|
|
|
|
|
LEFT JOIN tbl_danger_check_record d on d.service_item_id = c.service_item_id |
|
|
|
|
|
|
|
WHERE |
|
|
|
|
|
|
|
a.service_id in (SELECT service_id |
|
|
|
|
|
|
|
FROM |
|
|
|
|
|
|
|
tbl_service |
|
|
|
|
|
|
|
WHERE |
|
|
|
|
|
|
|
customer_id = #{customerId} and policy_number = #{policyNumber}) |
|
|
|
|
|
|
|
and a.policy_number = #{policyNumber} |
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
</mapper> |
|
|
|
</mapper> |
|
|
|