Browse Source

统计

mine
袁强 5 months ago
parent
commit
38fcbbb6b9
  1. 2
      ArcFace64.dat
  2. 32
      yq-admin/src/main/java/yq/web/controller/mine/MineHealthController.java
  3. 28
      yq-admin/src/main/java/yq/web/controller/mine/MineWarningController.java
  4. 2
      yq-admin/src/main/java/yq/web/controller/nologin/NoLogin.java
  5. 2
      yq-admin/src/main/resources/application-druid.yml
  6. 4
      yq-admin/src/main/resources/application.yml
  7. 2
      yq-common/src/main/java/yq/common/utils/FaceEnginUtil.java
  8. 9
      yq-system/src/main/java/yq/system/domain/MineFace.java
  9. 10
      yq-system/src/main/java/yq/system/domain/MineGroup.java
  10. 18
      yq-system/src/main/java/yq/system/domain/MineHealth.java
  11. 7
      yq-system/src/main/java/yq/system/domain/MineWarning.java
  12. 10
      yq-system/src/main/java/yq/system/domain/vo/MineHealthVo.java
  13. 17
      yq-system/src/main/java/yq/system/domain/vo/StatisticVo.java
  14. 1
      yq-system/src/main/java/yq/system/mapper/MineHealthMapper.java
  15. 6
      yq-system/src/main/java/yq/system/mapper/MineWarningMapper.java
  16. 3
      yq-system/src/main/java/yq/system/service/IMineHealthService.java
  17. 13
      yq-system/src/main/java/yq/system/service/IMineWarningService.java
  18. 22
      yq-system/src/main/java/yq/system/service/impl/MineGroupServiceImpl.java
  19. 5
      yq-system/src/main/java/yq/system/service/impl/MineHealthServiceImpl.java
  20. 20
      yq-system/src/main/java/yq/system/service/impl/MineWarningServiceImpl.java
  21. 8
      yq-system/src/main/resources/mapper/system/MineFaceMapper.xml
  22. 12
      yq-system/src/main/resources/mapper/system/MineGroupMapper.xml
  23. 35
      yq-system/src/main/resources/mapper/system/MineHealthMapper.xml
  24. 56
      yq-system/src/main/resources/mapper/system/MineWarningMapper.xml

2
ArcFace64.dat

@ -1 +1 @@
EWEPEPEOGMGTELIZJUGECKIUJDBCJTCNISGPBNHLJTJUBHEWGNAKGEGAIOHJDQAJGNCFDRFZJEDMJTGHINEUBWCNHEHIIBGNFTGGCFBXEREDBXA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SEACFCCCUDTHLBCCDCREFFOBCEZIOAVFOEJDXECAJIQAQHDBLHFFDGTDVHVIIEAAVDCDQGQIEFMFVIJBHBHBRDMINDGGAJNACFVHDJTBKDLHRCDHDAZHEARIKIWDJEJAA

32
yq-admin/src/main/java/yq/web/controller/mine/MineHealthController.java

