Commit ccf7cb94 authored by zhangjianqian's avatar zhangjianqian

app接口

parent e8f3450b
......@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.time.Year;
import java.util.List;
import java.util.Map;
......@@ -47,6 +48,8 @@ public class StatisticController
private ITWorkOrderService tWorkOrderService;
@Autowired
private ITInspectReportService inspectReportService;
@Autowired
private ITLinePatrolService linePatrolService;
/**
* 燃气事故台账统计
......@@ -121,4 +124,14 @@ public class StatisticController
return AjaxResult.success(list);
}
/**
* 巡检次数统计
* @return
*/
@GetMapping("/xunjianNum")
public AjaxResult xunjianNum() {
List<Map<String,Object>> list = linePatrolService.selectXunjianNum();
return AjaxResult.success(list);
}
}
package com.zehong.system.mapper;
import java.util.List;
import java.util.Map;
import com.zehong.system.domain.TLinePatrol;
/**
......@@ -60,4 +62,10 @@ public interface TLinePatrolMapper
public int deleteTLinePatrolByIds(Long[] ids);
int insertBatch(List<TLinePatrol> tLinePatrol);
/**
* 企业巡检数量
* @return
*/
public List<Map<String,Object>> selectXunjianNum();
}
\ No newline at end of file
package com.zehong.system.service;
import java.util.List;
import java.util.Map;
import com.zehong.system.domain.TLinePatrol;
......@@ -61,4 +62,10 @@ public interface ITLinePatrolService
public int deleteTLinePatrolById(Long id);
int insertBatch(List<TLinePatrol> tLinePatrol);
/**
* 查询巡检数量
* @return
*/
public List<Map<String,Object>> selectXunjianNum();
}
\ No newline at end of file
package com.zehong.system.service.impl;
import java.util.List;
import java.util.Map;
import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -97,4 +99,13 @@ public class TLinePatrolServiceImpl implements ITLinePatrolService
public int insertBatch(List<TLinePatrol> tLinePatrol) {
return tLinePatrolMapper.insertBatch(tLinePatrol);
}
/**
* 企业巡检数量
* @return
*/
@Override
public List<Map<String, Object>> selectXunjianNum() {
return tLinePatrolMapper.selectXunjianNum();
}
}
\ No newline at end of file
......@@ -98,4 +98,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
</foreach>
</insert>
<select id="selectXunjianNum" resultType="hashmap">
SELECT * FROM (SELECT e.enterprise_name AS ename, COUNT(p.id) AS num FROM t_enterprise_info e
LEFT JOIN t_line_patrol p ON p.beyond_enterprise_id = e.enterprise_id
GROUP BY e.enterprise_id) t
ORDER BY t.num DESC limit 10
</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