|
|
@@ -896,6 +896,7 @@
|
|
|
LEFT JOIN ins_fee_audit ifa on ifa.ins_order_no =iac.id
|
|
|
WHERE
|
|
|
agree.id IS NOT NULL
|
|
|
+ and ( io.del_flag is null or io.del_flag ='1')
|
|
|
<if test="vo.companyId != null and vo.companyId!='' ">
|
|
|
AND agree.insurance_company_id = #{vo.companyId}
|
|
|
</if>
|
|
|
@@ -934,6 +935,69 @@
|
|
|
order by a.parterCompanyId
|
|
|
</select>
|
|
|
|
|
|
+
|
|
|
+ <select id="quotationDetailsExcel" resultType="com.ydtech.modules.admin.model.dto.QuotationDetailsExcel">
|
|
|
+ select
|
|
|
+ iac.orderno as "orderno",
|
|
|
+ iac.agreement_id as "agreementId",
|
|
|
+ iac.orderstatus as "orderstatus",
|
|
|
+ iac.company_id as "companyId",
|
|
|
+ agree.partner_companies_id as "partnerCompaniesId",
|
|
|
+ ins.namesimple as "partnerCompaniesName",
|
|
|
+ agree.insurance_company as "inscompany",
|
|
|
+ iac.jqpolicyno as "jqpolicyno",
|
|
|
+ iac.sypolicyno as "sypolicyno",
|
|
|
+ iac.sumpremium as "sumpremium",
|
|
|
+ iac.jqpremium as "jqpremium",
|
|
|
+ iac.sypremium as "sypremium",
|
|
|
+ iac.jypremium as "jypremium",
|
|
|
+ iac.createtime as "createtime",
|
|
|
+ iac.signing_time as "signingTime",
|
|
|
+ sd.management_source as "managementSource",
|
|
|
+ agree.audit_type as "auditType",
|
|
|
+ ifa.auditstatus as "auditstatus"
|
|
|
+ from ins_area_company iac
|
|
|
+ LEFT JOIN ptl_agreement agree ON iac.agreement_id = agree.id
|
|
|
+ LEFT JOIN ins_orders io ON iac.orderno = io.orderno
|
|
|
+ LEFT JOIN sys_dept sd ON sd.id = io.deptid
|
|
|
+ LEFT JOIN ins_fee_audit ifa on ifa.ins_order_no = iac.id
|
|
|
+ LEFT JOIN esm_ins_company ins ON agree.partner_companies_id = ins.id
|
|
|
+ <where>
|
|
|
+ agree.id IS NOT NULL
|
|
|
+ and ( io.del_flag is null or io.del_flag ='1')
|
|
|
+ <if test="vo.companyId != null and vo.companyId!='' ">
|
|
|
+ AND agree.insurance_company_id = #{vo.companyId}
|
|
|
+ </if>
|
|
|
+ <if test="vo.parterCompanyId != null and vo.parterCompanyId!='' ">
|
|
|
+ AND agree.partner_companies_id = #{vo.parterCompanyId}
|
|
|
+ </if>
|
|
|
+ <if test="vo.beginDate != null and vo.beginDate!='' and vo.endDate != null and vo.endDate!=''">
|
|
|
+ AND iac.createtime BETWEEN #{vo.beginDate} AND #{vo.endDate}
|
|
|
+ </if>
|
|
|
+ <if test="vo.managementSource != null and vo.managementSource!=''">
|
|
|
+ AND sd.management_source =#{vo.managementSource}
|
|
|
+ </if>
|
|
|
+ <if test="vo.userId != null and vo.userId !=''">
|
|
|
+ AND io.userid =#{vo.userId}
|
|
|
+ </if>
|
|
|
+ <if test="vo.deptId != null and vo.deptId !=''">
|
|
|
+ AND io.deptId like concat('%',#{vo.deptId},'%')
|
|
|
+ </if>
|
|
|
+ <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
|
|
|
+ AND sd.id in
|
|
|
+ <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="vo.userIds != null and vo.userIds != '' and vo.userIds.size() > 0">
|
|
|
+ AND io.userid in
|
|
|
+ <foreach collection="taskStatisticsVo.userIds" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="getInsAreaCompanyError"
|
|
|
resultType="com.ydtech.modules.admin.model.report.company.CompanyQutationCountDataDto">
|
|
|
SELECT
|
|
|
@@ -1548,8 +1612,7 @@
|
|
|
COUNT( CASE WHEN iot.order_status = '1' THEN 1 END ) as "auditOrder"
|
|
|
FROM
|
|
|
(
|
|
|
- select iot.suborder,iot.order_status from `ins_orders_track` iot
|
|
|
- GROUP BY iot.suborder ,iot.order_status
|
|
|
+ select DISTINCT iot.suborder,iot.order_status from `ins_orders_track` iot
|
|
|
) iot
|
|
|
LEFT JOIN ins_area_company iac ON iac.id = iot.suborder
|
|
|
left join ins_orders io on io.orderno = iac.orderno
|