@ -7,10 +7,13 @@ import org.springframework.web.bind.annotation.*;
import yq.common.annotation.Log;
import yq.common.core.controller.BaseController;
import yq.common.core.domain.AjaxResult;
import yq.common.core.domain.entity.SysRole;
import yq.common.core.domain.model.LoginUser;
import yq.common.core.page.TableDataInfo;
import yq.common.enums.BusinessType;
import yq.common.exception.ServiceException;
import yq.common.utils.DateUtils;
import yq.common.utils.SecurityUtils;
import yq.common.utils.poi.ExcelUtil;
import yq.system.domain.MineFace;
import yq.system.domain.MineHealth;
@ -18,6 +21,7 @@ import yq.system.domain.MineWarning;
import yq.system.service.IMineFaceService;
import yq.system.service.IMineHealthService;
import yq.system.service.IMineWarningService;
import yq.system.service.ISysRoleService;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@ -38,6 +42,9 @@ public class MineHealthController extends BaseController
@Autowired
private IMineFaceService mineFaceService;
@Autowired
private ISysRoleService roleService;
/**
*/
@PreAuthorize("@ss.hasPermi('system:health:list')")
@ -45,12 +52,33 @@ public class MineHealthController extends BaseController
public TableDataInfo list(MineHealth mineHealth)
{
startPage();
LoginUser loginUser = SecurityUtils.getLoginUser();
List<SysRole> sysRoles = roleService.selectRolesByUserId(loginUser.getUserId());
if(!sysRoles.isEmpty()){
for (SysRole sysRole : sysRoles) {
if(sysRole.getRoleKey().equals("admin") || sysRole.getRoleKey().equals("mine_admin")){
mineHealth.setUserId(null);
}else {
mineHealth.setUserId(loginUser.getUserId());
}
}
}
List<MineHealth> list = mineHealthService.selectMineHealthList(mineHealth);
return getDataTable(list);
}
/**处理记录
*/
@PreAuthorize("@ss.hasPermi('system:health:list')")
@GetMapping("/warning/list")
public TableDataInfo warningList(MineHealth mineHealth)
{
startPage();
List<MineHealth> list = mineHealthService.selectMineHealthList(mineHealth);
return getDataTable(list);
}
/**
@ -88,7 +116,9 @@ public class MineHealthController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody MineHealth mineHealth)
{
// 获取当前的用户
LoginUser loginUser = SecurityUtils.getLoginUser();
mineHealth.setUserId(loginUser.getUserId());
if(ObjectUtil.isNotNull(mineHealth.getIsWork())&&mineHealth.getIsWork()==1){
MineFace mineFace=new MineFace();

28
yq-admin/src/main/java/yq/web/controller/mine/MineWarningController.java

@ -17,9 +17,10 @@ import yq.common.annotation.Log;
import yq.common.core.controller.BaseController;
import yq.common.core.domain.AjaxResult;
import yq.common.enums.BusinessType;
import yq.system.domain.MineHealth;
import yq.system.domain.MineWarning;
import yq.system.domain.vo.MineWarningVo;
import yq.system.domain.vo.StatisticVo;
import yq.system.service.IMineWarningService;
import yq.common.utils.poi.ExcelUtil;
import yq.common.core.page.TableDataInfo;
@ -59,6 +60,29 @@ public class MineWarningController extends BaseController
return getDataTable(list);
}
/**
*/
@PreAuthorize("@ss.hasPermi('system:health:list')")
@GetMapping("/unMedical//list")
public TableDataInfo unMedicalList(MineWarning mineWarning)
{
startPage();
List<MineWarning> list = mineWarningService.selectMineWarningUnMedicalList(mineWarning);
return getDataTable(list);
}
/**
*/
@PreAuthorize("@ss.hasPermi('earlywarning:druid:list')")
@GetMapping("/statistic/list")
public TableDataInfo statisticList(StatisticVo statisticVo){
List<StatisticVo> list = mineWarningService.selectMineWarningStatisticList(statisticVo);
return getDataTable(list);
}
/**

2
yq-admin/src/main/java/yq/web/controller/nologin/NoLogin.java

@ -84,7 +84,7 @@ public class NoLogin {
}
}
}
return AjaxResult.error("人员未录入!");
return AjaxResult.success("人员未录入!");
}
@PostMapping("/saveMineWarning")

2
yq-admin/src/main/resources/application-druid.yml

@ -6,7 +6,7 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://localhost:3307/mine?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://localhost:3306/mine?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: 123456
# 从库数据源

4
yq-admin/src/main/resources/application.yml

@ -87,7 +87,7 @@ spring:
# 数据库索引
database: 0
# 密码
password: 123456
password:
# 连接超时时间
timeout: 10s
lettuce:
@ -143,7 +143,7 @@ xss:
arcsoft:
appId: 7MtFQZ9S9Ue2UC7koYxJbeL5iEHhqGtp3d5SJbJ4ou92
sdkKey: 4VM5rVL8eKmmELhRi8ZoopH33GzsgPoptA94zSXyHvzz
faceEngine: E:\\arcsoft_lib\\LINUX64
faceEngine: D:\yq\arcsoft_lib\LINUX64
thread-pool-size: 10

2
yq-common/src/main/java/yq/common/utils/FaceEnginUtil.java

@ -42,7 +42,7 @@ public class FaceEnginUtil {
@Value(value = "${arcsoft.faceEngine}")
private static String faceEngineUrl = "E:\\arcsoft_lib\\LINUX64";
private static String faceEngineUrl = "D:\\yq\\arcsoft_lib\\LINUX64";
public static FaceEngine init() {

9
yq-system/src/main/java/yq/system/domain/MineFace.java

@ -57,7 +57,7 @@ public class MineFace
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date useTime;
@NotNull(message = "groupId不能为空")
@NotNull(message = "未选择分组")
@Excel(name = "分组id")
private Long groupId;
@Excel(name = "创建时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")
@ -67,4 +67,11 @@ public class MineFace
private byte[] faceByte;
@NotNull(message = "未选择部门")
private Long deptId;
/** 组名 */
@Excel(name = "部门名称")
private String deptName;
}

10
yq-system/src/main/java/yq/system/domain/MineGroup.java

@ -8,6 +8,8 @@ import org.springframework.format.annotation.DateTimeFormat;
import yq.common.annotation.Excel;
import yq.common.core.domain.BaseEntity;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
@ -24,12 +26,20 @@ public class MineGroup {
private Long id;
/** 组名 */
@NotBlank(message = "组名不能为空")
@Excel(name = "组名")
private String mineGroupName;
@Excel(name = "创建时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@NotNull(message = "未选择部门")
private Long deptId;
/** 组名 */
@Excel(name = "部门名称")
private String deptName;
}

18
yq-system/src/main/java/yq/system/domain/MineHealth.java

@ -6,6 +6,7 @@ import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import yq.common.annotation.Excel;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
@ -19,9 +20,15 @@ public class MineHealth {
private Long faceId;
@Excel(name = "体检人")
@Excel(name = "姓名")
private String faceName;
@Excel(name = "年龄")
private Long age;
/** 手机号 */
@Excel(name = "手机号")
private String facePhone;
@Excel(name = "组名")
@ -47,6 +54,15 @@ public class MineHealth {
private Date createTime;
private Long userId;
private Long warningId;
private Long deptId;
/** 组名 */
@Excel(name = "部门名称")
private String deptName;
}

7
yq-system/src/main/java/yq/system/domain/MineWarning.java

@ -24,6 +24,8 @@ import java.util.Map;
public class MineWarning {
private Long id;
@NotNull(message = "faceId不能为空")
private Long faceId;
@ -72,9 +74,12 @@ public class MineWarning {
@Excel(name = "手机号")
private String facePhone;
@NotNull(message = "groupId不能为空")
@NotNull(message = "未选择分组")
private Long groupId;
@Excel(name = "组名")
private String mineGroupName;
private String deptIdStr;
private Long userId;
}

10
yq-system/src/main/java/yq/system/domain/vo/MineHealthVo.java

@ -1,15 +1,18 @@
package yq.system.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import yq.common.annotation.Excel;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
* @auther yq
* @data 2025/1/8
*/
@Data
public class MineHealthVo {
private Long id;
@ -51,4 +54,11 @@ public class MineHealthVo {
private Date createTime;
private Long userId;
private Long deptId;
/** 组名 */
@Excel(name = "部门名称")
private String deptName;
}

17
yq-system/src/main/java/yq/system/domain/vo/StatisticVo.java

@ -0,0 +1,17 @@
package yq.system.domain.vo;
import lombok.Data;
/**
* @auther yq
* @data 2025/1/10
*/
@Data
public class StatisticVo {
private String search;
private String mineGroupName;
private Integer clock;
private Integer unClock;
}

1
yq-system/src/main/java/yq/system/mapper/MineHealthMapper.java

@ -30,6 +30,7 @@ public interface MineHealthMapper
public List<MineHealth> selectMineHealthList(MineHealth mineHealth);
public List<MineWarning> selectMineHealthByList(MineHealth mineHealth);
/**
* 新增请填写功能名称
*

6
yq-system/src/main/java/yq/system/mapper/MineWarningMapper.java

@ -3,6 +3,7 @@ package yq.system.mapper;
import java.util.List;
import yq.system.domain.MineWarning;
import yq.system.domain.vo.MineWarningVo;
import yq.system.domain.vo.StatisticVo;
/**
* 请填写功能名称Mapper接口
@ -30,6 +31,11 @@ public interface MineWarningMapper
public List<MineWarning> selectMineWarningMedicalList(MineWarning mineWarning);
public List<MineWarning> selectMineWarningUnMedicalList(MineWarning mineWarning);
public List<StatisticVo> selectMineWarningStatisticList(StatisticVo statisticVo);
public List<MineWarning> selectMineWarningListOne(MineWarning mineWarning);
/**

3
yq-system/src/main/java/yq/system/service/IMineHealthService.java

@ -1,6 +1,7 @@
package yq.system.service;
import yq.system.domain.MineHealth;
import yq.system.domain.MineWarning;
import java.util.List;
@ -29,7 +30,7 @@ public interface IMineHealthService
*/
public List<MineHealth> selectMineHealthList(MineHealth mineHealth);
public List<MineWarning> selectMineHealthByList(MineHealth mineHealth);
/**
* 新增请填写功能名称

13
yq-system/src/main/java/yq/system/service/IMineWarningService.java

@ -3,6 +3,7 @@ package yq.system.service;
import java.util.List;
import yq.system.domain.MineWarning;
import yq.system.domain.vo.MineWarningVo;
import yq.system.domain.vo.StatisticVo;
/**
* 请填写功能名称Service接口
@ -35,6 +36,18 @@ public interface IMineWarningService
*/
public List<MineWarning> selectMineWarningmedicalList(MineWarning mineWarning);
public List<MineWarning> selectMineWarningUnMedicalList(MineWarning mineWarning);
/**
* 查询请填写功能名称列表
*
* @param statisticVo 请填写功能名称
* @return 请填写功能名称集合
*/
public List<StatisticVo> selectMineWarningStatisticList(StatisticVo statisticVo);
/**
* 新增请填写功能名称

22
yq-system/src/main/java/yq/system/service/impl/MineGroupServiceImpl.java

@ -4,6 +4,8 @@ import java.util.List;
import yq.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import yq.system.domain.MineFace;
import yq.system.mapper.MineFaceMapper;
import yq.system.mapper.MineGroupMapper;
import yq.system.domain.MineGroup;
import yq.system.service.IMineGroupService;
@ -20,6 +22,8 @@ public class MineGroupServiceImpl implements IMineGroupService
@Autowired
private MineGroupMapper mineGroupMapper;
@Autowired
private MineFaceMapper mineFaceMapper;
/**
* 查询请填写功能名称
*
@ -78,6 +82,17 @@ public class MineGroupServiceImpl implements IMineGroupService
@Override
public int deleteMineGroupByIds(Long[] ids)
{
if(ids.length>0){
for (Long id : ids) {
MineGroup mineGroup = mineGroupMapper.selectMineGroupById(id);
MineFace mineFace =new MineFace();
mineFace.setGroupId(mineGroup.getId());
List<MineFace> mineFaces = mineFaceMapper.selectMineFaceList(mineFace);
if(!mineFaces.isEmpty()){
throw new RuntimeException("该分组["+mineGroup.getMineGroupName()+"]下有人员,不能删除");
}
}
}
return mineGroupMapper.deleteMineGroupByIds(ids);
}
@ -90,6 +105,13 @@ public class MineGroupServiceImpl implements IMineGroupService
@Override
public int deleteMineGroupById(Long id)
{
MineGroup mineGroup = mineGroupMapper.selectMineGroupById(id);
MineFace mineFace =new MineFace();
mineFace.setGroupId(mineGroup.getId());
List<MineFace> mineFaces = mineFaceMapper.selectMineFaceList(mineFace);
if(!mineFaces.isEmpty()){
throw new RuntimeException("该分组["+mineGroup.getMineGroupName()+"]下有人员,不能删除");
}
return mineGroupMapper.deleteMineGroupById(id);
}
}

5
yq-system/src/main/java/yq/system/service/impl/MineHealthServiceImpl.java

@ -39,9 +39,14 @@ public class MineHealthServiceImpl implements IMineHealthService
@Override
public List<MineHealth> selectMineHealthList(MineHealth mineHealth)
{
return mineHealthMapper.selectMineHealthList(mineHealth);
}
@Override
public List<MineWarning> selectMineHealthByList(MineHealth mineHealth) {
return mineHealthMapper.selectMineHealthByList(mineHealth);
}
/**

20
yq-system/src/main/java/yq/system/service/impl/MineWarningServiceImpl.java

@ -1,20 +1,25 @@
package yq.system.service.impl;
import java.util.List;
import java.util.stream.Collectors;
import cn.hutool.core.util.ObjectUtil;
import org.springframework.util.CollectionUtils;
import yq.common.core.domain.model.LoginUser;
import yq.common.exception.ServiceException;
import yq.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import yq.common.utils.SecurityUtils;
import yq.system.domain.MineFace;
import yq.system.domain.MineWarning;
import yq.system.domain.vo.MineWarningVo;
import yq.system.domain.vo.StatisticVo;
import yq.system.mapper.MineFaceMapper;
import yq.system.mapper.MineWarningMapper;
import yq.system.service.IMineFaceService;
import yq.system.service.IMineWarningService;
import yq.system.service.ISysDeptService;
/**
* 请填写功能名称Service业务层处理
@ -27,7 +32,8 @@ public class MineWarningServiceImpl implements IMineWarningService
{
@Autowired
private MineWarningMapper mineWarningMapper;
@Autowired
private ISysDeptService sysDeptService;
@Autowired
private IMineFaceService mineFaceService;
@ -52,6 +58,8 @@ public class MineWarningServiceImpl implements IMineWarningService
@Override
public List<MineWarning> selectMineWarningList(MineWarning mineWarning)
{
return mineWarningMapper.selectMineWarningList(mineWarning);
}
@ -60,6 +68,16 @@ public class MineWarningServiceImpl implements IMineWarningService
return mineWarningMapper.selectMineWarningMedicalList(mineWarning);
}
@Override
public List<MineWarning> selectMineWarningUnMedicalList(MineWarning mineWarning) {
return mineWarningMapper.selectMineWarningUnMedicalList(mineWarning);
}
@Override
public List<StatisticVo> selectMineWarningStatisticList(StatisticVo statisticVo) {
return mineWarningMapper.selectMineWarningStatisticList(statisticVo);
}
/**
* 新增请填写功能名称
*

8
yq-system/src/main/resources/mapper/system/MineFaceMapper.xml

@ -6,6 +6,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="MineFace" id="MineFaceResult">
<result property="id" column="id" />
<result property="deptId" column="dept_id" />
<result property="deptName" column="dept_name" />
<result property="faceName" column="face_name" />
<result property="age" column="age" />
<result property="facePhone" column="face_phone" />
@ -20,7 +22,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectMineFaceVo">
select mf.id, mf.face_name, mf.age, mf.face_phone, mf.face_url, mf.is_work, mf.remark, mf.create_time,mf.use_time, mf.group_id ,mg.mine_group_name from mine_face mf left join mine_group mg on mg.id =mf.group_id
select mf.id, mf.face_name,mg.dept_id,d.dept_name, mf.age, mf.face_phone, mf.face_url, mf.is_work, mf.remark, mf.create_time,mf.use_time, mf.group_id ,mg.mine_group_name
from mine_face mf
inner join mine_group mg on mg.id =mf.group_id
inner join sys_dept d on mg.dept_id = d.dept_id
</sql>
<select id="selectMineFaceList" parameterType="MineFace" resultMap="MineFaceResult">
@ -28,6 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="faceName != null and faceName != ''"> and mf.face_name like concat('%', #{faceName}, '%')</if>
<if test="age != null "> and mf.age = #{age}</if>
<if test="deptId != null "> and d.dept_id =#{deptId}</if>
<if test="facePhone != null and facePhone != ''"> and mf.face_phone = #{facePhone}</if>
<if test="faceUrl != null and faceUrl != ''"> and mf.face_url = #{faceUrl}</if>
<if test="isWork != null "> and mf.is_work = #{isWork}</if>

12
yq-system/src/main/resources/mapper/system/MineGroupMapper.xml

@ -7,34 +7,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="MineGroup" id="MineGroupResult">
<result property="id" column="id" />
<result property="mineGroupName" column="mine_group_name" />
<result property="deptId" column="dept_id" />
<result property="deptName" column="dept_name" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectMineGroupVo">
select id, mine_group_name, create_time from mine_group
select mg.id, mg.mine_group_name, mg.create_time ,mg.dept_id,d.dept_name from mine_group mg inner join sys_dept d on mg.dept_id = d.dept_id
</sql>
<select id="selectMineGroupList" parameterType="MineGroup" resultMap="MineGroupResult">
<include refid="selectMineGroupVo"/>
<where>
<if test="mineGroupName != null and mineGroupName != ''"> and mine_group_name like concat('%', #{mineGroupName}, '%')</if>
<if test="mineGroupName != null and mineGroupName != ''"> and mg.mine_group_name like concat('%', #{mineGroupName}, '%')</if>
<if test="deptId != null "> and d.dept_id =#{deptId}</if>
<if test="deptName != null and deptName != ''"> and d.dept_name like concat('%', #{deptName}, '%')</if>
</where>
</select>
<select id="selectMineGroupById" parameterType="Long" resultMap="MineGroupResult">
<include refid="selectMineGroupVo"/>
where id = #{id}
where mg.id = #{id}
</select>
<insert id="insertMineGroup" parameterType="MineGroup">
insert into mine_group
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="deptId != null">dept_id,</if>
<if test="mineGroupName != null">mine_group_name,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="deptId != null">#{deptId},</if>
<if test="mineGroupName != null">#{mineGroupName},</if>
<if test="createTime != null">#{createTime},</if>
</trim>

35
yq-system/src/main/resources/mapper/system/MineHealthMapper.xml

@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="yq.system.mapper.MineHealthMapper">
<resultMap type="mineHealthVo" id="MineHealthResult">
<resultMap type="mineHealth" id="MineHealthResult">
<result property="id" column="id" />
<result property="bpHigh" column="bp_high" />
<result property="bpLow" column="bp_low" />
@ -17,6 +17,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="mineGroupName" column="mine_group_name" />
<result property="faceName" column="face_name" />
<result property="facePhone" column="face_phone" />
<result property="deptId" column="dept_id" />
<result property="deptName" column="dept_name" />
<result property="age" column="age" />
</resultMap>
@ -31,9 +33,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mh.temperature,
mh.is_work,
mh.create_time,
mh.user_id,
mh.warning_id,
mf.face_name,
mf.face_phone ,
mf.age ,
mg.dept_id,
d.dept_name,
mg.mine_group_name
FROM
mine_health mh
@ -41,6 +47,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
on mf.id =mh.face_id
INNER JOIN mine_group mg
on mg.id =mf.group_id
inner join sys_dept d
on d.dept_id =mg.dept_id
</sql>
<select id="selectMineHealthList" parameterType="mineHealthVo" resultMap="MineHealthResult">
<include refid="selectMineHealthVo"/>
@ -52,15 +60,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="br != null "> and mh.br = #{br}</if>
<if test="hr != null "> and mh.hr = #{hr}</if>
<if test="hrv != null "> and mh.hrv = #{hrv}</if>
<if test="userId != null "> and mh.user_id = #{userId}</if>
<if test="warningId != null "> and mh.waring_id = #{warningId}</if>
<if test="temperature != null and temperature != ''"> and mh.temperature = #{temperature}</if>
<if test="isWork != null "> and mf.is_work = #{isWork}</if>
</where>
order by mh.user_id,mh.create_time desc
</select>
<select id="selectMineHealthById" parameterType="Long" resultMap="MineHealthResult">
<include refid="selectMineHealthVo"/>
where mh.id = #{id}
</select>
<select id="selectMineHealthByList" resultMap="MineHealthResult">
<include refid="selectMineHealthVo"/>
<where>
<if test="mineGroupName != null and mineGroupName != ''"> and mg.mine_group_name like concat('%', #{mineGroupName}, '%')</if>
<if test="faceName != null and faceName != ''"> and mf.face_name like concat('%', #{faceName}, '%')</if>
<if test="bpHigh != null "> and mh.bp_high = #{bpHigh}</if>
<if test="bpLow != null "> and mh.bp_low = #{bpLow}</if>
<if test="br != null "> and mh.br = #{br}</if>
<if test="hr != null "> and mh.hr = #{hr}</if>
<if test="hrv != null "> and mh.hrv = #{hrv}</if>
<if test="userId != null "> and mh.user_id = #{userId}</if>
<if test="warningId != null "> and mh.waring_id = #{warningId}</if>
<if test="temperature != null and temperature != ''"> and mh.temperature = #{temperature}</if>
<if test="isWork != null "> and mf.is_work = #{isWork}</if>
</where>
</select>
<insert id="insertMineHealth" parameterType="MineHealth" useGeneratedKeys="true" keyProperty="id">
@ -70,7 +97,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="bpLow != null">bp_low,</if>
<if test="br != null">br,</if>
<if test="hr != null">hr,</if>
<if test="userId != null "> user_id,</if>
<if test="faceId != null">face_id,</if>
<if test="warningId != null">warning_id,</if>
<if test="hrv != null">hrv,</if>
<if test="temperature != null">temperature,</if>
<if test="isWork != null">is_work,</if>
@ -78,10 +107,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="bpHigh != null">#{bpHigh},</if>
<if test="faceId != null">face_id,</if>
<if test="bpLow != null">#{bpLow},</if>
<if test="br != null">#{br},</if>
<if test="hr != null">#{hr},</if>
<if test="userId != null "> #{userId},</if>
<if test="faceId != null">#{faceId},</if>
<if test="warningId != null">#{warningId},</if>
<if test="hrv != null">#{hrv},</if>
<if test="temperature != null">#{temperature},</if>
<if test="isWork != null">#{isWork},</if>

56
yq-system/src/main/resources/mapper/system/MineWarningMapper.xml

@ -22,6 +22,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="groupId" column="group_id" />
</resultMap>
<resultMap type="MineWarning" id="MineWarningUnResult">
<result property="id" column="id" />
<result property="faceId" column="face_id" />
<result property="bpHigh" column="bp_high" />
<result property="bpLow" column="bp_low" />
<result property="br" column="br" />
<result property="hr" column="hr" />
<result property="hrv" column="hrv" />
<result property="temperature" column="temperature" />
<result property="isWork" column="is_work" />
<result property="createTime" column="create_time" />
<result property="mineGroupName" column="mine_group_name" />
<result property="faceName" column="face_name" />
<result property="facePhone" column="face_phone" />
<result property="age" column="age" />
<result property="groupId" column="group_id" />
</resultMap>
<sql id="selectMineWarningVo">
SELECT
mw.id,
@ -105,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND date_format(mw.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
</where>
${params.dataScope}
order by mw.create_time desc
</select>
@ -183,6 +204,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
rn = 1
ORDER BY create_time DESC
</select>
<select id="selectMineWarningStatisticList" resultType="yq.system.domain.vo.StatisticVo">
SELECT
mg.mine_group_name,
COUNT(CASE WHEN mw.create_time IS NOT NULL THEN 1 END) AS clock, -- 计算已打卡的人数
COUNT(CASE WHEN mw.create_time IS NULL THEN 1 END) AS unClock -- 计算未打卡的人数
FROM
mine_face mf
LEFT JOIN
mine_warning mw ON mw.face_id = mf.id
<if test="search == 今日 "> AND DATE(mw.create_time) = CURDATE() </if>
<if test="search == 7天 "> AND DATE(mw.create_time) = CURDATE() - INTERVAL 7 DAY </if>
<if test="search == 30天 "> AND DATE(mw.create_time) = CURDATE() - INTERVAL 1 MONTH </if>
LEFT JOIN
mine_group mg ON mg.id = mf.group_id
GROUP BY
mg.dept_id, mg.id;
</select>
<select id="selectMineWarningUnMedicalList" resultMap="MineWarningResult">
select mw.id,
mw.face_id,
mw.bp_high,
mw.bp_low,
mw.br,
mw.hr,
mw.hrv,
mw.temperature,
mw.is_work,
mw.create_time,
mf.face_name,
mg.mine_group_name
from mine_warning mw
INNER join mine_health mh on mw.id =mh.warning_id
INNER JOIN mine_face mf ON mf.id = mw.face_id
INNER JOIN mine_group mg ON mg.id = mf.group_id
</select>
<insert id="insertMineWarning" parameterType="MineWarning" useGeneratedKeys="true" keyProperty="id">
insert into mine_warning

Loading…
Cancel
Save