图片附件,注册密码,账号登陆
This commit is contained in:
parent
9287270fdb
commit
489ddfff57
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.ruoyi.web.controller.app;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.Result;
|
||||||
|
import com.ruoyi.system.domain.TbUser;
|
||||||
|
import com.ruoyi.system.service.ITbUserService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.apache.commons.codec.digest.DigestUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@Api(tags = "App*用户信息")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "/app/user")
|
||||||
|
public class TbUserAppController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ITbUserService tbUserService;
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ApiOperation(value = "注册用户", httpMethod = "POST")
|
||||||
|
public Result<TbUser> addSave(@RequestBody TbUser tbUser)
|
||||||
|
{
|
||||||
|
tbUser.setPassword(DigestUtils.md5Hex(tbUser.getPassword()));
|
||||||
|
int effectiveRows = tbUserService.insertTbUser(tbUser);
|
||||||
|
if(effectiveRows > 0){
|
||||||
|
return Result.success(tbUser);
|
||||||
|
}else {
|
||||||
|
return Result.error("注册用户失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
package com.ruoyi.web.controller.app;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.Result;
|
||||||
|
import com.ruoyi.system.domain.TbUserImg;
|
||||||
|
import com.ruoyi.system.service.ITbUserImgService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Api(tags = "App*单身用户图片附件")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "/app/img")
|
||||||
|
public class TbUserImgAppController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ITbUserImgService tbUserImgService;
|
||||||
|
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/getByUserId")
|
||||||
|
@ApiOperation(value = "通过userId获取用户所有图片附件", httpMethod = "POST")
|
||||||
|
public Result<List<TbUserImg>> getByUserId(@RequestBody TbUserImg tbUserImg)
|
||||||
|
{
|
||||||
|
return Result.success(tbUserImgService.lambdaQuery().eq(TbUserImg::getUserId, tbUserImg.getUserId()).list());
|
||||||
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ApiOperation(value = "上传用户附件", httpMethod = "POST")
|
||||||
|
public Result<String> addSave(@RequestBody TbUserImg tbUserImg)
|
||||||
|
{
|
||||||
|
int effectiveRows = tbUserImgService.insertTbUserImg(tbUserImg);
|
||||||
|
if(effectiveRows > 0){
|
||||||
|
return Result.success("上传用户附件成功");
|
||||||
|
}
|
||||||
|
return Result.error("上传用户附件失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/edit")
|
||||||
|
public Result<String> editSave(@RequestBody TbUserImg tbUserImg)
|
||||||
|
{
|
||||||
|
int effectiveRows = tbUserImgService.updateTbUserImg(tbUserImg);
|
||||||
|
if(effectiveRows > 0){
|
||||||
|
return Result.success("修改用户附件成功");
|
||||||
|
}
|
||||||
|
return Result.error("修改用户附件失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,81 @@
|
||||||
|
package com.ruoyi.web.controller.app;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.domain.Result;
|
||||||
|
import com.ruoyi.system.domain.TbUserSingle;
|
||||||
|
import com.ruoyi.system.service.ITbUserSingleService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>登陆相关接口</p>
|
||||||
|
* @author clunt
|
||||||
|
*/
|
||||||
|
@Api(tags = "App*单身信息")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "/app/single")
|
||||||
|
public class TbUserSingleAppController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ITbUserSingleService tbUserSingleService;
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ApiOperation(value = "填写用户信息", httpMethod = "POST")
|
||||||
|
public Result<String> addSave(@RequestBody TbUserSingle tbUserSingle)
|
||||||
|
{
|
||||||
|
int effectiveRows = tbUserSingleService.insertTbUserSingle(tbUserSingle);
|
||||||
|
if(effectiveRows > 0){
|
||||||
|
return Result.success("填写用户信息成功!");
|
||||||
|
}else {
|
||||||
|
return Result.error("填写用户信息失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/getByUserId")
|
||||||
|
@ApiOperation(value = "通过userId获取用户信息", httpMethod = "POST")
|
||||||
|
public Result<TbUserSingle> getByUserId(@RequestBody TbUserSingle tbUserSingle)
|
||||||
|
{
|
||||||
|
TbUserSingle userSingle = tbUserSingleService.lambdaQuery().eq(TbUserSingle::getUserId, tbUserSingle.getUserId()).one();
|
||||||
|
return Result.success(userSingle);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/edit")
|
||||||
|
@ApiOperation(value = "更新用户信息", httpMethod = "POST")
|
||||||
|
public Result<String> editSave(@RequestBody TbUserSingle tbUserSingle)
|
||||||
|
{
|
||||||
|
int effectiveRows = tbUserSingleService.updateTbUserSingle(tbUserSingle);
|
||||||
|
if(effectiveRows > 0){
|
||||||
|
return Result.success("更新用户信息成功!");
|
||||||
|
}else {
|
||||||
|
return Result.error("更新用户信息失败!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/recommend")
|
||||||
|
@ApiOperation(value = "获取推荐用户.第一版不排除自己", httpMethod = "POST")
|
||||||
|
@ApiImplicitParams({ @ApiImplicitParam(name = "pageNum", value = "当前页码", required = true, dataType = "int"),
|
||||||
|
@ApiImplicitParam(name = "pageSize", value = "每页显示的条数", required = true, dataType = "int") })
|
||||||
|
public Result<PageInfo<TbUserSingle>> recommend(@RequestBody TbUserSingle tbUserSingle,
|
||||||
|
@RequestParam("pageNum") int pageNum,
|
||||||
|
@RequestParam("pageSize") int pageSize) {
|
||||||
|
PageHelper.startPage(pageNum, pageSize);
|
||||||
|
List<TbUserSingle> list = tbUserSingleService.selectTbUserSingleList(tbUserSingle);
|
||||||
|
return Result.success(PageInfo.of(list));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,127 @@
|
||||||
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.ModelMap;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.system.domain.TbUserImg;
|
||||||
|
import com.ruoyi.system.service.ITbUserImgService;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户图片附件Controller
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-12-11
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/system/img")
|
||||||
|
public class TbUserImgController extends BaseController
|
||||||
|
{
|
||||||
|
private String prefix = "system/img";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ITbUserImgService tbUserImgService;
|
||||||
|
|
||||||
|
@RequiresPermissions("system:img:view")
|
||||||
|
@GetMapping()
|
||||||
|
public String img()
|
||||||
|
{
|
||||||
|
return prefix + "/img";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户图片附件列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:img:list")
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(TbUserImg tbUserImg)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<TbUserImg> list = tbUserImgService.selectTbUserImgList(tbUserImg);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出用户图片附件列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:img:export")
|
||||||
|
@Log(title = "用户图片附件", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult export(TbUserImg tbUserImg)
|
||||||
|
{
|
||||||
|
List<TbUserImg> list = tbUserImgService.selectTbUserImgList(tbUserImg);
|
||||||
|
ExcelUtil<TbUserImg> util = new ExcelUtil<TbUserImg>(TbUserImg.class);
|
||||||
|
return util.exportExcel(list, "用户图片附件数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增用户图片附件
|
||||||
|
*/
|
||||||
|
@GetMapping("/add")
|
||||||
|
public String add()
|
||||||
|
{
|
||||||
|
return prefix + "/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增保存用户图片附件
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:img:add")
|
||||||
|
@Log(title = "用户图片附件", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult addSave(TbUserImg tbUserImg)
|
||||||
|
{
|
||||||
|
return toAjax(tbUserImgService.insertTbUserImg(tbUserImg));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户图片附件
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:img:edit")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
||||||
|
{
|
||||||
|
TbUserImg tbUserImg = tbUserImgService.selectTbUserImgById(id);
|
||||||
|
mmap.put("tbUserImg", tbUserImg);
|
||||||
|
return prefix + "/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存用户图片附件
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:img:edit")
|
||||||
|
@Log(title = "用户图片附件", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/edit")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult editSave(TbUserImg tbUserImg)
|
||||||
|
{
|
||||||
|
return toAjax(tbUserImgService.updateTbUserImg(tbUserImg));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户图片附件
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:img:remove")
|
||||||
|
@Log(title = "用户图片附件", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping( "/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids)
|
||||||
|
{
|
||||||
|
return toAjax(tbUserImgService.deleteTbUserImgByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -50,7 +50,11 @@ public class LoginServiceImpl implements LoginService {
|
||||||
if(tbUser == null){
|
if(tbUser == null){
|
||||||
tbUser = new TbUser();
|
tbUser = new TbUser();
|
||||||
tbUser.setMobile(loginReq.getMobile());
|
tbUser.setMobile(loginReq.getMobile());
|
||||||
tbUser.setPassword(DigestUtils.md5Hex(DEFAULT_PASSWORD));
|
if(StringUtils.isEmpty(loginReq.getPassword())){
|
||||||
|
tbUser.setPassword(DigestUtils.md5Hex(DEFAULT_PASSWORD));
|
||||||
|
}else {
|
||||||
|
tbUser.setPassword(DigestUtils.md5Hex(loginReq.getPassword()));
|
||||||
|
}
|
||||||
tbUser.setCreateTime(new Date());
|
tbUser.setCreateTime(new Date());
|
||||||
tbUser.setCreateBy(DEFAULT_CREATE_BY);
|
tbUser.setCreateBy(DEFAULT_CREATE_BY);
|
||||||
tbUserService.save(tbUser);
|
tbUserService.save(tbUser);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,49 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||||
|
<head>
|
||||||
|
<th:block th:include="include :: header('新增用户图片附件')" />
|
||||||
|
</head>
|
||||||
|
<body class="white-bg">
|
||||||
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||||
|
<form class="form-horizontal m" id="form-img-add">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label is-required">用户id:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="userId" class="form-control" type="text" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">类型:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="type" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label is-required">图片url地址:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<textarea name="imgUrl" class="form-control" required></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">状态:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="remark" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var prefix = ctx + "system/img"
|
||||||
|
$("#form-img-add").validate({
|
||||||
|
focusCleanup: true
|
||||||
|
});
|
||||||
|
|
||||||
|
function submitHandler() {
|
||||||
|
if ($.validate.form()) {
|
||||||
|
$.operate.save(prefix + "/add", $('#form-img-add').serialize());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||||
|
<head>
|
||||||
|
<th:block th:include="include :: header('修改用户图片附件')" />
|
||||||
|
</head>
|
||||||
|
<body class="white-bg">
|
||||||
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||||
|
<form class="form-horizontal m" id="form-img-edit" th:object="${tbUserImg}">
|
||||||
|
<input name="id" th:field="*{id}" type="hidden">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label is-required">用户id:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="userId" th:field="*{userId}" class="form-control" type="text" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">类型:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="type" th:field="*{type}" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label is-required">图片url地址:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<textarea name="imgUrl" class="form-control" required>[[*{imgUrl}]]</textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">状态:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="remark" th:field="*{remark}" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var prefix = ctx + "system/img";
|
||||||
|
$("#form-img-edit").validate({
|
||||||
|
focusCleanup: true
|
||||||
|
});
|
||||||
|
|
||||||
|
function submitHandler() {
|
||||||
|
if ($.validate.form()) {
|
||||||
|
$.operate.save(prefix + "/edit", $('#form-img-edit').serialize());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,98 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||||
|
<head>
|
||||||
|
<th:block th:include="include :: header('用户图片附件列表')" />
|
||||||
|
</head>
|
||||||
|
<body class="gray-bg">
|
||||||
|
<div class="container-div">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12 search-collapse">
|
||||||
|
<form id="formId">
|
||||||
|
<div class="select-list">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<label>用户id:</label>
|
||||||
|
<input type="text" name="userId"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||||
|
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="btn-group-sm" id="toolbar" role="group">
|
||||||
|
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:img:add">
|
||||||
|
<i class="fa fa-plus"></i> 添加
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:img:edit">
|
||||||
|
<i class="fa fa-edit"></i> 修改
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:img:remove">
|
||||||
|
<i class="fa fa-remove"></i> 删除
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:img:export">
|
||||||
|
<i class="fa fa-download"></i> 导出
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-12 select-table table-striped">
|
||||||
|
<table id="bootstrap-table"></table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var editFlag = [[${@permission.hasPermi('system:img:edit')}]];
|
||||||
|
var removeFlag = [[${@permission.hasPermi('system:img:remove')}]];
|
||||||
|
var prefix = ctx + "system/img";
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
var options = {
|
||||||
|
url: prefix + "/list",
|
||||||
|
createUrl: prefix + "/add",
|
||||||
|
updateUrl: prefix + "/edit/{id}",
|
||||||
|
removeUrl: prefix + "/remove",
|
||||||
|
exportUrl: prefix + "/export",
|
||||||
|
modalName: "用户图片附件",
|
||||||
|
columns: [{
|
||||||
|
checkbox: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'id',
|
||||||
|
title: '应用用户id',
|
||||||
|
visible: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'userId',
|
||||||
|
title: '用户id'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'type',
|
||||||
|
title: '图片类型,0.头像 1.学历证明 2.房产证明 3.车证明'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'imgUrl',
|
||||||
|
title: '图片url地址'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'remark',
|
||||||
|
title: '状态'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function(value, row, index) {
|
||||||
|
var actions = [];
|
||||||
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||||
|
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
$.table.init(options);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.ruoyi.system.domain;
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
@ -15,6 +17,7 @@ import lombok.EqualsAndHashCode;
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@TableName(value = "tb_user")
|
@TableName(value = "tb_user")
|
||||||
|
@ApiModel(value = "App*用户信息")
|
||||||
public class TbUser extends BaseEntity
|
public class TbUser extends BaseEntity
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
@ -24,10 +27,12 @@ public class TbUser extends BaseEntity
|
||||||
|
|
||||||
/** 用户手机号 */
|
/** 用户手机号 */
|
||||||
@Excel(name = "用户手机号")
|
@Excel(name = "用户手机号")
|
||||||
|
@ApiModelProperty(value = "用户手机号")
|
||||||
private String mobile;
|
private String mobile;
|
||||||
|
|
||||||
/** 密码(需加密存储) */
|
/** 密码(需加密存储) */
|
||||||
@Excel(name = "密码(需加密存储)")
|
@Excel(name = "密码(需加密存储)")
|
||||||
|
@ApiModelProperty(value = "用户密码,前端传明文")
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户图片附件对象 tb_user_img
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-12-11
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName(value = "tb_user_img")
|
||||||
|
@ApiModel(value = "用户图片附件对象")
|
||||||
|
public class TbUserImg extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 应用用户id */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 用户id */
|
||||||
|
@Excel(name = "用户id")
|
||||||
|
@ApiModelProperty(value = "用户id")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/** 图片类型,0.头像 1.学历证明 2.房产证明 3.车证明 */
|
||||||
|
@Excel(name = "图片类型,0.头像 1.学历证明 2.房产证明 3.车证明")
|
||||||
|
@ApiModelProperty(value = "图片类型,0.头像 1.学历证明 2.房产证明 3.车证明")
|
||||||
|
private Long type;
|
||||||
|
|
||||||
|
/** 图片url地址 */
|
||||||
|
@Excel(name = "图片url地址")
|
||||||
|
@ApiModelProperty(value = "图片url地址")
|
||||||
|
private String imgUrl;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -3,6 +3,8 @@ package com.ruoyi.system.domain;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
|
@ -17,97 +19,119 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@TableName(value = "tb_user_single")
|
@TableName(value = "tb_user_single")
|
||||||
|
@ApiModel(value = "单身用户信息")
|
||||||
public class TbUserSingle extends BaseEntity
|
public class TbUserSingle extends BaseEntity
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 主键 */
|
/** 主键 */
|
||||||
|
@ApiModelProperty(value = "主键id")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/** 用户id【tb_user.id】 */
|
/** 用户id【tb_user.id】 */
|
||||||
@Excel(name = "用户id【tb_user.id】")
|
@Excel(name = "用户id【tb_user.id】")
|
||||||
|
@ApiModelProperty(value = "用户id【tb_user.id】")
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
/** 昵称 */
|
/** 昵称 */
|
||||||
@Excel(name = "昵称")
|
@Excel(name = "昵称")
|
||||||
|
@ApiModelProperty(value = "昵称")
|
||||||
private String nickName;
|
private String nickName;
|
||||||
|
|
||||||
/** 真实姓名 */
|
/** 真实姓名 */
|
||||||
@Excel(name = "真实姓名")
|
@Excel(name = "真实姓名")
|
||||||
|
@ApiModelProperty(value = "真实姓名")
|
||||||
private String realName;
|
private String realName;
|
||||||
|
|
||||||
/** 性别: 0.未知 1.男 2.女 */
|
/** 性别: 0.未知 1.男 2.女 */
|
||||||
@Excel(name = "性别: 0.未知 1.男 2.女")
|
@Excel(name = "性别: 0.未知 1.男 2.女")
|
||||||
|
@ApiModelProperty(value = "性别: 0.未知 1.男 2.女")
|
||||||
private Long sex;
|
private Long sex;
|
||||||
|
|
||||||
/** 出生年月 */
|
/** 出生年月 */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@Excel(name = "出生年月", width = 30, dateFormat = "yyyy-MM-dd")
|
@Excel(name = "出生年月", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
@ApiModelProperty(value = "出生年月")
|
||||||
private Date birthday;
|
private Date birthday;
|
||||||
|
|
||||||
/** 身高(单位cm) */
|
/** 身高(单位cm) */
|
||||||
@Excel(name = "身高(单位cm)")
|
@Excel(name = "身高(单位cm)")
|
||||||
|
@ApiModelProperty(value = "身高(单位cm)")
|
||||||
private Long height;
|
private Long height;
|
||||||
|
|
||||||
/** 体重(单位KG) */
|
/** 体重(单位KG) */
|
||||||
@Excel(name = "体重(单位KG)")
|
@Excel(name = "体重(单位KG)")
|
||||||
|
@ApiModelProperty(value = "体重(单位KG)")
|
||||||
private Long weight;
|
private Long weight;
|
||||||
|
|
||||||
/** 学历 0.大专以下 1.大专 2.本科 3.研究生 4.博士 */
|
/** 学历 0.大专以下 1.大专 2.本科 3.研究生 4.博士 */
|
||||||
@Excel(name = "学历 0.大专以下 1.大专 2.本科 3.研究生 4.博士")
|
@Excel(name = "学历 0.大专以下 1.大专 2.本科 3.研究生 4.博士")
|
||||||
|
@ApiModelProperty(value = "学历 0.大专以下 1.大专 2.本科 3.研究生 4.博士")
|
||||||
private Long education;
|
private Long education;
|
||||||
|
|
||||||
/** 毕业院校 */
|
/** 毕业院校 */
|
||||||
@Excel(name = "毕业院校")
|
@Excel(name = "毕业院校")
|
||||||
|
@ApiModelProperty(value = "毕业院校")
|
||||||
private String school;
|
private String school;
|
||||||
|
|
||||||
/** 婚姻状况 0.未婚 1.离异 */
|
/** 婚姻状况 0.未婚 1.离异 */
|
||||||
@Excel(name = "婚姻状况 0.未婚 1.离异")
|
@Excel(name = "婚姻状况 0.未婚 1.离异")
|
||||||
|
@ApiModelProperty(value = "婚姻状况 0.未婚 1.离异")
|
||||||
private Long marriage;
|
private Long marriage;
|
||||||
|
|
||||||
/** 职业 */
|
/** 职业 */
|
||||||
@Excel(name = "职业")
|
@Excel(name = "职业")
|
||||||
|
@ApiModelProperty(value = "职业")
|
||||||
private String job;
|
private String job;
|
||||||
|
|
||||||
/** 收入(元/年) */
|
/** 收入(元/年) */
|
||||||
@Excel(name = "收入(元/年)")
|
@Excel(name = "收入(元/年)")
|
||||||
|
@ApiModelProperty(value = "收入(元/年)")
|
||||||
private Long income;
|
private Long income;
|
||||||
|
|
||||||
/** 籍贯 */
|
/** 籍贯 */
|
||||||
@Excel(name = "籍贯")
|
@Excel(name = "籍贯")
|
||||||
|
@ApiModelProperty(value = "籍贯")
|
||||||
private String nativePlace;
|
private String nativePlace;
|
||||||
|
|
||||||
/** 省份 */
|
/** 省份 */
|
||||||
@Excel(name = "省份")
|
@Excel(name = "省份")
|
||||||
|
@ApiModelProperty(value = "省份")
|
||||||
private Long provinceId;
|
private Long provinceId;
|
||||||
|
|
||||||
/** 城市 */
|
/** 城市 */
|
||||||
@Excel(name = "城市")
|
@Excel(name = "城市")
|
||||||
|
@ApiModelProperty(value = "城市")
|
||||||
private Long cityId;
|
private Long cityId;
|
||||||
|
|
||||||
/** 是否有房产 0.无房 1.有房 */
|
/** 是否有房产 0.无房 1.有房 */
|
||||||
@Excel(name = "是否有房产 0.无房 1.有房")
|
@Excel(name = "是否有房产 0.无房 1.有房")
|
||||||
|
@ApiModelProperty(value = "是否有房产 0.无房 1.有房")
|
||||||
private Long houseProperty;
|
private Long houseProperty;
|
||||||
|
|
||||||
/** 是否有车 0.无车 1.有车 */
|
/** 是否有车 0.无车 1.有车 */
|
||||||
@Excel(name = "是否有车 0.无车 1.有车")
|
@Excel(name = "是否有车 0.无车 1.有车")
|
||||||
|
@ApiModelProperty(value = "是否有车 0.无车 1.有车")
|
||||||
private Long carProperty;
|
private Long carProperty;
|
||||||
|
|
||||||
/** 自我介绍 */
|
/** 自我介绍 */
|
||||||
@Excel(name = "自我介绍")
|
@Excel(name = "自我介绍")
|
||||||
|
@ApiModelProperty(value = "自我介绍")
|
||||||
private String selfIntroduce;
|
private String selfIntroduce;
|
||||||
|
|
||||||
/** 家庭背景 */
|
/** 家庭背景 */
|
||||||
@Excel(name = "家庭背景")
|
@Excel(name = "家庭背景")
|
||||||
|
@ApiModelProperty(value = "家庭背景")
|
||||||
private String familyBackground;
|
private String familyBackground;
|
||||||
|
|
||||||
/** 业务爱好 */
|
/** 业务爱好 */
|
||||||
@Excel(name = "业务爱好")
|
@Excel(name = "业务爱好")
|
||||||
|
@ApiModelProperty(value = "业务爱好")
|
||||||
private String hobby;
|
private String hobby;
|
||||||
|
|
||||||
/** 择偶标准 */
|
/** 择偶标准 */
|
||||||
@Excel(name = "择偶标准")
|
@Excel(name = "择偶标准")
|
||||||
|
@ApiModelProperty(value = "择偶标准")
|
||||||
private String choosingStandard;
|
private String choosingStandard;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.system.domain.TbUserImg;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户图片附件Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-12-11
|
||||||
|
*/
|
||||||
|
public interface TbUserImgMapper extends BaseMapper<TbUserImg>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询用户图片附件
|
||||||
|
*
|
||||||
|
* @param id 用户图片附件主键
|
||||||
|
* @return 用户图片附件
|
||||||
|
*/
|
||||||
|
public TbUserImg selectTbUserImgById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户图片附件列表
|
||||||
|
*
|
||||||
|
* @param tbUserImg 用户图片附件
|
||||||
|
* @return 用户图片附件集合
|
||||||
|
*/
|
||||||
|
public List<TbUserImg> selectTbUserImgList(TbUserImg tbUserImg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增用户图片附件
|
||||||
|
*
|
||||||
|
* @param tbUserImg 用户图片附件
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertTbUserImg(TbUserImg tbUserImg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户图片附件
|
||||||
|
*
|
||||||
|
* @param tbUserImg 用户图片附件
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateTbUserImg(TbUserImg tbUserImg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户图片附件
|
||||||
|
*
|
||||||
|
* @param id 用户图片附件主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTbUserImgById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除用户图片附件
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTbUserImgByIds(String[] ids);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.ruoyi.system.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.system.domain.TbUserImg;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户图片附件Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-12-11
|
||||||
|
*/
|
||||||
|
public interface ITbUserImgService extends IService<TbUserImg>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询用户图片附件
|
||||||
|
*
|
||||||
|
* @param id 用户图片附件主键
|
||||||
|
* @return 用户图片附件
|
||||||
|
*/
|
||||||
|
public TbUserImg selectTbUserImgById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户图片附件列表
|
||||||
|
*
|
||||||
|
* @param tbUserImg 用户图片附件
|
||||||
|
* @return 用户图片附件集合
|
||||||
|
*/
|
||||||
|
public List<TbUserImg> selectTbUserImgList(TbUserImg tbUserImg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增用户图片附件
|
||||||
|
*
|
||||||
|
* @param tbUserImg 用户图片附件
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertTbUserImg(TbUserImg tbUserImg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户图片附件
|
||||||
|
*
|
||||||
|
* @param tbUserImg 用户图片附件
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateTbUserImg(TbUserImg tbUserImg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除用户图片附件
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的用户图片附件主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTbUserImgByIds(String ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户图片附件信息
|
||||||
|
*
|
||||||
|
* @param id 用户图片附件主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTbUserImgById(Long id);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,98 @@
|
||||||
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.system.mapper.TbUserImgMapper;
|
||||||
|
import com.ruoyi.system.domain.TbUserImg;
|
||||||
|
import com.ruoyi.system.service.ITbUserImgService;
|
||||||
|
import com.ruoyi.common.core.text.Convert;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户图片附件Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-12-11
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TbUserImgServiceImpl extends ServiceImpl<TbUserImgMapper, TbUserImg> implements ITbUserImgService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private TbUserImgMapper tbUserImgMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户图片附件
|
||||||
|
*
|
||||||
|
* @param id 用户图片附件主键
|
||||||
|
* @return 用户图片附件
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TbUserImg selectTbUserImgById(Long id)
|
||||||
|
{
|
||||||
|
return tbUserImgMapper.selectTbUserImgById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户图片附件列表
|
||||||
|
*
|
||||||
|
* @param tbUserImg 用户图片附件
|
||||||
|
* @return 用户图片附件
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<TbUserImg> selectTbUserImgList(TbUserImg tbUserImg)
|
||||||
|
{
|
||||||
|
return tbUserImgMapper.selectTbUserImgList(tbUserImg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增用户图片附件
|
||||||
|
*
|
||||||
|
* @param tbUserImg 用户图片附件
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertTbUserImg(TbUserImg tbUserImg)
|
||||||
|
{
|
||||||
|
tbUserImg.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return tbUserImgMapper.insertTbUserImg(tbUserImg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户图片附件
|
||||||
|
*
|
||||||
|
* @param tbUserImg 用户图片附件
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateTbUserImg(TbUserImg tbUserImg)
|
||||||
|
{
|
||||||
|
tbUserImg.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return tbUserImgMapper.updateTbUserImg(tbUserImg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除用户图片附件
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的用户图片附件主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTbUserImgByIds(String ids)
|
||||||
|
{
|
||||||
|
return tbUserImgMapper.deleteTbUserImgByIds(Convert.toStrArray(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户图片附件信息
|
||||||
|
*
|
||||||
|
* @param id 用户图片附件主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTbUserImgById(Long id)
|
||||||
|
{
|
||||||
|
return tbUserImgMapper.deleteTbUserImgById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,79 @@
|
||||||
|
<?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.system.mapper.TbUserImgMapper">
|
||||||
|
|
||||||
|
<resultMap type="TbUserImg" id="TbUserImgResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="userId" column="user_id" />
|
||||||
|
<result property="type" column="type" />
|
||||||
|
<result property="imgUrl" column="img_url" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectTbUserImgVo">
|
||||||
|
select id, user_id, type, img_url, create_time, update_time, remark from tb_user_img
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectTbUserImgList" parameterType="TbUserImg" resultMap="TbUserImgResult">
|
||||||
|
<include refid="selectTbUserImgVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="userId != null "> and user_id = #{userId}</if>
|
||||||
|
<if test="type != null "> and type = #{type}</if>
|
||||||
|
<if test="imgUrl != null and imgUrl != ''"> and img_url = #{imgUrl}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectTbUserImgById" parameterType="Long" resultMap="TbUserImgResult">
|
||||||
|
<include refid="selectTbUserImgVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertTbUserImg" parameterType="TbUserImg" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into tb_user_img
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="userId != null">user_id,</if>
|
||||||
|
<if test="type != null">type,</if>
|
||||||
|
<if test="imgUrl != null and imgUrl != ''">img_url,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="userId != null">#{userId},</if>
|
||||||
|
<if test="type != null">#{type},</if>
|
||||||
|
<if test="imgUrl != null and imgUrl != ''">#{imgUrl},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateTbUserImg" parameterType="TbUserImg">
|
||||||
|
update tb_user_img
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="userId != null">user_id = #{userId},</if>
|
||||||
|
<if test="type != null">type = #{type},</if>
|
||||||
|
<if test="imgUrl != null and imgUrl != ''">img_url = #{imgUrl},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteTbUserImgById" parameterType="Long">
|
||||||
|
delete from tb_user_img where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteTbUserImgByIds" parameterType="String">
|
||||||
|
delete from tb_user_img where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue