大数据统计接口

This commit is contained in:
ly19960718 2021-08-03 18:08:32 +08:00
parent ca69710ebe
commit a418dfb76a
22 changed files with 732 additions and 0 deletions

View File

@ -0,0 +1,60 @@
package com.cm.inspection.controller.app.resources;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 大数据页面返回实体
*/
public class BigDataResult {
private Map<String, Object> data = new HashMap<String, Object>();
private List<Object> list = new ArrayList<Object>();
private String msg = "加载成功";
private String state = "200";
public static BigDataResult getInstance() {
return new BigDataResult();
}
public Map<String, Object> getData() {
return data;
}
public void setData(Map<String, Object> data) {
this.data = data;
}
public List getList() {
if (list == null) {
return new ArrayList<>();
}
return list;
}
public void setList(List list) {
this.list = list;
}
public String getMsg() {
return msg == null ? "" : msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public String getState() {
return state == null ? "" : state;
}
public void setState(String state) {
this.state = state;
}
}

View File

@ -0,0 +1,47 @@
package com.cm.inspection.controller.app.resources.check;
import com.cm.common.base.AbstractController;
import com.cm.common.constants.ISystemConstant;
import com.cm.inspection.controller.app.resources.BigDataResult;
import com.cm.inspection.service.check.ICheck2Service;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;
/**
* 检查统计
*/
@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "环保检查统计接口")
@RestController
@RequestMapping(ISystemConstant.APP_PREFIX + "/check/v2/"+ISystemConstant.APP_RELEASE_SUFFIX)
public class CheckV2CountController extends AbstractController {
@Autowired
private ICheck2Service check2Service;
@ApiOperation(value = "统计当月检查总数", notes = "统计当月检查总数接口")
@GetMapping("count-themonthcheckdata")
public BigDataResult countTheMonthData(){
BigDataResult result = new BigDataResult();
Map<String,Object> params = new HashMap<>();
Integer count = check2Service.countTheMonthCheckData(params);
params.put("value",count);
result.setData(params);
return result;
}
}

View File

@ -0,0 +1,61 @@
package com.cm.inspection.controller.app.resources.datadictionary;
import com.cm.common.constants.ISystemConstant;
import com.cm.common.plugin.pojo.dtos.datadictionary.DataDictionaryDTO;
import com.cm.common.plugin.service.datadictionary.impl.DataDictionaryServiceImpl;
import com.cm.inspection.controller.app.resources.BigDataResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "数据字典接口")
@RestController
@RequestMapping(ISystemConstant.APP_PREFIX + "/datadictionary/"+ISystemConstant.APP_RELEASE_SUFFIX)
public class DatadictionaryController {
@Autowired
private DataDictionaryServiceImpl dataDictionaryService;
@ApiOperation(value = "根据父级ID获取", notes = "根据父级ID获取接口")
@GetMapping("get-by-parentid/{parentId}")
public BigDataResult getByParentId(@PathVariable("parentId") String parentId){
BigDataResult result = new BigDataResult();
List<Map<String,Object>> list = new ArrayList<>();
if(!StringUtils.isBlank(parentId)){
List<DataDictionaryDTO> dataDictionaryDTOS = dataDictionaryService.listDictionaryByParentId(parentId);
for (DataDictionaryDTO dataDictionaryDTO : dataDictionaryDTOS) {
Map<String,Object> params = new HashMap<>();
params.put("id",dataDictionaryDTO.getDictionaryId());
params.put("name",dataDictionaryDTO.getDictionaryName());
list.add(params);
}
}
result.setList(list);
return result;
}
}

View File

