Commit 417f57fd authored by zhangsen's avatar zhangsen

管控左屏巡检需求

parent 462a6d4e
package com.yeejoin.amos.patrol.business.controller;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.patrol.business.service.intfc.IPlanTaskService;
import com.yeejoin.amos.patrol.business.util.CommonResponse;
import com.yeejoin.amos.patrol.business.util.CommonResponseUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import javax.annotation.Resource;
@RestController
@RequestMapping("/api/controlScreen")
@Api(value = "管控屏API", tags = "管控屏API")
public class ControlScreenController extends AbstractBaseController {
@Resource
private IPlanTaskService iPlanTaskService;
@GetMapping("/firePatrolStatics")
@ApiOperation(value = "消防巡检信息统计")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse firePatrolStatics(@RequestParam(required = false) String bizOrgCode) {
if (StringUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
}
return CommonResponseUtil.success(iPlanTaskService.firePatrolStatics(bizOrgCode));
}
}
......@@ -191,4 +191,11 @@ public interface PlanTaskMapper extends BaseMapper {
List<Plan> getPlanIdsByDate(@Param("date") Date date);
List<PlanTask> getPlanTaskList(@Param("date") Date date);
/**
* 消防巡检信息统计
* @param bizOrgCode 业务公司编码
* @return 消防巡检信息统计
*/
List<Map<String, Object>> firePatrolStatics(@Param("bizOrgCode") String bizOrgCode);
}
......@@ -1811,4 +1811,9 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
return result;
}
@Override
public List<Map<String, Object>> firePatrolStatics(String bizOrgCode) {
return planTaskMapper.firePatrolStatics(bizOrgCode);
}
}
......@@ -178,4 +178,11 @@ public interface IPlanTaskService {
List<Map<String,Object>> queryPlanTaskTimeAxis(Long userId,Integer createDate);
List<Map<String,Object>> queryTimeAxis(Long userId,Integer createDate);
/**
* 消防巡检信息统计
* @param bizOrgCode 业务公司编码
* @return 消防巡检信息统计
*/
List<Map<String,Object>> firePatrolStatics(String bizOrgCode);
}
......@@ -1126,4 +1126,52 @@
and finish_status in (0,1)
and status = 0
</select>
<select id="firePatrolStatics" resultType="java.util.Map">
SELECT
ifnull( sum( `p_plan_task`.`point_num` ), 0 ) AS `value`,
'个' AS unit,
'今日应巡查点' AS `name`,
'currentDayTotal' AS `indexKey`,
'xfxc' AS type,
'1' AS `key`
FROM
`p_plan_task`
WHERE
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
UNION ALL
SELECT
ifnull( sum( `p_plan_task`.`point_num` ), 0 ) AS `value`,
'个' AS unit,
'今日漏查点位' AS `name`,
'currentDayMiss' AS `indexKey`,
'xfxc' AS type,
'2' AS `key`
FROM
`p_plan_task`
WHERE
`finish_status` = 3
AND DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
UNION ALL
SELECT
ifnull( sum( `p_plan_task`.`finish_num` ), 0 ) AS `value`,
'个' AS unit,
'今日已巡查点' AS `name`,
'currentDayPass' AS `indexKey`,
'xfxc' AS type,
'3' AS `key`
FROM
`p_plan_task`
WHERE
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</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