Commit d7b80989 authored by jianqian's avatar jianqian

BASE

parent 193119a5
......@@ -148,4 +148,9 @@ public class TDeviceInfoController extends BaseController
List<Map<Object, Object>> list = tDeviceInfoService.countDeviceByType();
return AjaxResult.success(list);
}
@PutMapping("/devicefeed")
public AjaxResult devicefeed(@RequestBody Map<String, Object> param)
{
return AjaxResult.success(tDeviceInfoService.devicefeed(param));
}
}
......@@ -4,6 +4,8 @@ import java.util.List;
import java.util.Map;
import com.zehong.system.domain.TDeviceInfo;
import org.apache.commons.math3.analysis.function.Add;
import org.apache.ibatis.annotations.Param;
/**
* 设备信息Mapper接口
......@@ -74,4 +76,9 @@ public interface TDeviceInfoMapper
* @return 结果
*/
public int deleteTDeviceInfoByIds(int[] deviceIds);
/**
* 工单设备进程
*/
List<Map<String,Object>> selectdevicefeed(@Param("orderId") String orderId,@Param("ids") List<Integer> ids);
}
......@@ -92,4 +92,10 @@ public interface ITDeviceInfoService
* @return 结果
*/
public int deleteTDeviceInfoById(int deviceId);
/**
*
* @return
*/
public List<Map<String,Object>> devicefeed(Map<String, Object> param);
}
......@@ -100,7 +100,26 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
return pageVo;
}
@Override
public List<Map<String, Object>> devicefeed(Map<String, Object> param)
{
List<Integer> ids = 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");
if(deviceList.size() != 0) {
for (Map<Object, Object> temp : deviceList) {
ids.add((Integer) temp.get("deviceId"));
}
}
if(pipeList.size() != 0){
for(Map<Object, Object> temp : pipeList){
ids.add((Integer) temp.get("pipeId"));
}
}
List<Map<String,Object>> list = tDeviceInfoMapper.selectdevicefeed(orderId,ids);
return list;
}
/**
* 构建前端所需要下拉树结构
*
......
......@@ -141,4 +141,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{deviceId}
</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
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
</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