@ -0,0 +1,85 @@
package com.cm.inspection.controller.app.resources.enterprise;
import com.cm.common.base.AbstractController;
import com.cm.common.constants.ISystemConstant;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResultList;
import com.cm.inspection.controller.app.resources.BigDataResult;
import com.cm.inspection.enums.enterpriseTypeEnum;
import com.cm.inspection.pojo.dtos.enterprise.EnterpriseDTO;
import com.cm.inspection.service.enterprise.IEnterpriseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "环保企业接口")
@RestController
@RequestMapping(ISystemConstant.APP_PREFIX + "/enterprise/"+ISystemConstant.APP_RELEASE_SUFFIX)
public class EnterpriseCountController extends AbstractController {
@Autowired
private IEnterpriseService enterpriseService;
@ApiOperation(value = "统计企业类型", notes = "统计企业类型接口")
@GetMapping("count-enterprisetype")
public BigDataResult countEnterpriseType(){
BigDataResult result = new BigDataResult();
List<Map<String,Object>> list = new ArrayList();
Map<String,Object> params1 = new HashMap<>();
params1.put("enterpriseType",enterpriseTypeEnum.TYOE_1.getValue());
Integer count1 = enterpriseService.countEnterprisePollution(params1);
params1.clear();
params1.put("name",enterpriseTypeEnum.TYOE_1.getSummary());
params1.put("value",count1);
list.add(params1);
Map<String,Object> params2 = new HashMap<>();
params2.put("enterpriseType",enterpriseTypeEnum.TYOE_2.getValue());
Integer count2 = enterpriseService.countEnterprisePollution(params2);
params2.clear();
params2.put("name",enterpriseTypeEnum.TYOE_2.getSummary());
params2.put("value",count2);
list.add(params2);
Map<String,Object> params3 = new HashMap<>();
params3.put("enterpriseType",enterpriseTypeEnum.TYOE_3.getValue());
Integer count3 = enterpriseService.countEnterprisePollution(params3);
params3.clear();
params3.put("name",enterpriseTypeEnum.TYOE_3.getSummary());
params3.put("value",count3);
list.add(params3);
result.setList(list);
return result;
}
@ApiOperation(value = "企业列表", notes = "企业列表接口")
@GetMapping("enterprise-list")
public SuccessResultList<List<EnterpriseDTO>> enterpriseList(ListPage page){
Map<String, Object> params = requestParams();
page.setParams(params);
return enterpriseService.listPage(page);
}
}

View File

