Browse Source

提交

mine
袁强 6 months ago
parent
commit
0556427966
  1. 2
      pom.xml
  2. 27
      yq-admin/src/main/java/yq/web/controller/common/CommonController.java
  3. 117
      yq-admin/src/main/java/yq/web/controller/mine/MineFaceController.java
  4. 114
      yq-admin/src/main/java/yq/web/controller/mine/MineGroupController.java
  5. 124
      yq-admin/src/main/java/yq/web/controller/mine/MineHealthController.java
  6. 120
      yq-admin/src/main/java/yq/web/controller/mine/MineWarningController.java
  7. 2
      yq-admin/src/main/resources/application.yml
  8. 64
      yq-system/src/main/java/yq/system/domain/MineFace.java
  9. 35
      yq-system/src/main/java/yq/system/domain/MineGroup.java
  10. 52
      yq-system/src/main/java/yq/system/domain/MineHealth.java
  11. 58
      yq-system/src/main/java/yq/system/domain/MineWarning.java
  12. 61
      yq-system/src/main/java/yq/system/mapper/MineFaceMapper.java
  13. 61
      yq-system/src/main/java/yq/system/mapper/MineGroupMapper.java
  14. 64
      yq-system/src/main/java/yq/system/mapper/MineHealthMapper.java
  15. 65
      yq-system/src/main/java/yq/system/mapper/MineWarningMapper.java
  16. 61
      yq-system/src/main/java/yq/system/service/IMineFaceService.java
  17. 61
      yq-system/src/main/java/yq/system/service/IMineGroupService.java
  18. 65
      yq-system/src/main/java/yq/system/service/IMineHealthService.java
  19. 69
      yq-system/src/main/java/yq/system/service/IMineWarningService.java
  20. 101
      yq-system/src/main/java/yq/system/service/impl/MineFaceServiceImpl.java
  21. 95
      yq-system/src/main/java/yq/system/service/impl/MineGroupServiceImpl.java
  22. 95
      yq-system/src/main/java/yq/system/service/impl/MineHealthServiceImpl.java
  23. 121
      yq-system/src/main/java/yq/system/service/impl/MineWarningServiceImpl.java
  24. 94
      yq-system/src/main/resources/mapper/system/MineFaceMapper.xml
  25. 62
      yq-system/src/main/resources/mapper/system/MineGroupMapper.xml
  26. 114
      yq-system/src/main/resources/mapper/system/MineHealthMapper.xml
  27. 228
      yq-system/src/main/resources/mapper/system/MineWarningMapper.xml

2
pom.xml

@ -10,7 +10,7 @@
<name>yq</name> <name>yq</name>
<url>http://www.ruoyi.vip</url> <url>http://www.ruoyi.vip</url>
<description>勇强AI智能检测系统</description> <description>人体适岗性一体化检测系统</description>
<properties> <properties>
<yq.version>3.8.6</yq.version> <yq.version>3.8.6</yq.version>

27
yq-admin/src/main/java/yq/web/controller/common/CommonController.java

@ -19,6 +19,7 @@ import yq.common.core.domain.AjaxResult;
import yq.common.utils.StringUtils; import yq.common.utils.StringUtils;
import yq.common.utils.file.FileUploadUtils; import yq.common.utils.file.FileUploadUtils;
import yq.common.utils.file.FileUtils; import yq.common.utils.file.FileUtils;
import yq.common.utils.file.MimeTypeUtils;
import yq.framework.config.ServerConfig; import yq.framework.config.ServerConfig;
/** /**
@ -69,6 +70,32 @@ public class CommonController
} }
} }
/**
* 通用上传请求单个
*/
@PostMapping("/upload/img")
public AjaxResult uploadImgFile(MultipartFile file) throws Exception
{
try
{
// 上传文件路径
String filePath = RuoYiConfig.getUploadPath();
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION);
String url = serverConfig.getUrl() + fileName;
AjaxResult ajax = AjaxResult.success();
ajax.put("url", url);
ajax.put("fileName", fileName);
ajax.put("newFileName", FileUtils.getName(fileName));
ajax.put("originalFilename", file.getOriginalFilename());
return ajax;
}
catch (Exception e)
{
return AjaxResult.error(e.getMessage());
}
}
/** /**
* 通用上传请求单个 * 通用上传请求单个
*/ */

117
yq-admin/src/main/java/yq/web/controller/mine/MineFaceController.java

@ -0,0 +1,117 @@
package yq.web.controller.mine;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import yq.common.annotation.Log;
import yq.common.core.controller.BaseController;
import yq.common.core.domain.AjaxResult;
import yq.common.enums.BusinessType;
import yq.common.exception.ServiceException;
import yq.system.domain.MineFace;
import yq.system.service.IMineFaceService;
import yq.common.utils.poi.ExcelUtil;
import yq.common.core.page.TableDataInfo;
/**
* 请填写功能名称Controller
*
* @author yq
* @date 2025-01-07
*/
@RestController
@RequestMapping("/system/face")
public class MineFaceController extends BaseController
{
@Autowired
private IMineFaceService mineFaceService;
/**
* 查询请填写功能名称列表
*/
@PreAuthorize("@ss.hasPermi('system:face:list')")
@GetMapping("/list")
public TableDataInfo list(MineFace mineFace)
{
startPage();
List<MineFace> list = mineFaceService.selectMineFaceList(mineFace);
return getDataTable(list);
}
/**
* 导出请填写功能名称列表
*/
@PreAuthorize("@ss.hasPermi('system:face:export')")
@Log(title = "【人脸列表导出】", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MineFace mineFace)
{
List<MineFace> list = mineFaceService.selectMineFaceList(mineFace);
ExcelUtil<MineFace> util = new ExcelUtil<MineFace>(MineFace.class);
util.exportExcel(response, list, "【人脸列表】数据");
}
/**
* 获取请填写功能名称详细信息
*/
@PreAuthorize("@ss.hasPermi('system:face:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(mineFaceService.selectMineFaceById(id));
}
/**
* 新增请填写功能名称
*/
@PreAuthorize("@ss.hasPermi('system:face:add')")
@Log(title = "【人脸录入】", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MineFace mineFace)
{
if(ObjectUtil.isNotNull(mineFace.getGroupId())){
throw new ServiceException("请选择分组!");
}
if(StrUtil.isEmpty(mineFace.getFaceUrl())){
throw new ServiceException("请上传人脸照片");
}
if(StrUtil.isEmpty(mineFace.getFaceName())){
throw new ServiceException("请填写名称");
}
return toAjax(mineFaceService.insertMineFace(mineFace));
}
/**
* 修改请填写功能名称
*/
@PreAuthorize("@ss.hasPermi('system:face:edit')")
@Log(title = "【人脸修改】", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MineFace mineFace)
{
return toAjax(mineFaceService.updateMineFace(mineFace));
}
/**
* 删除请填写功能名称
*/
@PreAuthorize("@ss.hasPermi('system:face:remove')")
@Log(title = "【人脸删除】", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mineFaceService.deleteMineFaceByIds(ids));
}
}

