|
@@ -983,7 +983,8 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="queryPageTaskStatistics" resultType="com.ydtech.modules.admin.model.dto.TaskStatisticsDto">
|
|
<select id="queryPageTaskStatistics" resultType="com.ydtech.modules.admin.model.dto.TaskStatisticsDto">
|
|
|
- select a.*,(select name from sys_user where id =a.userId) as "userName"
|
|
|
|
|
|
|
+ select a.*,(select name from sys_user where id =a.userId) as "userName",
|
|
|
|
|
+ su.leader_name as "leaderName"
|
|
|
from (
|
|
from (
|
|
|
SELECT
|
|
SELECT
|
|
|
sd.NAME AS "deptName",
|
|
sd.NAME AS "deptName",
|
|
@@ -1054,6 +1055,7 @@
|
|
|
sd.NAME,
|
|
sd.NAME,
|
|
|
sd.id
|
|
sd.id
|
|
|
) a
|
|
) a
|
|
|
|
|
+ left join sys_user su on su.id =a.userId
|
|
|
</select>
|
|
</select>
|
|
|
<select id="queryPageTaskStatisticsTotal" resultType="java.lang.Long">
|
|
<select id="queryPageTaskStatisticsTotal" resultType="java.lang.Long">
|
|
|
select count(0) from (
|
|
select count(0) from (
|
|
@@ -1138,19 +1140,23 @@
|
|
|
ins_area_company iac
|
|
ins_area_company iac
|
|
|
LEFT JOIN ins_fee_audit ifa ON ifa.ins_order_no = iac.id
|
|
LEFT JOIN ins_fee_audit ifa ON ifa.ins_order_no = iac.id
|
|
|
LEFT JOIN ptl_agreement pa ON pa.id = iac.agreement_id
|
|
LEFT JOIN ptl_agreement pa ON pa.id = iac.agreement_id
|
|
|
|
|
+ LEFT JOIN ins_orders io ON io.orderno = iac.orderno
|
|
|
<where>
|
|
<where>
|
|
|
pa.insurance_company_id IS NOT NULL
|
|
pa.insurance_company_id IS NOT NULL
|
|
|
<if test="taskStatisticsVo.provinceId != null and taskStatisticsVo.provinceId != ''">
|
|
<if test="taskStatisticsVo.provinceId != null and taskStatisticsVo.provinceId != ''">
|
|
|
- and io.deptid like "${taskStatisticsVo.provinceId}%"
|
|
|
|
|
|
|
+ and io.deptid like concat('%', #{taskStatisticsVo.provinceId}, '%')
|
|
|
|
|
+
|
|
|
</if>
|
|
</if>
|
|
|
<if test="taskStatisticsVo.cityId != null and taskStatisticsVo.cityId != ''">
|
|
<if test="taskStatisticsVo.cityId != null and taskStatisticsVo.cityId != ''">
|
|
|
- and io.deptid like "${taskStatisticsVo.cityId}%"
|
|
|
|
|
|
|
+ and io.deptid like concat('%', #{taskStatisticsVo.cityId}, '%')
|
|
|
|
|
+
|
|
|
</if>
|
|
</if>
|
|
|
<if test="taskStatisticsVo.countyId != null and taskStatisticsVo.countyId != ''">
|
|
<if test="taskStatisticsVo.countyId != null and taskStatisticsVo.countyId != ''">
|
|
|
- and io.deptid like "${taskStatisticsVo.countyId}%"
|
|
|
|
|
|
|
+ and io.deptid like concat('%', #{taskStatisticsVo.countyId}, '%')
|
|
|
|
|
+
|
|
|
</if>
|
|
</if>
|
|
|
<if test="taskStatisticsVo.houseId != null and taskStatisticsVo.houseId != ''">
|
|
<if test="taskStatisticsVo.houseId != null and taskStatisticsVo.houseId != ''">
|
|
|
- and io.deptid like "${taskStatisticsVo.houseId}%"
|
|
|
|
|
|
|
+ and io.deptid like concat('%', #{taskStatisticsVo.houseId}, '%')
|
|
|
</if>
|
|
</if>
|
|
|
<if test="taskStatisticsVo.createtimeStart !=null and taskStatisticsVo.createtimeStart != '' and taskStatisticsVo.createtimeEnd !=null and taskStatisticsVo.createtimeEnd != ''">
|
|
<if test="taskStatisticsVo.createtimeStart !=null and taskStatisticsVo.createtimeStart != '' and taskStatisticsVo.createtimeEnd !=null and taskStatisticsVo.createtimeEnd != ''">
|
|
|
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}
|
|
@@ -1186,19 +1192,23 @@
|
|
|
ins_area_company iac
|
|
ins_area_company iac
|
|
|
LEFT JOIN ins_fee_audit ifa ON ifa.ins_order_no = iac.id
|
|
LEFT JOIN ins_fee_audit ifa ON ifa.ins_order_no = iac.id
|
|
|
LEFT JOIN ptl_agreement pa ON pa.id = iac.agreement_id
|
|
LEFT JOIN ptl_agreement pa ON pa.id = iac.agreement_id
|
|
|
|
|
+ LEFT JOIN ins_orders io ON io.orderno = iac.orderno
|
|
|
<where>
|
|
<where>
|
|
|
pa.insurance_company_id IS NOT NULL
|
|
pa.insurance_company_id IS NOT NULL
|
|
|
<if test="taskStatisticsVo.provinceId != null and taskStatisticsVo.provinceId != ''">
|
|
<if test="taskStatisticsVo.provinceId != null and taskStatisticsVo.provinceId != ''">
|
|
|
- and io.deptid like "${taskStatisticsVo.provinceId}%"
|
|
|
|
|
|
|
+ and io.deptid like concat('%', #{taskStatisticsVo.provinceId}, '%')
|
|
|
|
|
+
|
|
|
</if>
|
|
</if>
|
|
|
<if test="taskStatisticsVo.cityId != null and taskStatisticsVo.cityId != ''">
|
|
<if test="taskStatisticsVo.cityId != null and taskStatisticsVo.cityId != ''">
|
|
|
- and io.deptid like "${taskStatisticsVo.cityId}%"
|
|
|
|
|
|
|
+ and io.deptid like concat('%', #{taskStatisticsVo.cityId}, '%')
|
|
|
|
|
+
|
|
|
</if>
|
|
</if>
|
|
|
<if test="taskStatisticsVo.countyId != null and taskStatisticsVo.countyId != ''">
|
|
<if test="taskStatisticsVo.countyId != null and taskStatisticsVo.countyId != ''">
|
|
|
- and io.deptid like "${taskStatisticsVo.countyId}%"
|
|
|
|
|
|
|
+ and io.deptid like concat('%', #{taskStatisticsVo.countyId}, '%')
|
|
|
|
|
+
|
|
|
</if>
|
|
</if>
|
|
|
<if test="taskStatisticsVo.houseId != null and taskStatisticsVo.houseId != ''">
|
|
<if test="taskStatisticsVo.houseId != null and taskStatisticsVo.houseId != ''">
|
|
|
- and io.deptid like "${taskStatisticsVo.houseId}%"
|
|
|
|
|
|
|
+ and io.deptid like concat('%', #{taskStatisticsVo.houseId}, '%')
|
|
|
</if>
|
|
</if>
|
|
|
<if test="taskStatisticsVo.createtimeStart !=null and taskStatisticsVo.createtimeStart != '' and taskStatisticsVo.createtimeEnd !=null and taskStatisticsVo.createtimeEnd != ''">
|
|
<if test="taskStatisticsVo.createtimeStart !=null and taskStatisticsVo.createtimeStart != '' and taskStatisticsVo.createtimeEnd !=null and taskStatisticsVo.createtimeEnd != ''">
|
|
|
AND io.createtime BETWEEN #{taskStatisticsVo.createtimeStart} AND #{taskStatisticsVo.createtimeEnd}
|
|
AND io.createtime BETWEEN #{taskStatisticsVo.createtimeStart} AND #{taskStatisticsVo.createtimeEnd}
|
|
@@ -1318,6 +1328,10 @@
|
|
|
AND DATE_FORMAT( iac.createtime, '%Y-%m-%d') BETWEEN DATE_FORMAT( #{taskStatisticsVo.beginDate}, '%Y-%m-%d') AND DATE_FORMAT( #{taskStatisticsVo.endDate}, '%Y-%m-%d')
|
|
AND DATE_FORMAT( iac.createtime, '%Y-%m-%d') BETWEEN DATE_FORMAT( #{taskStatisticsVo.beginDate}, '%Y-%m-%d') AND DATE_FORMAT( #{taskStatisticsVo.endDate}, '%Y-%m-%d')
|
|
|
</if>
|
|
</if>
|
|
|
|
|
|
|
|
|
|
+ <if test="taskStatisticsVo.userId !=null and taskStatisticsVo.userId!='' ">
|
|
|
|
|
+ and io.userid =#{taskStatisticsVo.userId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
<if test="taskStatisticsVo.days !=null and taskStatisticsVo.days !='' ">
|
|
<if test="taskStatisticsVo.days !=null and taskStatisticsVo.days !='' ">
|
|
|
and iac.createtime >= DATE_SUB(NOW(), INTERVAL #{taskStatisticsVo.days} DAY)
|
|
and iac.createtime >= DATE_SUB(NOW(), INTERVAL #{taskStatisticsVo.days} DAY)
|
|
|
</if>
|
|
</if>
|
|
@@ -1774,7 +1788,7 @@
|
|
|
</if>
|
|
</if>
|
|
|
|
|
|
|
|
<if test="vo.frameno != null and vo.frameno!='' ">
|
|
<if test="vo.frameno != null and vo.frameno!='' ">
|
|
|
- AND su.frameno =#{vo.frameno}
|
|
|
|
|
|
|
+ AND io.frameno =#{vo.frameno}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="vo.deptId != null and vo.deptId!='' ">
|
|
<if test="vo.deptId != null and vo.deptId!='' ">
|
|
|
and io.deptid like concat('%', #{vo.deptId}, '%')
|
|
and io.deptid like concat('%', #{vo.deptId}, '%')
|
|
@@ -1887,7 +1901,7 @@
|
|
|
</if>
|
|
</if>
|
|
|
|
|
|
|
|
<if test="vo.frameno != null and vo.frameno!='' ">
|
|
<if test="vo.frameno != null and vo.frameno!='' ">
|
|
|
- AND su.frameno =#{vo.frameno}
|
|
|
|
|
|
|
+ AND io.frameno =#{vo.frameno}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="vo.deptId != null and vo.deptId!='' ">
|
|
<if test="vo.deptId != null and vo.deptId!='' ">
|
|
|
and io.deptid like concat('%', #{vo.deptId}, '%')
|
|
and io.deptid like concat('%', #{vo.deptId}, '%')
|