@ -0,0 +1,249 @@
package com.cm.inspection.controller.app.resources.taskcheck;
import com.alibaba.fastjson.JSONArray;
import com.cm.common.base.AbstractController;
import com.cm.common.constants.ISystemConstant;
import com.cm.common.plugin.oauth.service.department.IDepartmentService;
import com.cm.common.plugin.oauth.service.user.IUserService;
import com.cm.common.plugin.pojo.bos.user.UserDepartmentResourceBO;
import com.cm.common.pojo.ListPage;
import com.cm.common.pojo.dtos.department.DepartmentSortDTO;
import com.cm.common.result.ErrorResult;
import com.cm.common.result.SuccessResultList;
import com.cm.inspection.controller.app.resources.BigDataResult;
import com.cm.inspection.pojo.dtos.taskcheck.v2.TaskCheckDTO;
import com.cm.inspection.service.taskcheck.v2.ITaskCheckService;
import io.swagger.annotations.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "环保任务统计接口")
@RestController
@RequestMapping(ISystemConstant.APP_PREFIX + "/taskcheck/v2/"+ISystemConstant.APP_RELEASE_SUFFIX)
public class TaskcheckV2CountController extends AbstractController {
@Resource(name = "taskCheckV2Service")
private ITaskCheckService taskCheckService;
@Autowired
private IDepartmentService departmentService;
@Autowired
private IUserService userService;
@Value("${count-big-data.jiniqu-dept-id}")
protected String jinniquId;
@Value("${count-big-data.shengtaiwei-dept-id}")
protected String shengtaiweiId;
@ApiOperation(value = "检查任务分页列表", notes = "检查任务分页列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "Integer", defaultValue = "1"),
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "Integer", defaultValue = "20"),
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("listpagetask")
public SuccessResultList<List<TaskCheckDTO>> listPageTask(ListPage page) {
Map<String, Object> params = requestParams();
page.setParams(params);
return taskCheckService.listPageTask(page);
}
@ApiOperation(value = "统计当月任务总数", notes = "统计当月任务总数接口")
@GetMapping("count-themonthtaskcheckdata")
public BigDataResult countTheMonthTaskCheckData(){
BigDataResult result = new BigDataResult();
Map<String,Object> params = new HashMap<>();
Integer count = taskCheckService.countTheMonthTaskData(params);
params.put("value",count);
result.setData(params);
return result;
}
@ApiOperation(value = "统计任务完成度占比", notes = "统计任务完成度占比接口")
@GetMapping("count-taskenterprise")
public BigDataResult countTaskEnterprise(){
BigDataResult result = new BigDataResult();
List<Map<String,Object>> list = new ArrayList<>();
Map<String,Object> params0 = new HashMap<>();
params0.put("isCompleted","0");
Integer integer0 = taskCheckService.countTaskEnterprise(params0);
params0.clear();
params0.put("name","未完成");
params0.put("value",integer0);
list.add(params0);
Map<String,Object> params1 = new HashMap<>();
params1.put("isCompleted","1");
Integer integer1 = taskCheckService.countTaskEnterprise(params1);
params1.clear();
params1.put("name","已完成");
params1.put("value",integer1);
list.add(params1);
result.setList(list);
return result;
}
@ApiOperation(value = "统计集宁区各科室任务信息", notes = "统计集宁区各科室任务信息接口")
@GetMapping("count-jiniqu-dept-taskcheckdata")
public BigDataResult countDepartmentTaskCheckData1(){
BigDataResult result = new BigDataResult();
List<Map<String,Object>> list = new ArrayList<>();
if(StringUtils.isBlank(jinniquId)){
result.setList(list);
return result;
}
List<DepartmentSortDTO> departmentSortDTOS = departmentService.listSortByParentId(jinniquId);
for (DepartmentSortDTO departmentSortDTO : departmentSortDTOS) {
Integer count0 = 0;
Integer count1 = 0;
//查询部门用户
List<String> deptList =new ArrayList<>();
deptList.add(departmentSortDTO.getDepartmentId());
final List<String> userIds = this.deptUserUtils(userService.listUserDepartmentResourceByDepartmentIds(deptList));
if(userIds.size() > 0){
//统计未完成
Map<String,Object> params0 = new HashMap<>();
params0.put("isCompleted","0");
params0.put("checkUserIds",userIds);
count0 = taskCheckService.countTaskEnterprise(params0);
//统计已完成
Map<String,Object> params1 = new HashMap<>();
params1.put("isCompleted","1");
params1.put("checkUserIds",userIds);
count1 = taskCheckService.countTaskEnterprise(params1);
}
//参数封装
Map<String,Object> params = new HashMap<>();
params.put("name",departmentSortDTO.getDepartmentName());
deptList.clear();
deptList.add(count1.toString());//完成
deptList.add(count0.toString());//未完成
params.put("columns",deptList);
list.add(params);
}
result.setList(list);
return result;
}
@ApiOperation(value = "统计生态委各科室任务信息", notes = "统计集宁区各科室任务信息接口")
@GetMapping("count-shengtaiwei-dept-taskcheckdata")
public BigDataResult countDepartmentTaskCheckData2(){
BigDataResult result = new BigDataResult();
List<Map<String,Object>> list = new ArrayList<>();
if(StringUtils.isBlank(shengtaiweiId)){
result.setList(list);
return result;
}
List<DepartmentSortDTO> departmentSortDTOS = departmentService.listSortByParentId(shengtaiweiId);
for (DepartmentSortDTO departmentSortDTO : departmentSortDTOS) {
Integer count0 = 0;
Integer count1 = 0;
//查询部门用户
List<String> deptList =new ArrayList<>();
deptList.add(departmentSortDTO.getDepartmentId());
final List<String> userIds = this.deptUserUtils(userService.listUserDepartmentResourceByDepartmentIds(deptList));
if(userIds.size() > 0){
//统计未完成
Map<String,Object> params0 = new HashMap<>();
params0.put("isCompleted","0");
params0.put("checkUserIds",userIds);
count0 = taskCheckService.countTaskEnterprise(params0);
//统计已完成
Map<String,Object> params1 = new HashMap<>();
params1.put("isCompleted","1");
params1.put("checkUserIds",userIds);
count1 = taskCheckService.countTaskEnterprise(params1);
}
//参数封装
Map<String,Object> params = new HashMap<>();
params.put("name",departmentSortDTO.getDepartmentName());
deptList.clear();
deptList.add(count1.toString());//完成
deptList.add(count0.toString());//未完成
params.put("columns",deptList);
list.add(params);
}
result.setList(list);
Map<String,Object> dataParams = new HashMap<>();
List<String> dataList = new ArrayList<>();
dataList.add("已完成");
dataList.add("未完成");
dataParams.put("nameColumns",dataList);
result.setData(dataParams);
return result;
}
@ApiOperation(value = "获取生态委科室数据", notes = "获取生态委科室数据接口")
@GetMapping("departmentdata-shengtaiwei")
public BigDataResult departmentData(){
BigDataResult result = new BigDataResult();
List<Map<String, Object>> list = new ArrayList<>();
List<DepartmentSortDTO> departmentSortDTOS = departmentService.listSortByParentId(shengtaiweiId);
for (DepartmentSortDTO departmentSortDTO : departmentSortDTOS) {
Map<String,Object> params = new HashMap<>();
params.put("id",departmentSortDTO.getDepartmentId());
params.put("name",departmentSortDTO.getDepartmentName());
list.add(params);
}
result.setList(list);
return result;
}
public List<String> deptUserUtils(List<UserDepartmentResourceBO> list){
List<String> userList = new ArrayList<>();
for (UserDepartmentResourceBO ub : list) {
userList.add(ub.getUserId());
}
return userList;
}
}

