From 8218eb29f22c7ca0af555d3d2bb7d2f6e2de32b0 Mon Sep 17 00:00:00 2001 From: lxw <810412026@qq.com> Date: 星期三, 13 七月 2022 15:37:07 +0800 Subject: [PATCH] 用户管理提交 --- src/main/java/com/whyc/service/DocFaceService.java | 31 ++++++++++++++++++++++++++++++- 1 files changed, 30 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/whyc/service/DocFaceService.java b/src/main/java/com/whyc/service/DocFaceService.java index 118e4c1..120b95c 100644 --- a/src/main/java/com/whyc/service/DocFaceService.java +++ b/src/main/java/com/whyc/service/DocFaceService.java @@ -1,11 +1,40 @@ package com.whyc.service; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.whyc.mapper.DocFaceMapper; +import com.whyc.pojo.DocFace; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service public class DocFaceService { - @Autowired + @Autowired(required = false) private DocFaceMapper mapper; + + //璇诲彇鏈�澶х殑faceid骞剁敓鎴愭柊鐨刦aceid+1 + public int getNewFaceId(){ + int faceId=mapper.selectMaxFaceId(); + if(faceId==0){ + faceId=4001; + }else { + faceId=faceId+1; + } + return faceId; + } + //褰曞叆鏂扮殑浜鸿劯 + public int setNewFace(int faceId,String filePath){ + DocFace face=new DocFace(); + face.setFaceId(faceId); + face.setUrl(filePath); + int bl=mapper.insert(face); + return bl; + } + //淇敼鏃х殑浜鸿劯 + public int updateFace(int faceId, String filePath) { + UpdateWrapper wrapper=new UpdateWrapper(); + wrapper.set("url",filePath); + wrapper.eq("face_id",faceId); + int bl=mapper.update(null,wrapper); + return bl; + } } -- Gitblit v1.9.1