|
@@ -665,25 +665,39 @@
|
|
|
where order_pid = #{orderPid,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
|
|
|
- <!--查询派单时的用户状态-->
|
|
|
+ <!--查询工单派单时的用户状态-->
|
|
|
<select id="selectOrderUserStatus" parameterType="java.lang.String" resultType="map">
|
|
|
- select X, Y, CASE WHEN S IS NULL THEN '空闲' WHEN S='0' THEN '空闲' ELSE '执行中' END S ,
|
|
|
- case when offlinetime is null then '离线' when offlinetime>10 then '离线' when offlinetime <= 10 THEN '在线' END L FROM
|
|
|
- (
|
|
|
- select order_user_id,longtitude X, latitude Y, TIMESTAMPDIFF(second,upload_date, now()) offlinetime from sc_work_order_manage t1 left join sc_gps_data t2
|
|
|
- on t1.order_user_id = t2.user_id
|
|
|
- group by order_user_id,longtitude, latitude,upload_date
|
|
|
- ) a
|
|
|
- left join
|
|
|
- (
|
|
|
- select count(*) S,order_user_id from sc_work_order_manage
|
|
|
- where order_status = 1
|
|
|
- group by order_user_id
|
|
|
- ) b
|
|
|
- on a.order_user_id=b.order_user_id
|
|
|
- where a.order_user_id= #{userId,jdbcType=INTEGER}
|
|
|
+ SELECT X, Y,
|
|
|
+ CASE WHEN S IS NULL THEN '空闲' WHEN S='0' THEN '空闲' ELSE '执行中' END S ,
|
|
|
+ CASE WHEN offlinetime IS NULL THEN '离线' WHEN offlinetime>10 THEN '离线' WHEN offlinetime <= 10 THEN '在线' END L
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ select order_user_id,longtitude X, latitude Y, TIMESTAMPDIFF(second,upload_date, now()) offlinetime from sc_work_order_manage t1 left join sc_gps_data t2
|
|
|
+ on t1.order_user_id = t2.user_id
|
|
|
+ group by order_user_id,longtitude, latitude,upload_date
|
|
|
+ ) a
|
|
|
+ left join
|
|
|
+ (
|
|
|
+ select count(*) S,order_user_id from sc_work_order_manage
|
|
|
+ where order_status = 1
|
|
|
+ group by order_user_id
|
|
|
+ ) b
|
|
|
+ on a.order_user_id=b.order_user_id
|
|
|
+ where a.order_user_id= #{userId,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+ <!--查询任务单派单时的用户状态-->
|
|
|
+ <select id="selectPlanUserStatus" parameterType="java.lang.String" resultType="map">
|
|
|
+ SELECT
|
|
|
+ CASE WHEN S IS NULL THEN '空闲' WHEN S='0' THEN '空闲' ELSE '执行中' END S
|
|
|
+ FROM (
|
|
|
+ select count(*) S,user_id from sc_plan_manage
|
|
|
+ where plan_status = 1
|
|
|
+ group by user_id
|
|
|
+ ) a
|
|
|
+ where a.user_id= #{userId,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
|
|
|
+
|
|
|
<!--查询维修列表的用户状态-->
|
|
|
<select id="selectMaintainUserStatus" parameterType="java.lang.String" resultType="map">
|
|
|
select X, Y,
|
|
@@ -795,5 +809,6 @@
|
|
|
</if>
|
|
|
</if>
|
|
|
</where>
|
|
|
+ order by t1.date_create desc
|
|
|
</select>
|
|
|
</mapper>
|