|
@@ -964,5 +964,56 @@
|
|
|
order by '日期'
|
|
|
</select>
|
|
|
|
|
|
+ <!--事件数据年统计-->
|
|
|
+ <select id="eventYearStatistics" resultType="map">
|
|
|
+ select '数量','日期' from
|
|
|
+ (
|
|
|
+ select count(1) '数量',date_format(date_create,'%Y-%c') '日期'
|
|
|
+ from sc_work_order_manage t1
|
|
|
+ <where>
|
|
|
+ <if test="order.statsType == 0">
|
|
|
+ and t1.date_create >= date_format(#{order.startDate,jdbcType=VARCHAR},'%Y-%c-%d')
|
|
|
+ and t1.date_create < DATE_ADD(date_format(#{order.startDate,jdbcType=VARCHAR},'%Y-%c-%d'),INTERVAL 1 MONTH)
|
|
|
+ </if>
|
|
|
+ <if test="order.statsType == 1">
|
|
|
+ and t1.date_create >= date_format(#{order.startDate,jdbcType=VARCHAR},'%Y-%c-%d')
|
|
|
+ and t1.date_create < DATE_ADD(date_format(#{order.startDate,jdbcType=VARCHAR},'%Y-%c-%d'),INTERVAL 1 YEAR)
|
|
|
+ </if>
|
|
|
+ <if test="order.tenantId != null and order.tenantId != ''">
|
|
|
+ and t1.tenant_id = #{order.tenantId}
|
|
|
+ </if>
|
|
|
+ <if test="order.userType!=null and order.userType!=-999 and order.userType!=-9999 and order.programItems != null and order.programItems.size() > 0">
|
|
|
+ <if test="order.permissonType == 5 or order.permissonType == 2">
|
|
|
+ and ( t1.department_org_id in
|
|
|
+ <foreach collection="order.programItems" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.orgId}
|
|
|
+ </foreach>
|
|
|
+ or
|
|
|
+ t1.COMPANY_ORG_ID in
|
|
|
+ <foreach collection="order.programItems" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.orgId}
|
|
|
+ </foreach>
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="order.permissonType == 4 or order.permissonType == 3">
|
|
|
+ and t1.department_org_id in
|
|
|
+ <foreach collection="order.programItems" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.orgId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="order.permissonType == 1">
|
|
|
+ and t1.COMPANY_ORG_ID in
|
|
|
+ <foreach collection="order.programItems" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.orgId}
|
|
|
+ </foreach>
|
|
|
+ and (t1.department_org_id is null or t1.department_org_id =0)
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ group by date_format(date_create,'%Y-%c')
|
|
|
+ ) a
|
|
|
+ order by '日期'
|
|
|
+ </select>
|
|
|
+
|
|
|
|
|
|
</mapper>
|