|
@@ -41,6 +41,8 @@
|
|
|
<result column="scenes_id" property="scenesId" jdbcType="INTEGER" />
|
|
|
<result column="device_name" property="deviceName" jdbcType="VARCHAR" />
|
|
|
<result column="scenes_name" property="scenesName" jdbcType="VARCHAR" />
|
|
|
+ <result column="order_status_name" property="orderStatusName" jdbcType="VARCHAR" />
|
|
|
+ <result column="order_count" property="orderCount" jdbcType="VARCHAR" />
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap id="workFlowLogResultMap" type="com.huaxu.order.entity.WorkFlowLog">
|
|
@@ -681,4 +683,50 @@
|
|
|
select count(1) from sc_work_order_manage
|
|
|
where id = #{id,jdbcType=INTEGER} and FIND_IN_SET(#{currentUsers,jdbcType=VARCHAR},current_users)
|
|
|
</select>
|
|
|
+
|
|
|
+ <!--综合展示-查询工单执行情况-->
|
|
|
+ <select id="selectOrderStatus" resultMap="BaseResultMap" >
|
|
|
+ select order_status_name,sum(order_count) order_count
|
|
|
+ from(
|
|
|
+ select order_status,count(1) order_count ,
|
|
|
+ case when order_status=0 then '未派单' when order_status=1 or order_status=4 then '处理中' else '已完结' end order_status_name
|
|
|
+ from sc_work_order_manage t1
|
|
|
+ where t1.date_create>=date_format(curdate(), '%Y-%m' )
|
|
|
+ <if test="tenantId != null and tenantId != ''">
|
|
|
+ and t1.tenant_id=#{tenantId}
|
|
|
+ </if>
|
|
|
+ <if test="companyOrgId != null and companyOrgId !=''">
|
|
|
+ and t1.company_org_id=#{companyOrgId}
|
|
|
+ </if>
|
|
|
+ <if test="userType!=null and userType!=-999 and userType!=-9999 and programItems != null and programItems.size() > 0">
|
|
|
+ <if test="permissonType == 5 or permissonType == 2">
|
|
|
+ and ( t1.department_org_id in
|
|
|
+ <foreach collection="programItems" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.orgId}
|
|
|
+ </foreach>
|
|
|
+ or
|
|
|
+ t1.COMPANY_ORG_ID in
|
|
|
+ <foreach collection="programItems" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.orgId}
|
|
|
+ </foreach>
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="permissonType == 4 or permissonType == 3">
|
|
|
+ and t1.department_org_id in
|
|
|
+ <foreach collection="programItems" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.orgId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="permissonType == 1">
|
|
|
+ and t1.COMPANY_ORG_ID in
|
|
|
+ <foreach collection="programItems" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.orgId}
|
|
|
+ </foreach>
|
|
|
+ and (t1.department_org_id is null or t1.department_org_id =0)
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ group by order_status
|
|
|
+ )tab1
|
|
|
+ group by order_status_name
|
|
|
+ </select>
|
|
|
</mapper>
|