|
@@ -1569,6 +1569,139 @@
|
|
|
</if>
|
|
</if>
|
|
|
</where>
|
|
</where>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+ <select id="querOrdersDataPage" resultType="com.ydtech.modules.admin.model.report.company.OrdersDataDto">
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ io.licenseno AS "licenseno",
|
|
|
|
|
+ io.frameno AS "frameno",
|
|
|
|
|
+ pa.partner_companies_id as 'partnerCompaniesId',
|
|
|
|
|
+ count(io.orderno) as "orderNumber",
|
|
|
|
|
+ eic.namesimple as "namesimple",
|
|
|
|
|
+ IFNULL(count(CASE WHEN iac.orderstatus = '3' THEN 1 ELSE 0 END),0) / (IFNULL(count(CASE WHEN iac.orderstatus = '2' THEN 1 ELSE 0 END),0) + IFNULL(count(CASE WHEN iac.orderstatus = '3' THEN 1 ELSE 0 END),0)) AS "closeRate"
|
|
|
|
|
+ FROM
|
|
|
|
|
+ ins_area_company iac
|
|
|
|
|
+ LEFT JOIN ins_orders io ON iac.orderno = io.orderno
|
|
|
|
|
+ LEFT JOIN ptl_agreement pa ON pa.id = iac.agreement_id
|
|
|
|
|
+ LEFT JOIN esm_ins_company eic ON eic.id = pa.insurance_company_id
|
|
|
|
|
+ LEFT JOIN sys_user su on io.userid=su.id
|
|
|
|
|
+ <where>
|
|
|
|
|
+ 1=1
|
|
|
|
|
+ <if test="vo.beginDate != null and vo.beginDate!='' and vo.endDate != null and vo.endDate!=''">
|
|
|
|
|
+ AND io.createtime BETWEEN #{vo.beginDate} AND #{vo.endDate}
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="vo.licenseno != null and vo.licenseno!='' ">
|
|
|
|
|
+ AND io.licenseno =#{vo.licenseno}
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="vo.userId != null and vo.userId!='' ">
|
|
|
|
|
+ AND io.userId =#{vo.userId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="vo.userName != null and vo.userName!='' ">
|
|
|
|
|
+ AND su.name =#{vo.userName}
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="vo.mobile != null and vo.mobile!='' ">
|
|
|
|
|
+ AND su.mobile =#{vo.mobile}
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="vo.frameno != null and vo.frameno!='' ">
|
|
|
|
|
+ AND su.frameno =#{vo.frameno}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="vo.deptId != null and vo.deptId!='' ">
|
|
|
|
|
+ and io.deptid like concat('%', #{vo.deptId}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ GROUP BY
|
|
|
|
|
+ io.licenseno,
|
|
|
|
|
+ io.frameno,
|
|
|
|
|
+ pa.partner_companies_id,
|
|
|
|
|
+ eic.namesimple
|
|
|
|
|
+
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select id="querOrdersamountTo" resultType="com.ydtech.modules.admin.model.report.company.OrdersDataDto">
|
|
|
|
|
+ select count(a.frameno) as "frameno" from (
|
|
|
|
|
+
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ io.frameno AS "frameno"
|
|
|
|
|
+ FROM
|
|
|
|
|
+ ins_orders io
|
|
|
|
|
+ LEFT JOIN ins_area_company iac ON iac.orderno = io.orderno
|
|
|
|
|
+ LEFT JOIN sys_user su ON io.userid = su.id
|
|
|
|
|
+ <where>
|
|
|
|
|
+ 1=1
|
|
|
|
|
+ <if test="vo.beginDate != null and vo.beginDate!='' and vo.endDate != null and vo.endDate!=''">
|
|
|
|
|
+ AND io.createtime BETWEEN #{vo.beginDate} AND #{vo.endDate}
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="vo.licenseno != null and vo.licenseno!='' ">
|
|
|
|
|
+ AND io.licenseno =#{vo.licenseno}
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="vo.userId != null and vo.userId!='' ">
|
|
|
|
|
+ AND io.userId =#{vo.userId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="vo.userName != null and vo.userName!='' ">
|
|
|
|
|
+ AND su.name =#{vo.userName}
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="vo.mobile != null and vo.mobile!='' ">
|
|
|
|
|
+ AND su.mobile =#{vo.mobile}
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="vo.frameno != null and vo.frameno!='' ">
|
|
|
|
|
+ AND su.frameno =#{vo.frameno}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="vo.deptId != null and vo.deptId!='' ">
|
|
|
|
|
+ and io.deptid like concat('%', #{vo.deptId}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ </where>
|
|
|
|
|
+ GROUP BY
|
|
|
|
|
+ io.frameno
|
|
|
|
|
+ ) a
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="querResultOrderNumber" resultType="com.ydtech.modules.admin.model.report.company.OrdersDataDto">
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ count( io.orderno ) AS "orderNumber",
|
|
|
|
|
+ IFNULL(count(CASE WHEN io.orderstatus = '3' THEN 1 ELSE 0 END),0) / (IFNULL(count(CASE WHEN io.orderstatus = '2' THEN 1 ELSE 0 END),0) + IFNULL(count(CASE WHEN io.orderstatus = '3' THEN 1 ELSE 0 END),0)) AS "closeRate"
|
|
|
|
|
+ FROM
|
|
|
|
|
+ ins_orders io
|
|
|
|
|
+ LEFT JOIN ins_area_company iac ON iac.orderno = io.orderno
|
|
|
|
|
+ LEFT JOIN sys_user su ON io.userid = su.id
|
|
|
|
|
+ <where>
|
|
|
|
|
+ 1=1
|
|
|
|
|
+ <if test="vo.beginDate != null and vo.beginDate!='' and vo.endDate != null and vo.endDate!=''">
|
|
|
|
|
+ AND io.createtime BETWEEN #{vo.beginDate} AND #{vo.endDate}
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="vo.licenseno != null and vo.licenseno!='' ">
|
|
|
|
|
+ AND io.licenseno =#{vo.licenseno}
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="vo.userId != null and vo.userId!='' ">
|
|
|
|
|
+ AND io.userId =#{vo.userId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="vo.userName != null and vo.userName!='' ">
|
|
|
|
|
+ AND su.name =#{vo.userName}
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="vo.mobile != null and vo.mobile!='' ">
|
|
|
|
|
+ AND su.mobile =#{vo.mobile}
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="vo.frameno != null and vo.frameno!='' ">
|
|
|
|
|
+ AND su.frameno =#{vo.frameno}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="vo.deptId != null and vo.deptId!='' ">
|
|
|
|
|
+ and io.deptid like concat('%', #{vo.deptId}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+
|
|
|
|
|
+ </select>
|
|
|
<select id="numberQuotationsByUserIds" resultType="com.ydtech.modules.admin.model.dto.TaskStatisticsDto">
|
|
<select id="numberQuotationsByUserIds" resultType="com.ydtech.modules.admin.model.dto.TaskStatisticsDto">
|
|
|
SELECT
|
|
SELECT
|
|
|
count(iac.id) as "orderNumber",
|
|
count(iac.id) as "orderNumber",
|