Commit b7f01903 authored by maoying's avatar maoying

添加日常管理巡查统计脚本

parent 98a3b00b
...@@ -6152,4 +6152,62 @@ FROM ...@@ -6152,4 +6152,62 @@ FROM
WHERE WHERE
DATEDIFF(begin_time,CURRENT_DATE) <= 0 AND DATEDIFF(end_time,CURRENT_DATE) >= 0 DATEDIFF(begin_time,CURRENT_DATE) <= 0 AND DATEDIFF(end_time,CURRENT_DATE) >= 0
GROUP BY GROUP BY
au.USER_ID; au.USER_ID;
\ No newline at end of file
-- 今日巡查统计日常管理组态屏查询脚本
DROP VIEW IF EXISTS `v_check_point_num`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_check_point_num` AS
SELECT
(
SELECT
ifnull(
sum(`p_plan_task`.`point_num`),
0
)
FROM
`p_plan_task`
WHERE
(
to_days(`p_plan_task`.`begin_time`) - to_days(curdate())
) <= 0
AND (
to_days(`p_plan_task`.`end_time`) - to_days(curdate())
) >= 0
) AS `pointNum`,
(
SELECT
ifnull(
sum(`p_plan_task`.`point_num`),
0
)
FROM
`p_plan_task`
WHERE
`p_plan_task`.`finish_status` = 2
AND (
to_days(`p_plan_task`.`begin_time`) - to_days(curdate())
) <= 0
AND (
to_days(`p_plan_task`.`end_time`) - to_days(curdate())
) >= 0
) AS `finishNum`,
(
SELECT
ifnull(
sum(`p_plan_task`.`point_num`),
0
)
FROM
`p_plan_task`
WHERE
(
`p_plan_task`.`finish_status` = 0
OR `p_plan_task`.`finish_status` = 1
)
AND (
to_days(`p_plan_task`.`begin_time`) - to_days(curdate())
) <= 0
AND (
to_days(`p_plan_task`.`end_time`) - to_days(curdate())
) >= 0
) AS `unFinishNum`;
\ 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