114
yq-admin/src/main/java/yq/web/controller/mine/MineGroupController.java

@ -0,0 +1,114 @@
package yq.web.controller.mine;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
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.MineGroup;
import yq.system.service.IMineGroupService;
import yq.common.utils.poi.ExcelUtil;
import yq.common.core.page.TableDataInfo;
/**
*
*
* @author yq
* @date 2025-01-07
*/
@RestController
@RequestMapping("/system/group")
public class MineGroupController extends BaseController
{
@Autowired
private IMineGroupService mineGroupService;
/**
* 查询请填写功能名称列表
*/
@PreAuthorize("@ss.hasPermi('system:group:list')")
@GetMapping("/list")
public TableDataInfo list(MineGroup mineGroup)
{
startPage();
List<MineGroup> list = mineGroupService.selectMineGroupList(mineGroup);
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('system:group:list')")
@GetMapping("/byList")
public AjaxResult byList(MineGroup mineGroup)
{
List<MineGroup> list = mineGroupService.selectMineGroupList(mineGroup);
return success(list);
}
/**
* 导出请填写功能名称列表
*/
@PreAuthorize("@ss.hasPermi('system:group:export')")
@Log(title = "【分组导出】", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MineGroup mineGroup)
{
List<MineGroup> list = mineGroupService.selectMineGroupList(mineGroup);
ExcelUtil<MineGroup> util = new ExcelUtil<MineGroup>(MineGroup.class);
util.exportExcel(response, list, "【分组列表】数据");
}
/**
* 获取请填写功能名称详细信息
*/
@PreAuthorize("@ss.hasPermi('system:group:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(mineGroupService.selectMineGroupById(id));
}
/**
* 新增请填写功能名称
*/
@PreAuthorize("@ss.hasPermi('system:group:add')")
@Log(title = "【分组新增】", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MineGroup mineGroup)
{
return toAjax(mineGroupService.insertMineGroup(mineGroup));
}
/**
* 修改请填写功能名称
*/
@PreAuthorize("@ss.hasPermi('system:group:edit')")
@Log(title = "【分组修改】", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MineGroup mineGroup)
{
return toAjax(mineGroupService.updateMineGroup(mineGroup));
}
/**
* 删除请填写功能名称
*/
@PreAuthorize("@ss.hasPermi('system:group:remove')")
@Log(title = "【分组删除】", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mineGroupService.deleteMineGroupByIds(ids));
}
}

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

@ -0,0 +1,124 @@
package yq.web.controller.mine;
import cn.hutool.core.util.ObjectUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
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.page.TableDataInfo;
import yq.common.enums.BusinessType;
import yq.common.exception.ServiceException;
import yq.common.utils.DateUtils;
import yq.common.utils.poi.ExcelUtil;
import yq.system.domain.MineFace;
import yq.system.domain.MineHealth;
import yq.system.domain.MineWarning;
import yq.system.service.IMineFaceService;
import yq.system.service.IMineHealthService;
import yq.system.service.IMineWarningService;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
*
*
* @author yq
* @date 2025-01-07
*/
@RestController
@RequestMapping("/system/health")
public class MineHealthController extends BaseController
{
@Autowired
private IMineHealthService mineHealthService;
@Autowired
private IMineFaceService mineFaceService;
/**
*/
@PreAuthorize("@ss.hasPermi('system:health:list')")
@GetMapping("/list")
public TableDataInfo list(MineHealth mineHealth)
{
startPage();
List<MineHealth> list = mineHealthService.selectMineHealthList(mineHealth);
return getDataTable(list);
}
/**
*/
@PreAuthorize("@ss.hasPermi('system:health:export')")
@Log(title = "【健康报告导出】", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MineHealth mineHealth)
{
List<MineHealth> list = mineHealthService.selectMineHealthList(mineHealth);
ExcelUtil<MineHealth> util = new ExcelUtil<MineHealth>(MineHealth.class);
util.exportExcel(response, list, "【健康报告】数据");
}
/**
* 获取请填写功能名称详细信息
*/
@PreAuthorize("@ss.hasPermi('system:health:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(mineHealthService.selectMineHealthById(id));
}
/**
* 新增请填写功能名称
*/
@PreAuthorize("@ss.hasPermi('system:health:add')")
@Log(title = "【健康报告新增】", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MineHealth mineHealth)
{
if(ObjectUtil.isNotNull(mineHealth.getIsWork())&&mineHealth.getIsWork()==1){
MineFace mineFace=new MineFace();
mineFace.setId(mineHealth.getFaceId());
mineFace.setIsWork(1);
mineFace.setUseTime(DateUtils.getNowDate());
mineFaceService.updateMineFace(mineFace);
}
return toAjax(mineHealthService.insertMineHealth(mineHealth));
}
/**
* 修改请填写功能名称
*/
@PreAuthorize("@ss.hasPermi('system:health:edit')")
@Log(title = "【健康报告修改】", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MineHealth mineHealth)
{
return toAjax(mineHealthService.updateMineHealth(mineHealth));
}
/**
* 删除请填写功能名称
*/
@PreAuthorize("@ss.hasPermi('system:health:remove')")
@Log(title = "【健康报告删除】", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mineHealthService.deleteMineHealthByIds(ids));
}
}

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

