|
@@ -10,7 +10,7 @@
|
|
|
COALESCE(SUM(jqpremium), 0) AS jqPremium,
|
|
COALESCE(SUM(jqpremium), 0) AS jqPremium,
|
|
|
COALESCE(SUM(sypremium), 0) AS syPremium,
|
|
COALESCE(SUM(sypremium), 0) AS syPremium,
|
|
|
COALESCE(SUM(taxamount), 0) AS taxPremium,
|
|
COALESCE(SUM(taxamount), 0) AS taxPremium,
|
|
|
- COALESCE(SUM(jqpremium) + SUM(sypremium), 0) AS sumPremium,
|
|
|
|
|
|
|
+ COALESCE(SUM(jqpremium) + SUM(sypremium) + SUM(jypremium), 0) AS sumPremium,
|
|
|
COALESCE(COUNT(iac.id), 0) as sumOrderNum
|
|
COALESCE(COUNT(iac.id), 0) as sumOrderNum
|
|
|
FROM
|
|
FROM
|
|
|
ptl_agreement pa
|
|
ptl_agreement pa
|
|
@@ -23,6 +23,11 @@
|
|
|
<if test="startDate != null and startDate != ''">
|
|
<if test="startDate != null and startDate != ''">
|
|
|
and iac.createtime BETWEEN #{startDate} and #{endDate}
|
|
and iac.createtime BETWEEN #{startDate} and #{endDate}
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="signStartDate != null and signStartDate != '' and signEndDate !=null and signEndDate !=''">
|
|
|
|
|
+ and iac.signing_time BETWEEN #{signStartDate} and #{signEndDate}
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
GROUP BY
|
|
GROUP BY
|
|
|
pa.insurance_company_id, pa.insurance_company
|
|
pa.insurance_company_id, pa.insurance_company
|
|
|
order by
|
|
order by
|
|
@@ -44,7 +49,7 @@
|
|
|
COALESCE(SUM(jqpremium), 0) AS jqPremium,
|
|
COALESCE(SUM(jqpremium), 0) AS jqPremium,
|
|
|
COALESCE(SUM(sypremium), 0) AS syPremium,
|
|
COALESCE(SUM(sypremium), 0) AS syPremium,
|
|
|
COALESCE(SUM(taxamount), 0) AS taxPremium,
|
|
COALESCE(SUM(taxamount), 0) AS taxPremium,
|
|
|
- COALESCE(SUM(jqpremium) + SUM(sypremium), 0) AS sumPremium,
|
|
|
|
|
|
|
+ COALESCE(SUM(jqpremium) + SUM(sypremium) + SUM(jypremium), 0) AS sumPremium,
|
|
|
COALESCE(COUNT(iac.id), 0) as sumOrderNum
|
|
COALESCE(COUNT(iac.id), 0) as sumOrderNum
|
|
|
FROM
|
|
FROM
|
|
|
ins_area_company iac
|
|
ins_area_company iac
|
|
@@ -56,6 +61,11 @@
|
|
|
<if test="startDate != null and startDate != ''">
|
|
<if test="startDate != null and startDate != ''">
|
|
|
and iac.createtime BETWEEN #{startDate} and #{endDate}
|
|
and iac.createtime BETWEEN #{startDate} and #{endDate}
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="signStartDate != null and signStartDate != '' and signEndDate !=null and signEndDate !=''">
|
|
|
|
|
+ and iac.signing_time BETWEEN #{signStartDate} and #{signEndDate}
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
<if test="companyId != null and companyId != ''">
|
|
<if test="companyId != null and companyId != ''">
|
|
|
and iac.company_id = #{companyId}
|
|
and iac.company_id = #{companyId}
|
|
|
</if>
|
|
</if>
|
|
@@ -87,6 +97,10 @@
|
|
|
<if test="startDate != null and startDate != ''">
|
|
<if test="startDate != null and startDate != ''">
|
|
|
and iac.createtime BETWEEN #{startDate} and #{endDate}
|
|
and iac.createtime BETWEEN #{startDate} and #{endDate}
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="signStartDate != null and signStartDate != '' and signEndDate !=null and signEndDate !=''">
|
|
|
|
|
+ and iac.signing_time BETWEEN #{signStartDate} and #{signEndDate}
|
|
|
|
|
+ </if>
|
|
|
AND
|
|
AND
|
|
|
sd.id != 9991401
|
|
sd.id != 9991401
|
|
|
group by
|
|
group by
|
|
@@ -99,13 +113,18 @@
|
|
|
<select id="getOrderNumber" parameterType="com.ydtech.modules.largescreen.model.query.DataQuery"
|
|
<select id="getOrderNumber" parameterType="com.ydtech.modules.largescreen.model.query.DataQuery"
|
|
|
resultType="Integer">
|
|
resultType="Integer">
|
|
|
SELECT
|
|
SELECT
|
|
|
- count( orderno )
|
|
|
|
|
|
|
+ count( io.orderno )
|
|
|
FROM
|
|
FROM
|
|
|
- ins_orders
|
|
|
|
|
|
|
+ ins_orders io
|
|
|
|
|
+ left join ins_area_company iac on iac.orderno =io.orderno
|
|
|
WHERE
|
|
WHERE
|
|
|
1=1
|
|
1=1
|
|
|
<if test="startDate != null and startDate != ''">
|
|
<if test="startDate != null and startDate != ''">
|
|
|
- and createtime BETWEEN #{startDate} and #{endDate}
|
|
|
|
|
|
|
+ and io.createtime BETWEEN #{startDate} and #{endDate}
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="signStartDate != null and signStartDate != '' and signEndDate !=null and signEndDate !=''">
|
|
|
|
|
+ and iac.signing_time BETWEEN #{signStartDate} and #{signEndDate}
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|