parent
c085069ad4
commit
0533a2873e
|
|
@ -0,0 +1,46 @@
|
|||
package com.securitycontrol.screen.controller;
|
||||
import com.securitycontrol.common.core.web.controller.BaseController;
|
||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||
import com.securitycontrol.screen.domain.SjConstructionProgress;
|
||||
import com.securitycontrol.screen.domain.SjProjectQuality;
|
||||
import com.securitycontrol.screen.service.SjConstructionProgressService;
|
||||
import com.securitycontrol.screen.service.impl.SjConstructionProgressServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 施工进度安全分析控制层
|
||||
*
|
||||
* @author fly
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/proProgress")
|
||||
@Slf4j
|
||||
public class SjConstructionProgressController extends BaseController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Resource
|
||||
private SjConstructionProgressService service;
|
||||
|
||||
/**
|
||||
* 查询工程质量验收项
|
||||
*
|
||||
* @param o 传参
|
||||
* @return 查询工程质量验收项
|
||||
*/
|
||||
@GetMapping("selectProProgress")
|
||||
public AjaxResult selectProProgress(SjConstructionProgress o) {
|
||||
try {
|
||||
return service.selectProProgress(o);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
return error("请求出错了");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.securitycontrol.screen.controller;
|
||||
import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A;
|
||||
import com.securitycontrol.common.core.web.controller.BaseController;
|
||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||
import com.securitycontrol.screen.domain.SjProjectQuality;
|
||||
import com.securitycontrol.screen.service.SjProjectQualityService;
|
||||
import com.securitycontrol.screen.service.impl.SjProjectQualityServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 工程质量数据分析控制层
|
||||
*
|
||||
* @author fly
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/proQuality")
|
||||
@Slf4j
|
||||
public class SjProjectQualityController extends BaseController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Resource
|
||||
private SjProjectQualityService service;
|
||||
|
||||
/**
|
||||
* 查询工程质量验收项
|
||||
*
|
||||
* @param o 传参
|
||||
* @return 查询工程质量验收项
|
||||
*/
|
||||
@GetMapping("selectProQualityData")
|
||||
public AjaxResult selectProQualityData(SjProjectQuality o) {
|
||||
try {
|
||||
return service.selectProQualityData(o);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
return error("请求出错了");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询工程质量验收项-柱状图
|
||||
*
|
||||
* @param o 传参
|
||||
* @return 查询工程质量验收项
|
||||
*/
|
||||
@GetMapping("selectProQualityData")
|
||||
public AjaxResult selectProQualityEcharts(SjProjectQuality o) {
|
||||
try {
|
||||
return service.selectProQualityEcharts(o);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
return error("请求出错了");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
package com.securitycontrol.screen.controller;
|
||||
import com.securitycontrol.common.core.web.controller.BaseController;
|
||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||
import com.securitycontrol.common.core.web.page.TableDataInfo;
|
||||
import com.securitycontrol.entity.screen.vo.PersonnelControlVo;
|
||||
import com.securitycontrol.screen.domain.SjProjectQuality;
|
||||
import com.securitycontrol.screen.domain.SjProjectSafety;
|
||||
import com.securitycontrol.screen.service.SjProjectSafetyService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工程安全分析-控制层
|
||||
*
|
||||
* @author fly
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/proSafety")
|
||||
@Slf4j
|
||||
public class SjProjectSafetyController extends BaseController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Resource
|
||||
private SjProjectSafetyService service;
|
||||
|
||||
/**
|
||||
* 工程安全分析-一本账
|
||||
*
|
||||
* @param o 传参
|
||||
* @return 查询工程质量验收项
|
||||
*/
|
||||
@GetMapping("selectProSafetyLedger")
|
||||
public TableDataInfo selectProSafetyLedger(SjProjectSafety o) {
|
||||
try{
|
||||
startLayPage();
|
||||
List<SjProjectSafety> list = service.selectProSafetyLedger(o);
|
||||
return getDataTableLayui(list);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return getDataTableBadLayui(new ArrayList<>(),"请求出错了");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 工程安全分析-视频图片
|
||||
*
|
||||
* @param o 传参
|
||||
* @return 查询工程质量验收项
|
||||
*/
|
||||
@GetMapping("selectProSafetyVideo")
|
||||
public TableDataInfo selectProSafetyVideo(SjProjectSafety o) {
|
||||
try{
|
||||
startLayPage();
|
||||
List<SjProjectSafety> list = service.selectProSafetyVideo(o);
|
||||
return getDataTableLayui(list);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return getDataTableBadLayui(new ArrayList<>(),"请求出错了");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 工程安全分析-球机列表
|
||||
*
|
||||
* @param o 传参
|
||||
* @return 查询工程质量验收项
|
||||
*/
|
||||
@GetMapping("selectBallSelect")
|
||||
public AjaxResult selectBallSelect(SjProjectSafety o) {
|
||||
try {
|
||||
return service.selectBallSelect(o);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
return error("请求出错了");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package com.securitycontrol.screen.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 施工进度安全分析
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SjConstructionProgress {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 工程类型
|
||||
*/
|
||||
private String proType;
|
||||
|
||||
/**
|
||||
* 工序
|
||||
*/
|
||||
private String proGx;
|
||||
|
||||
/**
|
||||
* 计划开始时间
|
||||
*/
|
||||
private String planStartTime;
|
||||
|
||||
/**
|
||||
* 计划结束时间
|
||||
*/
|
||||
private String planEndTime;
|
||||
|
||||
/**
|
||||
* 实际开始时间
|
||||
*/
|
||||
private String startTime;
|
||||
|
||||
/**
|
||||
* 实际结束时间
|
||||
*/
|
||||
private String endTime;
|
||||
|
||||
private String sql;
|
||||
|
||||
//统计数据
|
||||
private String date;
|
||||
private String plannedCount;
|
||||
private String actualCount;
|
||||
|
||||
|
||||
//进度数据
|
||||
private String actualDays;
|
||||
private String actualPercent;
|
||||
private String planDays;
|
||||
private String planPercent;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
package com.securitycontrol.screen.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 工程质量数据分析
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SjProjectQuality {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 工程类型
|
||||
*/
|
||||
private String proType;
|
||||
|
||||
/**
|
||||
* 工程结构划分
|
||||
*/
|
||||
private String proStructure;
|
||||
|
||||
/**
|
||||
* 总验收项
|
||||
*/
|
||||
private String totalItem;
|
||||
|
||||
/**
|
||||
* 已验收项
|
||||
*/
|
||||
private String acceptItem;
|
||||
|
||||
/**
|
||||
* 已填验收表项
|
||||
*/
|
||||
private String notAcceptItem;
|
||||
/**
|
||||
* 已填验收表数量
|
||||
*/
|
||||
private String acceptTable;
|
||||
|
||||
/**
|
||||
* 已填合格验收表数量
|
||||
*/
|
||||
private String acceptQualifiedTable;
|
||||
|
||||
/**
|
||||
* 验收率
|
||||
*/
|
||||
private String acceptRate;
|
||||
|
||||
/**
|
||||
* 验收填报准确率
|
||||
*/
|
||||
private String acceptTbRate;
|
||||
|
||||
/**
|
||||
* 主设备试验调试通过数量
|
||||
*/
|
||||
private String mainAcceptNum;
|
||||
|
||||
/**
|
||||
* 主设备试验调试一次通过数量
|
||||
*/
|
||||
private String mainOneAcceptNum;
|
||||
|
||||
/**
|
||||
* 主设备试验调试一次通过率
|
||||
*/
|
||||
private String mainAcceptRate;
|
||||
|
||||
/**
|
||||
* 系统投运通过数量
|
||||
*/
|
||||
private String commAccept;
|
||||
|
||||
/**
|
||||
* 系统投运一次通过数量
|
||||
*/
|
||||
private String commOneAccept;
|
||||
|
||||
/**
|
||||
* 系统投运一次通过率
|
||||
*/
|
||||
private String commAcceptRate;
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package com.securitycontrol.screen.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 工程安全分析-一本账
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SjProjectSafety {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 风险编号
|
||||
*/
|
||||
private String riskCode;
|
||||
|
||||
/**
|
||||
* 作业部位
|
||||
*/
|
||||
private String riskSite;
|
||||
|
||||
/**
|
||||
* 风险等级
|
||||
*/
|
||||
private String riskLevel;
|
||||
|
||||
/**
|
||||
* 预控措施
|
||||
*/
|
||||
private String controller;
|
||||
|
||||
/**
|
||||
* 风险控制关键因素
|
||||
*/
|
||||
private String riskController;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private String startTime;
|
||||
|
||||
private String endTime;
|
||||
|
||||
/**
|
||||
* 是否销号 0 否 1是
|
||||
*/
|
||||
private Integer isXh;
|
||||
|
||||
|
||||
|
||||
private String ballName;
|
||||
private String createTime;
|
||||
private String imagePath;
|
||||
private String name;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package com.securitycontrol.screen.service;
|
||||
|
||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||
import com.securitycontrol.screen.domain.SjConstructionProgress;
|
||||
public interface SjConstructionProgressService{
|
||||
|
||||
AjaxResult selectProProgress(SjConstructionProgress o);
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.securitycontrol.screen.service;
|
||||
|
||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||
import com.securitycontrol.screen.domain.SjProjectQuality;
|
||||
public interface SjProjectQualityService{
|
||||
|
||||
/**
|
||||
* 查询工程质量数据
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
AjaxResult selectProQualityData(SjProjectQuality o);
|
||||
|
||||
/**
|
||||
* 获取工程质量数据-柱状图
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
AjaxResult selectProQualityEcharts(SjProjectQuality o);
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.securitycontrol.screen.service;
|
||||
|
||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||
import com.securitycontrol.screen.domain.SjProjectSafety;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SjProjectSafetyService{
|
||||
|
||||
List<SjProjectSafety> selectProSafetyLedger(SjProjectSafety o);
|
||||
|
||||
List<SjProjectSafety> selectProSafetyVideo(SjProjectSafety o);
|
||||
|
||||
AjaxResult selectBallSelect(SjProjectSafety o);
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.securitycontrol.screen.service.impl;
|
||||
|
||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||
import com.securitycontrol.screen.domain.SjProjectQuality;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.securitycontrol.screen.mapper.SjConstructionProgressMapper;
|
||||
import com.securitycontrol.screen.domain.SjConstructionProgress;
|
||||
import com.securitycontrol.screen.service.SjConstructionProgressService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class SjConstructionProgressServiceImpl implements SjConstructionProgressService{
|
||||
|
||||
@Resource
|
||||
private SjConstructionProgressMapper mapper;
|
||||
|
||||
|
||||
@Override
|
||||
public AjaxResult selectProProgress(SjConstructionProgress o) {
|
||||
String sql = "SELECT DATE_ADD("+o.getStartTime()+", INTERVAL (ones.a + tens.a * 10) DAY) AS dt\n" +
|
||||
" FROM\n" +
|
||||
" (SELECT 0 AS a UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3\n" +
|
||||
" UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7\n" +
|
||||
" UNION ALL SELECT 8 UNION ALL SELECT 9) AS ones\n" +
|
||||
" CROSS JOIN\n" +
|
||||
" (SELECT 0 AS a UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3\n" +
|
||||
" UNION ALL SELECT 4 UNION ALL SELECT 5) AS tens\n" +
|
||||
" WHERE DATE_ADD("+o.getStartTime()+", INTERVAL (ones.a + tens.a * 10) DAY) <= "+o.getEndTime();
|
||||
o.setSql(sql);
|
||||
List<SjConstructionProgress> echartsList = mapper.selectProProgress(o);
|
||||
Map<String, List<SjConstructionProgress>> groupedByProTypeEcharts = echartsList.stream()
|
||||
.collect(Collectors.groupingBy(SjConstructionProgress::getProType));
|
||||
List<SjConstructionProgress> percentList = mapper.getProgressWithPercent(o);
|
||||
Map<String, List<SjConstructionProgress>> groupedByProTypePercent = percentList.stream()
|
||||
.collect(Collectors.groupingBy(SjConstructionProgress::getProType));
|
||||
|
||||
//将数据组合一下
|
||||
Map<String, Map<String, List<SjConstructionProgress>>> mergedMap = groupedByProTypeEcharts.entrySet().stream()
|
||||
.collect(Collectors.toMap(
|
||||
Map.Entry::getKey, // 保持相同的 key
|
||||
entry -> {
|
||||
String key = entry.getKey();
|
||||
List<SjConstructionProgress> echartsList2 = entry.getValue();
|
||||
List<SjConstructionProgress> percentList2 = groupedByProTypePercent.getOrDefault(key, Collections.emptyList());
|
||||
// 将两个列表放入一个 Map 中返回
|
||||
Map<String, List<SjConstructionProgress>> combined = new HashMap<>();
|
||||
combined.put("echarts", echartsList2);
|
||||
combined.put("percent", percentList2);
|
||||
return combined;
|
||||
}
|
||||
));
|
||||
return AjaxResult.success("查询成功",mergedMap);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package com.securitycontrol.screen.service.impl;
|
||||
|
||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||
import com.securitycontrol.screen.service.SjProjectQualityService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.securitycontrol.screen.domain.SjProjectQuality;
|
||||
import com.securitycontrol.screen.mapper.SjProjectQualityMapper;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class SjProjectQualityServiceImpl implements SjProjectQualityService {
|
||||
|
||||
@Resource
|
||||
private SjProjectQualityMapper mapper;
|
||||
/**
|
||||
* 查询工程质量验收项
|
||||
*
|
||||
* @param o 传参
|
||||
* @return 查询工程质量验收项
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult selectProQualityData(SjProjectQuality o) {
|
||||
SjProjectQuality bean = mapper.selectProQualityData(o);
|
||||
return AjaxResult.success("查询成功",bean);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询工程质量验收项echarts
|
||||
*
|
||||
* @param o 传参
|
||||
* @return 查询工程质量验收项echarts
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult selectProQualityEcharts(SjProjectQuality o) {
|
||||
List<SjProjectQuality> list = mapper.selectProQualityEcharts(o);
|
||||
//按照pro_type,分割成若干个List
|
||||
Map<String, List<SjProjectQuality>> groupedByProType = list.stream()
|
||||
.collect(Collectors.groupingBy(SjProjectQuality::getProType));
|
||||
return AjaxResult.success("查询成功",groupedByProType);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.securitycontrol.screen.service.impl;
|
||||
|
||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||
import com.securitycontrol.screen.service.SjProjectSafetyService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.securitycontrol.screen.mapper.SjProjectSafetyMapper;
|
||||
import com.securitycontrol.screen.domain.SjProjectSafety;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class SjProjectSafetyServiceImpl implements SjProjectSafetyService {
|
||||
|
||||
@Resource
|
||||
private SjProjectSafetyMapper mapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<SjProjectSafety> selectProSafetyLedger(SjProjectSafety o) {
|
||||
return mapper.selectProSafetyLedger(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SjProjectSafety> selectProSafetyVideo(SjProjectSafety o) {
|
||||
return mapper.selectProSafetyVideo(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult selectBallSelect(SjProjectSafety o) {
|
||||
List<SjProjectSafety> list = mapper.selectBallSelect(o);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,135 @@
|
|||
<?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.securitycontrol.screen.mapper.SjConstructionProgressMapper">
|
||||
<resultMap id="BaseResultMap" type="com.securitycontrol.screen.domain.SjConstructionProgress">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table sj_construction_progress-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="pro_type" jdbcType="VARCHAR" property="proType" />
|
||||
<result column="pro_gx" jdbcType="VARCHAR" property="proGx" />
|
||||
<result column="plan_start_time" jdbcType="DATE" property="planStartTime" />
|
||||
<result column="plan_end_time" jdbcType="DATE" property="planEndTime" />
|
||||
<result column="start_time" jdbcType="DATE" property="startTime" />
|
||||
<result column="end_time" jdbcType="DATE" property="endTime" />
|
||||
<result column="date" property="date"/>
|
||||
<result column="planned_count" property="plannedCount"/>
|
||||
<result column="actual_count" property="actualCount"/>
|
||||
<result column="actualDays" property="actualDays"/>
|
||||
<result column="actualPercent" property="actualPercent"/>
|
||||
<result column="planDays" property="planDays"/>
|
||||
<result column="planPercent" property="planPercent"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, pro_type, pro_gx, plan_start_time, plan_end_time, start_time, end_time
|
||||
</sql>
|
||||
|
||||
|
||||
<!-- 不按pro_type分组
|
||||
|
||||
SELECT
|
||||
date_list.dt AS date,
|
||||
COALESCE(planned_count, 0) AS planned_count,
|
||||
COALESCE(actual_count, 0) AS actual_count
|
||||
FROM (
|
||||
#{sql}
|
||||
) AS date_list
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
dl_inner.dt,
|
||||
COUNT(p.id) AS planned_count
|
||||
FROM (
|
||||
#{sql}
|
||||
) AS dl_inner
|
||||
LEFT JOIN sj_construction_progress p
|
||||
ON dl_inner.dt BETWEEN p.plan_start_time AND p.plan_end_time
|
||||
GROUP BY dl_inner.dt
|
||||
) AS planned ON date_list.dt = planned.dt
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
dl_inner.dt,
|
||||
COUNT(a.id) AS actual_count
|
||||
FROM (
|
||||
#{sql}
|
||||
) AS dl_inner
|
||||
LEFT JOIN sj_construction_progress a
|
||||
ON dl_inner.dt BETWEEN a.start_time AND a.end_time
|
||||
GROUP BY dl_inner.dt
|
||||
) AS actual ON date_list.dt = actual.dt
|
||||
WHERE date_list.dt BETWEEN #{startTime} AND #{endTime}
|
||||
ORDER BY date_list.dt; -->
|
||||
|
||||
<select id="selectProProgress" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
date_list.dt AS date,
|
||||
coalesce(p_summary.pro_type, a_summary.pro_type) AS pro_type,
|
||||
COALESCE(p_summary.planned_count, 0) AS planned_count,
|
||||
COALESCE(a_summary.actual_count, 0) AS actual_count
|
||||
FROM (
|
||||
#{sql}
|
||||
) AS date_list
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
dl_inner.dt,
|
||||
p.pro_type,
|
||||
COUNT(p.id) AS planned_count
|
||||
FROM (
|
||||
#{sql}
|
||||
) AS dl_inner
|
||||
INNER JOIN sj_construction_progress p
|
||||
ON dl_inner.dt BETWEEN p.plan_start_time AND p.plan_end_time
|
||||
GROUP BY dl_inner.dt, p.pro_type
|
||||
) AS p_summary ON date_list.dt = p_summary.dt
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
dl_inner.dt,
|
||||
a.pro_type,
|
||||
COUNT(a.id) AS actual_count
|
||||
FROM (
|
||||
#{sql}
|
||||
) AS dl_inner
|
||||
INNER JOIN sj_construction_progress a
|
||||
ON dl_inner.dt BETWEEN a.start_time AND a.end_time
|
||||
GROUP BY dl_inner.dt, a.pro_type
|
||||
) AS a_summary
|
||||
ON date_list.dt = a_summary.dt
|
||||
AND p_summary.pro_type = a_summary.pro_type
|
||||
WHERE date_list.dt BETWEEN #{startTime} AND #{endTime}
|
||||
ORDER BY date_list.dt, pro_type;
|
||||
</select>
|
||||
|
||||
<select id="getProgressWithPercent" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
id,
|
||||
pro_type,
|
||||
pro_gx,
|
||||
plan_start_time,
|
||||
plan_end_time,
|
||||
DATEDIFF(plan_end_time, plan_start_time) + 1 AS planDays,
|
||||
CASE
|
||||
WHEN CURDATE() >= plan_end_time THEN 100.00
|
||||
WHEN CURDATE() < plan_start_time THEN 0.00
|
||||
ELSE
|
||||
ROUND(
|
||||
(DATEDIFF(CURDATE(), plan_start_time) + 1) * 100.0 /
|
||||
(DATEDIFF(plan_end_time, plan_start_time) + 1),
|
||||
2
|
||||
)
|
||||
END AS planPercent,
|
||||
start_time,
|
||||
end_time,
|
||||
DATEDIFF(end_time, start_time) + 1 AS actualDays,
|
||||
CASE
|
||||
WHEN CURDATE() >= end_time THEN 100.00
|
||||
WHEN CURDATE() < start_time THEN 0.00
|
||||
ELSE
|
||||
ROUND(
|
||||
(DATEDIFF(CURDATE(), start_time) + 1) * 100.0 /
|
||||
(DATEDIFF(end_time, start_time) + 1),
|
||||
2
|
||||
)
|
||||
END AS actualPercent
|
||||
FROM sj_construction_progress
|
||||
ORDER BY id
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
<?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.securitycontrol.screen.mapper.SjProjectQualityMapper">
|
||||
<resultMap id="BaseResultMap" type="com.securitycontrol.screen.domain.SjProjectQuality">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table sj_project_quality-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="pro_type" jdbcType="VARCHAR" property="proType" />
|
||||
<result column="pro_structure" jdbcType="VARCHAR" property="proStructure" />
|
||||
<result column="total_item" jdbcType="VARCHAR" property="totalItem" />
|
||||
<result column="accept_item" jdbcType="VARCHAR" property="acceptItem" />
|
||||
<result column="accept_table" jdbcType="VARCHAR" property="acceptTable" />
|
||||
<result column="accept_qualified_table" jdbcType="VARCHAR" property="acceptQualifiedTable" />
|
||||
<result column="accept_rate" jdbcType="VARCHAR" property="acceptRate" />
|
||||
<result column="accept_tb_rate" jdbcType="VARCHAR" property="acceptTbRate" />
|
||||
<result column="main_accept_num" jdbcType="VARCHAR" property="mainAcceptNum" />
|
||||
<result column="main_one_accept_num" jdbcType="VARCHAR" property="mainOneAcceptNum" />
|
||||
<result column="main_accept_rate" jdbcType="VARCHAR" property="mainAcceptRate" />
|
||||
<result column="comm_accept" jdbcType="VARCHAR" property="commAccept" />
|
||||
<result column="comm_one_accept" jdbcType="VARCHAR" property="commOneAccept" />
|
||||
<result column="comm_accept_rate" jdbcType="VARCHAR" property="commAcceptRate" />
|
||||
<result column="not_accept_item" property="notAcceptItem"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, pro_type, pro_structure, total_item, accept_item, accept_table, accept_qualified_table,
|
||||
accept_rate, accept_tb_rate, main_accept_num, main_one_accept_num, main_accept_rate,
|
||||
comm_accept, comm_one_accept, comm_accept_rate
|
||||
</sql>
|
||||
|
||||
<select id="selectProQualityData" resultMap="BaseResultMap">
|
||||
select
|
||||
sum(total_item) as total_item,
|
||||
sum(accept_item) as accept_item,
|
||||
sum(accept_table) as accept_table,
|
||||
sum(accept_qualified_table) as accept_qualified_table,
|
||||
sum(accept_item)/sum(total_item) as accept_rate,
|
||||
sum(accept_qualified_table)/sum(accept_table) as accept_tb_rate,
|
||||
sum( main_one_accept_num)/sum(main_accept_num) as main_accept_rate,
|
||||
sum(comm_one_accept)/sum(comm_accept) as comm_accept_rate
|
||||
from sj_project_quality
|
||||
</select>
|
||||
|
||||
<select id="selectProQualityEcharts" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
pro_type,
|
||||
pro_structure,
|
||||
SUM(CAST(total_item AS SIGNED)) AS total_item,
|
||||
SUM(CAST(accept_item AS SIGNED)) AS accept_item,
|
||||
SUM(CAST(total_item AS SIGNED)) - SUM(CAST(accept_item AS SIGNED)) AS not_accept_item
|
||||
FROM
|
||||
sj_project_quality
|
||||
GROUP BY
|
||||
pro_type,
|
||||
pro_structure
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
<?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.securitycontrol.screen.mapper.SjProjectSafetyMapper">
|
||||
<resultMap id="BaseResultMap" type="com.securitycontrol.screen.domain.SjProjectSafety">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table sj_project_safety-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="risk_code" jdbcType="VARCHAR" property="riskCode" />
|
||||
<result column="risk_site" jdbcType="VARCHAR" property="riskSite" />
|
||||
<result column="risk_level" jdbcType="VARCHAR" property="riskLevel" />
|
||||
<result column="controller" jdbcType="VARCHAR" property="controller" />
|
||||
<result column="risk_controller" jdbcType="VARCHAR" property="riskController" />
|
||||
<result column="start_time" jdbcType="DATE" property="startTime" />
|
||||
<result column="is_xh" jdbcType="INTEGER" property="isXh" />
|
||||
<result column="ball_name" property="ballName"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="image_path" property="imagePath"/>
|
||||
<result column="name" property="name"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, risk_code, risk_site, risk_level, controller, risk_controller, start_time, is_xh
|
||||
</sql>
|
||||
|
||||
<select id="selectProSafetyLedger" resultMap="BaseResultMap">
|
||||
select risk_code, risk_site, risk_level, controller, risk_controller, start_time, is_xh
|
||||
from sj_project_safety
|
||||
<where>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
and start_time between #{startTime} and #{endTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProSafetyVideo" resultMap="BaseResultMap">
|
||||
select ball_name, image_path, name,create_time
|
||||
from sj_video_safety
|
||||
<where>
|
||||
ball_name like concat('%',#{ballName},'%')
|
||||
<if test="startTime != null and startTime != ''">
|
||||
and create_time between #{startTime} and #{endTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBallSelect" resultMap="BaseResultMap">
|
||||
select distinct ball_name
|
||||
from sj_video_safety
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue