修改 bug
parent
f001bd2bc5
commit
54ca6c347c
@ -0,0 +1,25 @@
|
|||||||
|
package com.ruoyi.api.controller;
|
||||||
|
|
||||||
|
import com.ruoyi.api.service.impl.BroadApiService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wanghao
|
||||||
|
* @date 2024/3/1 13:29
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api")
|
||||||
|
public class BroadApiController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private BroadApiService service;
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/selectCountNumber")
|
||||||
|
private String selectCountNumber(){
|
||||||
|
return service.selectCountNumber();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.ruoyi.api.mapper;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wanghao
|
||||||
|
* @date 2024/3/1 13:30
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface BroadApiMapper {
|
||||||
|
String selectCountNumber();
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package com.ruoyi.api.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.api.mapper.BroadApiMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wanghao
|
||||||
|
* @date 2024/3/1 13:30
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class BroadApiService {
|
||||||
|
@Autowired
|
||||||
|
private BroadApiMapper mapper;
|
||||||
|
|
||||||
|
public String selectCountNumber() {
|
||||||
|
return mapper.selectCountNumber();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ruoyi.api.mapper.BroadApiMapper">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectCountNumber" resultType="com.ruoyi.manage.domain.ResultBeen">
|
||||||
|
select count(inspection_id) as t, '巡检次数' as name
|
||||||
|
from record_inspection
|
||||||
|
where DATE(inspection_time) = CURDATE()
|
||||||
|
union
|
||||||
|
select count(DISTINCT location_code) as t, '巡检机位' as name
|
||||||
|
from record_inspection_info
|
||||||
|
where DATE(create_time) = CURDATE()
|
||||||
|
union
|
||||||
|
select count(inspection_state) as t, '巡检结果' as name
|
||||||
|
from record_inspection_info
|
||||||
|
where DATE(create_time) = CURDATE() and inspection_state !='正常'
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue