diff --git a/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/controller/AppUserController.java b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/controller/AppUserController.java new file mode 100644 index 0000000..7dde55f --- /dev/null +++ b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/controller/AppUserController.java @@ -0,0 +1,105 @@ +package com.ruoyi.app.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +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 com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.ruoyi.app.domain.AppUser; +import com.ruoyi.app.service.IAppUserService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.utils.poi.ExcelUtil; +import com.ruoyi.common.core.web.page.TableDataInfo; + +/** + * app用户Controller + * + * @author wyh + * @date 2024-04-23 + */ +@RestController +@RequestMapping("/user") +public class AppUserController extends BaseController +{ + @Autowired + private IAppUserService appUserService; + + /** + * 查询app用户列表 + */ + @RequiresPermissions("app:user:list") + @GetMapping("/list") + public TableDataInfo list(AppUser appUser) + { + startPage(); + List list = appUserService.selectAppUserList(appUser); + return getDataTable(list); + } + + /** + * 导出app用户列表 + */ + @RequiresPermissions("app:user:export") + @Log(title = "app用户", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, AppUser appUser) + { + List list = appUserService.selectAppUserList(appUser); + ExcelUtil util = new ExcelUtil(AppUser.class); + util.exportExcel(response, list, "app用户数据"); + } + + /** + * 获取app用户详细信息 + */ + @RequiresPermissions("app:user:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(appUserService.selectAppUserById(id)); + } + + /** + * 新增app用户 + */ + @RequiresPermissions("app:user:add") + @Log(title = "app用户", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody AppUser appUser) + { + return toAjax(appUserService.insertAppUser(appUser)); + } + + /** + * 修改app用户 + */ + @RequiresPermissions("app:user:edit") + @Log(title = "app用户", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody AppUser appUser) + { + return toAjax(appUserService.updateAppUser(appUser)); + } + + /** + * 删除app用户 + */ + @RequiresPermissions("app:user:remove") + @Log(title = "app用户", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(appUserService.deleteAppUserByIds(ids)); + } +} diff --git a/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/controller/UserSkillController.java b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/controller/UserSkillController.java new file mode 100644 index 0000000..f2945b6 --- /dev/null +++ b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/controller/UserSkillController.java @@ -0,0 +1,105 @@ +package com.ruoyi.app.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +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 com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.ruoyi.app.domain.UserSkill; +import com.ruoyi.app.service.IUserSkillService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.utils.poi.ExcelUtil; +import com.ruoyi.common.core.web.page.TableDataInfo; + +/** + * 技能标签Controller + * + * @author wyh + * @date 2024-04-23 + */ +@RestController +@RequestMapping("/skill") +public class UserSkillController extends BaseController +{ + @Autowired + private IUserSkillService userSkillService; + + /** + * 查询技能标签列表 + */ + @RequiresPermissions("app:skill:list") + @GetMapping("/list") + public TableDataInfo list(UserSkill userSkill) + { + startPage(); + List list = userSkillService.selectUserSkillList(userSkill); + return getDataTable(list); + } + + /** + * 导出技能标签列表 + */ + @RequiresPermissions("app:skill:export") + @Log(title = "技能标签", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, UserSkill userSkill) + { + List list = userSkillService.selectUserSkillList(userSkill); + ExcelUtil util = new ExcelUtil(UserSkill.class); + util.exportExcel(response, list, "技能标签数据"); + } + + /** + * 获取技能标签详细信息 + */ + @RequiresPermissions("app:skill:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(userSkillService.selectUserSkillById(id)); + } + + /** + * 新增技能标签 + */ + @RequiresPermissions("app:skill:add") + @Log(title = "技能标签", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody UserSkill userSkill) + { + return toAjax(userSkillService.insertUserSkill(userSkill)); + } + + /** + * 修改技能标签 + */ + @RequiresPermissions("app:skill:edit") + @Log(title = "技能标签", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody UserSkill userSkill) + { + return toAjax(userSkillService.updateUserSkill(userSkill)); + } + + /** + * 删除技能标签 + */ + @RequiresPermissions("app:skill:remove") + @Log(title = "技能标签", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(userSkillService.deleteUserSkillByIds(ids)); + } +} diff --git a/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/domain/AppUser.java b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/domain/AppUser.java index 559b949..12de46b 100644 --- a/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/domain/AppUser.java +++ b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/domain/AppUser.java @@ -1,5 +1,9 @@ package com.ruoyi.app.domain; +import java.util.Date; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonFormat; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.core.annotation.Excel; @@ -9,7 +13,7 @@ import com.ruoyi.common.core.web.domain.BaseEntity; * app用户对象 app_user * * @author wyh - * @date 2024-04-19 + * @date 2024-04-23 */ public class AppUser extends BaseEntity { @@ -46,6 +50,70 @@ public class AppUser extends BaseEntity @Excel(name = "头像") private String avatarUrl; + /** 学历 */ + @Excel(name = "学历") + private String education; + + /** 学校 */ + @Excel(name = "学校") + private String school; + + /** 专业 */ + @Excel(name = "专业") + private String major; + + /** 学历开始时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "学历开始时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date startTime; + + /** 学历结束时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "学历结束时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date endTime; + + /** 在校经历 */ + @Excel(name = "在校经历") + private String experience; + + /** 公司名称 */ + @Excel(name = "公司名称") + private String companyName; + + /** 行业 */ + @Excel(name = "行业") + private String industry; + + /** 在职时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "在职时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date jobTime; + + /** 职位名称 */ + @Excel(name = "职位名称") + private String jobName; + + /** 职位类别 */ + @Excel(name = "职位类别") + private String jobType; + + /** 技能id */ + @Excel(name = "技能id") + private Long skillId; + + /** 工作内容 */ + @Excel(name = "工作内容") + private String jobContent; + + /** 权限:0公开1私密 */ + @Excel(name = "权限:0公开1私密") + private Long type; + + @Excel(name = "技能标签,多个用,逗号隔开") + private String skills; + + private List userSkillList; + public void setId(Long id) { this.id = id; @@ -118,6 +186,149 @@ public class AppUser extends BaseEntity { return avatarUrl; } + public void setEducation(String education) + { + this.education = education; + } + + public String getEducation() + { + return education; + } + public void setSchool(String school) + { + this.school = school; + } + + public String getSchool() + { + return school; + } + public void setMajor(String major) + { + this.major = major; + } + + public String getMajor() + { + return major; + } + public void setStartTime(Date startTime) + { + this.startTime = startTime; + } + + public Date getStartTime() + { + return startTime; + } + public void setEndTime(Date endTime) + { + this.endTime = endTime; + } + + public Date getEndTime() + { + return endTime; + } + public void setExperience(String experience) + { + this.experience = experience; + } + + public String getExperience() + { + return experience; + } + public void setCompanyName(String companyName) + { + this.companyName = companyName; + } + + public String getCompanyName() + { + return companyName; + } + public void setIndustry(String industry) + { + this.industry = industry; + } + + public String getIndustry() + { + return industry; + } + public void setJobTime(Date jobTime) + { + this.jobTime = jobTime; + } + + public Date getJobTime() + { + return jobTime; + } + public void setJobName(String jobName) + { + this.jobName = jobName; + } + + public String getJobName() + { + return jobName; + } + public void setJobType(String jobType) + { + this.jobType = jobType; + } + + public String getJobType() + { + return jobType; + } + public void setSkillId(Long skillId) + { + this.skillId = skillId; + } + + public Long getSkillId() + { + return skillId; + } + public void setJobContent(String jobContent) + { + this.jobContent = jobContent; + } + + public String getJobContent() + { + return jobContent; + } + public void setType(Long type) + { + this.type = type; + } + + public Long getType() + { + return type; + } + + + public void setUserSkillList(List userSkillList) { + this.userSkillList = userSkillList; + } + + public List getUserSkillList() { + return userSkillList; + } + + public void setSkills(String skills) { + this.skills = skills; + } + + public String getSkills() { + return skills; + } @Override public String toString() { @@ -132,6 +343,21 @@ public class AppUser extends BaseEntity .append("createTime", getCreateTime()) .append("updateTime", getUpdateTime()) .append("avatarUrl", getAvatarUrl()) + .append("education", getEducation()) + .append("school", getSchool()) + .append("major", getMajor()) + .append("startTime", getStartTime()) + .append("endTime", getEndTime()) + .append("experience", getExperience()) + .append("companyName", getCompanyName()) + .append("industry", getIndustry()) + .append("jobTime", getJobTime()) + .append("jobName", getJobName()) + .append("jobType", getJobType()) + .append("skillId", getSkillId()) + .append("jobContent", getJobContent()) + .append("type", getType()) + .append("userSkillList", getUserSkillList()) .toString(); } } diff --git a/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/domain/UserSkill.java b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/domain/UserSkill.java new file mode 100644 index 0000000..20ff56e --- /dev/null +++ b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/domain/UserSkill.java @@ -0,0 +1,67 @@ +package com.ruoyi.app.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.core.annotation.Excel; +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 技能标签对象 user_skill + * + * @author wyh + * @date 2024-04-23 + */ +public class UserSkill extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** $column.columnComment */ + @Excel(name = "用户id") + private Long userId; + + /** 标签描述 */ + @Excel(name = "标签描述") + private String name; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("userId", getUserId()) + .append("name", getName()) + .append("createTime", getCreateTime()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/mapper/AppUserMapper.java b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/mapper/AppUserMapper.java new file mode 100644 index 0000000..d243dba --- /dev/null +++ b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/mapper/AppUserMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.app.mapper; + +import java.util.List; +import com.ruoyi.app.domain.AppUser; + +/** + * app用户Mapper接口 + * + * @author wyh + * @date 2024-04-23 + */ +public interface AppUserMapper +{ + /** + * 查询app用户 + * + * @param id app用户主键 + * @return app用户 + */ + public AppUser selectAppUserById(Long id); + + /** + * 查询app用户列表 + * + * @param appUser app用户 + * @return app用户集合 + */ + public List selectAppUserList(AppUser appUser); + + /** + * 新增app用户 + * + * @param appUser app用户 + * @return 结果 + */ + public int insertAppUser(AppUser appUser); + + /** + * 修改app用户 + * + * @param appUser app用户 + * @return 结果 + */ + public int updateAppUser(AppUser appUser); + + /** + * 删除app用户 + * + * @param id app用户主键 + * @return 结果 + */ + public int deleteAppUserById(Long id); + + /** + * 批量删除app用户 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteAppUserByIds(Long[] ids); +} diff --git a/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/mapper/UserSkillMapper.java b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/mapper/UserSkillMapper.java new file mode 100644 index 0000000..2a3540c --- /dev/null +++ b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/mapper/UserSkillMapper.java @@ -0,0 +1,64 @@ +package com.ruoyi.app.mapper; + +import java.util.List; +import com.ruoyi.app.domain.UserSkill; + +/** + * 技能标签Mapper接口 + * + * @author wyh + * @date 2024-04-23 + */ +public interface UserSkillMapper +{ + /** + * 查询技能标签 + * + * @param id 技能标签主键 + * @return 技能标签 + */ + public UserSkill selectUserSkillById(Long id); + + /** + * 查询技能标签列表 + * + * @param userSkill 技能标签 + * @return 技能标签集合 + */ + public List selectUserSkillList(UserSkill userSkill); + + /** + * 新增技能标签 + * + * @param userSkill 技能标签 + * @return 结果 + */ + public int insertUserSkill(UserSkill userSkill); + + /** + * 修改技能标签 + * + * @param userSkill 技能标签 + * @return 结果 + */ + public int updateUserSkill(UserSkill userSkill); + + /** + * 删除技能标签 + * + * @param id 技能标签主键 + * @return 结果 + */ + public int deleteUserSkillById(Long id); + + /** + * 批量删除技能标签 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteUserSkillByIds(Long[] ids); + + public int deleteUserSkillByUserId(Long userId); + +} diff --git a/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/service/IAppUserService.java b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/service/IAppUserService.java new file mode 100644 index 0000000..04f8587 --- /dev/null +++ b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/service/IAppUserService.java @@ -0,0 +1,61 @@ +package com.ruoyi.app.service; + +import java.util.List; +import com.ruoyi.app.domain.AppUser; + +/** + * app用户Service接口 + * + * @author wyh + * @date 2024-04-23 + */ +public interface IAppUserService +{ + /** + * 查询app用户 + * + * @param id app用户主键 + * @return app用户 + */ + public AppUser selectAppUserById(Long id); + + /** + * 查询app用户列表 + * + * @param appUser app用户 + * @return app用户集合 + */ + public List selectAppUserList(AppUser appUser); + + /** + * 新增app用户 + * + * @param appUser app用户 + * @return 结果 + */ + public int insertAppUser(AppUser appUser); + + /** + * 修改app用户 + * + * @param appUser app用户 + * @return 结果 + */ + public int updateAppUser(AppUser appUser); + + /** + * 批量删除app用户 + * + * @param ids 需要删除的app用户主键集合 + * @return 结果 + */ + public int deleteAppUserByIds(Long[] ids); + + /** + * 删除app用户信息 + * + * @param id app用户主键 + * @return 结果 + */ + public int deleteAppUserById(Long id); +} diff --git a/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/service/IUserSkillService.java b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/service/IUserSkillService.java new file mode 100644 index 0000000..f78cb83 --- /dev/null +++ b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/service/IUserSkillService.java @@ -0,0 +1,61 @@ +package com.ruoyi.app.service; + +import java.util.List; +import com.ruoyi.app.domain.UserSkill; + +/** + * 技能标签Service接口 + * + * @author wyh + * @date 2024-04-23 + */ +public interface IUserSkillService +{ + /** + * 查询技能标签 + * + * @param id 技能标签主键 + * @return 技能标签 + */ + public UserSkill selectUserSkillById(Long id); + + /** + * 查询技能标签列表 + * + * @param userSkill 技能标签 + * @return 技能标签集合 + */ + public List selectUserSkillList(UserSkill userSkill); + + /** + * 新增技能标签 + * + * @param userSkill 技能标签 + * @return 结果 + */ + public int insertUserSkill(UserSkill userSkill); + + /** + * 修改技能标签 + * + * @param userSkill 技能标签 + * @return 结果 + */ + public int updateUserSkill(UserSkill userSkill); + + /** + * 批量删除技能标签 + * + * @param ids 需要删除的技能标签主键集合 + * @return 结果 + */ + public int deleteUserSkillByIds(Long[] ids); + + /** + * 删除技能标签信息 + * + * @param id 技能标签主键 + * @return 结果 + */ + public int deleteUserSkillById(Long id); +} diff --git a/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/service/impl/AppUserServiceImpl.java b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/service/impl/AppUserServiceImpl.java new file mode 100644 index 0000000..5d7ab10 --- /dev/null +++ b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/service/impl/AppUserServiceImpl.java @@ -0,0 +1,122 @@ +package com.ruoyi.app.service.impl; + +import java.security.Security; +import java.util.Arrays; +import java.util.List; + +import com.ruoyi.app.domain.UserSkill; +import com.ruoyi.app.mapper.UserSkillMapper; +import com.ruoyi.common.core.utils.DateUtils; +import com.ruoyi.common.security.utils.SecurityUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.app.mapper.AppUserMapper; +import com.ruoyi.app.domain.AppUser; +import com.ruoyi.app.service.IAppUserService; + +/** + * app用户Service业务层处理 + * + * @author wyh + * @date 2024-04-23 + */ +@Service +public class AppUserServiceImpl implements IAppUserService +{ + @Autowired + private AppUserMapper appUserMapper; + + @Autowired + private UserSkillMapper userSkillMapper; + + /** + * 查询app用户 + * + * @param id app用户主键 + * @return app用户 + */ + @Override + public AppUser selectAppUserById(Long id) { + UserSkill userSkill = new UserSkill(); + userSkill.setUserId(id); + List userSkillList = userSkillMapper.selectUserSkillList(userSkill); + AppUser appUser = appUserMapper.selectAppUserById(id); + appUser.setUserSkillList(userSkillList); + return appUser; + } + + /** + * 查询app用户列表 + * + * @param appUser app用户 + * @return app用户 + */ + @Override + public List selectAppUserList(AppUser appUser) + { + return appUserMapper.selectAppUserList(appUser); + } + + /** + * 新增app用户 + * + * @param appUser app用户 + * @return 结果 + */ + @Override + public int insertAppUser(AppUser appUser) + { + appUser.setCreateTime(DateUtils.getNowDate()); + return appUserMapper.insertAppUser(appUser); + } + + /** + * 修改app用户 + * + * @param appUser app用户 + * @return 结果 + */ + @Override + public int updateAppUser(AppUser appUser) + { + appUser.setUpdateTime(DateUtils.getNowDate()); + if (StringUtils.isNotBlank(appUser.getSkills())) { + // 删除标签 + + // 保存技能标签 + List skills = Arrays.asList(appUser.getSkills().split(",")); + for (String skill : skills) { + UserSkill userSkill = new UserSkill(); + userSkill.setName(skill); + userSkill.setUserId(appUser.getId()); + userSkillMapper.insertUserSkill(userSkill); + } + } + return appUserMapper.updateAppUser(appUser); + } + + /** + * 批量删除app用户 + * + * @param ids 需要删除的app用户主键 + * @return 结果 + */ + @Override + public int deleteAppUserByIds(Long[] ids) + { + return appUserMapper.deleteAppUserByIds(ids); + } + + /** + * 删除app用户信息 + * + * @param id app用户主键 + * @return 结果 + */ + @Override + public int deleteAppUserById(Long id) + { + return appUserMapper.deleteAppUserById(id); + } +} diff --git a/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/service/impl/UserSkillServiceImpl.java b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/service/impl/UserSkillServiceImpl.java new file mode 100644 index 0000000..3c7f2fa --- /dev/null +++ b/gan-modules/ruoyi-gan/src/main/java/com/ruoyi/app/service/impl/UserSkillServiceImpl.java @@ -0,0 +1,96 @@ +package com.ruoyi.app.service.impl; + +import java.util.List; +import com.ruoyi.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.app.mapper.UserSkillMapper; +import com.ruoyi.app.domain.UserSkill; +import com.ruoyi.app.service.IUserSkillService; + +/** + * 技能标签Service业务层处理 + * + * @author wyh + * @date 2024-04-23 + */ +@Service +public class UserSkillServiceImpl implements IUserSkillService +{ + @Autowired + private UserSkillMapper userSkillMapper; + + /** + * 查询技能标签 + * + * @param id 技能标签主键 + * @return 技能标签 + */ + @Override + public UserSkill selectUserSkillById(Long id) + { + return userSkillMapper.selectUserSkillById(id); + } + + /** + * 查询技能标签列表 + * + * @param userSkill 技能标签 + * @return 技能标签 + */ + @Override + public List selectUserSkillList(UserSkill userSkill) + { + return userSkillMapper.selectUserSkillList(userSkill); + } + + /** + * 新增技能标签 + * + * @param userSkill 技能标签 + * @return 结果 + */ + @Override + public int insertUserSkill(UserSkill userSkill) + { + userSkill.setCreateTime(DateUtils.getNowDate()); + return userSkillMapper.insertUserSkill(userSkill); + } + + /** + * 修改技能标签 + * + * @param userSkill 技能标签 + * @return 结果 + */ + @Override + public int updateUserSkill(UserSkill userSkill) + { + userSkill.setUpdateTime(DateUtils.getNowDate()); + return userSkillMapper.updateUserSkill(userSkill); + } + + /** + * 批量删除技能标签 + * + * @param ids 需要删除的技能标签主键 + * @return 结果 + */ + @Override + public int deleteUserSkillByIds(Long[] ids) + { + return userSkillMapper.deleteUserSkillByIds(ids); + } + + /** + * 删除技能标签信息 + * + * @param id 技能标签主键 + * @return 结果 + */ + @Override + public int deleteUserSkillById(Long id) + { + return userSkillMapper.deleteUserSkillById(id); + } +} diff --git a/gan-modules/ruoyi-gan/src/main/resources/mapper/app/AppUserMapper.xml b/gan-modules/ruoyi-gan/src/main/resources/mapper/app/AppUserMapper.xml new file mode 100644 index 0000000..8ed27e9 --- /dev/null +++ b/gan-modules/ruoyi-gan/src/main/resources/mapper/app/AppUserMapper.xml @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, username, password, nickname, email, phone, address, create_time, update_time, avatar_url, education, school, major, start_time, end_time, experience, company_name, industry, job_time, job_name, job_type, skill_id, job_content, type from app_user + + + + + + + + insert into app_user + + username, + password, + nickname, + email, + phone, + address, + create_time, + update_time, + avatar_url, + education, + school, + major, + start_time, + end_time, + experience, + company_name, + industry, + job_time, + job_name, + job_type, + skill_id, + job_content, + type, + + + #{username}, + #{password}, + #{nickname}, + #{email}, + #{phone}, + #{address}, + #{createTime}, + #{updateTime}, + #{avatarUrl}, + #{education}, + #{school}, + #{major}, + #{startTime}, + #{endTime}, + #{experience}, + #{companyName}, + #{industry}, + #{jobTime}, + #{jobName}, + #{jobType}, + #{skillId}, + #{jobContent}, + #{type}, + + + + + update app_user + + username = #{username}, + password = #{password}, + nickname = #{nickname}, + email = #{email}, + phone = #{phone}, + address = #{address}, + create_time = #{createTime}, + update_time = #{updateTime}, + avatar_url = #{avatarUrl}, + education = #{education}, + school = #{school}, + major = #{major}, + start_time = #{startTime}, + end_time = #{endTime}, + experience = #{experience}, + company_name = #{companyName}, + industry = #{industry}, + job_time = #{jobTime}, + job_name = #{jobName}, + job_type = #{jobType}, + skill_id = #{skillId}, + job_content = #{jobContent}, + type = #{type}, + + where id = #{id} + + + + delete from app_user where id = #{id} + + + + delete from app_user where id in + + #{id} + + + \ No newline at end of file diff --git a/gan-modules/ruoyi-gan/src/main/resources/mapper/app/UserSkillMapper.xml b/gan-modules/ruoyi-gan/src/main/resources/mapper/app/UserSkillMapper.xml new file mode 100644 index 0000000..8ee161e --- /dev/null +++ b/gan-modules/ruoyi-gan/src/main/resources/mapper/app/UserSkillMapper.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + select id, user_id, name, create_time, update_time from user_skill + + + + + + + > + insert into user_skill + + user_id, + name, + create_time, + update_time, + + + #{id}, + #{userId}, + #{name}, + #{createTime}, + #{updateTime}, + + + + + update user_skill + + user_id = #{userId}, + name = #{name}, + create_time = #{createTime}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from user_skill where id = #{id} + + + + delete from user_skill where user_id = #{userId} + + + + delete from user_skill where id in + + #{id} + + + \ No newline at end of file