个人信息完善

main
linhw 2024-04-23 13:04:03 +08:00
parent e29df7e02c
commit 80c076a16f
12 changed files with 1207 additions and 1 deletions

View File

@ -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<AppUser> 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<AppUser> list = appUserService.selectAppUserList(appUser);
ExcelUtil<AppUser> util = new ExcelUtil<AppUser>(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));
}
}

View File

@ -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<UserSkill> 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<UserSkill> list = userSkillService.selectUserSkillList(userSkill);
ExcelUtil<UserSkill> util = new ExcelUtil<UserSkill>(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));
}
}

View File

@ -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<UserSkill> 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<UserSkill> userSkillList) {
this.userSkillList = userSkillList;
}
public List<UserSkill> 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();
}
}

View File

@ -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();
}
}

View File

@ -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<AppUser> 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);
}

View File

@ -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<UserSkill> 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);
}

View File

@ -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<AppUser> 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);
}

View File

@ -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<UserSkill> 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);
}

View File

@ -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<UserSkill> userSkillList = userSkillMapper.selectUserSkillList(userSkill);
AppUser appUser = appUserMapper.selectAppUserById(id);
appUser.setUserSkillList(userSkillList);
return appUser;
}
/**
* 查询app用户列表
*
* @param appUser app用户
* @return app用户
*/
@Override
public List<AppUser> 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<String> 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);
}
}

View File

@ -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<UserSkill> 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);
}
}

View File

