Commit be3a3961 authored by 纪泽龙's avatar 纪泽龙

更改样式问题

parent e3c36b7b
......@@ -80,5 +80,7 @@ public interface TDeviceInfoMapper
/**
* 工单设备进程
*/
List<Map<String,Object>> selectdevicefeed(@Param("orderId") String orderId,@Param("ids") List<Integer> ids);
List<Map<String,Object>> selectdevicefeed(@Param("orderId") String orderId,
@Param("ids") List<Integer> ids,
@Param("ids2") List<Integer> ids2);
}
package com.zehong.system.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.zehong.common.utils.PageInfoUtil;
import com.zehong.system.domain.TDeviceInfo;
......@@ -104,6 +105,7 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
public List<Map<String, Object>> devicefeed(Map<String, Object> param)
{
List<Integer> ids = new ArrayList<>();
List<Integer> ids2 = new ArrayList<>();
List<Map<Object, Object>> deviceList = (List<Map<Object, Object>>)param.get("key1");
List<Map<Object, Object>> pipeList = (List<Map<Object, Object>>)param.get("key2");
String orderId = (String) param.get("orderId");
......@@ -114,10 +116,21 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
}
if(pipeList.size() != 0){
for(Map<Object, Object> temp : pipeList){
ids.add((Integer) temp.get("pipeId"));
ids2.add((Integer) temp.get("pipeId"));
}
}
List<Map<String,Object>> list = tDeviceInfoMapper.selectdevicefeed(orderId,ids,ids2);
for(Map<String,Object> map:list){
if((long)map.get("type")==1){
//List<String[]> listgps =
String str = (String) map.get("longitude");
String[] strgps = str.split(",");
map.put("longitude",strgps[0].substring(3, strgps[0].length() - 1));
map.put("latitude",strgps[1].substring(1, strgps[1].length() - 2));
System.out.println("============================="+map.get("longitude")+","+map.get("latitude"));
//JSONObject jo = JSONObject.parseObject(str);
}
}
List<Map<String,Object>> list = tDeviceInfoMapper.selectdevicefeed(orderId,ids);
return list;
}
/**
......
......@@ -142,13 +142,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>
<select id="selectdevicefeed" resultType="java.util.HashMap">
SELECT d.device_id AS id,device_name AS label,IF(f.feedback_id IS NULL,"未反馈","已反馈") as feed FROM t_device_info d
<if test="ids.size!=0">
SELECT d.device_id AS id,device_name AS label,IF(f.feedback_id IS NULL,"未反馈","已反馈") as feed,
d.longitude,d.latitude,0 as type
FROM t_device_info d
LEFT JOIN t_order_feedback f ON (d.device_id = f.`device_id` AND f.`order_id`=#{orderId} )
where d.device_id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
group by d.device_id
ORDER BY f.feedback_id DESC
where d.device_id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
group by d.device_id
</if>
<if test="ids2.size!=0 and ids.size!=0">
UNION ALL
</if>
<if test="ids2.size!=0">
SELECT p.pipe_id AS id,p.pipe_name AS label,IF(f.feedback_id IS NULL,"未反馈","已反馈") as feed,
p.coordinates as longitude,'' as latitude,1 as type
FROM t_pipe p
LEFT JOIN t_order_feedback f ON (p.pipe_id = f.`device_id` AND f.`order_id`=#{orderId} )
where p.pipe_id in
<foreach collection="ids2" item="id" open="(" separator="," close=")">
#{id}
</foreach>
group by p.pipe_id
</if>
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment