数据应用分析
This commit is contained in:
parent
29fcec5b88
commit
5660dd3fde
|
|
@ -24,4 +24,6 @@ public class ScreenParamDto extends ScreenDto{
|
||||||
@ApiModelProperty("编码类型")
|
@ApiModelProperty("编码类型")
|
||||||
private int typeCode;
|
private int typeCode;
|
||||||
|
|
||||||
|
private String type;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,11 @@ import lombok.Data;
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class DataAnalysisVo {
|
public class DataAnalysisVo {
|
||||||
|
|
||||||
/**名称*/
|
/**名称*/
|
||||||
private String dataAnalysisName;
|
private String name;
|
||||||
/**数量*/
|
/**数量*/
|
||||||
private Integer num;
|
private Integer num;
|
||||||
|
|
||||||
|
private String typeName;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
package com.securitycontrol.screen.mapper;
|
package com.securitycontrol.screen.mapper;
|
||||||
|
|
||||||
|
import com.securitycontrol.entity.screen.dto.ScreenParamDto;
|
||||||
|
import com.securitycontrol.entity.screen.vo.DataAnalysisVo;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @className:DataAnalysisMapper
|
* @className:DataAnalysisMapper
|
||||||
* @author:cwchen
|
* @author:cwchen
|
||||||
|
|
@ -11,4 +15,12 @@ import org.springframework.stereotype.Repository;
|
||||||
*/
|
*/
|
||||||
@Repository(value = "DataAnalysisMapper")
|
@Repository(value = "DataAnalysisMapper")
|
||||||
public interface DataAnalysisMapper {
|
public interface DataAnalysisMapper {
|
||||||
|
/**
|
||||||
|
* 根据类型获取数据分析应用
|
||||||
|
* @param dto
|
||||||
|
* @return List<DataAnalysisVo>
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/9/4 17:03
|
||||||
|
*/
|
||||||
|
List<DataAnalysisVo> getDataAnalysisByType(ScreenParamDto dto);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,15 @@ package com.securitycontrol.screen.service.impl;
|
||||||
|
|
||||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||||
import com.securitycontrol.entity.screen.dto.ScreenParamDto;
|
import com.securitycontrol.entity.screen.dto.ScreenParamDto;
|
||||||
|
import com.securitycontrol.entity.screen.vo.DataAnalysisVo;
|
||||||
import com.securitycontrol.screen.mapper.DataAnalysisMapper;
|
import com.securitycontrol.screen.mapper.DataAnalysisMapper;
|
||||||
import com.securitycontrol.screen.service.DataAnalysisService;
|
import com.securitycontrol.screen.service.DataAnalysisService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @className:DataAnalysisServiceImpl
|
* @className:DataAnalysisServiceImpl
|
||||||
|
|
@ -25,12 +28,12 @@ public class DataAnalysisServiceImpl implements DataAnalysisService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult getDataAnalysisByType(ScreenParamDto dto) {
|
public AjaxResult getDataAnalysisByType(ScreenParamDto dto) {
|
||||||
|
List<DataAnalysisVo> list = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
|
list = mapper.getDataAnalysisByType(dto);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.toString(),e);
|
log.error(e.toString(),e);
|
||||||
}
|
}
|
||||||
return AjaxResult.success();
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,4 +2,33 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
<mapper namespace="com.securitycontrol.screen.mapper.DataAnalysisMapper">
|
<mapper namespace="com.securitycontrol.screen.mapper.DataAnalysisMapper">
|
||||||
|
|
||||||
|
<!--根据类型获取数据分析应用-->
|
||||||
|
<select id="getDataAnalysisByType" resultType="com.securitycontrol.entity.screen.vo.DataAnalysisVo">
|
||||||
|
<if test="type!=10">
|
||||||
|
SELECT analysis_name AS name,
|
||||||
|
COUNT(*) AS num
|
||||||
|
FROM tb_data_analysis
|
||||||
|
WHERE analysis_type = #{type} AND del_flag = 0
|
||||||
|
GROUP BY analysis_name
|
||||||
|
</if>
|
||||||
|
<if test="type==10">
|
||||||
|
SELECT CASE analysis_type
|
||||||
|
WHEN 1 THEN '工程质量分析'
|
||||||
|
WHEN 2 THEN '工程安全分析'
|
||||||
|
WHEN 3 THEN '工程进度分析'
|
||||||
|
WHEN 4 THEN '资源利用率分析'
|
||||||
|
WHEN 5 THEN '节能减排分析'
|
||||||
|
WHEN 6 THEN '工人效率分析'
|
||||||
|
WHEN 7 THEN '环境监测分析'
|
||||||
|
WHEN 8 THEN '项目管理分析'
|
||||||
|
WHEN 9 THEN '整体效能分析'
|
||||||
|
END AS name,
|
||||||
|
COUNT(*) AS num,
|
||||||
|
GROUP_CONCAT(DISTINCT ANY_VALUE(analysis_name)) AS typeName
|
||||||
|
FROM tb_data_analysis
|
||||||
|
WHERE del_flag = 0
|
||||||
|
GROUP BY analysis_type
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue