wushunjie
杜函宇 7 months ago
parent bf9920ed04
commit 6ebcb18c74

@ -227,8 +227,10 @@ public class BmsTemplateRecordServiceImpl extends ServiceImpl<BmsTemplateRecordM
//如果前端部分企业名录集合为空 //如果前端部分企业名录集合为空
if (null != enterpriseDirectoryList && enterpriseDirectoryList.size() > 0) { if (null != enterpriseDirectoryList && enterpriseDirectoryList.size() > 0) {
enterpriseDirectoryList.forEach(x -> { enterpriseDirectoryList.forEach(x -> {
getDeclarationRecordsList(bmsTemplateRecordAddDto, drlist, x.getCreditCode(), tp.getTemplateJson()); getDeclarationRecordsList(bmsTemplateRecordAddDto, drlist, x.getCreditCode().trim(), tp.getTemplateJson());
x.setTemplateRecordId(bmsTemplateRecordAddDto.getId()); x.setTemplateRecordId(bmsTemplateRecordAddDto.getId());
x.setCreditCode(x.getCreditCode().trim());
x.setEnterpriseName(x.getEnterpriseName().trim());
}); });
enterpriseDirectoryService.saveBatch(enterpriseDirectoryList); enterpriseDirectoryService.saveBatch(enterpriseDirectoryList);
} else { } else {

@ -5,16 +5,20 @@ import cn.hutool.core.io.resource.ClassPathResource;
import cn.hutool.poi.word.Word07Writer; import cn.hutool.poi.word.Word07Writer;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.jjh.ent.entity.JDevelopmentReport; import com.ruoyi.jjh.ent.entity.JDevelopmentReport;
import com.ruoyi.jjh.ent.entity.response.JTemplateMetricsResponse; import com.ruoyi.jjh.ent.entity.response.JTemplateMetricsResponse;
import com.ruoyi.jjh.ent.service.JDevelopmentReportService; import com.ruoyi.jjh.ent.service.JDevelopmentReportService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
import org.jsoup.Jsoup; import org.jsoup.Jsoup;
import org.jsoup.nodes.Document; import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element; import org.jsoup.nodes.Element;
import org.jsoup.select.Elements; import org.jsoup.select.Elements;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.FileSystemResource; import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
@ -22,17 +26,14 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.awt.*; import java.awt.*;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.List;
/** /**
* j_template_metrics * j_template_metrics
@ -46,18 +47,51 @@ import java.nio.file.Paths;
public class JDevelopmentReportController extends BaseController { public class JDevelopmentReportController extends BaseController {
@Value("${ruoyi.profile}")
private String fileAddress;
@Autowired @Autowired
private JDevelopmentReportService jDevelopmentReportService; private JDevelopmentReportService jDevelopmentReportService;
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')")
@ApiOperation(value = "获取当前用户的模板", response = JDevelopmentReport.class)
@PostMapping("/getId")
public AjaxResult getId() {
Long userId = null;
try {
userId = SecurityUtils.getUserId();
} catch (Exception ignored) {
throw new ServiceException("获取当前用户失败!");
}
List<JDevelopmentReport> list = jDevelopmentReportService.lambdaQuery().eq(JDevelopmentReport::getCreateId, userId).list();
if(!list.isEmpty()){
return success(list.get(0));
}else {
return success();
}
}
/** /**
* *
*/ */
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')") @PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')")
@ApiOperation(value = "新增服务业发展报告", response = JDevelopmentReport.class) @ApiOperation(value = "新增或者修改服务业发展报告", response = JDevelopmentReport.class)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody JDevelopmentReport jDevelopmentReport) { public AjaxResult add(@RequestBody JDevelopmentReport jDevelopmentReport) {
return toAjax(jDevelopmentReportService.save(jDevelopmentReport)); Long userId = null;
try {
userId = SecurityUtils.getUserId();
} catch (Exception ignored) {
throw new ServiceException("获取当前用户失败!");
}
List<JDevelopmentReport> list = jDevelopmentReportService.lambdaQuery().eq(JDevelopmentReport::getCreateId, userId).list();
if(!list.isEmpty()){
return toAjax(jDevelopmentReportService.updateById(jDevelopmentReport));
}else {
return toAjax(jDevelopmentReportService.save(jDevelopmentReport));
}
} }
/** /**
@ -65,76 +99,52 @@ public class JDevelopmentReportController extends BaseController {
*/ */
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')") @PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')")
@ApiOperation(value = "模板指标自定义选择", response = JTemplateMetricsResponse.class) @ApiOperation(value = "模板指标自定义选择", response = JTemplateMetricsResponse.class)
@GetMapping("/templateMetrics") @GetMapping("/templateMetrics/{year}")
public AjaxResult getTemplateMetrics(String year) { public AjaxResult getTemplateMetrics(@PathVariable("year") String year) {
return success(jDevelopmentReportService.getTemplateMetrics(year)); return success(jDevelopmentReportService.getTemplateMetrics(year));
} }
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')")
@ApiOperation(value = "下载发展模板") @ApiOperation(value = "下载发展模板")
@GetMapping("/downloadLocal") @PostMapping("/downloadTemplate")
public ResponseEntity<Resource> downloadLocal() { public ResponseEntity<Resource> downloadTemplate(@RequestBody JDevelopmentReport s) {
String filePath = System.getProperty("user.dir") + "/ruoyi-admin/src/main/resources/template/发展报告模板.docx"; // 创建父文件目录
// 创建文件资源 String fatherFile = fileAddress + "/" + "moban.docx";
Path path = Paths.get(filePath); // 创建文件
FileSystemResource resource = new FileSystemResource(path.toFile()); File touch = FileUtil.touch(fatherFile);
// 设置响应头 // 创建 Word07Writer 实例
HttpHeaders headers = new HttpHeaders(); Word07Writer writer = new Word07Writer();
headers.add(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + "moban"); try {
headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_OCTET_STREAM_VALUE); // 添加段落(标题)
// 返回 ResponseEntity writer.addText(ParagraphAlignment.CENTER,new Font("宋体", Font.PLAIN, 18), s.getTitle());
return ResponseEntity.ok() // 添加副标题
.headers(headers) writer.addText(ParagraphAlignment.CENTER,new Font("宋体", Font.PLAIN, 14), s.getSubheading());
.body(resource); // 使用 Jsoup 解析页面内容
Document doc = Jsoup.parse(s.getContent(), "UTF-8");
// 获取页面内容中的段落
Elements paragraphs = doc.select("p");
for (Element paragraph : paragraphs) {
writer.addText(new Font("仿宋", Font.PLAIN, 12), paragraph.text());
}
// 写出到文件
writer.flush(touch);
// 设置响应头
HttpHeaders headers = new HttpHeaders();
headers.add(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=moban.docx");
headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_OCTET_STREAM_VALUE);
// 封装为 ResponseEntity
FileSystemResource resource = new FileSystemResource(touch);
return ResponseEntity.ok()
.headers(headers)
.body(resource);
} catch (Exception e) {
// 处理异常情况,例如日志记录或者其他错误处理
e.printStackTrace();
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();
} finally {
// 关闭资源
writer.close();
}
} }
// @ApiOperation(value = "下载发展模板")
// @PostMapping("/downloadTemplate")
// public ResponseEntity<Resource> downloadTemplate(@RequestBody JDevelopmentReport s) {
// // 定义文件路径
// ClassPathResource filePath = new ClassPathResource("/template/moban.docx");
// File touch = filePath.getFile();
// // 创建 Word07Writer 实例
// Word07Writer writer = new Word07Writer();
//
// try {
// // 添加段落(标题)
// writer.addText(new Font("宋体", Font.PLAIN, 22), s.getTitle());
//
// // 添加副标题
// writer.addText(new Font("宋体", Font.PLAIN, 18), s.getSubheading());
//
// // 使用 Jsoup 解析页面内容
// Document doc = Jsoup.parse(s.getContent(), "UTF-8");
//
// // 获取页面内容中的段落
// Elements paragraphs = doc.select("p");
// for (Element paragraph : paragraphs) {
// writer.addText(new Font("仿宋", Font.PLAIN, 16), paragraph.text());
// }
//
// // 写出到文件
// writer.flush(touch);
//
// // 设置响应头
// HttpHeaders headers = new HttpHeaders();
// headers.add(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"发展报告模板1.docx\"");
// headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_OCTET_STREAM_VALUE);
//
// // 封装为 ResponseEntity
// FileSystemResource resource = new FileSystemResource(touch);
// return ResponseEntity.ok()
// .headers(headers)
// .body(resource);
// } catch (Exception e) {
// // 处理异常情况,例如日志记录或者其他错误处理
// e.printStackTrace();
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();
// } finally {
// // 关闭资源
// writer.close();
// // 删除临时文件
// FileUtil.del((Path) filePath);
// }
// }
} }

@ -7,9 +7,11 @@ import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.exception.job.TaskException; import com.ruoyi.common.exception.job.TaskException;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.jjh.declaration.regular.TimeChange; import com.ruoyi.jjh.declaration.regular.TimeChange;
import com.ruoyi.jjh.ent.entity.HomeRequestSmart;
import com.ruoyi.jjh.ent.entity.JSmartDeclaration; import com.ruoyi.jjh.ent.entity.JSmartDeclaration;
import com.ruoyi.jjh.ent.entity.JSmartReminders; import com.ruoyi.jjh.ent.entity.JSmartReminders;
import com.ruoyi.jjh.ent.entity.request.JAddJobSmart; import com.ruoyi.jjh.ent.entity.request.JAddJobSmart;
import com.ruoyi.jjh.ent.entity.request.JRemindChiefAllRequest;
import com.ruoyi.jjh.ent.entity.request.JSmartRemindersDq; import com.ruoyi.jjh.ent.entity.request.JSmartRemindersDq;
import com.ruoyi.jjh.ent.entity.request.JSmartRemindersNDq; import com.ruoyi.jjh.ent.entity.request.JSmartRemindersNDq;
import com.ruoyi.jjh.ent.mapper.JSmartRemindersMapper; import com.ruoyi.jjh.ent.mapper.JSmartRemindersMapper;
@ -86,7 +88,7 @@ public class JSmartRemindersController extends BaseController {
@PreAuthorize("@ss.hasAnyRoles('ent')") @PreAuthorize("@ss.hasAnyRoles('ent')")
@ApiOperation(value = "企业端首页智能提醒查询所有数据", response = JSmartDeclaration.class) @ApiOperation(value = "企业端首页智能提醒查询所有数据", response = JSmartDeclaration.class)
@GetMapping("/enterpriseAll") @GetMapping("/enterpriseAll")
public AjaxResult enterpriseAll() { public AjaxResult enterpriseAll(Page<HomeRequestSmart> page) {
// 获取当前登录用户是否是企业端 // 获取当前登录用户是否是企业端
boolean admin = false; boolean admin = false;
String str = null; String str = null;
@ -98,7 +100,7 @@ public class JSmartRemindersController extends BaseController {
if (admin) { if (admin) {
str = null; str = null;
} }
return success(jSmartDeclarationService.selectEnterpriseAllList(str)); return success(jSmartDeclarationService.selectEnterpriseAllList(page,str));
} }
@ -108,21 +110,20 @@ public class JSmartRemindersController extends BaseController {
* @return * @return
*/ */
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')") @PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')")
@ApiOperation(value = "政务端首页智能提醒查询所有数据", response = JSmartDeclaration.class) @ApiOperation(value = "政务端首页智能提醒查询数据", response = JSmartDeclaration.class)
@GetMapping("/chiefAll") @GetMapping("/chiefAll")
public AjaxResult chiefAll(Long projectId) { public AjaxResult chiefAll(Page<HomeRequestSmart> page, JRemindChiefAllRequest req) {
// 获取当前登录用户是否是政务端 // 获取当前登录用户是否是政务端
boolean admin = false; boolean admin = false;
Long userId = null;
try { try {
admin = SecurityUtils.isAdmin(SecurityUtils.getUserId()); admin = SecurityUtils.isAdmin(SecurityUtils.getUserId());
userId = SecurityUtils.getUserId(); req.setUserId(SecurityUtils.getUserId());
} catch (Exception ignored) { } catch (Exception ignored) {
} }
if (admin) { if (admin) {
userId = null; req.setUserId(null);
} }
return success(jSmartDeclarationService.chiefAll(userId, projectId)); return success(jSmartDeclarationService.chiefAll(page,req));
} }
/** /**

@ -1,8 +1,6 @@
package com.ruoyi.jjh.ent.entity; package com.ruoyi.jjh.ent.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.jjh.common.entity.BaseInfoEntity; import com.ruoyi.jjh.common.entity.BaseInfoEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -48,4 +46,20 @@ public class JDevelopmentReport extends BaseInfoEntity {
@NotBlank @NotBlank
@ApiModelProperty("内容") @ApiModelProperty("内容")
private String content; private String content;
/**
* ID
*/
@ApiModelProperty("创建ID")
@TableField(fill = FieldFill.INSERT)
private Long createId;
/**
* ID
*/
@ApiModelProperty("更新者ID")
@TableField(fill = FieldFill.UPDATE)
private Long updateId;
} }

@ -0,0 +1,31 @@
package com.ruoyi.jjh.ent.entity.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
* @author du
* @since 2024/8/2 10:36
*/
@Data
public class JRemindChiefAllRequest {
/**
*
*/
@ApiModelProperty("智能提醒内容")
private String content;
/**
* id
*/
@ApiModelProperty("项目id")
private Long projectId;
/**
* id
*/
@ApiModelProperty("用户id")
private Long userId;
}

@ -30,5 +30,5 @@ public class JTemplateMetricsResponse {
* *
*/ */
@ApiModelProperty("数值") @ApiModelProperty("数值")
private Integer count; private String count;
} }

@ -1,8 +1,10 @@
package com.ruoyi.jjh.ent.mapper; package com.ruoyi.jjh.ent.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.jjh.ent.entity.HomeRequestSmart; import com.ruoyi.jjh.ent.entity.HomeRequestSmart;
import com.ruoyi.jjh.ent.entity.JSmartDeclaration; import com.ruoyi.jjh.ent.entity.JSmartDeclaration;
import com.ruoyi.jjh.ent.entity.request.JRemindChiefAllRequest;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -20,13 +22,13 @@ public interface JSmartDeclarationMapper extends BaseMapper<JSmartDeclaration> {
* *
* @return * @return
*/ */
List<HomeRequestSmart> selectEnterpriseAllList(@Param("userName") String userName); Page<HomeRequestSmart> selectEnterpriseAllList(Page<HomeRequestSmart> page,@Param("userName") String userName);
/** /**
* *
* *
* @return * @return
*/ */
List<HomeRequestSmart> chiefAll(@Param("userId") Long userId, @Param("projectId") Long projectId); Page<HomeRequestSmart> chiefAll(Page<HomeRequestSmart> page,@Param("req") JRemindChiefAllRequest req);
} }

