用户模块(苏海龙)

pull/320/head
suhailong 3 years ago
parent e461342d4f
commit d9a1b4ed55

@ -15,4 +15,5 @@ import java.io.Serializable;
@Data @Data
public class PhoneVo extends BaseEntity { public class PhoneVo extends BaseEntity {
private String phone; private String phone;
private String code;
} }

@ -16,14 +16,13 @@ import java.util.Date;
@Data @Data
public class TbUserVo extends BaseEntity { public class TbUserVo extends BaseEntity {
private static final long serialVersionUID = 1L;
private Long userId; private Long userId;
private String token;
/** /**
* *
*/ */
private String userName; private String userName;
private String token;
/** /**
* *
@ -48,7 +47,7 @@ public class TbUserVo extends BaseEntity {
/** /**
* 0 1 2 * 0 1 2
*/ */
private String sex; private Integer sex;
/** /**
* *
@ -68,12 +67,12 @@ public class TbUserVo extends BaseEntity {
/** /**
* 0 1 * 0 1
*/ */
private String status; private Integer status;
/** /**
* 0 2 * 0 2
*/ */
private String delFlag; private Integer delFlag;
/** /**
* IP * IP
@ -124,12 +123,11 @@ public class TbUserVo extends BaseEntity {
/** /**
* (0,1) * (0,1)
*/ */
private String realnameState; private Integer realnameState;
/** /**
* *
*/ */
private Integer honorIntegral; private Integer honorIntegral;
} }

@ -125,7 +125,11 @@
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-swagger</artifactId> <artifactId>ruoyi-common-swagger</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
<version>2.0.7</version>
</dependency>
</dependencies> </dependencies>
<build> <build>

@ -1,18 +0,0 @@
package com.bwie.ruoyi.mapper;
import com.bwie.ruoyi.pojo.TbPerm;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author
* @description tb_perm()Mapper
* @createDate 2023-01-13 14:34:44
* @Entity com.bwie.ruoyi.pojo.TbPerm
*/
public interface TbPermMapper extends BaseMapper<TbPerm> {
}

@ -1,18 +0,0 @@
package com.bwie.ruoyi.mapper;
import com.bwie.ruoyi.pojo.TbRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author
* @description tb_role()Mapper
* @createDate 2023-01-13 14:34:44
* @Entity com.bwie.ruoyi.pojo.TbRole
*/
public interface TbRoleMapper extends BaseMapper<TbRole> {
}

@ -1,18 +0,0 @@
package com.bwie.ruoyi.mapper;
import com.bwie.ruoyi.pojo.TbRolePerm;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author
* @description tb_role_perm()Mapper
* @createDate 2023-01-13 14:34:44
* @Entity com.bwie.ruoyi.pojo.TbRolePerm
*/
public interface TbRolePermMapper extends BaseMapper<TbRolePerm> {
}

@ -1,18 +0,0 @@
package com.bwie.ruoyi.mapper;
import com.bwie.ruoyi.pojo.TbUserBankcard;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author
* @description tb_user_bankcard()Mapper
* @createDate 2023-01-13 14:34:44
* @Entity com.bwie.ruoyi.pojo.TbUserBankcard
*/
public interface TbUserBankcardMapper extends BaseMapper<TbUserBankcard> {
}

@ -1,18 +0,0 @@
package com.bwie.ruoyi.mapper;
import com.bwie.ruoyi.pojo.TbUserRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author
* @description tb_user_role()Mapper
* @createDate 2023-01-13 14:34:44
* @Entity com.bwie.ruoyi.pojo.TbUserRole
*/
public interface TbUserRoleMapper extends BaseMapper<TbUserRole> {
}

