parent
d3c14bb713
commit
6821594506
@ -0,0 +1,33 @@
|
||||
package com.ruoyi.jjh.ent.entity.response;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 模板指标自定义选择返回体
|
||||
* @author du
|
||||
* @since 2024/7/31 15:28
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("模板指标自定义选择返回体")
|
||||
public class JTemplateMetricsResponse {
|
||||
|
||||
/**
|
||||
* 数据项
|
||||
*/
|
||||
@ApiModelProperty("数据项")
|
||||
private String dataName;
|
||||
|
||||
/**
|
||||
* 年份
|
||||
*/
|
||||
@ApiModelProperty("年份")
|
||||
private String years;
|
||||
|
||||
/**
|
||||
* 数值
|
||||
*/
|
||||
@ApiModelProperty("数值")
|
||||
private Integer count;
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
<?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.jjh.ent.mapper.JDevelopmentReportMapper">
|
||||
<select id="getTemplateMetrics" resultType="com.ruoyi.jjh.ent.entity.response.JTemplateMetricsResponse">
|
||||
SELECT
|
||||
'服务业企业总数' as dataName,
|
||||
null as years,
|
||||
count(*) as count
|
||||
from bms_enterprise_basic_info
|
||||
UNION
|
||||
SELECT
|
||||
'规上企业总数' as dataName,
|
||||
null as years,
|
||||
sum(type = 1) as count
|
||||
from bms_enterprise_basic_info
|
||||
UNION
|
||||
SELECT
|
||||
'荣誉总数' as dataName,
|
||||
project_year as years,
|
||||
count(*) as count
|
||||
from j_project
|
||||
<where>
|
||||
<if test="years!= null and years != '' ">
|
||||
project_year = #{year}
|
||||
</if>
|
||||
</where>
|
||||
UNION
|
||||
SELECT
|
||||
CASE services_type
|
||||
WHEN '1' THEN '生产性服务业企业数'
|
||||
WHEN '2' THEN '生活性服务业企业数'
|
||||
WHEN '3' THEN '新兴服务业企业数'
|
||||
ELSE '限上批零住餐企业数'
|
||||
END as dataName,
|
||||
years as years,
|
||||
count(*) as count
|
||||
from j_services_list
|
||||
<where>
|
||||
<if test="years!= null and years != '' ">
|
||||
years = #{year}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
services_type
|
||||
UNION
|
||||
SELECT
|
||||
a.dict_label AS dataName,
|
||||
IF(#{year} is null,null,rs.project_year) AS years,
|
||||
IFNULL( rs.count, 0 ) AS count
|
||||
FROM
|
||||
sys_dict_data a
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
project_big_type,
|
||||
IF
|
||||
(
|
||||
project_big_type = 1
|
||||
OR project_big_type = 9,
|
||||
COUNT( DISTINCT credit_code ),
|
||||
COUNT(*)) AS count,
|
||||
project_year
|
||||
FROM
|
||||
j_project
|
||||
<where>
|
||||
<if test="years!= null and years != '' ">
|
||||
project_year = #{year}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
project_big_type
|
||||
) AS rs ON a.dict_value = rs.project_big_type
|
||||
WHERE
|
||||
a.dict_type = 'project_categories'
|
||||
AND a.dict_value != 11
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in new issue