@ -0,0 +1,120 @@
package yq.web.controller.mine;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
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.service.IMineWarningService;
import yq.common.utils.poi.ExcelUtil;
import yq.common.core.page.TableDataInfo;
/**
*
*
* @author yq
* @date 2025-01-07
*/
@RestController
@RequestMapping("/system/warning")
public class MineWarningController extends BaseController
{
@Autowired
private IMineWarningService mineWarningService;
/**
*/
@PreAuthorize("@ss.hasPermi('system:warning:list')")
@GetMapping("/list")
public TableDataInfo list(MineWarning mineWarning)
{
startPage();
List<MineWarning> list = mineWarningService.selectMineWarningList(mineWarning);
return getDataTable(list);
}
/**
*/
@PreAuthorize("@ss.hasPermi('system:health:list')")
@GetMapping("/medical/list")
public TableDataInfo medicalList(MineWarning mineWarning)
{
startPage();
List<MineWarning> list = mineWarningService.selectMineWarningmedicalList(mineWarning);
return getDataTable(list);
}
/**
*/
@PreAuthorize("@ss.hasPermi('system:warning:export')")
@Log(title = "【预警导出】", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MineWarning mineWarning){
List<MineWarning> list = mineWarningService.selectMineWarningmedicalList(mineWarning);
ExcelUtil<MineWarning> util = new ExcelUtil<MineWarning>(MineWarning.class);
util.exportExcel(response, list, "预警列表数据");
}
/**
* 获取请填写功能名称详细信息
*/
@PreAuthorize("@ss.hasPermi('system:warning:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(mineWarningService.selectMineWarningById(id));
}
/**
* 新增请填写功能名称
*/
@PreAuthorize("@ss.hasPermi('system:warning:add')")
@Log(title = "【预警新增】", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MineWarning mineWarning)
{
return toAjax(mineWarningService.insertMineWarning(mineWarning));
}
/**
* 修改请填写功能名称
*/
@PreAuthorize("@ss.hasPermi('system:warning:edit')")
@Log(title = "【预警修改】", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MineWarning mineWarning)
{
return toAjax(mineWarningService.updateMineWarning(mineWarning));
}
/**
* 删除请填写功能名称
*/
@PreAuthorize("@ss.hasPermi('system:warning:remove')")
@Log(title = "【预警删除】", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mineWarningService.deleteMineWarningByIds(ids));
}
}

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

@ -18,7 +18,7 @@ ruoyi:
# 开发环境配置 # 开发环境配置
server: server:
# 服务器的HTTP端口,默认为8080 # 服务器的HTTP端口,默认为8080
port: 8080 port: 7777
servlet: servlet:
# 应用的访问路径 # 应用的访问路径
context-path: / context-path: /

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

@ -0,0 +1,64 @@
package yq.system.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.format.annotation.DateTimeFormat;
import yq.common.annotation.Excel;
import yq.common.core.domain.BaseEntity;
import java.util.Date;
/**
* 请填写功能名称对象 mine_face
*
* @author yq
* @date 2025-01-07
*/
@Data
public class MineFace
{
/** $column.columnComment */
private Long id;
/** 姓名 */
@Excel(name = "姓名")
private String faceName;
@Excel(name = "组名")
private String mineGroupName;
/** 年龄 */
@Excel(name = "年龄")
private Long age;
/** 手机号 */
@Excel(name = "手机号")
private String facePhone;
@Excel(name = "图片", readConverterExp = "$column.readConverterExp()")
private String faceUrl;
@Excel(name = "备注")
private String remark;
@Excel(name = "是否允许上岗 0:否 1:是")
private Integer isWork;
@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 useTime;
@Excel(name = "分组id")
private Long groupId;
@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;
}

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

@ -0,0 +1,35 @@
package yq.system.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.format.annotation.DateTimeFormat;
import yq.common.annotation.Excel;
import yq.common.core.domain.BaseEntity;
import java.util.Date;
/**
* 请填写功能名称对象 mine_group
*
* @author yq
* @date 2025-01-07
*/
@Data
public class MineGroup {
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 组名 */
@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;
}

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

@ -0,0 +1,52 @@
package yq.system.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import yq.common.annotation.Excel;
import java.util.Date;
/**
* @auther yq
* @data 2025/1/7
*/
@Data
public class MineHealth {
private Long id;
private Long faceId;
@Excel(name = "体检人")
private String faceName;
@Excel(name = "组名")
private String mineGroupName;
@Excel(name = "高压")
private Integer bpHigh;
@Excel(name = "低压")
private Integer bpLow;
@Excel(name = "心跳")
private Integer br;
@Excel(name = "呼吸频率")
private Integer hr;
@Excel(name = "心跳变异率")
private Integer hrv;
@Excel(name = "温度")
private Integer temperature;
@Excel(name = "是否允许上岗 0:否 1:是")
private Integer isWork;
@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;
}

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

@ -0,0 +1,58 @@
package yq.system.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import yq.common.annotation.Excel;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* @auther yq
* @data 2025/1/7
*/
@Data
public class MineWarning {
private Long id;
private Long faceId;
@Excel(name = "姓名")
private String faceName;
private Long groupId;
@Excel(name = "组名")
private String mineGroupName;
@Excel(name = "高压")
private Integer bpHigh;
@Excel(name = "低压")
private Integer bpLow;
@Excel(name = "心跳")
private Integer br;
@Excel(name = "呼吸频率")
private Integer hr;
@Excel(name = "心跳变异率")
private Integer hrv;
@Excel(name = "温度")
private Integer temperature;
@Excel(name = "是否适合上岗 0:否 1:是")
private Integer isWork;
@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;
/** 请求参数 */
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private Map<String, Object> params = new HashMap<>();
}

61
yq-system/src/main/java/yq/system/mapper/MineFaceMapper.java

@ -0,0 +1,61 @@
package yq.system.mapper;
import java.util.List;
import yq.system.domain.MineFace;
/**
* 请填写功能名称Mapper接口
*
* @author yq
* @date 2025-01-07
*/
public interface MineFaceMapper
{
/**
* 查询请填写功能名称
*
* @param id 请填写功能名称主键
* @return 请填写功能名称
*/
public MineFace selectMineFaceById(Long id);
/**
* 查询请填写功能名称列表
*
* @param mineFace 请填写功能名称
* @return 请填写功能名称集合
*/
public List<MineFace> selectMineFaceList(MineFace mineFace);
/**
* 新增请填写功能名称
*
* @param mineFace 请填写功能名称
* @return 结果
*/
public int insertMineFace(MineFace mineFace);
/**
* 修改请填写功能名称
*
* @param mineFace 请填写功能名称
* @return 结果
*/
public int updateMineFace(MineFace mineFace);
/**
* 删除请填写功能名称
*
* @param id 请填写功能名称主键
* @return 结果
*/
public int deleteMineFaceById(Long id);
/**
* 批量删除请填写功能名称
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteMineFaceByIds(Long[] ids);
}

61
yq-system/src/main/java/yq/system/mapper/MineGroupMapper.java

@ -0,0 +1,61 @@
package yq.system.mapper;
import java.util.List;
import yq.system.domain.MineGroup;
/**
* 请填写功能名称Mapper接口
*
* @author yq
* @date 2025-01-07
*/
public interface MineGroupMapper
{
/**
* 查询请填写功能名称
*
* @param id 请填写功能名称主键
* @return 请填写功能名称
*/
public MineGroup selectMineGroupById(Long id);
/**
* 查询请填写功能名称列表
*
* @param mineGroup 请填写功能名称
* @return 请填写功能名称集合
*/
public List<MineGroup> selectMineGroupList(MineGroup mineGroup);
/**
* 新增请填写功能名称
*
* @param mineGroup 请填写功能名称
* @return 结果
*/
public int insertMineGroup(MineGroup mineGroup);
/**
* 修改请填写功能名称
*
* @param mineGroup 请填写功能名称
* @return 结果
*/
public int updateMineGroup(MineGroup mineGroup);
/**
* 删除请填写功能名称
*
* @param id 请填写功能名称主键
* @return 结果
*/
public int deleteMineGroupById(Long id);
/**
* 批量删除请填写功能名称
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteMineGroupByIds(Long[] ids);
}

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

@ -0,0 +1,64 @@
package yq.system.mapper;
import yq.system.domain.MineHealth;
import yq.system.domain.MineWarning;
import java.util.List;
/**
* 请填写功能名称Mapper接口
*
* @author yq
* @date 2025-01-07
*/
public interface MineHealthMapper
{
/**
* 查询请填写功能名称
*
* @param id 请填写功能名称主键
* @return 请填写功能名称
*/
public MineHealth selectMineHealthById(Long id);
/**
* 查询请填写功能名称列表
*
* @param mineHealth 请填写功能名称
* @return 请填写功能名称集合
*/
public List<MineHealth> selectMineHealthList(MineHealth mineHealth);
/**
* 新增请填写功能名称
*
* @param mineHealth 请填写功能名称
* @return 结果
*/
public int insertMineHealth(MineHealth mineHealth);
/**
* 修改请填写功能名称
*
* @param mineHealth 请填写功能名称
* @return 结果
*/
public int updateMineHealth(MineHealth mineHealth);
/**
* 删除请填写功能名称
*
* @param id 请填写功能名称主键
* @return 结果
*/
public int deleteMineHealthById(Long id);
/**
* 批量删除请填写功能名称
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteMineHealthByIds(Long[] ids);
}

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

@ -0,0 +1,65 @@
package yq.system.mapper;
import java.util.List;
import yq.system.domain.MineWarning;
/**
* 请填写功能名称Mapper接口
*
* @author yq
* @date 2025-01-07
*/
public interface MineWarningMapper
{
/**
* 查询请填写功能名称
*
* @param id 请填写功能名称主键
* @return 请填写功能名称
*/
public MineWarning selectMineWarningById(Long id);
/**
* 查询请填写功能名称列表
*
* @param mineWarning 请填写功能名称
* @return 请填写功能名称集合
*/
public List<MineWarning> selectMineWarningList(MineWarning mineWarning);
public List<MineWarning> selectMineWarningMedicalList(MineWarning mineWarning);
public List<MineWarning> selectMineWarningListOne(MineWarning mineWarning);
/**
* 新增请填写功能名称
*
* @param mineWarning 请填写功能名称
* @return 结果
*/
public int insertMineWarning(MineWarning mineWarning);
/**
* 修改请填写功能名称
*
* @param mineWarning 请填写功能名称
* @return 结果
*/
public int updateMineWarning(MineWarning mineWarning);
/**
* 删除请填写功能名称
*
* @param id 请填写功能名称主键
* @return 结果
*/
public int deleteMineWarningById(Long id);
/**
* 批量删除请填写功能名称
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteMineWarningByIds(Long[] ids);
}

61
yq-system/src/main/java/yq/system/service/IMineFaceService.java

@ -0,0 +1,61 @@
package yq.system.service;
import java.util.List;
import yq.system.domain.MineFace;
/**
* 请填写功能名称Service接口
*
* @author yq
* @date 2025-01-07
*/
public interface IMineFaceService
{
/**
* 查询请填写功能名称
*
* @param id 请填写功能名称主键
* @return 请填写功能名称
*/
public MineFace selectMineFaceById(Long id);
/**
* 查询请填写功能名称列表
*
* @param mineFace 请填写功能名称
* @return 请填写功能名称集合
*/
public List<MineFace> selectMineFaceList(MineFace mineFace);
/**
* 新增请填写功能名称
*
* @param mineFace 请填写功能名称
* @return 结果
*/
public int insertMineFace(MineFace mineFace);
/**
* 修改请填写功能名称
*
* @param mineFace 请填写功能名称
* @return 结果
*/
public int updateMineFace(MineFace mineFace);
/**
* 批量删除请填写功能名称
*
* @param ids 需要删除的请填写功能名称主键集合
* @return 结果
*/
public int deleteMineFaceByIds(Long[] ids);
/**
* 删除请填写功能名称信息
*
* @param id 请填写功能名称主键
* @return 结果
*/
public int deleteMineFaceById(Long id);
}

61
yq-system/src/main/java/yq/system/service/IMineGroupService.java

@ -0,0 +1,61 @@
package yq.system.service;
import java.util.List;
import yq.system.domain.MineGroup;
/**
* 请填写功能名称Service接口
*
* @author yq
* @date 2025-01-07
*/
public interface IMineGroupService
{
/**
* 查询请填写功能名称
*
* @param id 请填写功能名称主键
* @return 请填写功能名称
*/
public MineGroup selectMineGroupById(Long id);
/**
* 查询请填写功能名称列表
*
* @param mineGroup 请填写功能名称
* @return 请填写功能名称集合
*/
public List<MineGroup> selectMineGroupList(MineGroup mineGroup);
/**
* 新增请填写功能名称
*
* @param mineGroup 请填写功能名称
* @return 结果
*/
public int insertMineGroup(MineGroup mineGroup);
/**
* 修改请填写功能名称
*
* @param mineGroup 请填写功能名称
* @return 结果
*/
public int updateMineGroup(MineGroup mineGroup);
/**
* 批量删除请填写功能名称
*
* @param ids 需要删除的请填写功能名称主键集合
* @return 结果
*/
public int deleteMineGroupByIds(Long[] ids);
/**
* 删除请填写功能名称信息
*
* @param id 请填写功能名称主键
* @return 结果
*/
public int deleteMineGroupById(Long id);
}

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

@ -0,0 +1,65 @@
package yq.system.service;
import yq.system.domain.MineHealth;
import java.util.List;
/**
* 请填写功能名称Service接口
*
* @author yq
* @date 2025-01-07
*/
public interface IMineHealthService
{
/**
* 查询请填写功能名称
*
* @param id 请填写功能名称主键
* @return 请填写功能名称
*/
public MineHealth selectMineHealthById(Long id);
/**
* 查询请填写功能名称列表
*
* @param mineHealth 请填写功能名称
* @return 请填写功能名称集合
*/
public List<MineHealth> selectMineHealthList(MineHealth mineHealth);
/**
* 新增请填写功能名称
*
* @param mineHealth 请填写功能名称
* @return 结果
*/
public int insertMineHealth(MineHealth mineHealth);
/**
* 修改请填写功能名称
*
* @param mineHealth 请填写功能名称
* @return 结果
*/
public int updateMineHealth(MineHealth mineHealth);
/**
* 批量删除请填写功能名称
*
* @param ids 需要删除的请填写功能名称主键集合
* @return 结果
*/
public int deleteMineHealthByIds(Long[] ids);
/**
* 删除请填写功能名称信息
*
* @param id 请填写功能名称主键
* @return 结果
*/
public int deleteMineHealthById(Long id);
}

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

@ -0,0 +1,69 @@
package yq.system.service;
import java.util.List;
import yq.system.domain.MineWarning;
/**
* 请填写功能名称Service接口
*
* @author yq
* @date 2025-01-07
*/
public interface IMineWarningService
{
/**
* 查询请填写功能名称
*
* @param id 请填写功能名称主键
* @return 请填写功能名称
*/
public MineWarning selectMineWarningById(Long id);
/**
* 查询请填写功能名称列表
*
* @param mineWarning 请填写功能名称
* @return 请填写功能名称集合
*/
public List<MineWarning> selectMineWarningList(MineWarning mineWarning);
/**
* 查询请填写功能名称列表
*
* @param mineWarning 请填写功能名称
* @return 请填写功能名称集合
*/
public List<MineWarning> selectMineWarningmedicalList(MineWarning mineWarning);
/**
* 新增请填写功能名称
*
* @param mineWarning 请填写功能名称
* @return 结果
*/
public int insertMineWarning(MineWarning mineWarning);
/**
* 修改请填写功能名称
*
* @param mineWarning 请填写功能名称
* @return 结果
*/
public int updateMineWarning(MineWarning mineWarning);
/**
* 批量删除请填写功能名称
*
* @param ids 需要删除的请填写功能名称主键集合
* @return 结果
*/
public int deleteMineWarningByIds(Long[] ids);
/**
* 删除请填写功能名称信息
*
* @param id 请填写功能名称主键
* @return 结果
*/
public int deleteMineWarningById(Long id);
}

101
yq-system/src/main/java/yq/system/service/impl/MineFaceServiceImpl.java

@ -0,0 +1,101 @@
package yq.system.service.impl;
import java.util.List;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import yq.common.exception.ServiceException;
import yq.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import yq.system.mapper.MineFaceMapper;
import yq.system.domain.MineFace;
import yq.system.service.IMineFaceService;
/**
* 请填写功能名称Service业务层处理
*
* @author yq
* @date 2025-01-07
*/
@Service
public class MineFaceServiceImpl implements IMineFaceService
{
@Autowired
private MineFaceMapper mineFaceMapper;
/**
* 查询请填写功能名称
*
* @param id 请填写功能名称主键
* @return 请填写功能名称
*/
@Override
public MineFace selectMineFaceById(Long id)
{
return mineFaceMapper.selectMineFaceById(id);
}
/**
* 查询请填写功能名称列表
*
* @param mineFace 请填写功能名称
* @return 请填写功能名称
*/
@Override
public List<MineFace> selectMineFaceList(MineFace mineFace)
{
return mineFaceMapper.selectMineFaceList(mineFace);
}
/**
* 新增请填写功能名称
*
* @param mineFace 请填写功能名称
* @return 结果
*/
@Override
public int insertMineFace(MineFace mineFace)
{
mineFace.setCreateTime(DateUtils.getNowDate());
mineFace.setUseTime(DateUtils.getNowDate());
return mineFaceMapper.insertMineFace(mineFace);
}
/**
* 修改请填写功能名称
*
* @param mineFace 请填写功能名称
* @return 结果
*/
@Override
public int updateMineFace(MineFace mineFace)
{
return mineFaceMapper.updateMineFace(mineFace);
}
/**
* 批量删除请填写功能名称
*
* @param ids 需要删除的请填写功能名称主键
* @return 结果
*/
@Override
public int deleteMineFaceByIds(Long[] ids)
{
return mineFaceMapper.deleteMineFaceByIds(ids);
}
/**
* 删除请填写功能名称信息
*
* @param id 请填写功能名称主键
* @return 结果
*/
@Override
public int deleteMineFaceById(Long id)
{
return mineFaceMapper.deleteMineFaceById(id);
}
}

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

@ -0,0 +1,95 @@
package yq.system.service.impl;
import java.util.List;
import yq.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import yq.system.mapper.MineGroupMapper;
import yq.system.domain.MineGroup;
import yq.system.service.IMineGroupService;
/**
* 请填写功能名称Service业务层处理
*
* @author yq
* @date 2025-01-07
*/
@Service
public class MineGroupServiceImpl implements IMineGroupService
{
@Autowired
private MineGroupMapper mineGroupMapper;
/**
* 查询请填写功能名称
*
* @param id 请填写功能名称主键
* @return 请填写功能名称
*/
@Override
public MineGroup selectMineGroupById(Long id)
{
return mineGroupMapper.selectMineGroupById(id);
}
/**
* 查询请填写功能名称列表
*
* @param mineGroup 请填写功能名称
* @return 请填写功能名称
*/
@Override
public List<MineGroup> selectMineGroupList(MineGroup mineGroup)
{
return mineGroupMapper.selectMineGroupList(mineGroup);
}
/**
* 新增请填写功能名称
*
* @param mineGroup 请填写功能名称
* @return 结果
*/
@Override
public int insertMineGroup(MineGroup mineGroup)
{
mineGroup.setCreateTime(DateUtils.getNowDate());
return mineGroupMapper.insertMineGroup(mineGroup);
}
/**
* 修改请填写功能名称
*
* @param mineGroup 请填写功能名称
* @return 结果
*/
@Override
public int updateMineGroup(MineGroup mineGroup)
{
return mineGroupMapper.updateMineGroup(mineGroup);
}
/**
* 批量删除请填写功能名称
*
* @param ids 需要删除的请填写功能名称主键
* @return 结果
*/
@Override
public int deleteMineGroupByIds(Long[] ids)
{
return mineGroupMapper.deleteMineGroupByIds(ids);
}
/**
* 删除请填写功能名称信息
*
* @param id 请填写功能名称主键
* @return 结果
*/
@Override
public int deleteMineGroupById(Long id)
{
return mineGroupMapper.deleteMineGroupById(id);
}
}

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

@ -0,0 +1,95 @@
package yq.system.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import yq.common.utils.DateUtils;
import yq.system.domain.MineHealth;
import yq.system.domain.MineWarning;
import yq.system.mapper.MineHealthMapper;
import yq.system.mapper.MineWarningMapper;
import yq.system.service.IMineHealthService;
import yq.system.service.IMineWarningService;
import java.util.List;
/**
* 请填写功能名称Service业务层处理
*
* @author yq
* @date 2025-01-07
*/
@Service
public class MineHealthServiceImpl implements IMineHealthService
{
@Autowired
private MineHealthMapper mineHealthMapper;
@Override
public MineHealth selectMineHealthById(Long id) {
return mineHealthMapper.selectMineHealthById(id);
}
/**
* 查询请填写功能名称列表
*
* @param mineHealth 请填写功能名称
* @return 请填写功能名称
*/
@Override
public List<MineHealth> selectMineHealthList(MineHealth mineHealth)
{
return mineHealthMapper.selectMineHealthList(mineHealth);
}
/**
* 新增请填写功能名称
*
* @param mineHealth 请填写功能名称
* @return 结果
*/
@Override
public int insertMineHealth(MineHealth mineHealth)
{
mineHealth.setCreateTime(DateUtils.getNowDate());
return mineHealthMapper.insertMineHealth(mineHealth);
}
/**
* 修改请填写功能名称
*
* @param mineHealth 请填写功能名称
* @return 结果
*/
@Override
public int updateMineHealth(MineHealth mineHealth)
{
return mineHealthMapper.updateMineHealth(mineHealth);
}
/**
* 批量删除请填写功能名称
*
* @param ids 需要删除的请填写功能名称主键
* @return 结果
*/
@Override
public int deleteMineHealthByIds(Long[] ids)
{
return mineHealthMapper.deleteMineHealthByIds(ids);
}
/**
* 删除请填写功能名称信息
*
* @param id 请填写功能名称主键
* @return 结果
*/
@Override
public int deleteMineHealthById(Long id)
{
return mineHealthMapper.deleteMineHealthById(id);
}
}

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

@ -0,0 +1,121 @@
package yq.system.service.impl;
import java.util.List;
import cn.hutool.core.util.ObjectUtil;
import org.springframework.util.CollectionUtils;
import yq.common.exception.ServiceException;
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.domain.MineWarning;
import yq.system.mapper.MineFaceMapper;
import yq.system.mapper.MineWarningMapper;
import yq.system.service.IMineFaceService;
import yq.system.service.IMineWarningService;
/**
* 请填写功能名称Service业务层处理
*
* @author yq
* @date 2025-01-07
*/
@Service
public class MineWarningServiceImpl implements IMineWarningService
{
@Autowired
private MineWarningMapper mineWarningMapper;
@Autowired
private IMineFaceService mineFaceService;
/**
* 查询请填写功能名称
*
* @param id 请填写功能名称主键
* @return 请填写功能名称
*/
@Override
public MineWarning selectMineWarningById(Long id)
{
return mineWarningMapper.selectMineWarningById(id);
}
/**
* 查询请填写功能名称列表
*
* @param mineWarning 请填写功能名称
* @return 请填写功能名称
*/
@Override
public List<MineWarning> selectMineWarningList(MineWarning mineWarning)
{
return mineWarningMapper.selectMineWarningList(mineWarning);
}
@Override
public List<MineWarning> selectMineWarningmedicalList(MineWarning mineWarning) {
return mineWarningMapper.selectMineWarningMedicalList(mineWarning);
}
/**
* 新增请填写功能名称
*
* @param mineWarning 请填写功能名称
* @return 结果
*/
@Override
public int insertMineWarning(MineWarning mineWarning)
{
mineWarning.setCreateTime(DateUtils.getNowDate());
mineWarningMapper.insertMineWarning(mineWarning);
List<MineWarning> mineWarnings = mineWarningMapper.selectMineWarningListOne(mineWarning);
if(mineWarnings.size() >=2){
MineFace mineFace=new MineFace();
mineFace.setId(mineWarning.getFaceId());
mineFace.setIsWork(0);
mineFace.setUseTime(DateUtils.getNowDate());
mineFaceService.updateMineFace(mineFace);
throw new ServiceException("检测异常,禁止上岗");
}
return 1;
}
/**
* 修改请填写功能名称
*
* @param mineWarning 请填写功能名称
* @return 结果
*/
@Override
public int updateMineWarning(MineWarning mineWarning)
{
return mineWarningMapper.updateMineWarning(mineWarning);
}
/**
* 批量删除请填写功能名称
*
* @param ids 需要删除的请填写功能名称主键
* @return 结果
*/
@Override
public int deleteMineWarningByIds(Long[] ids)
{
return mineWarningMapper.deleteMineWarningByIds(ids);
}
/**
* 删除请填写功能名称信息
*
* @param id 请填写功能名称主键
* @return 结果
*/
@Override
public int deleteMineWarningById(Long id)
{
return mineWarningMapper.deleteMineWarningById(id);
}
}

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

@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="yq.system.mapper.MineFaceMapper">
<resultMap type="MineFace" id="MineFaceResult">
<result property="id" column="id" />
<result property="faceName" column="face_name" />
<result property="age" column="age" />
<result property="facePhone" column="face_phone" />
<result property="faceUrl" column="face_url" />
<result property="isWork" column="is_work" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="groupId" column="group_id" />
<result property="mineGroupName" column="mine_group_name" />
<result property="useTime" column="use_time" />
</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
</sql>
<select id="selectMineFaceList" parameterType="MineFace" resultMap="MineFaceResult">
<include refid="selectMineFaceVo"/>
<where>
<if test="faceName != null and faceName != ''"> and face_name like concat('%', #{faceName}, '%')</if>
<if test="age != null "> and age = #{age}</if>
<if test="facePhone != null and facePhone != ''"> and face_phone = #{facePhone}</if>
<if test="faceUrl != null and faceUrl != ''"> and face_url = #{faceUrl}</if>
<if test="isWork != null "> and is_work = #{isWork}</if>
<if test="groupId != null "> and group_id = #{groupId}</if>
</where>
</select>
<select id="selectMineFaceById" parameterType="Long" resultMap="MineFaceResult">
<include refid="selectMineFaceVo"/>
where mf.id = #{id}
</select>
<insert id="insertMineFace" parameterType="MineFace">
insert into mine_face
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="faceName != null">face_name,</if>
<if test="age != null">age,</if>
<if test="facePhone != null">face_phone,</if>
<if test="faceUrl != null">face_url,</if>
<if test="isWork != null">is_work,</if>
<if test="remark != null">remark,</if>
<if test="createTime != null">create_time,</if>
<if test="groupId != null">group_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="faceName != null">#{faceName},</if>
<if test="age != null">#{age},</if>
<if test="facePhone != null">#{facePhone},</if>
<if test="faceUrl != null">#{faceUrl},</if>
<if test="isWork != null">#{isWork},</if>
<if test="remark != null">#{remark},</if>
<if test="createTime != null">#{createTime},</if>
<if test="groupId != null">#{groupId},</if>
</trim>
</insert>
<update id="updateMineFace" parameterType="MineFace">
update mine_face
<trim prefix="SET" suffixOverrides=",">
<if test="faceName != null">face_name = #{faceName},</if>
<if test="age != null">age = #{age},</if>
<if test="facePhone != null">face_phone = #{facePhone},</if>
<if test="faceUrl != null">face_url = #{faceUrl},</if>
<if test="isWork != null">is_work = #{isWork},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="groupId != null">group_id = #{groupId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMineFaceById" parameterType="Long">
delete from mine_face where id = #{id}
</delete>
<delete id="deleteMineFaceByIds" parameterType="String">
delete from mine_face where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

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

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="yq.system.mapper.MineGroupMapper">
<resultMap type="MineGroup" id="MineGroupResult">
<result property="id" column="id" />
<result property="mineGroupName" column="mine_group_name" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectMineGroupVo">
select id, mine_group_name, create_time from mine_group
</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>
</where>
</select>
<select id="selectMineGroupById" parameterType="Long" resultMap="MineGroupResult">
<include refid="selectMineGroupVo"/>
where id = #{id}
</select>
<insert id="insertMineGroup" parameterType="MineGroup">
insert into mine_group
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">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="mineGroupName != null">#{mineGroupName},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateMineGroup" parameterType="MineGroup">
update mine_group
<trim prefix="SET" suffixOverrides=",">
<if test="mineGroupName != null">mine_group_name = #{mineGroupName},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMineGroupById" parameterType="Long">
delete from mine_group where id = #{id}
</delete>
<delete id="deleteMineGroupByIds" parameterType="String">
delete from mine_group where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

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

@ -0,0 +1,114 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="yq.system.mapper.MineHealthMapper">
<resultMap type="MineHealth" id="MineHealthResult">
<result property="id" column="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" />
</resultMap>
<sql id="selectMineHealthVo">
SELECT
mh.id,
mh.bp_high,
mh.bp_low,
mh.br,
mh.hr,
mh.hrv,
mh.temperature,
mh.is_work,
mh.create_time,
mf.face_name,
mg.mine_group_name
FROM
mine_health mh
INNER JOIN mine_face mf
on mf.id =mh.face_id
INNER JOIN mine_group mg
on mg.id =mf.group_id
</sql>
<select id="selectMineHealthList" parameterType="MineHealth" 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="temperature != null and temperature != ''"> and mh.temperature = #{temperature}</if>
<if test="isWork != null "> and mf.is_work = #{isWork}</if>
</where>
</select>
<select id="selectMineHealthById" parameterType="Long" resultMap="MineHealthResult">
<include refid="selectMineHealthVo"/>
where mh.id = #{id}
</select>
<insert id="insertMineHealth" parameterType="MineHealth" useGeneratedKeys="true" keyProperty="id">
insert into mine_health
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="bpHigh != null">bp_high,</if>
<if test="bpLow != null">bp_low,</if>
<if test="br != null">br,</if>
<if test="hr != null">hr,</if>
<if test="faceId != null">face_id,</if>
<if test="hrv != null">hrv,</if>
<if test="temperature != null">temperature,</if>
<if test="isWork != null">is_work,</if>
<if test="createTime != null">create_time,</if>
</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="hrv != null">#{hrv},</if>
<if test="temperature != null">#{temperature},</if>
<if test="isWork != null">#{isWork},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateMineHealth" parameterType="MineHealth">
update mine_health
<trim prefix="SET" suffixOverrides=",">
<if test="faceId != null">face_id=#{faceId}</if>
<if test="bpHigh != null">bp_high = #{bpHigh},</if>
<if test="bpLow != null">bp_low = #{bpLow},</if>
<if test="br != null">br = #{br},</if>
<if test="hr != null">hr = #{hr},</if>
<if test="hrv != null">hrv = #{hrv},</if>
<if test="temperature != null">temperature = #{temperature},</if>
<if test="isWork != null">is_work = #{isWork},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMineHealthById" parameterType="Long">
delete from mine_health where id = #{id}
</delete>
<delete id="deleteMineHealthByIds" parameterType="String">
delete from mine_health where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

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

@ -0,0 +1,228 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="yq.system.mapper.MineWarningMapper">
<resultMap type="MineWarning" id="MineWarningResult">
<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" />
</resultMap>
<sql id="selectMineWarningVo">
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_face mf
on mf.id =mw.face_id
INNER JOIN mine_group mg
on mg.id =mf.group_id
</sql>
<sql id="selectMineWarningMedicalVo">
SELECT
mw.id,
mw.face_id,
mw.bp_high,
mw.bp_low,
mw.br,
mw.hr,
mw.hrv,
mw.temperature,
mf.is_work,
mw.create_time,
mf.face_name,
mg.mine_group_name
FROM
mine_warning mw
INNER JOIN mine_face mf
on mf.id =mw.face_id
INNER JOIN mine_group mg
on mg.id =mf.group_id
</sql>
<sql id="selectMineWarningList">
SELECT
mw.id,
mw.bp_high,
mw.bp_low,
mw.br,
mw.face_id,
mw.hr,
mw.hrv,
mw.temperature,
mw.is_work,
mw.create_time,
mw.face_id
FROM
mine_warning mw
</sql>
<select id="selectMineWarningList" parameterType="MineWarning" resultMap="MineWarningResult">
<include refid="selectMineWarningVo"/>
<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 mw.bp_high = #{bpHigh}</if>
<if test="bpLow != null "> and mw.bp_low = #{bpLow}</if>
<if test="groupId != null "> and mg.id = #{groupId}</if>
<if test="br != null "> and mw.br = #{br}</if>
<if test="hr != null "> and mw.hr = #{hr}</if>
<if test="hrv != null "> and mw.hrv = #{hrv}</if>
<if test="temperature != null and temperature != ''"> and mw.temperature = #{temperature}</if>
<if test="isWork != null "> and mw.is_work = #{isWork}</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(mw.create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(mw.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
</where>
</select>
<select id="selectMineWarningListOne" parameterType="MineWarning" resultMap="MineWarningResult">
<include refid="selectMineWarningList"/>
<where>
<if test="faceId != null "> and mw.face_id = #{faceId}</if>
<if test="isWork != null "> and mw.is_work = #{isWork}</if>
<if test="createTime != null and createTime != ''"> and mw.create_time > DATE_SUB( #{createTime}, INTERVAL 1 HOUR )</if>
</where>
ORDER BY mw.create_time DESC
LIMIT 0,2
</select>
<select id="selectMineWarningById" parameterType="Long" resultMap="MineWarningResult">
<include refid="selectMineWarningVo"/>
where mw.id = #{id}
</select>
<select id="selectMineWarningMedicalList" resultType="yq.system.domain.MineWarning">
WITH RankedWarnings AS (
SELECT
mw.id,
mw.face_id,
mw.bp_high,
mw.bp_low,
mw.br,
mw.hr,
mw.hrv,
mw.temperature,
mf.is_work,
mw.create_time,
mf.face_name,
mg.mine_group_name,
ROW_NUMBER() OVER (PARTITION BY mf.face_name ORDER BY mw.create_time DESC) AS rn
FROM
mine_warning mw
INNER JOIN mine_face mf ON mf.id = mw.face_id
INNER JOIN mine_group mg ON mg.id = mf.group_id
<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 mw.bp_high = #{bpHigh}</if>
<if test="bpLow != null "> and mw.bp_low = #{bpLow}</if>
<if test="groupId != null "> and mg.id = #{groupId}</if>
<if test="br != null "> and mw.br = #{br}</if>
<if test="hr != null "> and mw.hr = #{hr}</if>
<if test="hrv != null "> and mw.hrv = #{hrv}</if>
<if test="temperature != null and temperature != ''"> and mw.temperature = #{temperature}</if>
<if test="isWork != null "> and mf.is_work = #{isWork}</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(mw.create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(mw.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
</where>
)
SELECT
id,
face_id as faceId,
bp_high as bpHigh,
bp_low as bpLow,
br,
hr,
hrv,
temperature,
is_work as isWork,
create_time as createTime,
face_name as faceName,
mine_group_name as mineGroupName
FROM
RankedWarnings
WHERE
rn = 1
ORDER BY create_time DESC
</select>
<insert id="insertMineWarning" parameterType="MineWarning" useGeneratedKeys="true" keyProperty="id">
insert into mine_warning
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="bpHigh != null">bp_high,</if>
<if test="bpLow != null">bp_low,</if>
<if test="br != null">br,</if>
<if test="hr != null">hr,</if>
<if test="hrv != null">hrv,</if>
<if test="temperature != null">temperature,</if>
<if test="isWork != null">is_work,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="bpHigh != null">#{bpHigh},</if>
<if test="bpLow != null">#{bpLow},</if>
<if test="br != null">#{br},</if>
<if test="hr != null">#{hr},</if>
<if test="hrv != null">#{hrv},</if>
<if test="temperature != null">#{temperature},</if>
<if test="isWork != null">#{isWork},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateMineWarning" parameterType="MineWarning">
update mine_warning
<trim prefix="SET" suffixOverrides=",">
<if test="bpHigh != null">bp_high = #{bpHigh},</if>
<if test="bpLow != null">bp_low = #{bpLow},</if>
<if test="br != null">br = #{br},</if>
<if test="hr != null">hr = #{hr},</if>
<if test="hrv != null">hrv = #{hrv},</if>
<if test="temperature != null">temperature = #{temperature},</if>
<if test="isWork != null">is_work = #{isWork},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMineWarningById" parameterType="Long">
delete from mine_warning where id = #{id}
</delete>
<delete id="deleteMineWarningByIds" parameterType="String">
delete from mine_warning where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save