@ -0,0 +1,164 @@
<?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="com.ruoyi.app.mapper.AppUserMapper">
<resultMap type="AppUser" id="AppUserResult">
<result property="id" column="id" />
<result property="username" column="username" />
<result property="password" column="password" />
<result property="nickname" column="nickname" />
<result property="email" column="email" />
<result property="phone" column="phone" />
<result property="address" column="address" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="avatarUrl" column="avatar_url" />
<result property="education" column="education" />
<result property="school" column="school" />
<result property="major" column="major" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
<result property="experience" column="experience" />
<result property="companyName" column="company_name" />
<result property="industry" column="industry" />
<result property="jobTime" column="job_time" />
<result property="jobName" column="job_name" />
<result property="jobType" column="job_type" />
<result property="skillId" column="skill_id" />
<result property="jobContent" column="job_content" />
<result property="type" column="type" />
</resultMap>
<sql id="selectAppUserVo">
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
</sql>
<select id="selectAppUserList" parameterType="AppUser" resultMap="AppUserResult">
<include refid="selectAppUserVo"/>
<where>
<if test="username != null and username != ''"> and username like concat('%', #{username}, '%')</if>
<if test="password != null and password != ''"> and password = #{password}</if>
<if test="nickname != null and nickname != ''"> and nickname like concat('%', #{nickname}, '%')</if>
<if test="email != null and email != ''"> and email = #{email}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="avatarUrl != null and avatarUrl != ''"> and avatar_url = #{avatarUrl}</if>
<if test="education != null and education != ''"> and education = #{education}</if>
<if test="school != null and school != ''"> and school = #{school}</if>
<if test="major != null and major != ''"> and major = #{major}</if>
<if test="startTime != null "> and start_time = #{startTime}</if>
<if test="endTime != null "> and end_time = #{endTime}</if>
<if test="experience != null and experience != ''"> and experience = #{experience}</if>
<if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
<if test="industry != null and industry != ''"> and industry = #{industry}</if>
<if test="jobTime != null "> and job_time = #{jobTime}</if>
<if test="jobName != null and jobName != ''"> and job_name like concat('%', #{jobName}, '%')</if>
<if test="jobType != null and jobType != ''"> and job_type = #{jobType}</if>
<if test="skillId != null and skillId != ''"> and skill_id = #{skillId}</if>
<if test="jobContent != null and jobContent != ''"> and job_content = #{jobContent}</if>
<if test="type != null "> and type = #{type}</if>
</where>
</select>
<select id="selectAppUserById" parameterType="Long" resultMap="AppUserResult">
<include refid="selectAppUserVo"/>
where id = #{id}
</select>
<insert id="insertAppUser" parameterType="AppUser" useGeneratedKeys="true" keyProperty="id">
insert into app_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="username != null">username,</if>
<if test="password != null">password,</if>
<if test="nickname != null">nickname,</if>
<if test="email != null">email,</if>
<if test="phone != null">phone,</if>
<if test="address != null">address,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="avatarUrl != null">avatar_url,</if>
<if test="education != null">education,</if>
<if test="school != null">school,</if>
<if test="major != null">major,</if>
<if test="startTime != null">start_time,</if>
<if test="endTime != null">end_time,</if>
<if test="experience != null">experience,</if>
<if test="companyName != null">company_name,</if>
<if test="industry != null">industry,</if>
<if test="jobTime != null">job_time,</if>
<if test="jobName != null">job_name,</if>
<if test="jobType != null">job_type,</if>
<if test="skillId != null">skill_id,</if>
<if test="jobContent != null">job_content,</if>
<if test="type != null">type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="username != null">#{username},</if>
<if test="password != null">#{password},</if>
<if test="nickname != null">#{nickname},</if>
<if test="email != null">#{email},</if>
<if test="phone != null">#{phone},</if>
<if test="address != null">#{address},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="avatarUrl != null">#{avatarUrl},</if>
<if test="education != null">#{education},</if>
<if test="school != null">#{school},</if>
<if test="major != null">#{major},</if>
<if test="startTime != null">#{startTime},</if>
<if test="endTime != null">#{endTime},</if>
<if test="experience != null">#{experience},</if>
<if test="companyName != null">#{companyName},</if>
<if test="industry != null">#{industry},</if>
<if test="jobTime != null">#{jobTime},</if>
<if test="jobName != null">#{jobName},</if>
<if test="jobType != null">#{jobType},</if>
<if test="skillId != null">#{skillId},</if>
<if test="jobContent != null">#{jobContent},</if>
<if test="type != null">#{type},</if>
</trim>
</insert>
<update id="updateAppUser" parameterType="AppUser">
update app_user
<trim prefix="SET" suffixOverrides=",">
<if test="username != null">username = #{username},</if>
<if test="password != null">password = #{password},</if>
<if test="nickname != null">nickname = #{nickname},</if>
<if test="email != null">email = #{email},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="address != null">address = #{address},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="avatarUrl != null">avatar_url = #{avatarUrl},</if>
<if test="education != null">education = #{education},</if>
<if test="school != null">school = #{school},</if>
<if test="major != null">major = #{major},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="experience != null">experience = #{experience},</if>
<if test="companyName != null">company_name = #{companyName},</if>
<if test="industry != null">industry = #{industry},</if>
<if test="jobTime != null">job_time = #{jobTime},</if>
<if test="jobName != null">job_name = #{jobName},</if>
<if test="jobType != null">job_type = #{jobType},</if>
<if test="skillId != null">skill_id = #{skillId},</if>
<if test="jobContent != null">job_content = #{jobContent},</if>
<if test="type != null">type = #{type},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteAppUserById" parameterType="Long">
delete from app_user where id = #{id}
</delete>
<delete id="deleteAppUserByIds" parameterType="String">
delete from app_user where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,74 @@
<?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="com.ruoyi.app.mapper.UserSkillMapper">
<resultMap type="UserSkill" id="UserSkillResult">
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="name" column="name" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectUserSkillVo">
select id, user_id, name, create_time, update_time from user_skill
</sql>
<select id="selectUserSkillList" parameterType="UserSkill" resultMap="UserSkillResult">
<include refid="selectUserSkillVo"/>
<where>
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
</where>
</select>
<select id="selectUserSkillById" resultMap="UserSkillResult">
<include refid="selectUserSkillVo"/>
where id = #{id}
</select>
<insert id="insertUserSkill" parameterType="UserSkill" useGeneratedKeys="true" keyProperty="id">>
insert into user_skill
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">user_id,</if>
<if test="name != null">name,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="userId != null">#{userId},</if>
<if test="name != null">#{name},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateUserSkill" parameterType="UserSkill">
update user_skill
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="name != null">name = #{name},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteUserSkillById">
delete from user_skill where id = #{id}
</delete>
<delete id="deleteUserSkillByUserId">
delete from user_skill where user_id = #{userId}
</delete>
<delete id="deleteUserSkillByIds">
delete from user_skill where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>