@ -1,8 +1,10 @@
package com.ruoyi.jjh.ent.service; package com.ruoyi.jjh.ent.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.jjh.ent.entity.HomeRequestSmart; import com.ruoyi.jjh.ent.entity.HomeRequestSmart;
import com.ruoyi.jjh.ent.entity.JSmartDeclaration; import com.ruoyi.jjh.ent.entity.JSmartDeclaration;
import com.ruoyi.jjh.ent.entity.request.JRemindChiefAllRequest;
import java.util.List; import java.util.List;
@ -20,7 +22,7 @@ public interface JSmartDeclarationService extends IService<JSmartDeclaration> {
* *
* @return * @return
*/ */
List<HomeRequestSmart> selectEnterpriseAllList(String userName); Page<HomeRequestSmart> selectEnterpriseAllList(Page<HomeRequestSmart> page,String userName);
/** /**
@ -28,6 +30,6 @@ public interface JSmartDeclarationService extends IService<JSmartDeclaration> {
* *
* @return * @return
*/ */
List<HomeRequestSmart> chiefAll(Long userId, Long projectId); Page<HomeRequestSmart> chiefAll(Page<HomeRequestSmart> page, JRemindChiefAllRequest req);
} }

@ -1,8 +1,10 @@
package com.ruoyi.jjh.ent.service.impl; package com.ruoyi.jjh.ent.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.jjh.ent.entity.HomeRequestSmart; import com.ruoyi.jjh.ent.entity.HomeRequestSmart;
import com.ruoyi.jjh.ent.entity.JSmartDeclaration; import com.ruoyi.jjh.ent.entity.JSmartDeclaration;
import com.ruoyi.jjh.ent.entity.request.JRemindChiefAllRequest;
import com.ruoyi.jjh.ent.mapper.JSmartDeclarationMapper; import com.ruoyi.jjh.ent.mapper.JSmartDeclarationMapper;
import com.ruoyi.jjh.ent.service.JSmartDeclarationService; import com.ruoyi.jjh.ent.service.JSmartDeclarationService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -24,8 +26,8 @@ public class JSmartDeclarationServiceImpl extends ServiceImpl<JSmartDeclarationM
* @return * @return
*/ */
@Override @Override
public List<HomeRequestSmart> selectEnterpriseAllList(String userName) { public Page<HomeRequestSmart> selectEnterpriseAllList(Page<HomeRequestSmart> page,String userName) {
return baseMapper.selectEnterpriseAllList(userName); return baseMapper.selectEnterpriseAllList(page,userName);
} }
/** /**
@ -34,8 +36,8 @@ public class JSmartDeclarationServiceImpl extends ServiceImpl<JSmartDeclarationM
* @return * @return
*/ */
@Override @Override
public List<HomeRequestSmart> chiefAll(Long userId, Long projectId) { public Page<HomeRequestSmart> chiefAll(Page<HomeRequestSmart> page, JRemindChiefAllRequest req) {
return baseMapper.chiefAll(userId, projectId); return baseMapper.chiefAll(page, req);
} }
} }