View File

@ -21,6 +21,14 @@ import java.util.Map;
@Repository
public interface ICheck2Dao {
/**
* 统计当月的检查数量
* @param params
* @return
* @throws SearchException
*/
Integer countTheMonthCheckData(Map<String, Object> params) throws SearchException;
/**
* 新增检查表
*

View File

@ -148,4 +148,13 @@ public interface IEnterpriseDao {
* @throws SearchException
*/
List<EnterprisePollutionDTO> listEnterprisePollution(Map<String, Object> params) throws SearchException;
/**
* 统计污染因子
* @param params
* @return
* @throws SearchException
*/
Integer countEnterprisePollution(Map<String,Object> params) throws SearchException;
}

View File

@ -25,6 +25,23 @@ import java.util.Map;
*/
@Repository("taskCheckV2Dao")
public interface ITaskCheckDao {
/**
* 统计当月任务数量
* @param params
* @return
* @throws SearchException
*/
Integer countTheMonthTaskData(Map<String,Object> params) throws SearchException;
/**
* 统计任务企业表
* @param params
* @return
* @throws SearchException
*/
Integer countTaskEnterprise(Map<String,Object> params) throws SearchException;
/**
* 保存任务
*

View File

@ -0,0 +1,28 @@
package com.cm.inspection.enums;
/**
* 企业类型枚举类
*/
public enum enterpriseTypeEnum {
TYOE_1("1","重点监督"),
TYOE_2("2","常态监督"),
TYOE_3("3","优良企业");
private String value;
private String summary;
enterpriseTypeEnum(String value, String summary) {
this.value = value;
this.summary = summary;
}
public String getValue() {
return value == null ? "" : value;
}
public String getSummary() {
return summary == null ? "" : summary;
}
}

View File

@ -19,8 +19,12 @@ import java.io.Serializable;
public class EnterprisePollutionDTO implements Serializable {
private static final long serialVersionUID = -5026176927054951270L;
@ApiModelProperty(name = "enterpriseId", value = "企业ID")
private String enterpriseId;
@ApiModelProperty(name = "enterpriseType", value = "企业类型")
private String enterpriseType;
@ApiModelProperty(name = "pollutionFactor", value = "污染因子")
private String pollutionFactor;
@ApiModelProperty(name = "pollutionFactorDangerous", value = "污染因子危险废物")
@ -46,6 +50,18 @@ public class EnterprisePollutionDTO implements Serializable {
this.enterpriseId = enterpriseId;
}
public static long getSerialVersionUID() {
return serialVersionUID;
}
public String getEnterpriseType() {
return enterpriseType;
}
public void setEnterpriseType(String enterpriseType) {
this.enterpriseType = enterpriseType;
}
public String getPollutionFactor() {
return pollutionFactor == null ? "" : pollutionFactor.trim();
}

View File

@ -18,6 +18,8 @@ import java.io.Serializable;
@ApiModel
public class EnterprisePollutionVO {
@ApiModelProperty(name = "enterpriseType", value = "企业类型")
private String enterpriseType;
@ApiModelProperty(name = "pollutionFactor", value = "污染因子")
private String pollutionFactor;
@ApiModelProperty(name = "pollutionFactorDangerous", value = "污染因子危险废物")
@ -35,6 +37,14 @@ public class EnterprisePollutionVO {
@ApiModelProperty(name = "relatedDocuments", value = "相关文件")
private String relatedDocuments;
public String getEnterpriseType() {
return enterpriseType;
}
public void setEnterpriseType(String enterpriseType) {
this.enterpriseType = enterpriseType;
}
public String getPollutionFactor() {
return pollutionFactor == null ? "" : pollutionFactor.trim();
}

View File

@ -25,6 +25,12 @@ public interface ICheck2Service {
String BUSINESS_KEY_PREFIX = "check2";
/**
* 统计当月的检查数据
* @return
*/
Integer countTheMonthCheckData(Map<String, Object> params);
/**
* 新增检查

View File

@ -84,6 +84,13 @@ public class Check2ServiceImpl extends BaseService implements ICheck2Service {
private IUserService userService;
public Integer countTheMonthCheckData(Map<String, Object> params){
return check2Dao.countTheMonthCheckData(params);
}
@Override
public void save(String token, Check2VO check2VO) throws Exception {
// 如果是任务将任务标记为已处理

View File

@ -259,4 +259,13 @@ public interface IEnterpriseService {
*/
List<EnterpriseDTO> listSimpleByArea(String area1Id, String area2Id, String area3Id, String area4Id, String area5Id);
/**
* 统计污染因子
* @param params
* @return
* @throws SearchException
*/
Integer countEnterprisePollution(Map<String,Object> params) throws SearchException;
}

View File

@ -520,4 +520,10 @@ public class EnterpriseServiceImpl extends BaseService implements IEnterpriseSer
return enterpriseDTOs;
}
public Integer countEnterprisePollution(Map<String,Object> params) throws SearchException {
return enterpriseDao.countEnterprisePollution(params);
}
}

View File

@ -38,6 +38,22 @@ public interface ITaskCheckService {
*/
int CHECK_ITEM_LIST_TYPE_CUSTOM = 2;
/**
* 统计企业任务表
* @param params
* @return
* @throws SearchException
*/
Integer countTaskEnterprise(Map<String,Object> params) throws SearchException;
/**
* 统计当月任务数量
* @param params
* @return
* @throws SearchException
*/
Integer countTheMonthTaskData(Map<String,Object> params) throws SearchException;
/**
* 新增检查任务
*

View File

@ -82,6 +82,16 @@ public class TaskCheckServiceImpl extends BaseService implements ITaskCheckServi
@Autowired
private IUserService userService;
public Integer countTheMonthTaskData(Map<String,Object> params) throws SearchException{
return taskCheckDao.countTheMonthTaskData(params);
}
public Integer countTaskEnterprise(Map<String,Object> params) throws SearchException{
return taskCheckDao.countTaskEnterprise(params);
}
@Override
public SuccessResult save(TaskCheckVO taskCheckVO) throws Exception {
// 保存任务

View File

@ -636,5 +636,18 @@
LEFT(t1.gmt_create, 7) = #{checkMonth}
</if>
</select>
<select id="countTheMonthCheckData" parameterType="map" resultType="java.lang.Integer">
SELECT
count(*)
FROM
gen_check
WHERE
is_delete = 0
AND
DATE_FORMAT( gmt_create, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</select>
</mapper>

View File

@ -59,6 +59,7 @@
<resultMap id="enterprisePollutionDTO" type="com.cm.inspection.pojo.dtos.enterprise.EnterprisePollutionDTO">
<id column="enterprise_id" property="enterpriseId"/>
<result column="pollution_factor" property="pollutionFactor"/>
<result column="enterprise_type" property="enterpriseType"/>
<result column="pollution_factor_dangerous" property="pollutionFactorDangerous"/>
<result column="pollution_factor_other" property="pollutionFactorOther"/>
<result column="pollution_facilities" property="pollutionFacilities"/>
@ -398,6 +399,7 @@
<insert id="saveEnterprisePollution" parameterType="map" flushCache="true">
INSERT INTO gen_enterprise_pollution(
enterprise_id,
enterprise_type,
pollution_factor,
pollution_factor_dangerous,
pollution_factor_other,
@ -408,6 +410,7 @@
related_documents
) VALUES(
#{enterpriseId},
#{enterpriseType},
#{pollutionFactor},
#{pollutionFactorDangerous},
#{pollutionFactorOther},
@ -447,6 +450,9 @@
</if>
<if test="relatedDocuments != null">
related_documents = #{relatedDocuments},
</if>
<if test="enterpriseType != null">
enterprise_type = #{enterpriseType},
</if>
enterprise_id = #{enterpriseId}
WHERE
@ -654,6 +660,10 @@
AND
t1.remarks = #{remarks}
</if>
<if test="industryType != null and industryType != ''">
AND
t1.industry_type = #{industryType}
</if>
<if test="enterpriseIds != null and enterpriseIds.size > 0">
AND
t1.enterprise_id IN
@ -725,6 +735,7 @@
<select id="getEnterprisePollution" parameterType="map" resultMap="enterprisePollutionDTO" useCache="true">
SELECT
enterprise_id,
enterprise_type,
pollution_factor,
pollution_factor_dangerous,
pollution_factor_other,
@ -743,6 +754,7 @@
<select id="listEnterprisePollution" parameterType="map" resultMap="enterprisePollutionDTO" useCache="true">
SELECT
enterprise_id,
enterprise_type,
pollution_factor,
pollution_factor_dangerous,
pollution_factor_other,
@ -778,4 +790,14 @@
</if>
</select>
<select id="countEnterprisePollution" parameterType="map" resultType="java.lang.Integer" useCache="true">
SELECT
count(*)
FROM
gen_enterprise_pollution
WHERE
enterprise_type = #{enterpriseType}
</select>
</mapper>

View File

@ -522,4 +522,43 @@
</if>
</select>
<!--统计当月任务数量-->
<select id="countTheMonthTaskData" parameterType="map" resultType="java.lang.Integer" useCache="true">
SELECT
count(*)
FROM
gen_task_v2
WHERE
is_delete = 0
AND
DATE_FORMAT( gmt_create, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</select>
<!--统计任务企业表-->
<select id="countTaskEnterprise" parameterType="map" resultType="java.lang.Integer" useCache="true">
SELECT
count(*)
FROM
gen_task_enterprise_v2
WHERE 1=1
<if test="isCompleted != null and isCompleted != ''">
AND
is_completed = #{isCompleted}
</if>
<if test="isChecked != null and isChecked != ''">
AND
is_checked = #{isChecked}
</if>
<if test="checkUserIds != null and checkUserIds.size > 0">
AND
check_user_id IN
<foreach collection="checkUserIds" index="index" open="(" separator="," close=")">
#{checkUserIds[${index}]}
</foreach>
</if>
</select>
</mapper>

View File

@ -25,6 +25,18 @@
<div class="layui-card">
<div class="layui-card-body" style="padding: 15px;">
<form class="layui-form layui-form-pane" lay-filter="dataForm">
<div class="layui-form-item">
<label class="layui-form-label">企业类型</label>
<div class="layui-input-block">
<select id="enterpriseType" name="enterpriseType" lay-verify="required">
<option value="">请选择类型</option>
<option value="1">重点监督</option>
<option value="2">常态监督</option>
<option value="3">优良企业</option>
</select>
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">主要污染因子</label>
<div class="layui-input-block">

View File

@ -25,6 +25,8 @@
<div class="layui-card">
<div class="layui-card-body" style="padding: 15px;">
<form class="layui-form layui-form-pane" lay-filter="dataForm">
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">主要污染因子</label>
<div class="layui-input-block">