Commit 1b54cf30 authored by 王琮's avatar 王琮

修改首页统计

parent 641d7e6f
...@@ -51,9 +51,9 @@ public class YxryController extends BaseController ...@@ -51,9 +51,9 @@ public class YxryController extends BaseController
* 获取首页数据 * 获取首页数据
*/ */
@GetMapping(value = "/statistics") @GetMapping(value = "/statistics")
public AjaxResult statistics() public AjaxResult statistics(Yxry yxry)
{ {
return success(yxryService.statistics()); return success(yxryService.statistics(yxry));
} }
/** /**
......
package com.ruoyi.system.domain; package com.ruoyi.system.domain;
import java.time.LocalDate;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
import org.springframework.data.annotation.Transient;
/** /**
* 阳性人员对象 yxry * 阳性人员对象 yxry
...@@ -148,6 +150,17 @@ public class Yxry extends BaseEntity ...@@ -148,6 +150,17 @@ public class Yxry extends BaseEntity
/** 身份证是否重复 */ /** 身份证是否重复 */
private String isCf; private String isCf;
@Transient
private String begin;
@Transient
private String end;
@Transient
private String value;
@Transient
private LocalDate date;
/** 采样时间 */ /** 采样时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
...@@ -306,6 +319,14 @@ public class Yxry extends BaseEntity ...@@ -306,6 +319,14 @@ public class Yxry extends BaseEntity
this.committee = committee; this.committee = committee;
} }
public LocalDate getDate() {
return date;
}
public void setDate(LocalDate date) {
this.date = date;
}
public String getFcName() { public String getFcName() {
return fcName; return fcName;
} }
...@@ -338,6 +359,30 @@ public class Yxry extends BaseEntity ...@@ -338,6 +359,30 @@ public class Yxry extends BaseEntity
this.cyTime = cyTime; this.cyTime = cyTime;
} }
public String getBegin() {
return begin;
}
public void setBegin(String begin) {
this.begin = begin;
}
public String getEnd() {
return end;
}
public void setEnd(String end) {
this.end = end;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
...@@ -4,6 +4,7 @@ import java.time.LocalDate; ...@@ -4,6 +4,7 @@ import java.time.LocalDate;
import java.util.List; import java.util.List;
import com.ruoyi.system.domain.Fcry; import com.ruoyi.system.domain.Fcry;
import com.ruoyi.system.domain.Gldry; import com.ruoyi.system.domain.Gldry;
import com.ruoyi.system.domain.Yxry;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
/** /**
...@@ -70,9 +71,9 @@ public interface FcryMapper ...@@ -70,9 +71,9 @@ public interface FcryMapper
List<Gldry> selectGldryByCard(@Param("cardNo")String cardNo, @Param("id")Long id); List<Gldry> selectGldryByCard(@Param("cardNo")String cardNo, @Param("id")Long id);
int selectToday(@Param("date") LocalDate date); int selectToday(Yxry yxry);
int selectCurrent(); int selectCurrent(Yxry yxry);
List<Fcry> selectAll(); List<Fcry> selectAll();
......
...@@ -3,6 +3,7 @@ package com.ruoyi.system.mapper; ...@@ -3,6 +3,7 @@ package com.ruoyi.system.mapper;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.List; import java.util.List;
import com.ruoyi.system.domain.Fkqk; import com.ruoyi.system.domain.Fkqk;
import com.ruoyi.system.domain.Yxry;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
/** /**
...@@ -71,19 +72,18 @@ public interface FkqkMapper ...@@ -71,19 +72,18 @@ public interface FkqkMapper
/** /**
* 查询小区封控情况列表 * 查询小区封控情况列表
* *
* @param today 当天日期
* @return 小区封控情况集合 * @return 小区封控情况集合
*/ */
public List<Fkqk> selectFkToday(@Param("today") LocalDate today); public List<Fkqk> selectFkToday(Yxry yxry);
/** /**
* 查询小区封控情况列表 * 查询小区封控情况列表
* *
* @return 小区封控情况集合 * @return 小区封控情况集合
*/ */
public List<Fkqk> selectCurrent(); public List<Fkqk> selectCurrent(Yxry yxry);
// 根据小区分组 // 根据小区分组
List<Fkqk> selectCumulativeData(); List<Fkqk> selectCumulativeData(Yxry yxry);
} }
...@@ -3,6 +3,7 @@ package com.ruoyi.system.mapper; ...@@ -3,6 +3,7 @@ package com.ruoyi.system.mapper;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.List; import java.util.List;
import com.ruoyi.system.domain.Gldry; import com.ruoyi.system.domain.Gldry;
import com.ruoyi.system.domain.Yxry;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
/** /**
...@@ -69,9 +70,9 @@ public interface GldryMapper ...@@ -69,9 +70,9 @@ public interface GldryMapper
*/ */
List<Gldry> selectGldryByCard(@Param("cardNo") String cardNo, @Param("id") Long id); List<Gldry> selectGldryByCard(@Param("cardNo") String cardNo, @Param("id") Long id);
int selectToday(@Param("date") LocalDate date); int selectToday(Yxry yxry);
int selectCurrent(); int selectCurrent(Yxry yxry);
List<Gldry> selectAll(); List<Gldry> selectAll();
......
...@@ -2,6 +2,7 @@ package com.ruoyi.system.mapper; ...@@ -2,6 +2,7 @@ package com.ruoyi.system.mapper;
import java.util.List; import java.util.List;
import com.ruoyi.system.domain.Hscj; import com.ruoyi.system.domain.Hscj;
import com.ruoyi.system.domain.Yxry;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
/** /**
...@@ -62,7 +63,7 @@ public interface HscjMapper ...@@ -62,7 +63,7 @@ public interface HscjMapper
List<Hscj> checkCard(Hscj hscj); List<Hscj> checkCard(Hscj hscj);
List<Hscj> selectToday(@Param("begin") String begin, @Param("end") String end); List<Hscj> selectToday( Yxry yxry);
List<Hscj> checkCardBatch(List<Hscj> hscjList); List<Hscj> checkCardBatch(List<Hscj> hscjList);
......
...@@ -6,14 +6,14 @@ import com.ruoyi.common.core.domain.entity.SysUser; ...@@ -6,14 +6,14 @@ import com.ruoyi.common.core.domain.entity.SysUser;
/** /**
* 用户表 数据层 * 用户表 数据层
* *
* @author ruoyi * @author ruoyi
*/ */
public interface SysUserMapper public interface SysUserMapper
{ {
/** /**
* 根据条件分页查询用户列表 * 根据条件分页查询用户列表
* *
* @param sysUser 用户信息 * @param sysUser 用户信息
* @return 用户信息集合信息 * @return 用户信息集合信息
*/ */
...@@ -21,7 +21,7 @@ public interface SysUserMapper ...@@ -21,7 +21,7 @@ public interface SysUserMapper
/** /**
* 根据条件分页查询已配用户角色列表 * 根据条件分页查询已配用户角色列表
* *
* @param user 用户信息 * @param user 用户信息
* @return 用户信息集合信息 * @return 用户信息集合信息
*/ */
...@@ -29,7 +29,7 @@ public interface SysUserMapper ...@@ -29,7 +29,7 @@ public interface SysUserMapper
/** /**
* 根据条件分页查询未分配用户角色列表 * 根据条件分页查询未分配用户角色列表
* *
* @param user 用户信息 * @param user 用户信息
* @return 用户信息集合信息 * @return 用户信息集合信息
*/ */
...@@ -37,7 +37,7 @@ public interface SysUserMapper ...@@ -37,7 +37,7 @@ public interface SysUserMapper
/** /**
* 通过用户名查询用户 * 通过用户名查询用户
* *
* @param userName 用户名 * @param userName 用户名
* @return 用户对象信息 * @return 用户对象信息
*/ */
...@@ -45,7 +45,7 @@ public interface SysUserMapper ...@@ -45,7 +45,7 @@ public interface SysUserMapper
/** /**
* 通过用户ID查询用户 * 通过用户ID查询用户
* *
* @param userId 用户ID * @param userId 用户ID
* @return 用户对象信息 * @return 用户对象信息
*/ */
...@@ -53,7 +53,7 @@ public interface SysUserMapper ...@@ -53,7 +53,7 @@ public interface SysUserMapper
/** /**
* 新增用户信息 * 新增用户信息
* *
* @param user 用户信息 * @param user 用户信息
* @return 结果 * @return 结果
*/ */
...@@ -61,7 +61,7 @@ public interface SysUserMapper ...@@ -61,7 +61,7 @@ public interface SysUserMapper
/** /**
* 修改用户信息 * 修改用户信息
* *
* @param user 用户信息 * @param user 用户信息
* @return 结果 * @return 结果
*/ */
...@@ -69,7 +69,7 @@ public interface SysUserMapper ...@@ -69,7 +69,7 @@ public interface SysUserMapper
/** /**
* 修改用户头像 * 修改用户头像
* *
* @param userName 用户名 * @param userName 用户名
* @param avatar 头像地址 * @param avatar 头像地址
* @return 结果 * @return 结果
...@@ -78,7 +78,7 @@ public interface SysUserMapper ...@@ -78,7 +78,7 @@ public interface SysUserMapper
/** /**
* 重置用户密码 * 重置用户密码
* *
* @param userName 用户名 * @param userName 用户名
* @param password 密码 * @param password 密码
* @return 结果 * @return 结果
...@@ -87,7 +87,7 @@ public interface SysUserMapper ...@@ -87,7 +87,7 @@ public interface SysUserMapper
/** /**
* 通过用户ID删除用户 * 通过用户ID删除用户
* *
* @param userId 用户ID * @param userId 用户ID
* @return 结果 * @return 结果
*/ */
...@@ -95,7 +95,7 @@ public interface SysUserMapper ...@@ -95,7 +95,7 @@ public interface SysUserMapper
/** /**
* 批量删除用户信息 * 批量删除用户信息
* *
* @param userIds 需要删除的用户ID * @param userIds 需要删除的用户ID
* @return 结果 * @return 结果
*/ */
...@@ -103,7 +103,7 @@ public interface SysUserMapper ...@@ -103,7 +103,7 @@ public interface SysUserMapper
/** /**
* 校验用户名称是否唯一 * 校验用户名称是否唯一
* *
* @param userName 用户名称 * @param userName 用户名称
* @return 结果 * @return 结果
*/ */
...@@ -126,4 +126,6 @@ public interface SysUserMapper ...@@ -126,4 +126,6 @@ public interface SysUserMapper
public SysUser checkEmailUnique(String email); public SysUser checkEmailUnique(String email);
public String selectUserTypeById(Long id); public String selectUserTypeById(Long id);
public String selectTypeById(Long id);
} }
...@@ -67,9 +67,9 @@ public interface YxryMapper ...@@ -67,9 +67,9 @@ public interface YxryMapper
int updateBatchYxry(@Param("list")List<Yxry> list); int updateBatchYxry(@Param("list")List<Yxry> list);
List<Yxry> statistics(@Param("begin") String begin,@Param("end") String end); List<Yxry> statistics(Yxry yxry);
int selectNum(); int selectNum(Yxry userType);
int updateBatch(@Param("list")List<Yxry> list); int updateBatch(@Param("list")List<Yxry> list);
} }
...@@ -68,5 +68,5 @@ public interface IYxryService ...@@ -68,5 +68,5 @@ public interface IYxryService
Map selectByCard(String card); Map selectByCard(String card);
Map statistics(); Map statistics(Yxry yxry);
} }
...@@ -18,6 +18,7 @@ import com.ruoyi.system.mapper.FcryMapper; ...@@ -18,6 +18,7 @@ import com.ruoyi.system.mapper.FcryMapper;
import com.ruoyi.system.mapper.FkqkMapper; import com.ruoyi.system.mapper.FkqkMapper;
import com.ruoyi.system.mapper.GldryMapper; import com.ruoyi.system.mapper.GldryMapper;
import com.ruoyi.system.mapper.HscjMapper; import com.ruoyi.system.mapper.HscjMapper;
import com.ruoyi.system.mapper.SysUserMapper;
import io.netty.util.internal.ObjectUtil; import io.netty.util.internal.ObjectUtil;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.math3.stat.descriptive.summary.Product; import org.apache.commons.math3.stat.descriptive.summary.Product;
...@@ -41,6 +42,9 @@ public class YxryServiceImpl implements IYxryService { ...@@ -41,6 +42,9 @@ public class YxryServiceImpl implements IYxryService {
@Autowired @Autowired
private FcryMapper fcryMapper; private FcryMapper fcryMapper;
@Autowired
private SysUserMapper sysUserMapper;
@Autowired @Autowired
private YxryMapper yxryMapper; private YxryMapper yxryMapper;
...@@ -298,7 +302,8 @@ public class YxryServiceImpl implements IYxryService { ...@@ -298,7 +302,8 @@ public class YxryServiceImpl implements IYxryService {
} }
@Override @Override
public Map statistics() { @DataScope(deptAlias = "d", userAlias = "u")
public Map statistics(Yxry yxry) {
Map map = new HashMap(); Map map = new HashMap();
List<Object> todayData = new ArrayList<>(); List<Object> todayData = new ArrayList<>();
Map today = new HashMap(); Map today = new HashMap();
...@@ -306,65 +311,99 @@ public class YxryServiceImpl implements IYxryService { ...@@ -306,65 +311,99 @@ public class YxryServiceImpl implements IYxryService {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String begin = sdf.format(TimeUtils.getStartTime()); String begin = sdf.format(TimeUtils.getStartTime());
String end = sdf.format(TimeUtils.getEndTime()); String end = sdf.format(TimeUtils.getEndTime());
List<Yxry> yxryList = yxryMapper.statistics(begin, end); // 按照权限查询
String type = sysUserMapper.selectTypeById(SecurityUtils.getUserId());
String userType = sysUserMapper.selectUserTypeById(SecurityUtils.getUserId());
yxry.setBegin(begin);
yxry.setEnd(end);
yxry.setUserType(userType);
if (userType != null && userType.equals("00"))
yxry.setUserType("1");
if ("2".equals(userType))
yxry.setValue(DataUtils.getKey(null, String.valueOf(SecurityUtils.getUserId()), null, null, null));
else if ("3".equals(userType))
yxry.setValue(DataUtils.getKey(null, null, String.valueOf(SecurityUtils.getUserId()), null, null));
List<Yxry> yxryList = yxryMapper.statistics(yxry);
today.put("positiveNum", yxryList.size()); today.put("positiveNum", yxryList.size());
// 涉及小区数量 // 涉及小区数量
today.put("PositiveAreaNum", yxryList.stream().filter(y -> ObjectUtils.isNotEmpty(y.getCommunity())) today.put("PositiveAreaNum", yxryList.stream().filter(y -> y.getCommunity() != null)
.distinct().map(Yxry::getCommunity).collect(Collectors.toList()).size()); .map(Yxry::getCommunity).distinct().collect(Collectors.toList()).size());
// 涉及单元数量 // 涉及单元数量
Map<String, List<Yxry>> prodMap = yxryList.stream().filter(y -> ObjectUtils.isNotEmpty(y.getCommunity()) Map<String, List<Yxry>> prodMap = yxryList.stream().filter(y -> StringUtils.isNotEmpty(y.getCommunity())
&& ObjectUtils.isNotEmpty(y.getBuilding()) && ObjectUtils.isNotEmpty(y.getUnit())) && StringUtils.isNotEmpty(y.getBuilding()) && StringUtils.isNotEmpty(y.getUnit()))
.collect(Collectors.groupingBy(item -> item.getCommunity() + "_" + item.getBuilding() + "_" + item.getUnit())); .collect(Collectors.groupingBy(item -> item.getCommunity() + "_" + item.getBuilding() + "_" + item.getUnit()));
today.put("unitBuildingInvolvedNum", prodMap.keySet().size()); today.put("unitBuildingInvolvedNum", prodMap.keySet().size());
// 查询当天采集异常数据(身份证不为空) // 查询当天采集异常数据(身份证不为空)
List<Hscj> hscjList = hscjMapper.selectToday(begin, end); List<Hscj> hscjList = hscjMapper.selectToday(yxry);
today.put("abnormalMixingNum", hscjList.stream().filter(cj -> ObjectUtils.isNotEmpty(cj.getCjgh())).distinct() today.put("abnormalMixingNum", hscjList.stream().filter(cj -> StringUtils.isNotEmpty(cj.getCjgh()))
.map(Hscj::getCjgh).collect(Collectors.toList()).size()); .map(Hscj::getCjgh).distinct().collect(Collectors.toList()).size());
today.put("abnormalMixingOfPipesNum", hscjList.stream().distinct().map(Hscj::getCardNo).collect(Collectors.toList()).size()); today.put("abnormalMixingOfPipesNum", hscjList.stream().map(Hscj::getCardNo).distinct().collect(Collectors.toList()).size());
// 查询封控数据 // 查询封控数据
LocalDate date = LocalDate.now(); yxry.setDate(LocalDate.now());
List<Fkqk> fkqkList = fkqkMapper.selectFkToday(date); List<Fkqk> fkqkList = fkqkMapper.selectFkToday(yxry);
// 获取真实时间是空的 // 获取真实时间是空的
today.put("cellBlockingControlNum", fkqkList.stream().filter(f -> ObjectUtils.isEmpty(f.getRealTime()) today.put("cellBlockingControlNum", fkqkList.stream().filter(f -> ObjectUtils.isEmpty(f.getRealTime())
&& ObjectUtils.isNotEmpty(f.getCommunity())) && StringUtils.isNotEmpty(f.getCommunity()))
.distinct().map(Fkqk::getCommunity).collect(Collectors.toList()).size()); .map(Fkqk::getCommunity).distinct().collect(Collectors.toList()).size());
Map<String, List<Fkqk>> fkMap = fkqkList.stream().filter(f -> ObjectUtils.isEmpty(f.getRealTime()) Map<String, List<Fkqk>> fkMap = fkqkList.stream().filter(f -> ObjectUtils.isEmpty(f.getRealTime())
&& ObjectUtils.isNotEmpty(f.getFloor()) && ObjectUtils.isNotEmpty(f.getUnit())) && StringUtils.isNotEmpty(f.getFloor()) && StringUtils.isNotEmpty(f.getUnit()))
.collect(Collectors.groupingBy(item -> item.getCommunity() + "_" + item.getFloor() + "_" + item.getUnit())); .collect(Collectors.groupingBy(item -> item.getCommunity() + "_" + item.getFloor() + "_" + item.getUnit()));
today.put("unitSealingControlNum", fkMap.keySet().size()); today.put("unitSealingControlNum", fkMap.keySet().size());
Map<String, List<Fkqk>> jfMap = fkqkList.stream().filter(f -> ObjectUtils.isNotEmpty(f.getRealTime()) Map<String, List<Fkqk>> jfMap = fkqkList.stream().filter(f -> ObjectUtils.isNotEmpty(f.getRealTime())
&& ObjectUtils.isNotEmpty(f.getFloor()) && ObjectUtils.isNotEmpty(f.getUnit())) && StringUtils.isNotEmpty(f.getFloor()) && StringUtils.isNotEmpty(f.getUnit()))
.collect(Collectors.groupingBy(item -> item.getCommunity() + "_" + item.getFloor() + "_" + item.getUnit())); .collect(Collectors.groupingBy(item -> item.getCommunity() + "_" + item.getFloor() + "_" + item.getUnit()));
today.put("unpackingUnitNum", jfMap.keySet().size()); today.put("unpackingUnitNum", jfMap.keySet().size());
today.put("transferToShelterNum", fcryMapper.selectToday(date)); Yxry y = new Yxry();
today.put("transferToIsolationPointNum", gldryMapper.selectToday(date)); y.setUserType(null);
y.setParams(yxry.getParams());
y.setDate(yxry.getDate());
if (StringUtils.isNotEmpty(type) && type.equals("0")) {
yxry.setUserType(type);
today.put("transferToShelterNum", fcryMapper.selectToday(yxry) + "/" + fcryMapper.selectToday(y));
} else
today.put("transferToShelterNum", fcryMapper.selectToday(yxry));
if (StringUtils.isNotEmpty(type) && type.equals("1")) {
yxry.setUserType(type);
today.put("transferToIsolationPointNum", gldryMapper.selectToday(yxry) + "/" + gldryMapper.selectToday(y));
} else
today.put("transferToIsolationPointNum", gldryMapper.selectToday(yxry));
todayData.add(today); todayData.add(today);
map.put("todayData", todayData); map.put("todayData", todayData);
List<Object> currentData = new ArrayList<>(); List<Object> currentData = new ArrayList<>();
Map curr = new HashMap(); Map curr = new HashMap();
curr.put("isolationPointNum", gldryMapper.selectCurrent()); if (StringUtils.isNotEmpty(type) && type.equals("1")) {
curr.put("sheltersNum", fcryMapper.selectCurrent()); yxry.setUserType(type);
List<Fkqk> fkqks = fkqkMapper.selectCurrent(); curr.put("isolationPointNum", gldryMapper.selectCurrent(yxry) + "/" + gldryMapper.selectCurrent(y));
List<String> j = fkqks.stream().distinct().map(Fkqk::getCommunity) } else
.collect(Collectors.toList()); curr.put("isolationPointNum", gldryMapper.selectCurrent(yxry));
System.out.println(j.size()); if (StringUtils.isNotEmpty(type) && type.equals("0")) {
curr.put("BlockedControlCellNum", fkqks.stream().distinct().map(Fkqk::getCommunity).collect(Collectors.toList()).size()); yxry.setUserType(type);
curr.put("sheltersNum", fcryMapper.selectCurrent(yxry) + "/" + fcryMapper.selectCurrent(y));
} else
curr.put("sheltersNum", fcryMapper.selectCurrent(yxry));
yxry.setUserType(userType);
if (userType != null && userType.equals("00"))
yxry.setUserType("1");
List<Fkqk> fkqks = fkqkMapper.selectCurrent(yxry);
curr.put("BlockedControlCellNum", fkqks.stream().map(Fkqk::getCommunity).distinct().collect(Collectors.toList()).size());
Map<String, List<Fkqk>> fk = fkqks.stream() Map<String, List<Fkqk>> fk = fkqks.stream()
.collect(Collectors.groupingBy(item -> item.getCommunity() + "_" + item.getFloor() + "_" + item.getUnit())); .collect(Collectors.groupingBy(item -> item.getCommunity() + "_" + item.getFloor() + "_" + item.getUnit()));
curr.put("sealingControlUnitNum", fk.keySet().size()); curr.put("sealingControlUnitNum", fk.keySet().size());
List<Yxry> yxries = yxryMapper.statistics(null, null); yxry.setBegin(null);
yxry.setEnd(null);
List<Yxry> yxries = yxryMapper.statistics(yxry);
curr.put("positivePersonnelNum", yxries.size()); curr.put("positivePersonnelNum", yxries.size());
currentData.add(curr); currentData.add(curr);
map.put("currentData", currentData); map.put("currentData", currentData);
List<Object> CumulativeData = new ArrayList<>(); List<Object> CumulativeData = new ArrayList<>();
Map cum = new HashMap(); Map cum = new HashMap();
cum.put("CumulativePositivePerNum", yxryMapper.selectNum()); cum.put("CumulativePositivePerNum", yxryMapper.selectNum(yxry));
List<Fkqk> fks = fkqkMapper.selectCumulativeData(); List<Fkqk> fks = fkqkMapper.selectCumulativeData(yxry);
cum.put("CumulativeSealingControlUnitNum", fks.size()); cum.put("CumulativeSealingControlUnitNum", fks.size());
cum.put("CumulativeBlockedControlCellNum", fks.stream().distinct().map(Fkqk::getCommunity) cum.put("CumulativeBlockedControlCellNum",fks.stream().map(Fkqk::getCommunity).distinct()
.collect(Collectors.toList()).size()); .collect(Collectors.toList()).size());
cum.put("CumulativeUnpackingUnitNum", fks.stream().filter(f -> f.getRealTime()!=null) cum.put("CumulativeUnpackingUnitNum", fks.stream().filter(f -> f.getRealTime() != null)
.distinct().map(Fkqk::getCommunity) .map(Fkqk::getCommunity).distinct()
.collect(Collectors.toList()).size()); .collect(Collectors.toList()).size());
CumulativeData.add(cum); CumulativeData.add(cum);
map.put("CumulativeData", CumulativeData); map.put("CumulativeData", CumulativeData);
......
...@@ -149,18 +149,28 @@ ...@@ -149,18 +149,28 @@
<if test="id != null">and id != #{id}</if> <if test="id != null">and id != #{id}</if>
</select> </select>
<select id="selectToday" resultType="java.lang.Integer"> <select id="selectToday" resultType="java.lang.Integer">
select count(DISTINCT card_no) select count(DISTINCT f.card_no)
from fcry from fcry f
where zr_time = #{date} left join sys_user u on u.user_id = f.create_by
and del_flag = '0' left join sys_dept d on u.dept_id = d.dept_id
and card_no is not null where f.zr_time = #{date}
and f.del_flag = '0'
and f.card_no is not null
<if test="userType != null and userType == '0'.toString()">${params.dataScope}</if>
<if test="userType != null and userType == '2'.toString()">and f.street = #{value}</if>
<if test="userType != null and userType == '3'.toString()">and f.committee = #{value}</if>
</select> </select>
<select id="selectCurrent" resultType="java.lang.Integer"> <select id="selectCurrent" resultType="java.lang.Integer">
select count(DISTINCT card_no) select count(DISTINCT f.card_no)
from fcry from fcry f
where zc_time is null left join sys_user u on u.user_id = f.create_by
and del_flag = '0' left join sys_dept d on u.dept_id = d.dept_id
and card_no is not null where f.zc_time is null
and f.del_flag = '0'
and f.card_no is not null
<if test="userType != null and userType == '0'.toString()">${params.dataScope}</if>
<if test="userType != null and userType == '2'.toString()">and f.street = #{value}</if>
<if test="userType != null and userType == '3'.toString()">and f.committee = #{value}</if>
</select> </select>
<insert id="insertFcry" parameterType="Fcry" useGeneratedKeys="true" keyProperty="id"> <insert id="insertFcry" parameterType="Fcry" useGeneratedKeys="true" keyProperty="id">
......
...@@ -73,24 +73,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -73,24 +73,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE dict_type = 'shelter_name' AND status = '0' WHERE dict_type = 'shelter_name' AND status = '0'
</select> </select>
<select id="selectFkToday" resultMap="FkqkResult"> <select id="selectFkToday" resultMap="FkqkResult">
select community, floor, unit, fk_time, real_time select f.community, f.floor, f.unit, f.fk_time, f.real_time
from fkqk from fkqk f
where del_flag = '0' and (fk_time = #{today} left join sys_user u on u.user_id = f.create_by
or real_time = #{today} ) left join sys_dept d on u.dept_id = d.dept_id
where f.del_flag = '0' and (f.fk_time = #{date}
or f.real_time = #{date} )
<if test="userType != null and userType != '1'.toString() ">${params.dataScope}</if>
</select> </select>
<select id="selectCurrent" resultMap="FkqkResult"> <select id="selectCurrent" resultMap="FkqkResult">
select community, floor, unit, fk_time, real_time select k.community, k.floor, k.unit, k.fk_time, k.real_time
from fkqk from fkqk k
where del_flag = '0' left join sys_user u on u.user_id = k.create_by
and real_time is null left join sys_dept d on u.dept_id = d.dept_id
and community is not null where k.del_flag = '0'
and k.real_time is null
and k.community is not null
<if test="userType != null and userType != '1'.toString() ">${params.dataScope}</if>
</select> </select>
<select id="selectCumulativeData" resultMap="FkqkResult"> <select id="selectCumulativeData" resultMap="FkqkResult">
<include refid="selectFkqkVo"/> select k.community,k.floor, k.unit, k.fk_time, k.real_time from fkqk k
where del_flag = '0' left join sys_user u on u.user_id = k.create_by
and community is not null left join sys_dept d on u.dept_id = d.dept_id
and floor is not null where k.del_flag = '0'
and unit is not null and k.community is not null
and k.floor is not null
and k.unit is not null
<if test="userType != null and userType != '1'.toString() ">${params.dataScope}</if>
group by community,floor, unit group by community,floor, unit
</select> </select>
<insert id="insertFkqk" parameterType="Fkqk" useGeneratedKeys="true" keyProperty="id"> <insert id="insertFkqk" parameterType="Fkqk" useGeneratedKeys="true" keyProperty="id">
......
...@@ -82,19 +82,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -82,19 +82,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="id != null">and id != #{id}</if> <if test="id != null">and id != #{id}</if>
</select> </select>
<select id="selectToday" resultType="java.lang.Integer"> <select id="selectToday" resultType="java.lang.Integer">
select count(DISTINCT card_no) select count(DISTINCT g.card_no)
from gldry from gldry g
where zr_time = #{date} left join sys_user u on u.user_id = g.create_by
and del_flag = '0' left join sys_dept d on u.dept_id = d.dept_id
and card_no is not null where g.zr_time = #{date}
and g.del_flag = '0'
and g.card_no is not null
<if test="userType != null and userType == '1'.toString()">${params.dataScope}</if>
<if test="userType != null and userType == '2'.toString()">and g.street = #{value}</if>
<if test="userType != null and userType == '3'.toString()">and g.committee = #{value}</if>
</select> </select>
<select id="selectCurrent" resultType="java.lang.Integer"> <select id="selectCurrent" resultType="java.lang.Integer">
select count(DISTINCT card_no) select count(DISTINCT g.card_no)
from gldry from gldry g
where zc_time is null left join sys_user u on u.user_id = g.create_by
and del_flag = '0' left join sys_dept d on u.dept_id = d.dept_id
and card_no is not null where g.zc_time is null
and g.del_flag = '0'
and g.card_no is not null
<if test="userType != null and userType == '1'.toString()">${params.dataScope}</if>
<if test="userType != null and userType == '2'.toString()">and g.street = #{value}</if>
<if test="userType != null and userType == '3'.toString()">and g.committee = #{value}</if>
</select> </select>
<insert id="insertGldry" parameterType="Gldry" useGeneratedKeys="true" keyProperty="id"> <insert id="insertGldry" parameterType="Gldry" useGeneratedKeys="true" keyProperty="id">
......
...@@ -133,13 +133,16 @@ ...@@ -133,13 +133,16 @@
</select> </select>
<select id="selectToday" resultType="com.ruoyi.system.domain.Hscj"> <select id="selectToday" resultType="com.ruoyi.system.domain.Hscj">
select card_no, cjgh select j.card_no, j.cjgh
from hscj from hscj j
where cj_result = '0' left join sys_user u on u.user_id = j.create_by
and del_flag = '0' left join sys_dept d on u.dept_id = d.dept_id
and is_hun = '1' where j.cj_result = '0'
and cj_time BETWEEN #{begin} and #{end} and j.del_flag = '0'
and card_no is not null and j.is_hun = '1'
and j.cj_time BETWEEN #{begin} and #{end}
and j.card_no is not null
<if test="userType != null and userType != '1'.toString() ">${params.dataScope}</if>
</select> </select>
......
...@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" /> <association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" />
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> <collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
</resultMap> </resultMap>
<resultMap id="deptResult" type="SysDept"> <resultMap id="deptResult" type="SysDept">
<id property="deptId" column="dept_id" /> <id property="deptId" column="dept_id" />
<result property="parentId" column="parent_id" /> <result property="parentId" column="parent_id" />
...@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="leader" column="leader" /> <result property="leader" column="leader" />
<result property="status" column="dept_status" /> <result property="status" column="dept_status" />
</resultMap> </resultMap>
<resultMap id="RoleResult" type="SysRole"> <resultMap id="RoleResult" type="SysRole">
<id property="roleId" column="role_id" /> <id property="roleId" column="role_id" />
<result property="roleName" column="role_name" /> <result property="roleName" column="role_name" />
...@@ -45,9 +45,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -45,9 +45,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="dataScope" column="data_scope" /> <result property="dataScope" column="data_scope" />
<result property="status" column="role_status" /> <result property="status" column="role_status" />
</resultMap> </resultMap>
<sql id="selectUserVo"> <sql id="selectUserVo">
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
from sys_user u from sys_user u
...@@ -55,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -55,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join sys_user_role ur on u.user_id = ur.user_id left join sys_user_role ur on u.user_id = ur.user_id
left join sys_role r on r.role_id = ur.role_id left join sys_role r on r.role_id = ur.role_id
</sql> </sql>
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult"> <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
left join sys_dept d on u.dept_id = d.dept_id left join sys_dept d on u.dept_id = d.dept_id
...@@ -84,7 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -84,7 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}
</select> </select>
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult"> <select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
from sys_user u from sys_user u
...@@ -101,7 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -101,7 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}
</select> </select>
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult"> <select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
from sys_user u from sys_user u
...@@ -119,25 +119,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -119,25 +119,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}
</select> </select>
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult"> <select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
<include refid="selectUserVo"/> <include refid="selectUserVo"/>
where u.user_name = #{userName} and u.del_flag = '0' where u.user_name = #{userName} and u.del_flag = '0'
</select> </select>
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult"> <select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
<include refid="selectUserVo"/> <include refid="selectUserVo"/>
where u.user_id = #{userId} where u.user_id = #{userId}
</select> </select>
<select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult"> <select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult">
select user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0' limit 1 select user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0' limit 1
</select> </select>
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult"> <select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1 select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1
</select> </select>
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult"> <select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1 select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1
</select> </select>
...@@ -145,7 +145,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -145,7 +145,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectUserTypeById" parameterType="Long" resultType="java.lang.String"> <select id="selectUserTypeById" parameterType="Long" resultType="java.lang.String">
select user_type from sys_user where user_id = #{id} select user_type from sys_user where user_id = #{id}
</select> </select>
<select id="selectTypeById" parameterType="Long" resultType="java.lang.String">
select type from sys_user where user_id = #{id}
</select>
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId"> <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
insert into sys_user( insert into sys_user(
<if test="userId != null and userId != 0">user_id,</if> <if test="userId != null and userId != 0">user_id,</if>
...@@ -177,7 +181,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -177,7 +181,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sysdate() sysdate()
) )
</insert> </insert>
<update id="updateUser" parameterType="SysUser"> <update id="updateUser" parameterType="SysUser">
update sys_user update sys_user
<set> <set>
...@@ -198,28 +202,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -198,28 +202,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</set> </set>
where user_id = #{userId} where user_id = #{userId}
</update> </update>
<update id="updateUserStatus" parameterType="SysUser"> <update id="updateUserStatus" parameterType="SysUser">
update sys_user set status = #{status} where user_id = #{userId} update sys_user set status = #{status} where user_id = #{userId}
</update> </update>
<update id="updateUserAvatar" parameterType="SysUser"> <update id="updateUserAvatar" parameterType="SysUser">
update sys_user set avatar = #{avatar} where user_name = #{userName} update sys_user set avatar = #{avatar} where user_name = #{userName}
</update> </update>
<update id="resetUserPwd" parameterType="SysUser"> <update id="resetUserPwd" parameterType="SysUser">
update sys_user set password = #{password} where user_name = #{userName} update sys_user set password = #{password} where user_name = #{userName}
</update> </update>
<delete id="deleteUserById" parameterType="Long"> <delete id="deleteUserById" parameterType="Long">
update sys_user set del_flag = '2' where user_id = #{userId} update sys_user set del_flag = '2' where user_id = #{userId}
</delete> </delete>
<delete id="deleteUserByIds" parameterType="Long"> <delete id="deleteUserByIds" parameterType="Long">
update sys_user set del_flag = '2' where user_id in update sys_user set del_flag = '2' where user_id in
<foreach collection="array" item="userId" open="(" separator="," close=")"> <foreach collection="array" item="userId" open="(" separator="," close=")">
#{userId} #{userId}
</foreach> </foreach>
</delete> </delete>
</mapper> </mapper>
\ No newline at end of file
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
<if test="street != null and street != ''">and a.street = #{street}</if> <if test="street != null and street != ''">and a.street = #{street}</if>
<if test="isolationStatus != null and isolationStatus != ''">and a.isolation_status = #{isolationStatus}</if> <if test="isolationStatus != null and isolationStatus != ''">and a.isolation_status = #{isolationStatus}</if>
<if test="isControl != null and isControl != ''">and a.is_control = #{isControl}</if> <if test="isControl != null and isControl != ''">and a.is_control = #{isControl}</if>
<if test="community != null and community != ''">and a.community = #{community}</if> <if test="community != null and community != ''">and a.community = #{community}</if>
<if test="unit != null and unit != ''">and a.unit like concat('%', #{unit}, '%')</if> <if test="unit != null and unit != ''">and a.unit like concat('%', #{unit}, '%')</if>
<if test="house != null and house != ''">and a.house like concat('%', #{house}, '%')</if> <if test="house != null and house != ''">and a.house like concat('%', #{house}, '%')</if>
<if test="building != null and building != ''">and a.building like concat('%', #{building}, '%')</if> <if test="building != null and building != ''">and a.building like concat('%', #{building}, '%')</if>
...@@ -140,18 +140,26 @@ ...@@ -140,18 +140,26 @@
y.unit y.unit
FROM yxry y FROM yxry y
LEFT JOIN jcglry j ON y.card_no = j.card_no and j.del_flag = '0' LEFT JOIN jcglry j ON y.card_no = j.card_no and j.del_flag = '0'
left join sys_user u on u.user_id = y.create_by
left join sys_dept d on u.dept_id = d.dept_id
WHERE y.del_flag = '0' WHERE y.del_flag = '0'
<if test="begin!=null and end!=null"> <if test="begin!=null and end!=null">
AND y.sb_date BETWEEN #{begin} and #{end} AND y.sb_date BETWEEN #{begin} and #{end}
</if> </if>
AND y.card_no IS NOT NULL AND y.card_no IS NOT NULL
and y.street is not null
AND (j.card_no IS NULL OR y.sb_date > j.jc_time) AND (j.card_no IS NULL OR y.sb_date > j.jc_time)
<if test="userType != null and userType != '1'.toString() ">${params.dataScope}</if>
GROUP BY y.card_no GROUP BY y.card_no
</select> </select>
<select id="selectNum" resultType="java.lang.Integer"> <select id="selectNum" resultType="java.lang.Integer">
select count(DISTINCT card_no) from yxry select count(DISTINCT y.card_no)
where del_flag='0' from yxry y
and card_no is not null left join sys_user u on u.user_id = y.create_by
left join sys_dept d on u.dept_id = d.dept_id
where y.del_flag = '0'
and y.card_no is not null
<if test="userType != null and userType != '1'.toString() ">${params.dataScope}</if>
</select> </select>
<insert id="insertYxry" parameterType="Yxry" useGeneratedKeys="true" keyProperty="id"> <insert id="insertYxry" parameterType="Yxry" useGeneratedKeys="true" keyProperty="id">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment