|
@@ -665,36 +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 Z IS NULL THEN '空闲' WHEN Z='0' THEN '空闲' ELSE '执行中' END Z ,
|
|
|
- CASE WHEN S IS NULL AND Z IS NULL THEN '空闲' WHEN S='0' AND Z='0' THEN '空闲' ELSE '执行中' END W ,
|
|
|
- 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
|
|
|
+ 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
|
|
|
- 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
|
|
|
- left join
|
|
|
- (
|
|
|
- select count(*) Z,user_id from sc_plan_manage
|
|
|
- where plan_status = 1
|
|
|
- group by user_id
|
|
|
- ) c
|
|
|
- on c.user_id=a.order_user_id
|
|
|
- where a.order_user_id= #{userId,jdbcType=INTEGER}
|
|
|
+ where a.user_id= #{userId,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
|
|
|
+
|
|
|
<!--查询维修列表的用户状态-->
|
|
|
<select id="selectMaintainUserStatus" parameterType="java.lang.String" resultType="map">
|
|
|
select X, Y,
|