@ -63,7 +63,7 @@ spring:
multi-statement-allow: true multi-statement-allow: true
#自己客户端地址 #自己客户端地址
returnUrl: http://39.101.188.84:9999/demo/JinJiHu returnUrl: http://39.101.188.84:9999/demo/JinJiHu
#returnUrl: http://192.168.0.110:80 #returnUrl: http://192.168.0.113:80
#定时任务更新企业信息和联系人的开启 #定时任务更新企业信息和联系人的开启
isTiming: false isTiming: false

@ -34,7 +34,7 @@ spring:
# 国际化资源文件路径 # 国际化资源文件路径
basename: i18n/messages basename: i18n/messages
profiles: profiles:
active: druid active: internet
# 文件上传 # 文件上传
servlet: servlet:
multipart: multipart:

@ -5,74 +5,77 @@
<mapper namespace="com.ruoyi.jjh.ent.mapper.JDevelopmentReportMapper"> <mapper namespace="com.ruoyi.jjh.ent.mapper.JDevelopmentReportMapper">
<select id="getTemplateMetrics" resultType="com.ruoyi.jjh.ent.entity.response.JTemplateMetricsResponse"> <select id="getTemplateMetrics" resultType="com.ruoyi.jjh.ent.entity.response.JTemplateMetricsResponse">
SELECT SELECT
'服务业企业总数' as dataName, '服务业企业总数' AS dataName,
null as years, '-' AS years,
count(*) as count count(*) AS count
from bms_enterprise_basic_info FROM
UNION 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 SELECT
CASE services_type '规上企业总数' AS dataName,
WHEN '1' THEN '生产性服务业企业数' '-' AS years,
WHEN '2' THEN '生活性服务业企业数' sum( type = 1 ) AS count
WHEN '3' THEN '新兴服务业企业数' FROM
ELSE '限上批零住餐企业数' bms_enterprise_basic_info UNION
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 SELECT
a.dict_label AS dataName, '荣誉总数' AS dataName,
IF(#{year} is null,null,rs.project_year) AS years, #{year} AS years,
IFNULL( rs.count, 0 ) AS count count(*) AS count
FROM FROM
sys_dict_data a j_project
LEFT JOIN ( WHERE
project_year = #{year}
UNION
SELECT SELECT
project_big_type, CASE
IF services_type
( WHEN '1' THEN
project_big_type = 1 '生产性服务业企业数'
OR project_big_type = 9, WHEN '2' THEN
COUNT( DISTINCT credit_code ), '生活性服务业企业数'
COUNT(*)) AS count, WHEN '3' THEN
project_year '新兴服务业企业数' ELSE '限上批零住餐企业数'
END AS dataName,
#{year} AS years,
IF
(
sum(
IF
( #{year} = years, 1, '-' )) = 0,
'-',
sum(
IF
( #{year} = years, 1, '-' ))) AS count
FROM FROM
j_project j_services_list
<where>
<if test="years!= null and years != '' ">
project_year = #{year}
</if>
</where>
GROUP BY GROUP BY
project_big_type services_type UNION SELECT
) AS rs ON a.dict_value = rs.project_big_type a.dict_label AS dataName,
#{year} AS years,
IFNULL( rs.count, '-' ) 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
FROM
j_project
WHERE
project_big_type IN ( '1', '4' )
AND project_year = #{year}
GROUP BY
project_big_type
) AS rs ON a.dict_value = rs.project_big_type
WHERE WHERE
a.dict_type = 'project_categories' a.dict_type = 'project_categories'
AND a.dict_value != 11 AND a.dict_value IN (
'1',
'4'
)
</select> </select>
</mapper> </mapper>

@ -28,7 +28,7 @@
</if> </if>
and a.alert_time &lt; NOW() and a.alert_time &lt; NOW()
</where> </where>
order by a.alert_time desc; order by a.alert_time desc
</select> </select>
<select id="chiefAll" resultType="com.ruoyi.jjh.ent.entity.HomeRequestSmart"> <select id="chiefAll" resultType="com.ruoyi.jjh.ent.entity.HomeRequestSmart">
SELECT SELECT
@ -50,14 +50,14 @@
LEFT JOIN j_smart_reminders AS c ON a.smart_reminders_id = c.id LEFT JOIN j_smart_reminders AS c ON a.smart_reminders_id = c.id
<where> <where>
c.alert_recipients = 2 c.alert_recipients = 2
<if test="projectId != null and projectId != '' "> <if test="req.projectId != null and req.projectId != '' ">
and a.project_id = #{projectId} and a.project_id = #{req.projectId}
</if> </if>
<if test="userId != null and userId != '' "> <if test="req.userId != null and req.userId != '' ">
and a.zw_id = #{userId} and a.zw_id = #{req.userId}
</if> </if>
and a.alert_time &lt; NOW() and a.alert_time &lt; NOW()
</where> </where>
order by a.alert_time desc; order by a.alert_time desc
</select> </select>
</mapper> </mapper>

Loading…
Cancel
Save