|
@@ -871,7 +871,7 @@
|
|
|
agree.partner_companies_id = #{vo.parterCompanyId}
|
|
agree.partner_companies_id = #{vo.parterCompanyId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="vo.beginDate != null and vo.beginDate!='' and vo.endDate != null and vo.endDate!=''">
|
|
<if test="vo.beginDate != null and vo.beginDate!='' and vo.endDate != null and vo.endDate!=''">
|
|
|
- AND iac.signing_time BETWEEN #{vo.beginDate} AND #{vo.endDate}
|
|
|
|
|
|
|
+ AND iac.createtime BETWEEN #{vo.beginDate} AND #{vo.endDate}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="vo.managementSource != null and vo.managementSource!=''">
|
|
<if test="vo.managementSource != null and vo.managementSource!=''">
|
|
|
AND sd.management_source =#{vo.managementSource}
|
|
AND sd.management_source =#{vo.managementSource}
|
|
@@ -953,10 +953,10 @@
|
|
|
AND DATE_FORMAT( io.createtime, '%Y-%m-%d') BETWEEN #{taskStatisticsVo.createtimeStart} AND #{taskStatisticsVo.createtimeEnd}
|
|
AND DATE_FORMAT( io.createtime, '%Y-%m-%d') BETWEEN #{taskStatisticsVo.createtimeStart} AND #{taskStatisticsVo.createtimeEnd}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="taskStatisticsVo.beginDate !=null and taskStatisticsVo.beginDate != '' and taskStatisticsVo.endDate !=null and taskStatisticsVo.endDate != ''">
|
|
<if test="taskStatisticsVo.beginDate !=null and taskStatisticsVo.beginDate != '' and taskStatisticsVo.endDate !=null and taskStatisticsVo.endDate != ''">
|
|
|
- AND DATE_FORMAT( iac.signing_time, '%Y-%m-%d') BETWEEN #{taskStatisticsVo.beginDate} AND #{taskStatisticsVo.endDate}
|
|
|
|
|
|
|
+ AND DATE_FORMAT( iac.createtime, '%Y-%m-%d') BETWEEN #{taskStatisticsVo.beginDate} AND #{taskStatisticsVo.endDate}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="taskStatisticsVo.days !=null and taskStatisticsVo.days !='' ">
|
|
<if test="taskStatisticsVo.days !=null and taskStatisticsVo.days !='' ">
|
|
|
- and iac.signing_time >= DATE_SUB(NOW(), INTERVAL #{taskStatisticsVo.days} DAY)
|
|
|
|
|
|
|
+ and iac.createtime >= DATE_SUB(NOW(), INTERVAL #{taskStatisticsVo.days} DAY)
|
|
|
</if>
|
|
</if>
|
|
|
|
|
|
|
|
<if test="taskStatisticsVo.days !=null and taskStatisticsVo.days !='' ">
|
|
<if test="taskStatisticsVo.days !=null and taskStatisticsVo.days !='' ">
|
|
@@ -1072,11 +1072,11 @@
|
|
|
AND DATE_FORMAT( io.createtime, '%Y-%m-%d') BETWEEN #{taskStatisticsVo.createtimeStart} AND #{taskStatisticsVo.createtimeEnd}
|
|
AND DATE_FORMAT( io.createtime, '%Y-%m-%d') BETWEEN #{taskStatisticsVo.createtimeStart} AND #{taskStatisticsVo.createtimeEnd}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="taskStatisticsVo.beginDate !=null and taskStatisticsVo.beginDate != '' and taskStatisticsVo.endDate !=null and taskStatisticsVo.endDate != ''">
|
|
<if test="taskStatisticsVo.beginDate !=null and taskStatisticsVo.beginDate != '' and taskStatisticsVo.endDate !=null and taskStatisticsVo.endDate != ''">
|
|
|
- AND DATE_FORMAT( iac.signing_time, '%Y-%m-%d') BETWEEN #{taskStatisticsVo.beginDate} AND #{taskStatisticsVo.endDate}
|
|
|
|
|
|
|
+ AND DATE_FORMAT( iac.createtime, '%Y-%m-%d') BETWEEN #{taskStatisticsVo.beginDate} AND #{taskStatisticsVo.endDate}
|
|
|
</if>
|
|
</if>
|
|
|
|
|
|
|
|
<if test="taskStatisticsVo.days !=null and taskStatisticsVo.days !='' ">
|
|
<if test="taskStatisticsVo.days !=null and taskStatisticsVo.days !='' ">
|
|
|
- and iac.signing_time >= DATE_SUB(NOW(), INTERVAL #{taskStatisticsVo.days} DAY)
|
|
|
|
|
|
|
+ and iac.createtime >= DATE_SUB(NOW(), INTERVAL #{taskStatisticsVo.days} DAY)
|
|
|
</if>
|
|
</if>
|
|
|
</where>
|
|
</where>
|
|
|
GROUP BY
|
|
GROUP BY
|
|
@@ -1116,11 +1116,11 @@
|
|
|
AND DATE_FORMAT( io.createtime, '%Y-%m-%d') BETWEEN #{taskStatisticsVo.createtimeStart} AND #{taskStatisticsVo.createtimeEnd}
|
|
AND DATE_FORMAT( io.createtime, '%Y-%m-%d') BETWEEN #{taskStatisticsVo.createtimeStart} AND #{taskStatisticsVo.createtimeEnd}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="taskStatisticsVo.beginDate !=null and taskStatisticsVo.beginDate != '' and taskStatisticsVo.endDate !=null and taskStatisticsVo.endDate != ''">
|
|
<if test="taskStatisticsVo.beginDate !=null and taskStatisticsVo.beginDate != '' and taskStatisticsVo.endDate !=null and taskStatisticsVo.endDate != ''">
|
|
|
- AND DATE_FORMAT( iac.signing_time, '%Y-%m-%d') BETWEEN #{taskStatisticsVo.beginDate} AND #{taskStatisticsVo.endDate}
|
|
|
|
|
|
|
+ AND DATE_FORMAT( iac.createtime, '%Y-%m-%d') BETWEEN #{taskStatisticsVo.beginDate} AND #{taskStatisticsVo.endDate}
|
|
|
</if>
|
|
</if>
|
|
|
|
|
|
|
|
<if test="taskStatisticsVo.days !=null and taskStatisticsVo.days !='' ">
|
|
<if test="taskStatisticsVo.days !=null and taskStatisticsVo.days !='' ">
|
|
|
- and iac.signing_time >= DATE_SUB(NOW(), INTERVAL #{taskStatisticsVo.days} DAY)
|
|
|
|
|
|
|
+ and iac.createtime >= DATE_SUB(NOW(), INTERVAL #{taskStatisticsVo.days} DAY)
|
|
|
</if>
|
|
</if>
|
|
|
</where>
|
|
</where>
|
|
|
GROUP BY
|
|
GROUP BY
|
|
@@ -1169,11 +1169,11 @@
|
|
|
</if>
|
|
</if>
|
|
|
|
|
|
|
|
<if test="taskStatisticsVo.beginDate !=null and taskStatisticsVo.beginDate != '' and taskStatisticsVo.endDate !=null and taskStatisticsVo.endDate != ''">
|
|
<if test="taskStatisticsVo.beginDate !=null and taskStatisticsVo.beginDate != '' and taskStatisticsVo.endDate !=null and taskStatisticsVo.endDate != ''">
|
|
|
- AND DATE_FORMAT( iac.signing_time, '%Y-%m-%d') BETWEEN #{taskStatisticsVo.beginDate} AND #{taskStatisticsVo.endDate}
|
|
|
|
|
|
|
+ AND DATE_FORMAT( iac.createtime, '%Y-%m-%d') BETWEEN #{taskStatisticsVo.beginDate} AND #{taskStatisticsVo.endDate}
|
|
|
</if>
|
|
</if>
|
|
|
|
|
|
|
|
<if test="taskStatisticsVo.days !=null and taskStatisticsVo.days !='' ">
|
|
<if test="taskStatisticsVo.days !=null and taskStatisticsVo.days !='' ">
|
|
|
- and iac.signing_time >= DATE_SUB(NOW(), INTERVAL #{taskStatisticsVo.days} DAY)
|
|
|
|
|
|
|
+ and iac.createtime >= DATE_SUB(NOW(), INTERVAL #{taskStatisticsVo.days} DAY)
|
|
|
</if>
|
|
</if>
|
|
|
|
|
|
|
|
<if test="taskStatisticsVo.days !=null and taskStatisticsVo.days !='' ">
|
|
<if test="taskStatisticsVo.days !=null and taskStatisticsVo.days !='' ">
|
|
@@ -1215,11 +1215,11 @@
|
|
|
</if>
|
|
</if>
|
|
|
|
|
|
|
|
<if test="taskStatisticsVo.beginDate !=null and taskStatisticsVo.beginDate != '' and taskStatisticsVo.endDate !=null and taskStatisticsVo.endDate != ''">
|
|
<if test="taskStatisticsVo.beginDate !=null and taskStatisticsVo.beginDate != '' and taskStatisticsVo.endDate !=null and taskStatisticsVo.endDate != ''">
|
|
|
- AND DATE_FORMAT( iac.signing_time, '%Y-%m-%d') BETWEEN #{taskStatisticsVo.beginDate} AND #{taskStatisticsVo.endDate}
|
|
|
|
|
|
|
+ AND DATE_FORMAT( iac.createtime, '%Y-%m-%d') BETWEEN #{taskStatisticsVo.beginDate} AND #{taskStatisticsVo.endDate}
|
|
|
</if>
|
|
</if>
|
|
|
|
|
|
|
|
<if test="taskStatisticsVo.days !=null and taskStatisticsVo.days !='' ">
|
|
<if test="taskStatisticsVo.days !=null and taskStatisticsVo.days !='' ">
|
|
|
- and iac.signing_time >= DATE_SUB(NOW(), INTERVAL #{taskStatisticsVo.days} DAY)
|
|
|
|
|
|
|
+ and iac.createtime >= DATE_SUB(NOW(), INTERVAL #{taskStatisticsVo.days} DAY)
|
|
|
</if>
|
|
</if>
|
|
|
|
|
|
|
|
<choose>
|
|
<choose>
|
|
@@ -1299,12 +1299,58 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ <select id="getChannelOrderManpowerNew" resultType="com.ydtech.modules.admin.model.dto.QxFrontlineAgentDto">
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ a.userId as "userId",
|
|
|
|
|
+ a.orderNumber as "orderNumber",
|
|
|
|
|
+ a.underwritingCount as "underwritingCount",
|
|
|
|
|
+ a.qutationInsureCount as "qutationInsureCount",
|
|
|
|
|
+ IFNULL(a.jqpremium,0) + IFNULL(a.sypremium,0) + IFNULL(a.jypremium,0) as "totalPremium",
|
|
|
|
|
+ a.isFactorVerify as "isFactorVerify",
|
|
|
|
|
+ a.isNotFactorVerify as "isNotFactorVerify"
|
|
|
|
|
+ FROM
|
|
|
|
|
+ (
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ io.userid as "userId",
|
|
|
|
|
+ count( iac.orderno ) AS "orderNumber",
|
|
|
|
|
+ sum(CASE WHEN iac.orderstatus = 3 THEN iac.jqpremium END ) AS jqpremium,
|
|
|
|
|
+ sum(CASE WHEN iac.orderstatus = 3 THEN iac.sypremium END ) AS sypremium,
|
|
|
|
|
+ sum(CASE WHEN iac.orderstatus = 3 THEN iac.jypremium END ) AS jypremium,
|
|
|
|
|
+ COUNT( CASE WHEN iac.orderstatus = 2 THEN 1 END ) AS underwritingCount,
|
|
|
|
|
+ COUNT( CASE WHEN iac.orderstatus = 3 THEN 1 END ) AS qutationInsureCount,
|
|
|
|
|
+ COUNT( CASE WHEN su.factor_verify = 1 THEN 1 END ) AS isFactorVerify,
|
|
|
|
|
+ COUNT( CASE WHEN su.factor_verify = 0 THEN 1 END ) AS isNotFactorVerify
|
|
|
|
|
+ FROM
|
|
|
|
|
+ `ins_area_company` iac
|
|
|
|
|
+ LEFT JOIN ins_orders io ON io.orderno = iac.orderno
|
|
|
|
|
+ left join sys_user su on su.id=io.userid
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="vo.ids != null and vo.ids.size()>0 ">
|
|
|
|
|
+ AND io.userid IN
|
|
|
|
|
+ <foreach item="item" collection="vo.ids" open="(" separator="," close=")">
|
|
|
|
|
+ #{item}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="vo.createtimeStart != null and vo.createtimeStart!='' and vo.createtimeEnd != null and vo.createtimeEnd!=''">
|
|
|
|
|
+ AND iac.signing_time BETWEEN #{vo.createtimeStart} AND #{vo.createtimeEnd}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="vo.beginDate != null and vo.beginDate!='' and vo.endDate != null and vo.endDate!=''">
|
|
|
|
|
+ AND iac.signing_time BETWEEN #{vo.beginDate} AND #{vo.endDate}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ GROUP BY
|
|
|
|
|
+ io.userid
|
|
|
|
|
+ ) a
|
|
|
|
|
+ left join sys_user su on su.id=a.userId
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
<select id="NumberQuotations" resultType="com.ydtech.modules.admin.model.dto.TaskStatisticsDto">
|
|
<select id="NumberQuotations" resultType="com.ydtech.modules.admin.model.dto.TaskStatisticsDto">
|
|
|
SELECT
|
|
SELECT
|
|
|
count(iac.id) as "orderNumber",
|
|
count(iac.id) as "orderNumber",
|
|
|
COUNT( CASE WHEN iac.orderstatus = 2 THEN 1 END ) AS underwritingCount,
|
|
COUNT( CASE WHEN iac.orderstatus = 2 THEN 1 END ) AS underwritingCount,
|
|
|
COUNT( CASE WHEN iac.orderstatus = 3 THEN 1 END ) AS qutationInsureCount,
|
|
COUNT( CASE WHEN iac.orderstatus = 3 THEN 1 END ) AS qutationInsureCount,
|
|
|
- sum( CASE WHEN iac.orderstatus = 3 THEN iac.sumpremium END ) AS totalPremium
|
|
|
|
|
|
|
+ sum( CASE WHEN iac.orderstatus = 3 THEN IFNULL(iac.jqpremium, 0) + IFNULL(iac.sypremium, 0) + IFNULL(iac.jypremium, 0) END ) AS totalPremium
|
|
|
FROM
|
|
FROM
|
|
|
ins_area_company iac
|
|
ins_area_company iac
|
|
|
left join ins_orders io on io.orderno = iac.orderno
|
|
left join ins_orders io on io.orderno = iac.orderno
|
|
@@ -1410,10 +1456,10 @@
|
|
|
and agree.partner_companies_id = #{vo.parterCompanyId}
|
|
and agree.partner_companies_id = #{vo.parterCompanyId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="vo.createtimeStart != null and vo.createtimeStart!='' and vo.createtimeEnd != null and vo.createtimeEnd!=''">
|
|
<if test="vo.createtimeStart != null and vo.createtimeStart!='' and vo.createtimeEnd != null and vo.createtimeEnd!=''">
|
|
|
- AND iac.signing_time BETWEEN #{vo.createtimeStart} AND #{vo.createtimeStart}
|
|
|
|
|
|
|
+ AND iac.createtime BETWEEN #{vo.createtimeStart} AND #{vo.createtimeStart}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="vo.days !=null and vo.days !='' ">
|
|
<if test="vo.days !=null and vo.days !='' ">
|
|
|
- and iac.signing_time >= DATE_SUB(NOW(), INTERVAL #{vo.days} DAY)
|
|
|
|
|
|
|
+ and iac.createtime >= DATE_SUB(NOW(), INTERVAL #{vo.days} DAY)
|
|
|
</if>
|
|
</if>
|
|
|
<if test="vo.provinceId != null and vo.provinceId != ''">
|
|
<if test="vo.provinceId != null and vo.provinceId != ''">
|
|
|
and io.deptid like "${vo.provinceId}%"
|
|
and io.deptid like "${vo.provinceId}%"
|