@ -1,53 +0,0 @@
package com.bwie.ruoyi.pojo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
/**
*
* @TableName tb_role
*/
@TableName(value ="tb_role")
@Data
public class TbRole implements Serializable {
/**
*
*/
@TableId(type = IdType.AUTO)
private Integer roleId;
/**
*
*/
private String roleName;
/**
* 01
*/
private Integer deleted;
/**
*
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date createTime;
/**
*
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date updateTime;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}

@ -1,13 +0,0 @@
package com.bwie.ruoyi.service;
import com.bwie.ruoyi.pojo.TbPerm;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author
* @description tb_perm()Service
* @createDate 2023-01-13 14:34:44
*/
public interface TbPermService extends IService<TbPerm> {
}

@ -1,13 +0,0 @@
package com.bwie.ruoyi.service;
import com.bwie.ruoyi.pojo.TbRolePerm;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author
* @description tb_role_perm()Service
* @createDate 2023-01-13 14:34:44
*/
public interface TbRolePermService extends IService<TbRolePerm> {
}

@ -1,13 +0,0 @@
package com.bwie.ruoyi.service;
import com.bwie.ruoyi.pojo.TbRole;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author
* @description tb_role()Service
* @createDate 2023-01-13 14:34:44
*/
public interface TbRoleService extends IService<TbRole> {
}

@ -1,13 +0,0 @@
package com.bwie.ruoyi.service;
import com.bwie.ruoyi.pojo.TbUserBankcard;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author
* @description tb_user_bankcard()Service
* @createDate 2023-01-13 14:34:44
*/
public interface TbUserBankcardService extends IService<TbUserBankcard> {
}

@ -1,13 +0,0 @@
package com.bwie.ruoyi.service;
import com.bwie.ruoyi.pojo.TbUserRole;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author
* @description tb_user_role()Service
* @createDate 2023-01-13 14:34:44
*/
public interface TbUserRoleService extends IService<TbUserRole> {
}

@ -1,22 +0,0 @@
package com.bwie.ruoyi.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bwie.ruoyi.pojo.TbPerm;
import com.bwie.ruoyi.service.TbPermService;
import com.bwie.ruoyi.mapper.TbPermMapper;
import org.springframework.stereotype.Service;
/**
* @author
* @description tb_perm()Service
* @createDate 2023-01-13 14:34:44
*/
@Service
public class TbPermServiceImpl extends ServiceImpl<TbPermMapper, TbPerm>
implements TbPermService{
}

@ -1,22 +0,0 @@
package com.bwie.ruoyi.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bwie.ruoyi.pojo.TbRolePerm;
import com.bwie.ruoyi.service.TbRolePermService;
import com.bwie.ruoyi.mapper.TbRolePermMapper;
import org.springframework.stereotype.Service;
/**
* @author
* @description tb_role_perm()Service
* @createDate 2023-01-13 14:34:44
*/
@Service
public class TbRolePermServiceImpl extends ServiceImpl<TbRolePermMapper, TbRolePerm>
implements TbRolePermService{
}

@ -1,22 +0,0 @@
package com.bwie.ruoyi.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bwie.ruoyi.pojo.TbRole;
import com.bwie.ruoyi.service.TbRoleService;
import com.bwie.ruoyi.mapper.TbRoleMapper;
import org.springframework.stereotype.Service;
/**
* @author
* @description tb_role()Service
* @createDate 2023-01-13 14:34:44
*/
@Service
public class TbRoleServiceImpl extends ServiceImpl<TbRoleMapper, TbRole>
implements TbRoleService{
}

@ -1,22 +0,0 @@
package com.bwie.ruoyi.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bwie.ruoyi.pojo.TbUserBankcard;
import com.bwie.ruoyi.service.TbUserBankcardService;
import com.bwie.ruoyi.mapper.TbUserBankcardMapper;
import org.springframework.stereotype.Service;
/**
* @author
* @description tb_user_bankcard()Service
* @createDate 2023-01-13 14:34:44
*/
@Service
public class TbUserBankcardServiceImpl extends ServiceImpl<TbUserBankcardMapper, TbUserBankcard>
implements TbUserBankcardService{
}

@ -1,22 +0,0 @@
package com.bwie.ruoyi.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bwie.ruoyi.pojo.TbUserRole;
import com.bwie.ruoyi.service.TbUserRoleService;
import com.bwie.ruoyi.mapper.TbUserRoleMapper;
import org.springframework.stereotype.Service;
/**
* @author
* @description tb_user_role()Service
* @createDate 2023-01-13 14:34:44
*/
@Service
public class TbUserRoleServiceImpl extends ServiceImpl<TbUserRoleMapper, TbUserRole>
implements TbUserRoleService{
}

@ -1,8 +1,9 @@
package com.bwie.ruoyi; package com.bwie.user;
import com.ruoyi.common.security.annotation.EnableCustomConfig; import com.ruoyi.common.security.annotation.EnableCustomConfig;
import com.ruoyi.common.security.annotation.EnableRyFeignClients; import com.ruoyi.common.security.annotation.EnableRyFeignClients;
import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2; import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
@ -15,6 +16,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
@EnableCustomSwagger2 @EnableCustomSwagger2
@EnableRyFeignClients @EnableRyFeignClients
@SpringBootApplication @SpringBootApplication
@MapperScan("com.bwie.user.mapper")
public class RuoYiUserApplication public class RuoYiUserApplication
{ {
public static void main(String[] args) public static void main(String[] args)

@ -1,48 +1,43 @@
package com.bwie.ruoyi.config; package com.bwie.user.config;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact; import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType; import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; import springfox.documentation.swagger2.annotations.EnableSwagger2;
/** /**
* @author * @Description //TODO
* @version 1.0 * @Author
* @description: TODO * @Date 2022/11/13 19:53
* @date 2022/10/21 20:15
*/ */
@Configuration @Configuration
@EnableSwagger2WebMvc @EnableSwagger2
public class Knife4jConfiguration { public class Knife4jConfiguration {
@Bean(value = "dockerBean") @Bean(value = "defaultApi2")
public Docket dockerBean() { public Docket defaultApi2() {
//指定使用Swagger2规范 String groupName="3.X版本";
Docket docket = new Docket(DocumentationType.SWAGGER_2) Docket docket=new Docket(DocumentationType.OAS_30)
.apiInfo(webApiInfo()) .apiInfo(new ApiInfoBuilder()
.title("这是User API ")
.description("# 这里记录服务端所有的接口的入参,出参等等信息")
.termsOfServiceUrl("https://www.shenmazong.com")
.contact(new Contact("shl","http://bwie.com","1447562585@qq.com"))
.version("3.0")
.build())
//分组名称 //分组名称
.groupName("WebApi") .groupName(groupName)
.select() .select()
//这里指定Controller扫描包路径 //这里指定Controller扫描包路径
.apis(RequestHandlerSelectors.basePackage("com.bwie")) .apis(RequestHandlerSelectors.basePackage("com.bwie.user"))
.paths(PathSelectors.any()) .paths(PathSelectors.any())
.build(); .build();
return docket; return docket;
} }
private ApiInfo webApiInfo() {
return new ApiInfoBuilder()
//描述字段支持Markdown语法
.title("Weekly-API")
.contact(new Contact("苏海龙", "https://www.bwie.net/", "bwie@bwie.com"))
.description("考试服务端API-version1.0")
.version("1.0")
.build();
}
} }

@ -1,6 +1,6 @@
package com.bwie.ruoyi.controller; package com.bwie.user.controller;
import com.bwie.ruoyi.service.TbUserService; import com.bwie.user.service.TbUserService;
import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.system.api.model.PhoneVo; import com.ruoyi.system.api.model.PhoneVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;

@ -0,0 +1,105 @@
package com.bwie.user.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.bwie.user.domain.TbMyrole;
import com.bwie.user.service.ITbMyroleService;
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 xs
* @date 2023-01-15
*/
@RestController
@RequestMapping("/myrole")
public class TbMyroleController extends BaseController
{
@Autowired
private ITbMyroleService tbMyroleService;
/**
*
*/
@RequiresPermissions("myrole:myrole:list")
@GetMapping("/list")
public TableDataInfo list(TbMyrole tbMyrole)
{
startPage();
List<TbMyrole> list = tbMyroleService.selectTbMyroleList(tbMyrole);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("myrole:myrole:export")
@Log(title = "角色", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TbMyrole tbMyrole)
{
List<TbMyrole> list = tbMyroleService.selectTbMyroleList(tbMyrole);
ExcelUtil<TbMyrole> util = new ExcelUtil<TbMyrole>(TbMyrole.class);
util.exportExcel(response, list, "角色数据");
}
/**
*
*/
@RequiresPermissions("myrole:myrole:query")
@GetMapping(value = "/{roleId}")
public AjaxResult getInfo(@PathVariable("roleId") Long roleId)
{
return success(tbMyroleService.selectTbMyroleByRoleId(roleId));
}
/**
*
*/
@RequiresPermissions("myrole:myrole:add")
@Log(title = "角色", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TbMyrole tbMyrole)
{
return toAjax(tbMyroleService.insertTbMyrole(tbMyrole));
}
/**
*
*/
@RequiresPermissions("myrole:myrole:edit")
@Log(title = "角色", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TbMyrole tbMyrole)
{
return toAjax(tbMyroleService.updateTbMyrole(tbMyrole));
}
/**
*
*/
@RequiresPermissions("myrole:myrole:remove")
@Log(title = "角色", businessType = BusinessType.DELETE)
@DeleteMapping("/{roleIds}")
public AjaxResult remove(@PathVariable Long[] roleIds)
{
return toAjax(tbMyroleService.deleteTbMyroleByRoleIds(roleIds));
}
}

@ -0,0 +1,105 @@
package com.bwie.user.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.bwie.user.domain.TbPerm;
import com.bwie.user.service.ITbPermService;
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 ruoyi
* @date 2023-01-15
*/
@RestController
@RequestMapping("/perm")
public class TbPermController extends BaseController
{
@Autowired
private ITbPermService tbPermService;
/**
*
*/
@RequiresPermissions("perm:perm:list")
@GetMapping("/list")
public TableDataInfo list(TbPerm tbPerm)
{
startPage();
List<TbPerm> list = tbPermService.selectTbPermList(tbPerm);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("perm:perm:export")
@Log(title = "权限", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TbPerm tbPerm)
{
List<TbPerm> list = tbPermService.selectTbPermList(tbPerm);
ExcelUtil<TbPerm> util = new ExcelUtil<TbPerm>(TbPerm.class);
util.exportExcel(response, list, "权限数据");
}
/**
*
*/
@RequiresPermissions("perm:perm:query")
@GetMapping(value = "/{permId}")
public AjaxResult getInfo(@PathVariable("permId") Long permId)
{
return success(tbPermService.selectTbPermByPermId(permId));
}
/**
*
*/
@RequiresPermissions("perm:perm:add")
@Log(title = "权限", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TbPerm tbPerm)
{
return toAjax(tbPermService.insertTbPerm(tbPerm));
}
/**
*
*/
@RequiresPermissions("perm:perm:edit")
@Log(title = "权限", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TbPerm tbPerm)
{
return toAjax(tbPermService.updateTbPerm(tbPerm));
}
/**
*
*/
@RequiresPermissions("perm:perm:remove")
@Log(title = "权限", businessType = BusinessType.DELETE)
@DeleteMapping("/{permIds}")
public AjaxResult remove(@PathVariable Long[] permIds)
{
return toAjax(tbPermService.deleteTbPermByPermIds(permIds));
}
}

@ -0,0 +1,105 @@
package com.bwie.user.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.bwie.user.domain.TbRolePerm;
import com.bwie.user.service.ITbRolePermService;
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 xs
* @date 2023-01-15
*/
@RestController
@RequestMapping("/roleperm")
public class TbRolePermController extends BaseController
{
@Autowired
private ITbRolePermService tbRolePermService;
/**
*
*/
@RequiresPermissions("roleperm:roleperm:list")
@GetMapping("/list")
public TableDataInfo list(TbRolePerm tbRolePerm)
{
startPage();
List<TbRolePerm> list = tbRolePermService.selectTbRolePermList(tbRolePerm);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("roleperm:roleperm:export")
@Log(title = "角色权限", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TbRolePerm tbRolePerm)
{
List<TbRolePerm> list = tbRolePermService.selectTbRolePermList(tbRolePerm);
ExcelUtil<TbRolePerm> util = new ExcelUtil<TbRolePerm>(TbRolePerm.class);
util.exportExcel(response, list, "角色权限数据");
}
/**
*
*/
@RequiresPermissions("roleperm:roleperm:query")
@GetMapping(value = "/{rolePermId}")
public AjaxResult getInfo(@PathVariable("rolePermId") Long rolePermId)
{
return success(tbRolePermService.selectTbRolePermByRolePermId(rolePermId));
}
/**
*
*/
@RequiresPermissions("roleperm:roleperm:add")
@Log(title = "角色权限", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TbRolePerm tbRolePerm)
{
return toAjax(tbRolePermService.insertTbRolePerm(tbRolePerm));
}
/**
*
*/
@RequiresPermissions("roleperm:roleperm:edit")
@Log(title = "角色权限", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TbRolePerm tbRolePerm)
{
return toAjax(tbRolePermService.updateTbRolePerm(tbRolePerm));
}
/**
*
*/
@RequiresPermissions("roleperm:roleperm:remove")
@Log(title = "角色权限", businessType = BusinessType.DELETE)
@DeleteMapping("/{rolePermIds}")
public AjaxResult remove(@PathVariable Long[] rolePermIds)
{
return toAjax(tbRolePermService.deleteTbRolePermByRolePermIds(rolePermIds));
}
}

@ -0,0 +1,105 @@
package com.bwie.user.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.bwie.user.domain.TbUserRole;
import com.bwie.user.service.ITbUserRoleService;
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 xs
* @date 2023-01-15
*/
@RestController
@RequestMapping("/userrole")
public class TbUserRoleController extends BaseController
{
@Autowired
private ITbUserRoleService tbUserRoleService;
/**
*
*/
@RequiresPermissions("userrole:userrole:list")
@GetMapping("/list")
public TableDataInfo list(TbUserRole tbUserRole)
{
startPage();
List<TbUserRole> list = tbUserRoleService.selectTbUserRoleList(tbUserRole);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("userrole:userrole:export")
@Log(title = "用户类型", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TbUserRole tbUserRole)
{
List<TbUserRole> list = tbUserRoleService.selectTbUserRoleList(tbUserRole);
ExcelUtil<TbUserRole> util = new ExcelUtil<TbUserRole>(TbUserRole.class);
util.exportExcel(response, list, "用户类型数据");
}
/**
*
*/
@RequiresPermissions("userrole:userrole:query")
@GetMapping(value = "/{userRoleId}")
public AjaxResult getInfo(@PathVariable("userRoleId") Long userRoleId)
{
return success(tbUserRoleService.selectTbUserRoleByUserRoleId(userRoleId));
}
/**
*
*/
@RequiresPermissions("userrole:userrole:add")
@Log(title = "用户类型", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TbUserRole tbUserRole)
{
return toAjax(tbUserRoleService.insertTbUserRole(tbUserRole));
}
/**
*
*/
@RequiresPermissions("userrole:userrole:edit")
@Log(title = "用户类型", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TbUserRole tbUserRole)
{
return toAjax(tbUserRoleService.updateTbUserRole(tbUserRole));
}
/**
*
*/
@RequiresPermissions("userrole:userrole:remove")
@Log(title = "用户类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{userRoleIds}")
public AjaxResult remove(@PathVariable Long[] userRoleIds)
{
return toAjax(tbUserRoleService.deleteTbUserRoleByUserRoleIds(userRoleIds));
}
}

@ -1,7 +1,6 @@
package com.bwie.ruoyi.controller; package com.bwie.user.controller;
import com.bwie.ruoyi.pojo.TbUser; import com.bwie.user.service.TbUserService;
import com.bwie.ruoyi.service.TbUserService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.ruoyi.common.core.web.controller.BaseController; import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.domain.AjaxResult;
@ -40,8 +39,8 @@ public class UserController extends BaseController {
return tbUserServicet.deluser(idVo); return tbUserServicet.deluser(idVo);
} }
@PostMapping("adduser") @PostMapping("adduser")
private AjaxResult adduser(@RequestBody TbUserVo tbUserVo){ private AjaxResult adduser(@RequestBody PhoneVo phoneVo){
return tbUserServicet.adduser(tbUserVo); return tbUserServicet.adduser(phoneVo);
} }
@PostMapping("updateuser") @PostMapping("updateuser")

@ -0,0 +1,67 @@
package com.bwie.user.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;
/**
* tb_myrole
*
* @author xs
* @date 2023-01-15
*/
public class TbMyrole extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 角色id */
private Long roleId;
/** 角色名称 */
@Excel(name = "角色名称")
private String roleName;
/** 删除状态0未删除1已删除 */
@Excel(name = "删除状态0未删除1已删除")
private Integer deleted;
public void setRoleId(Long roleId)
{
this.roleId = roleId;
}
public Long getRoleId()
{
return roleId;
}
public void setRoleName(String roleName)
{
this.roleName = roleName;
}
public String getRoleName()
{
return roleName;
}
public void setDeleted(Integer deleted)
{
this.deleted = deleted;
}
public Integer getDeleted()
{
return deleted;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("roleId", getRoleId())
.append("roleName", getRoleName())
.append("deleted", getDeleted())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -1,4 +1,4 @@
package com.bwie.ruoyi.pojo; package com.bwie.user.domain;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
@ -52,7 +52,7 @@ public class TbUser implements Serializable {
/** /**
* 0 1 2 * 0 1 2
*/ */
private String sex; private Integer sex;
/** /**
* *
@ -72,12 +72,12 @@ public class TbUser implements Serializable {
/** /**
* 0 1 * 0 1
*/ */
private String status; private Integer status;
/** /**
* 0 2 * 0 2
*/ */
private String delFlag; private Integer delFlag;
/** /**
* IP * IP
@ -128,7 +128,7 @@ public class TbUser implements Serializable {
/** /**
* (0,1) * (0,1)
*/ */
private String realnameState; private Integer realnameState;
/** /**
* *

@ -1,4 +1,4 @@
package com.bwie.ruoyi.pojo; package com.bwie.user.domain;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;

@ -0,0 +1,61 @@
package com.bwie.user.mapper;
import java.util.List;
import com.bwie.user.domain.TbMyrole;
/**
* Mapper
*
* @author xs
* @date 2023-01-15
*/
public interface TbMyroleMapper
{
/**
*
*
* @param roleId
* @return
*/
public TbMyrole selectTbMyroleByRoleId(Long roleId);
/**
*
*
* @param tbMyrole
* @return
*/
public List<TbMyrole> selectTbMyroleList(TbMyrole tbMyrole);
/**
*
*
* @param tbMyrole
* @return
*/
public int insertTbMyrole(TbMyrole tbMyrole);
/**
*
*
* @param tbMyrole
* @return
*/
public int updateTbMyrole(TbMyrole tbMyrole);
/**
*
*
* @param roleId
* @return
*/
public int deleteTbMyroleByRoleId(Long roleId);
/**
*
*
* @param roleIds
* @return
*/
public int deleteTbMyroleByRoleIds(Long[] roleIds);
}

@ -0,0 +1,61 @@
package com.bwie.user.mapper;
import java.util.List;
import com.bwie.user.domain.TbPerm;
/**
* Mapper
*
* @author ruoyi
* @date 2023-01-15
*/
public interface TbPermMapper
{
/**
*
*
* @param permId
* @return
*/
public TbPerm selectTbPermByPermId(Long permId);
/**
*
*
* @param tbPerm
* @return
*/
public List<TbPerm> selectTbPermList(TbPerm tbPerm);
/**
*
*
* @param tbPerm
* @return
*/
public int insertTbPerm(TbPerm tbPerm);
/**
*
*
* @param tbPerm
* @return
*/
public int updateTbPerm(TbPerm tbPerm);
/**
*
*
* @param permId
* @return
*/
public int deleteTbPermByPermId(Long permId);
/**
*
*
* @param permIds
* @return
*/
public int deleteTbPermByPermIds(Long[] permIds);
}

@ -0,0 +1,61 @@
package com.bwie.user.mapper;
import java.util.List;
import com.bwie.user.domain.TbRolePerm;
/**
* Mapper
*
* @author xs
* @date 2023-01-15
*/
public interface TbRolePermMapper
{
/**
*
*
* @param rolePermId
* @return
*/
public TbRolePerm selectTbRolePermByRolePermId(Long rolePermId);
/**
*
*
* @param tbRolePerm
* @return
*/
public List<TbRolePerm> selectTbRolePermList(TbRolePerm tbRolePerm);
/**
*
*
* @param tbRolePerm
* @return
*/
public int insertTbRolePerm(TbRolePerm tbRolePerm);
/**
*
*
* @param tbRolePerm
* @return
*/
public int updateTbRolePerm(TbRolePerm tbRolePerm);
/**
*
*
* @param rolePermId
* @return
*/
public int deleteTbRolePermByRolePermId(Long rolePermId);
/**
*
*
* @param rolePermIds
* @return
*/
public int deleteTbRolePermByRolePermIds(Long[] rolePermIds);
}

@ -1,6 +1,6 @@
package com.bwie.ruoyi.mapper; package com.bwie.user.mapper;
import com.bwie.ruoyi.pojo.TbUser; import com.bwie.user.domain.TbUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/** /**

@ -0,0 +1,61 @@
package com.bwie.user.mapper;
import java.util.List;
import com.bwie.user.domain.TbUserRole;
/**
* Mapper
*
* @author xs
* @date 2023-01-15
*/
public interface TbUserRoleMapper
{
/**
*
*
* @param userRoleId
* @return
*/
public TbUserRole selectTbUserRoleByUserRoleId(Long userRoleId);
/**
*
*
* @param tbUserRole
* @return
*/
public List<TbUserRole> selectTbUserRoleList(TbUserRole tbUserRole);
/**
*
*
* @param tbUserRole
* @return
*/
public int insertTbUserRole(TbUserRole tbUserRole);
/**
*
*
* @param tbUserRole
* @return
*/
public int updateTbUserRole(TbUserRole tbUserRole);
/**
*
*
* @param userRoleId
* @return
*/
public int deleteTbUserRoleByUserRoleId(Long userRoleId);
/**
*
*
* @param userRoleIds
* @return
*/
public int deleteTbUserRoleByUserRoleIds(Long[] userRoleIds);
}

@ -0,0 +1,61 @@
package com.bwie.user.service;
import java.util.List;
import com.bwie.user.domain.TbMyrole;
/**
* Service
*
* @author xs
* @date 2023-01-15
*/
public interface ITbMyroleService
{
/**
*
*
* @param roleId
* @return
*/
public TbMyrole selectTbMyroleByRoleId(Long roleId);
/**
*
*
* @param tbMyrole
* @return
*/
public List<TbMyrole> selectTbMyroleList(TbMyrole tbMyrole);
/**
*
*
* @param tbMyrole
* @return
*/
public int insertTbMyrole(TbMyrole tbMyrole);
/**
*
*
* @param tbMyrole
* @return
*/
public int updateTbMyrole(TbMyrole tbMyrole);
/**
*
*
* @param roleIds
* @return
*/
public int deleteTbMyroleByRoleIds(Long[] roleIds);
/**
*
*
* @param roleId
* @return
*/
public int deleteTbMyroleByRoleId(Long roleId);
}

@ -0,0 +1,61 @@
package com.bwie.user.service;
import java.util.List;
import com.bwie.user.domain.TbPerm;
/**
* Service
*
* @author ruoyi
* @date 2023-01-15
*/
public interface ITbPermService
{
/**
*
*
* @param permId
* @return
*/
public TbPerm selectTbPermByPermId(Long permId);
/**
*
*
* @param tbPerm
* @return
*/
public List<TbPerm> selectTbPermList(TbPerm tbPerm);
/**
*
*
* @param tbPerm
* @return
*/
public int insertTbPerm(TbPerm tbPerm);
/**
*
*
* @param tbPerm
* @return
*/
public int updateTbPerm(TbPerm tbPerm);
/**
*
*
* @param permIds
* @return
*/
public int deleteTbPermByPermIds(Long[] permIds);
/**
*
*
* @param permId
* @return
*/
public int deleteTbPermByPermId(Long permId);
}

@ -0,0 +1,61 @@
package com.bwie.user.service;
import java.util.List;
import com.bwie.user.domain.TbRolePerm;
/**
* Service
*
* @author xs
* @date 2023-01-15
*/
public interface ITbRolePermService
{
/**
*
*
* @param rolePermId
* @return
*/
public TbRolePerm selectTbRolePermByRolePermId(Long rolePermId);
/**
*
*
* @param tbRolePerm
* @return
*/
public List<TbRolePerm> selectTbRolePermList(TbRolePerm tbRolePerm);
/**
*
*
* @param tbRolePerm
* @return
*/
public int insertTbRolePerm(TbRolePerm tbRolePerm);
/**
*
*
* @param tbRolePerm
* @return
*/
public int updateTbRolePerm(TbRolePerm tbRolePerm);
/**
*
*
* @param rolePermIds
* @return
*/
public int deleteTbRolePermByRolePermIds(Long[] rolePermIds);
/**
*
*
* @param rolePermId
* @return
*/
public int deleteTbRolePermByRolePermId(Long rolePermId);
}

@ -0,0 +1,61 @@
package com.bwie.user.service;
import java.util.List;
import com.bwie.user.domain.TbUserRole;
/**
* Service
*
* @author xs
* @date 2023-01-15
*/
public interface ITbUserRoleService
{
/**
*
*
* @param userRoleId
* @return
*/
public TbUserRole selectTbUserRoleByUserRoleId(Long userRoleId);
/**
*
*
* @param tbUserRole
* @return
*/
public List<TbUserRole> selectTbUserRoleList(TbUserRole tbUserRole);
/**
*
*
* @param tbUserRole
* @return
*/
public int insertTbUserRole(TbUserRole tbUserRole);
/**
*
*
* @param tbUserRole
* @return
*/
public int updateTbUserRole(TbUserRole tbUserRole);
/**
*
*
* @param userRoleIds
* @return
*/
public int deleteTbUserRoleByUserRoleIds(Long[] userRoleIds);
/**
*
*
* @param userRoleId
* @return
*/
public int deleteTbUserRoleByUserRoleId(Long userRoleId);
}

@ -1,6 +1,6 @@
package com.bwie.ruoyi.service; package com.bwie.user.service;
import com.bwie.ruoyi.pojo.TbUser; import com.bwie.user.domain.TbUser;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.system.api.model.*; import com.ruoyi.system.api.model.*;
@ -18,7 +18,7 @@ public interface TbUserService extends IService<TbUser> {
AjaxResult deluser(IdVo idVo); AjaxResult deluser(IdVo idVo);
AjaxResult adduser(TbUserVo tbUserVo); AjaxResult adduser(PhoneVo phoneVo);
AjaxResult phoneSend(PhoneVo phoneVo); AjaxResult phoneSend(PhoneVo phoneVo);

@ -0,0 +1,96 @@
package com.bwie.user.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.bwie.user.mapper.TbMyroleMapper;
import com.bwie.user.domain.TbMyrole;
import com.bwie.user.service.ITbMyroleService;
/**
* Service
*
* @author xs
* @date 2023-01-15
*/
@Service
public class TbMyroleServiceImpl implements ITbMyroleService
{
@Autowired
private TbMyroleMapper tbMyroleMapper;
/**
*
*
* @param roleId
* @return
*/
@Override
public TbMyrole selectTbMyroleByRoleId(Long roleId)
{
return tbMyroleMapper.selectTbMyroleByRoleId(roleId);
}
/**
*
*
* @param tbMyrole
* @return
*/
@Override
public List<TbMyrole> selectTbMyroleList(TbMyrole tbMyrole)
{
return tbMyroleMapper.selectTbMyroleList(tbMyrole);
}
/**
*
*
* @param tbMyrole
* @return
*/
@Override
public int insertTbMyrole(TbMyrole tbMyrole)
{
tbMyrole.setCreateTime(DateUtils.getNowDate());
return tbMyroleMapper.insertTbMyrole(tbMyrole);
}
/**
*
*
* @param tbMyrole
* @return
*/
@Override
public int updateTbMyrole(TbMyrole tbMyrole)
{
tbMyrole.setUpdateTime(DateUtils.getNowDate());
return tbMyroleMapper.updateTbMyrole(tbMyrole);
}
/**
*
*
* @param roleIds
* @return
*/
@Override
public int deleteTbMyroleByRoleIds(Long[] roleIds)
{
return tbMyroleMapper.deleteTbMyroleByRoleIds(roleIds);
}
/**
*
*
* @param roleId
* @return
*/
@Override
public int deleteTbMyroleByRoleId(Long roleId)
{
return tbMyroleMapper.deleteTbMyroleByRoleId(roleId);
}
}

@ -0,0 +1,96 @@
package com.bwie.user.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.bwie.user.mapper.TbPermMapper;
import com.bwie.user.domain.TbPerm;
import com.bwie.user.service.ITbPermService;
/**
* Service
*
* @author ruoyi
* @date 2023-01-15
*/
@Service
public class TbPermServiceImpl implements ITbPermService
{
@Autowired
private TbPermMapper tbPermMapper;
/**
*
*
* @param permId
* @return
*/
@Override
public TbPerm selectTbPermByPermId(Long permId)
{
return tbPermMapper.selectTbPermByPermId(permId);
}
/**
*
*
* @param tbPerm
* @return
*/
@Override
public List<TbPerm> selectTbPermList(TbPerm tbPerm)
{
return tbPermMapper.selectTbPermList(tbPerm);
}
/**
*
*
* @param tbPerm
* @return
*/
@Override
public int insertTbPerm(TbPerm tbPerm)
{
tbPerm.setCreateTime(DateUtils.getNowDate());
return tbPermMapper.insertTbPerm(tbPerm);
}
/**
*
*
* @param tbPerm
* @return
*/
@Override
public int updateTbPerm(TbPerm tbPerm)
{
tbPerm.setUpdateTime(DateUtils.getNowDate());
return tbPermMapper.updateTbPerm(tbPerm);
}
/**
*
*
* @param permIds
* @return
*/
@Override
public int deleteTbPermByPermIds(Long[] permIds)
{
return tbPermMapper.deleteTbPermByPermIds(permIds);
}
/**
*
*
* @param permId
* @return
*/
@Override
public int deleteTbPermByPermId(Long permId)
{
return tbPermMapper.deleteTbPermByPermId(permId);
}
}

@ -0,0 +1,96 @@
package com.bwie.user.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.bwie.user.mapper.TbRolePermMapper;
import com.bwie.user.domain.TbRolePerm;
import com.bwie.user.service.ITbRolePermService;
/**
* Service
*
* @author xs
* @date 2023-01-15
*/
@Service
public class TbRolePermServiceImpl implements ITbRolePermService
{
@Autowired
private TbRolePermMapper tbRolePermMapper;
/**
*
*
* @param rolePermId
* @return
*/
@Override
public TbRolePerm selectTbRolePermByRolePermId(Long rolePermId)
{
return tbRolePermMapper.selectTbRolePermByRolePermId(rolePermId);
}
/**
*
*
* @param tbRolePerm
* @return
*/
@Override
public List<TbRolePerm> selectTbRolePermList(TbRolePerm tbRolePerm)
{
return tbRolePermMapper.selectTbRolePermList(tbRolePerm);
}
/**
*
*
* @param tbRolePerm
* @return
*/
@Override
public int insertTbRolePerm(TbRolePerm tbRolePerm)
{
tbRolePerm.setCreateTime(DateUtils.getNowDate());
return tbRolePermMapper.insertTbRolePerm(tbRolePerm);
}
/**
*
*
* @param tbRolePerm
* @return
*/
@Override
public int updateTbRolePerm(TbRolePerm tbRolePerm)
{
tbRolePerm.setUpdateTime(DateUtils.getNowDate());
return tbRolePermMapper.updateTbRolePerm(tbRolePerm);
}
/**
*
*
* @param rolePermIds
* @return
*/
@Override
public int deleteTbRolePermByRolePermIds(Long[] rolePermIds)
{
return tbRolePermMapper.deleteTbRolePermByRolePermIds(rolePermIds);
}
/**
*
*
* @param rolePermId
* @return
*/
@Override
public int deleteTbRolePermByRolePermId(Long rolePermId)
{
return tbRolePermMapper.deleteTbRolePermByRolePermId(rolePermId);
}
}

@ -0,0 +1,96 @@
package com.bwie.user.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.bwie.user.mapper.TbUserRoleMapper;
import com.bwie.user.domain.TbUserRole;
import com.bwie.user.service.ITbUserRoleService;
/**
* Service
*
* @author xs
* @date 2023-01-15
*/
@Service
public class TbUserRoleServiceImpl implements ITbUserRoleService
{
@Autowired
private TbUserRoleMapper tbUserRoleMapper;
/**
*
*
* @param userRoleId
* @return
*/
@Override
public TbUserRole selectTbUserRoleByUserRoleId(Long userRoleId)
{
return tbUserRoleMapper.selectTbUserRoleByUserRoleId(userRoleId);
}
/**
*
*
* @param tbUserRole
* @return
*/
@Override
public List<TbUserRole> selectTbUserRoleList(TbUserRole tbUserRole)
{
return tbUserRoleMapper.selectTbUserRoleList(tbUserRole);
}
/**
*
*
* @param tbUserRole
* @return
*/
@Override
public int insertTbUserRole(TbUserRole tbUserRole)
{
tbUserRole.setCreateTime(DateUtils.getNowDate());
return tbUserRoleMapper.insertTbUserRole(tbUserRole);
}
/**
*
*
* @param tbUserRole
* @return
*/
@Override
public int updateTbUserRole(TbUserRole tbUserRole)
{
tbUserRole.setUpdateTime(DateUtils.getNowDate());
return tbUserRoleMapper.updateTbUserRole(tbUserRole);
}
/**
*
*
* @param userRoleIds
* @return
*/
@Override
public int deleteTbUserRoleByUserRoleIds(Long[] userRoleIds)
{
return tbUserRoleMapper.deleteTbUserRoleByUserRoleIds(userRoleIds);
}
/**
*
*
* @param userRoleId
* @return
*/
@Override
public int deleteTbUserRoleByUserRoleId(Long userRoleId)
{
return tbUserRoleMapper.deleteTbUserRoleByUserRoleId(userRoleId);
}
}

@ -1,16 +1,15 @@
package com.bwie.ruoyi.service.impl; package com.bwie.user.service.impl;
import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.RandomUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bwie.ruoyi.pojo.TbUser; import com.bwie.user.domain.TbUser;
import com.bwie.ruoyi.service.TbUserService; import com.bwie.user.service.TbUserService;
import com.bwie.ruoyi.mapper.TbUserMapper; import com.bwie.user.mapper.TbUserMapper;
import com.bwie.ruoyi.utils.DuanxinUtils; import com.bwie.user.utils.DuanxinUtils;
import com.bwie.ruoyi.utils.TokenUtils; import com.bwie.user.utils.TokenUtils;
import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.system.api.model.*; import com.ruoyi.system.api.model.*;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.security.crypto.bcrypt.BCrypt; import org.springframework.security.crypto.bcrypt.BCrypt;
@ -51,24 +50,21 @@ public class TbUserServiceImpl extends ServiceImpl<TbUserMapper, TbUser>
} }
@Override @Override
public AjaxResult adduser(TbUserVo tbUserVo) { public AjaxResult adduser(PhoneVo phoneVo) {
LambdaQueryWrapper<TbUser> wrapper=new LambdaQueryWrapper<>(); LambdaQueryWrapper<TbUser> wrapper=new LambdaQueryWrapper<>();
wrapper.eq(TbUser::getPhonenumber,tbUserVo.getPhonenumber()); wrapper.eq(TbUser::getPhonenumber,phoneVo.getPhone());
//判断手机号 TbUser tbUser1 = tbUserMapper.selectOne(wrapper);
if(tbUserMapper.selectOne(wrapper)!=null){ if(tbUser1!=null){
return AjaxResult.error("手机号已经注册请检查手机号"); return AjaxResult.error("手机号已被注册");
} }
//判断用户的昵称 Object o = redisTemplate.opsForValue().get(phoneVo.getPhone());
LambdaQueryWrapper<TbUser> wrapper1=new LambdaQueryWrapper<>(); if(!phoneVo.getCode().equals(o)){
wrapper1.eq(TbUser::getNickName,tbUserVo.getNickName() ); return AjaxResult.error("验证码不正确");
if(tbUserMapper.selectOne(wrapper1)!=null){
return AjaxResult.error("用户昵称已经被注册请换一个");
} }
//加密密码
String hashpw = BCrypt.hashpw(tbUserVo.getPassword(), BCrypt.gensalt());
TbUser tbUser = new TbUser(); TbUser tbUser = new TbUser();
BeanUtils.copyProperties(tbUserVo, tbUser); tbUser.setNickName("tbuser_"+RandomUtil.randomNumbers(4));
//更换加密密码 tbUser.setPhonenumber(phoneVo.getPhone());
String hashpw = BCrypt.hashpw("123456", BCrypt.gensalt());
tbUser.setPassword(hashpw); tbUser.setPassword(hashpw);
tbUserMapper.insert(tbUser); tbUserMapper.insert(tbUser);
return AjaxResult.success(tbUser); return AjaxResult.success(tbUser);
@ -118,20 +114,15 @@ public class TbUserServiceImpl extends ServiceImpl<TbUserMapper, TbUser>
@Override @Override
public AjaxResult loginuser(LoginVo loginVo) { public AjaxResult loginuser(LoginVo loginVo) {
//第一步判断账号
LambdaQueryWrapper<TbUser> wrapper=new LambdaQueryWrapper<>(); LambdaQueryWrapper<TbUser> wrapper=new LambdaQueryWrapper<>();
wrapper.eq(TbUser::getNickName,loginVo.getNickName()); wrapper.eq(TbUser::getPhonenumber,loginVo.getPhone());
TbUser tbUser = tbUserMapper.selectOne(wrapper); TbUser tbUser = tbUserMapper.selectOne(wrapper);
if(tbUser==null){ if(tbUser==null){
return AjaxResult.error("账号不存在"); return AjaxResult.error("电话号没有被注册请先注册");
}
boolean checkpw = BCrypt.checkpw(loginVo.getUserPass(), tbUser.getPassword());
if(!checkpw){
return AjaxResult.error("密码不正确");
} }
//判断code //在进行判断code
String o =(String) redisTemplate.opsForValue().get(loginVo.getPhone()); String code =(String) redisTemplate.opsForValue().get(loginVo.getPhone());
if(!loginVo.getCode().equals(o)){ if(!loginVo.getCode().equals(code)) {
return AjaxResult.error("验证码不正确"); return AjaxResult.error("验证码不正确");
} }
//生成token //生成token

@ -1,4 +1,4 @@
package com.bwie.ruoyi.utils; package com.bwie.user.utils;
import org.apache.http.HttpResponse; import org.apache.http.HttpResponse;

@ -1,4 +1,4 @@
package com.bwie.ruoyi.utils; package com.bwie.user.utils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.http.HttpResponse; import org.apache.http.HttpResponse;

@ -1,4 +1,4 @@
package com.bwie.ruoyi.utils; package com.bwie.user.utils;
import io.jsonwebtoken.*; import io.jsonwebtoken.*;

@ -1,20 +0,0 @@
<?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.bwie.ruoyi.mapper.TbPermMapper">
<resultMap id="BaseResultMap" type="com.bwie.ruoyi.pojo.TbPerm">
<id property="permId" column="perm_id" jdbcType="INTEGER"/>
<result property="permName" column="perm_name" jdbcType="VARCHAR"/>
<result property="permCode" column="perm_code" jdbcType="VARCHAR"/>
<result property="deleted" column="deleted" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
perm_id,perm_name,perm_code,
deleted,create_time,update_time
</sql>
</mapper>

@ -1,19 +0,0 @@
<?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.bwie.ruoyi.mapper.TbRoleMapper">
<resultMap id="BaseResultMap" type="com.bwie.ruoyi.pojo.TbRole">
<id property="roleId" column="role_id" jdbcType="INTEGER"/>
<result property="roleName" column="role_name" jdbcType="VARCHAR"/>
<result property="deleted" column="deleted" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
role_id,role_name,deleted,
create_time,update_time
</sql>
</mapper>

@ -1,20 +0,0 @@
<?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.bwie.ruoyi.mapper.TbRolePermMapper">
<resultMap id="BaseResultMap" type="com.bwie.ruoyi.pojo.TbRolePerm">
<id property="rolePermId" column="role_perm_id" jdbcType="INTEGER"/>
<result property="roleId" column="role_id" jdbcType="INTEGER"/>
<result property="permId" column="perm_id" jdbcType="INTEGER"/>
<result property="deleted" column="deleted" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
role_perm_id,role_id,perm_id,
deleted,create_time,update_time
</sql>
</mapper>

@ -1,24 +0,0 @@
<?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.bwie.ruoyi.mapper.TbUserBankcardMapper">
<resultMap id="BaseResultMap" type="com.bwie.ruoyi.pojo.TbUserBankcard">
<id property="bankcardId" column="bankcard_id" jdbcType="INTEGER"/>
<result property="brankcardName" column="brankcard_name" jdbcType="VARCHAR"/>
<result property="userId" column="user_id" jdbcType="INTEGER"/>
<result property="bankcardMoney" column="bankcard_money" jdbcType="INTEGER"/>
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
bankcard_id,brankcard_name,user_id,
bankcard_money,create_by,create_time,
del_flag,update_by,update_time
</sql>
</mapper>

@ -2,9 +2,9 @@
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bwie.ruoyi.mapper.TbUserMapper"> <mapper namespace="com.bwie.user.mapper.TbUserMapper">
<resultMap id="BaseResultMap" type="com.bwie.ruoyi.pojo.TbUser"> <resultMap id="BaseResultMap" type="com.bwie.user.domain.TbUser">
<id property="userId" column="user_id" jdbcType="BIGINT"/> <id property="userId" column="user_id" jdbcType="BIGINT"/>
<result property="userName" column="user_name" jdbcType="VARCHAR"/> <result property="userName" column="user_name" jdbcType="VARCHAR"/>
<result property="nickName" column="nick_name" jdbcType="VARCHAR"/> <result property="nickName" column="nick_name" jdbcType="VARCHAR"/>

@ -1,22 +0,0 @@
<?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.bwie.ruoyi.mapper.TbUserRoleMapper">
<resultMap id="BaseResultMap" type="com.bwie.ruoyi.pojo.TbUserRole">
<id property="userRoleId" column="user_role_id" jdbcType="BIGINT"/>
<result property="userRoleName" column="user_role_name" jdbcType="VARCHAR"/>
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="roleFunction" column="role_function" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
user_role_id,user_role_name,create_by,
create_time,update_by,update_time,
role_function
</sql>
</mapper>

@ -0,0 +1,69 @@
<?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.bwie.user.mapper.TbMyroleMapper">
<resultMap type="com.bwie.user.domain.TbMyrole" id="TbMyroleResult">
<result property="roleId" column="role_id" />
<result property="roleName" column="role_name" />
<result property="deleted" column="deleted" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectTbMyroleVo">
select role_id, role_name, deleted, create_time, update_time from tb_myrole
</sql>
<select id="selectTbMyroleList" parameterType="com.bwie.user.domain.TbMyrole" resultMap="TbMyroleResult">
<include refid="selectTbMyroleVo"/>
<where>
<if test="roleName != null and roleName != ''"> and role_name like concat('%', #{roleName}, '%')</if>
<if test="deleted != null "> and deleted = #{deleted}</if>
</where>
</select>
<select id="selectTbMyroleByRoleId" parameterType="Long" resultMap="TbMyroleResult">
<include refid="selectTbMyroleVo"/>
where role_id = #{roleId}
</select>
<insert id="insertTbMyrole" parameterType="com.bwie.user.domain.TbMyrole" useGeneratedKeys="true" keyProperty="roleId">
insert into tb_myrole
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="roleName != null and roleName != ''">role_name,</if>
<if test="deleted != null">deleted,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="roleName != null and roleName != ''">#{roleName},</if>
<if test="deleted != null">#{deleted},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateTbMyrole" parameterType="com.bwie.user.domain.TbMyrole">
update tb_myrole
<trim prefix="SET" suffixOverrides=",">
<if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
<if test="deleted != null">deleted = #{deleted},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where role_id = #{roleId}
</update>
<delete id="deleteTbMyroleByRoleId" parameterType="Long">
delete from tb_myrole where role_id = #{roleId}
</delete>
<delete id="deleteTbMyroleByRoleIds" parameterType="String">
delete from tb_myrole where role_id in
<foreach item="roleId" collection="array" open="(" separator="," close=")">
#{roleId}
</foreach>
</delete>
</mapper>

@ -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.bwie.user.mapper.TbPermMapper">
<resultMap type="com.bwie.user.domain.TbPerm" id="TbPermResult">
<result property="permId" column="perm_id" />
<result property="permName" column="perm_name" />
<result property="permCode" column="perm_code" />
<result property="deleted" column="deleted" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectTbPermVo">
select perm_id, perm_name, perm_code, deleted, create_time, update_time from tb_perm
</sql>
<select id="selectTbPermList" parameterType="com.bwie.user.domain.TbPerm" resultMap="TbPermResult">
<include refid="selectTbPermVo"/>
<where>
<if test="permName != null and permName != ''"> and perm_name like concat('%', #{permName}, '%')</if>
<if test="permCode != null and permCode != ''"> and perm_code = #{permCode}</if>
<if test="deleted != null "> and deleted = #{deleted}</if>
</where>
</select>
<select id="selectTbPermByPermId" parameterType="Long" resultMap="TbPermResult">
<include refid="selectTbPermVo"/>
where perm_id = #{permId}
</select>
<insert id="insertTbPerm" parameterType="com.bwie.user.domain.TbPerm" useGeneratedKeys="true" keyProperty="permId">
insert into tb_perm
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="permName != null and permName != ''">perm_name,</if>
<if test="permCode != null and permCode != ''">perm_code,</if>
<if test="deleted != null">deleted,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="permName != null and permName != ''">#{permName},</if>
<if test="permCode != null and permCode != ''">#{permCode},</if>
<if test="deleted != null">#{deleted},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateTbPerm" parameterType="com.bwie.user.domain.TbPerm">
update tb_perm
<trim prefix="SET" suffixOverrides=",">
<if test="permName != null and permName != ''">perm_name = #{permName},</if>
<if test="permCode != null and permCode != ''">perm_code = #{permCode},</if>
<if test="deleted != null">deleted = #{deleted},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where perm_id = #{permId}
</update>
<delete id="deleteTbPermByPermId" parameterType="Long">
delete from tb_perm where perm_id = #{permId}
</delete>
<delete id="deleteTbPermByPermIds" parameterType="String">
delete from tb_perm where perm_id in
<foreach item="permId" collection="array" open="(" separator="," close=")">
#{permId}
</foreach>
</delete>
</mapper>

@ -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.bwie.user.mapper.TbRolePermMapper">
<resultMap type="com.bwie.user.domain.TbRolePerm" id="TbRolePermResult">
<result property="rolePermId" column="role_perm_id" />
<result property="roleId" column="role_id" />
<result property="permId" column="perm_id" />
<result property="deleted" column="deleted" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectTbRolePermVo">
select role_perm_id, role_id, perm_id, deleted, create_time, update_time from tb_role_perm
</sql>
<select id="selectTbRolePermList" parameterType="com.bwie.user.domain.TbRolePerm" resultMap="TbRolePermResult">
<include refid="selectTbRolePermVo"/>
<where>
<if test="roleId != null "> and role_id = #{roleId}</if>
<if test="permId != null "> and perm_id = #{permId}</if>
<if test="deleted != null "> and deleted = #{deleted}</if>
</where>
</select>
<select id="selectTbRolePermByRolePermId" parameterType="Long" resultMap="TbRolePermResult">
<include refid="selectTbRolePermVo"/>
where role_perm_id = #{rolePermId}
</select>
<insert id="insertTbRolePerm" parameterType="com.bwie.user.domain.TbRolePerm" useGeneratedKeys="true" keyProperty="rolePermId">
insert into tb_role_perm
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="roleId != null">role_id,</if>
<if test="permId != null">perm_id,</if>
<if test="deleted != null">deleted,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="roleId != null">#{roleId},</if>
<if test="permId != null">#{permId},</if>
<if test="deleted != null">#{deleted},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateTbRolePerm" parameterType="com.bwie.user.domain.TbRolePerm">
update tb_role_perm
<trim prefix="SET" suffixOverrides=",">
<if test="roleId != null">role_id = #{roleId},</if>
<if test="permId != null">perm_id = #{permId},</if>
<if test="deleted != null">deleted = #{deleted},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where role_perm_id = #{rolePermId}
</update>
<delete id="deleteTbRolePermByRolePermId" parameterType="Long">
delete from tb_role_perm where role_perm_id = #{rolePermId}
</delete>
<delete id="deleteTbRolePermByRolePermIds" parameterType="String">
delete from tb_role_perm where role_perm_id in
<foreach item="rolePermId" collection="array" open="(" separator="," close=")">
#{rolePermId}
</foreach>
</delete>
</mapper>

@ -0,0 +1,77 @@
<?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.bwie.user.mapper.TbUserRoleMapper">
<resultMap type="com.bwie.user.domain.TbUserRole" id="TbUserRoleResult">
<result property="userRoleId" column="user_role_id" />
<result property="userRoleName" column="user_role_name" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="roleFunction" column="role_function" />
</resultMap>
<sql id="selectTbUserRoleVo">
select user_role_id, user_role_name, create_by, create_time, update_by, update_time, role_function from tb_user_role
</sql>
<select id="selectTbUserRoleList" parameterType="com.bwie.user.domain.TbUserRole" resultMap="TbUserRoleResult">
<include refid="selectTbUserRoleVo"/>
<where>
<if test="userRoleName != null and userRoleName != ''"> and user_role_name like concat('%', #{userRoleName}, '%')</if>
<if test="roleFunction != null and roleFunction != ''"> and role_function = #{roleFunction}</if>
</where>
</select>
<select id="selectTbUserRoleByUserRoleId" parameterType="Long" resultMap="TbUserRoleResult">
<include refid="selectTbUserRoleVo"/>
where user_role_id = #{userRoleId}
</select>
<insert id="insertTbUserRole" parameterType="com.bwie.user.domain.TbUserRole" useGeneratedKeys="true" keyProperty="userRoleId">
insert into tb_user_role
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userRoleName != null and userRoleName != ''">user_role_name,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="roleFunction != null">role_function,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userRoleName != null and userRoleName != ''">#{userRoleName},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="roleFunction != null">#{roleFunction},</if>
</trim>
</insert>
<update id="updateTbUserRole" parameterType="com.bwie.user.domain.TbUserRole">
update tb_user_role
<trim prefix="SET" suffixOverrides=",">
<if test="userRoleName != null and userRoleName != ''">user_role_name = #{userRoleName},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="roleFunction != null">role_function = #{roleFunction},</if>
</trim>
where user_role_id = #{userRoleId}
</update>
<delete id="deleteTbUserRoleByUserRoleId" parameterType="Long">
delete from tb_user_role where user_role_id = #{userRoleId}
</delete>
<delete id="deleteTbUserRoleByUserRoleIds" parameterType="String">
delete from tb_user_role where user_role_id in
<foreach item="userRoleId" collection="array" open="(" separator="," close=")">
#{userRoleId}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save