|
|
@@ -1537,6 +1537,20 @@
|
|
|
1=1
|
|
|
and iac.id = ifa.ins_order_no
|
|
|
AND iac.orderstatus = 3
|
|
|
+
|
|
|
+
|
|
|
+ <if test="taskStatisticsVo.reviewer !=null and taskStatisticsVo.reviewer !=''">
|
|
|
+ and ifa.audituser =#{taskStatisticsVo.reviewer}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="taskStatisticsVo.audittime !=null and taskStatisticsVo.audittime !=''">
|
|
|
+ and ifa.audittime =#{taskStatisticsVo.audittime}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="taskStatisticsVo.companyId !=null and taskStatisticsVo.companyId !=''">
|
|
|
+ and ifa.company_id =#{taskStatisticsVo.companyId}
|
|
|
+ </if>
|
|
|
+
|
|
|
<if test="taskStatisticsVo.createtimeStart !=null and taskStatisticsVo.createtimeStart != '' and taskStatisticsVo.createtimeEnd !=null and taskStatisticsVo.createtimeEnd != ''">
|
|
|
AND DATE_FORMAT( ifa.audittime, '%Y-%m-%d') BETWEEN DATE_FORMAT( #{taskStatisticsVo.createtimeStart}, '%Y-%m-%d') AND DATE_FORMAT( #{taskStatisticsVo.createtimeEnd}, '%Y-%m-%d')
|
|
|
</if>
|
|
|
@@ -2381,15 +2395,12 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="querOrdersDataListExcel" resultType="com.ydtech.modules.admin.model.dto.OrdersDataExcel">
|
|
|
- select a.*,
|
|
|
- IFNULL(b.orderNumber,0)/IFNULL(a.orderNumber ,0)
|
|
|
- from (
|
|
|
SELECT
|
|
|
count( 0 ) AS "orderNumber",
|
|
|
b.licenseno as "licenseno",
|
|
|
+ b.frameno as "frameno",
|
|
|
b.modelCode as "modelCode",
|
|
|
- b.modelcname as "modelcname",
|
|
|
- b.frameno as "frameno"
|
|
|
+ b.modelcname as "modelcname"
|
|
|
FROM
|
|
|
(
|
|
|
SELECT
|
|
|
@@ -2432,6 +2443,19 @@
|
|
|
<if test="vo.year != null and vo.year!='' ">
|
|
|
AND DATE_FORMAT( io.createtime, '%Y') =#{vo.year}
|
|
|
</if>
|
|
|
+ <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
|
|
|
+ AND io.deptid 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="vo.userIds" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
</where>
|
|
|
) b
|
|
|
GROUP BY
|
|
|
@@ -2439,33 +2463,6 @@
|
|
|
b.frameno,
|
|
|
b.modelCode,
|
|
|
b.modelcname
|
|
|
- ) a
|
|
|
- left join (
|
|
|
- select count(0) as "orderNumber",
|
|
|
- GROUP_CONCAT(inscompany ORDER BY inscompany SEPARATOR ',') as "namesimple",
|
|
|
- io.licenseno as "licenseno"
|
|
|
- from ins_area_company iac
|
|
|
- left join ins_orders io on io.orderno = iac.orderno
|
|
|
- <where>
|
|
|
- 1=1
|
|
|
- and iac.orderstatus ='3'
|
|
|
- and io.orderstatus ='3'
|
|
|
- <if test="vo.licenseno !=null and vo.licenseno!=''">
|
|
|
- AND io.licenseno =#{vo.licenseno}
|
|
|
- </if>
|
|
|
- <if test="vo.frameno !=null and vo.frameno!=''">
|
|
|
- AND io.frameno =#{vo.frameno}
|
|
|
- </if>
|
|
|
- <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.year != null and vo.year!='' ">
|
|
|
- AND DATE_FORMAT( io.createtime, '%Y') =#{vo.year}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- group by
|
|
|
- io.licenseno
|
|
|
- ) b on b.licenseno =a.licenseno
|
|
|
</select>
|
|
|
|
|
|
<select id="orderCheckPage" resultType="com.ydtech.modules.order.entity.InsAreaCompany">
|
|
|
@@ -2502,4 +2499,62 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+ <select id="costCenterTotal" resultType="java.util.HashMap">
|
|
|
+ SELECT
|
|
|
+ COUNT( CASE WHEN ifa.auditstatus = 1 THEN 1 END ) AS "allAuditstatusOrders",
|
|
|
+ COUNT( CASE WHEN ifa.auditstatus = 0 THEN 1 END ) AS "allAuditOrder",
|
|
|
+ COUNT( CASE WHEN ifa.auditstatus = 1 and ifa.audituser != '自动审核' THEN 1 END ) AS "allPersionAudit",
|
|
|
+ COUNT( CASE WHEN ifa.audituser = '自动审核' THEN 1 END ) AS "allAutomaticAudit"
|
|
|
+ FROM
|
|
|
+ ins_fee_audit ifa
|
|
|
+ LEFT JOIN ins_orders io ON io.orderno = ifa.orderno
|
|
|
+ LEFT JOIN ins_area_company iac ON iac.orderno = io.orderno
|
|
|
+ AND iac.orderstatus = 3
|
|
|
+ LEFT JOIN ptl_agreement pa ON pa.id = iac.agreement_id
|
|
|
+ LEFT JOIN esm_ins_company eic ON eic.id = pa.partner_companies_id
|
|
|
+ <where>
|
|
|
+ 1=1
|
|
|
+ and iac.id = ifa.ins_order_no
|
|
|
+ AND iac.orderstatus = 3
|
|
|
+ <if test="taskStatisticsVo.reviewer !=null and taskStatisticsVo.reviewer !=''">
|
|
|
+ and ifa.audituser =#{taskStatisticsVo.reviewer}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="taskStatisticsVo.audittime !=null and taskStatisticsVo.audittime !=''">
|
|
|
+ and ifa.audittime =#{taskStatisticsVo.audittime}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="taskStatisticsVo.companyId !=null and taskStatisticsVo.companyId !=''">
|
|
|
+ and ifa.company_id =#{taskStatisticsVo.companyId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="taskStatisticsVo.createtimeStart !=null and taskStatisticsVo.createtimeStart != '' and taskStatisticsVo.createtimeEnd !=null and taskStatisticsVo.createtimeEnd != ''">
|
|
|
+ AND DATE_FORMAT( ifa.audittime, '%Y-%m-%d') BETWEEN DATE_FORMAT( #{taskStatisticsVo.createtimeStart}, '%Y-%m-%d') AND DATE_FORMAT( #{taskStatisticsVo.createtimeEnd}, '%Y-%m-%d')
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="taskStatisticsVo.beginDate !=null and taskStatisticsVo.beginDate != '' and taskStatisticsVo.endDate !=null and taskStatisticsVo.endDate != ''">
|
|
|
+ AND DATE_FORMAT( ifa.audittime, '%Y-%m-%d') BETWEEN DATE_FORMAT( #{taskStatisticsVo.beginDate}, '%Y-%m-%d') AND DATE_FORMAT( #{taskStatisticsVo.endDate}, '%Y-%m-%d')
|
|
|
+ </if>
|
|
|
+ <if test="taskStatisticsVo.deptIds != null and taskStatisticsVo.deptIds != '' and taskStatisticsVo.deptIds.size() > 0">
|
|
|
+ AND io.deptid in
|
|
|
+ <foreach collection="taskStatisticsVo.deptIds" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="taskStatisticsVo.userIds != null and taskStatisticsVo.userIds != '' and taskStatisticsVo.userIds.size() > 0">
|
|
|
+ AND su.id in
|
|
|
+ <foreach collection="taskStatisticsVo.userIds" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <choose>
|
|
|
+ <when test="taskStatisticsVo.riskCode != null and taskStatisticsVo.riskCode != '' and taskStatisticsVo.riskCode != 'all' ">
|
|
|
+ and iac.product = #{taskStatisticsVo.riskCode}
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
</mapper>
|