规范代码
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package com.lishouyu.oauth;
|
||||
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 根据用户名获取用户的详细信息,必须为此名称msUserDetailsServiceImpl
|
||||
* @author lsy
|
||||
*/
|
||||
|
||||
@Component("msUserDetailsServiceImpl")
|
||||
public class UserDetailsServiceImpl implements UserDetailsService {
|
||||
@Override
|
||||
public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -68,9 +68,6 @@ server:
|
||||
port: 8080
|
||||
tomcat:
|
||||
uri-encoding: utf-8
|
||||
feign:
|
||||
hystrix:
|
||||
enabled: true #开启监控熔断
|
||||
# 健康检查的相关配置
|
||||
management:
|
||||
security:
|
||||
@@ -84,6 +81,16 @@ mybatis:
|
||||
mappers: classpath:/mappers/*.xml
|
||||
pageHelperProperties:
|
||||
- dialect:mysql
|
||||
# --------------------------
|
||||
# /自定义的配置参数
|
||||
# --------------------------
|
||||
# boot-satrter-security-oauth模块自定义的配置
|
||||
ms:
|
||||
security:
|
||||
code:
|
||||
image:
|
||||
width: 67
|
||||
height: 23
|
||||
length: 4
|
||||
expireIn: 300
|
||||
oauth2:
|
||||
clients[0]:
|
||||
clientId: ms
|
||||
clientSecret: ms
|
||||
+26
-26
@@ -273,32 +273,32 @@ CREATE TABLE upms_user_role (
|
||||
ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8;
|
||||
|
||||
-- ----------------------------------
|
||||
-- upms_user_permission 用户_权限关联表
|
||||
-- ----------------------------------
|
||||
DROP TABLE IF EXISTS upms_user_permission;
|
||||
DROP TABLE IF EXISTS upms_user_permissioon;
|
||||
CREATE TABLE upms_user_permission (
|
||||
`id` INT(10) UNSIGNED AUTO_INCREMENT NOT NULL
|
||||
COMMENT '编号',
|
||||
`user_id` INT(10) UNSIGNED NOT NULL
|
||||
COMMENT '用户编号',
|
||||
`permission_id` INT(10) UNSIGNED NOT NULL
|
||||
COMMENT '权限编号',
|
||||
`type` TINYINT(4) NOT NULL
|
||||
COMMENT '权限类型 -1 减权限',
|
||||
`ctime` BIGINT(20) UNSIGNED DEFAULT NULL
|
||||
COMMENT '创建时间',
|
||||
`uptime` BIGINT(20) UNSIGNED DEFAULT NULL
|
||||
COMMENT '修改时间',
|
||||
`version` INT(10) UNSIGNED DEFAULT 0
|
||||
COMMENT '数据版本',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `upms_user_permission_user_id_index` (`user_id`) USING BTREE COMMENT 'B+树索引',
|
||||
KEY `upms_user_permission_permission_id_index` (`permission_id`) USING BTREE COMMENT 'B+树索引'
|
||||
)
|
||||
ENGINE = InnoDB
|
||||
DEFAULT CHARSET utf8;
|
||||
# -- ----------------------------------
|
||||
# -- upms_user_permission 用户_权限关联表
|
||||
# -- ----------------------------------
|
||||
# DROP TABLE IF EXISTS upms_user_permission;
|
||||
# DROP TABLE IF EXISTS upms_user_permissioon;
|
||||
# CREATE TABLE upms_user_permission (
|
||||
# `id` INT(10) UNSIGNED AUTO_INCREMENT NOT NULL
|
||||
# COMMENT '编号',
|
||||
# `user_id` INT(10) UNSIGNED NOT NULL
|
||||
# COMMENT '用户编号',
|
||||
# `permission_id` INT(10) UNSIGNED NOT NULL
|
||||
# COMMENT '权限编号',
|
||||
# `type` TINYINT(4) NOT NULL
|
||||
# COMMENT '权限类型 -1 减权限',
|
||||
# `ctime` BIGINT(20) UNSIGNED DEFAULT NULL
|
||||
# COMMENT '创建时间',
|
||||
# `uptime` BIGINT(20) UNSIGNED DEFAULT NULL
|
||||
# COMMENT '修改时间',
|
||||
# `version` INT(10) UNSIGNED DEFAULT 0
|
||||
# COMMENT '数据版本',
|
||||
# PRIMARY KEY (`id`),
|
||||
# KEY `upms_user_permission_user_id_index` (`user_id`) USING BTREE COMMENT 'B+树索引',
|
||||
# KEY `upms_user_permission_permission_id_index` (`permission_id`) USING BTREE COMMENT 'B+树索引'
|
||||
# )
|
||||
# ENGINE = InnoDB
|
||||
# DEFAULT CHARSET utf8;
|
||||
|
||||
-- ----------------------------------
|
||||
-- upms_role_permission 角色_权限关联表
|
||||
|
||||
@@ -6,6 +6,9 @@ import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lsy
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+7
-9
@@ -6,7 +6,6 @@ import com.micro.fast.upms.pojo.UpmsOrganization;
|
||||
import com.micro.fast.upms.service.UpmsOrganizationService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
import org.hibernate.validator.constraints.NotEmpty;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -15,7 +14,6 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -37,14 +35,14 @@ public class UpmsOrganizationController {
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询详细信息")
|
||||
@GetMapping("/{id}")
|
||||
@GetMapping
|
||||
public ServerResponse getUpmsOrganizationById(
|
||||
@PathVariable(value = "id") @NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){
|
||||
@RequestParam("id") @NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){
|
||||
return upmsOrganizationService.getById(Integer.valueOf(id));
|
||||
}
|
||||
|
||||
@ApiOperation("根据条件分页查询")
|
||||
@GetMapping
|
||||
@GetMapping("/getPageByCondition")
|
||||
public ServerResponse getUpmsOrganizationByCondition(UpmsOrganization upmsOrganization,
|
||||
@RequestParam(defaultValue = "1",required = false) int pageNum,
|
||||
@RequestParam(defaultValue = "10",required = false)int pageSize,
|
||||
@@ -53,9 +51,9 @@ public class UpmsOrganizationController {
|
||||
}
|
||||
|
||||
@ApiOperation("修改信息")
|
||||
@PutMapping("/{id}")
|
||||
@PutMapping
|
||||
public ServerResponse updateUpmsOrganization(@Valid UpmsOrganization upmsOrganization,
|
||||
@NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){
|
||||
@RequestParam("id") @NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){
|
||||
upmsOrganization.setId(Integer.valueOf(id));
|
||||
return upmsOrganizationService.update(upmsOrganization);
|
||||
}
|
||||
@@ -67,8 +65,8 @@ public class UpmsOrganizationController {
|
||||
}
|
||||
|
||||
@ApiOperation("根据用户id查询组织")
|
||||
@GetMapping("/organization/{userId}")
|
||||
public ServerResponse getOrganization(@PathVariable(value = "userId") Integer userId) {
|
||||
@GetMapping("/organization")
|
||||
public ServerResponse getOrganization(@RequestParam("userId") Integer userId) {
|
||||
return upmsOrganizationService.getOrganizationByUserId(userId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class UpmsPermissionController {
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询详细信息")
|
||||
@GetMapping("/{id}")
|
||||
@GetMapping
|
||||
public ServerResponse getUpmsPermissionById(
|
||||
@PathVariable(value = "id") @NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){
|
||||
return upmsPermissionService.getById(Integer.valueOf(id));
|
||||
@@ -49,7 +49,7 @@ public class UpmsPermissionController {
|
||||
@ApiImplicitParam(name = "systemId",value = "系统id",dataType = "integer"),
|
||||
@ApiImplicitParam(name = "status",value = "权限状态",dataType = "string")
|
||||
})
|
||||
@GetMapping
|
||||
@GetMapping("/getPageByCondition")
|
||||
public ServerResponse getUpmsPermissionByCondition(UpmsPermission upmsPermission,
|
||||
@RequestParam(defaultValue = "1",required = false) int pageNum,
|
||||
@RequestParam(defaultValue = "10",required = false)int pageSize,
|
||||
@@ -58,9 +58,9 @@ public class UpmsPermissionController {
|
||||
}
|
||||
|
||||
@ApiOperation("修改信息")
|
||||
@PutMapping("/{id}")
|
||||
@PutMapping
|
||||
public ServerResponse updateUpmsPermission(UpmsPermission upmsPermission,
|
||||
@NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){
|
||||
@RequestParam("id") @NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){
|
||||
upmsPermission.setId(Integer.valueOf(id));
|
||||
return upmsPermissionService.update(upmsPermission);
|
||||
}
|
||||
|
||||
@@ -36,14 +36,14 @@ public class UpmsRoleController {
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询详细信息")
|
||||
@GetMapping("/{id}")
|
||||
@GetMapping
|
||||
public ServerResponse getUpmsRoleById(
|
||||
@PathVariable(value = "id") @NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){
|
||||
@RequestParam(value = "id") @NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){
|
||||
return upmsRoleService.getById(Integer.valueOf(id));
|
||||
}
|
||||
|
||||
@ApiOperation("根据条件分页查询")
|
||||
@GetMapping
|
||||
@GetMapping("/getPageByCondition")
|
||||
public ServerResponse getUpmsRoleByCondition(UpmsRole upmsRole,
|
||||
@RequestParam(defaultValue = "1",required = false) int pageNum,
|
||||
@RequestParam(defaultValue = "10",required = false)int pageSize,
|
||||
@@ -52,9 +52,9 @@ public class UpmsRoleController {
|
||||
}
|
||||
|
||||
@ApiOperation("修改信息")
|
||||
@PutMapping("/{id}")
|
||||
@PutMapping
|
||||
public ServerResponse updateUpmsRole(UpmsRole upmsRole,
|
||||
@NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){
|
||||
@RequestParam("id") @NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){
|
||||
upmsRole.setId(Integer.valueOf(id));
|
||||
return upmsRoleService.update(upmsRole);
|
||||
}
|
||||
@@ -66,8 +66,8 @@ public class UpmsRoleController {
|
||||
}
|
||||
|
||||
@ApiOperation("根据用户id查询角色")
|
||||
@GetMapping("/userId/{userId}")
|
||||
public ServerResponse getRolesByUserId(@PathVariable("userId") Integer userId){
|
||||
@GetMapping("/userId")
|
||||
public ServerResponse getRolesByUserId(@RequestParam("userId") Integer userId){
|
||||
return upmsRoleService.getRolesByUserId(userId);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,14 +38,14 @@ public class UpmsSystemController {
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询详细信息")
|
||||
@GetMapping("/{id}")
|
||||
@GetMapping
|
||||
public ServerResponse getSystemById(
|
||||
@PathVariable(value = "id") @NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){
|
||||
@RequestParam(value = "id") @NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){
|
||||
return upmsSystemService.getById(Integer.valueOf(id));
|
||||
}
|
||||
|
||||
@ApiOperation("根据条件分页查询")
|
||||
@GetMapping
|
||||
@GetMapping("/getPageByCondition")
|
||||
public ServerResponse getSystemByCondition(UpmsSystem upmsSystem,
|
||||
@RequestParam(defaultValue = "1",required = false) int pageNum,
|
||||
@RequestParam(defaultValue = "10",required = false)int pageSize,
|
||||
@@ -54,9 +54,9 @@ public class UpmsSystemController {
|
||||
}
|
||||
|
||||
@ApiOperation("修改信息")
|
||||
@PutMapping("/{id}")
|
||||
@PutMapping
|
||||
public ServerResponse updateSystem( UpmsSystem upmsSystem,
|
||||
@NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){
|
||||
@RequestParam("id") @NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){
|
||||
upmsSystem.setId(Integer.valueOf(id));
|
||||
return upmsSystemService.update(upmsSystem);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 权限管理系统用户管理
|
||||
@@ -64,14 +65,14 @@ public class UpmsUserController {
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询详细信息")
|
||||
@GetMapping("/{id}")
|
||||
@GetMapping
|
||||
public ServerResponse getUserById(
|
||||
@PathVariable(value = "id") @NotBlank(message = BaseConst.BASEMSG_PREFIX + "请传入id") String id) {
|
||||
@RequestParam(value = "id") @NotBlank(message = BaseConst.BASEMSG_PREFIX + "请传入id") String id) {
|
||||
return upmsUserService.getById(Integer.valueOf(id));
|
||||
}
|
||||
|
||||
@ApiOperation("根据条件分页查询")
|
||||
@GetMapping
|
||||
@GetMapping("/getPageByCondition")
|
||||
public ServerResponse getUserByCondition(UpmsUser upmsUser,
|
||||
@RequestParam(defaultValue = "1", required = false) int pageNum,
|
||||
@RequestParam(defaultValue = "10", required = false) int pageSize,
|
||||
@@ -80,9 +81,9 @@ public class UpmsUserController {
|
||||
}
|
||||
|
||||
@ApiOperation("修改信息")
|
||||
@PutMapping("/{id}")
|
||||
@PutMapping
|
||||
public ServerResponse updateUser(UpmsUser upmsUser,
|
||||
@NotBlank(message = BaseConst.BASEMSG_PREFIX + "请传入id") String id) {
|
||||
@RequestParam("id") @NotBlank(message = BaseConst.BASEMSG_PREFIX + "请传入id") String id) {
|
||||
upmsUser.setId(Integer.valueOf(id));
|
||||
return upmsUserService.update(upmsUser);
|
||||
}
|
||||
@@ -95,7 +96,7 @@ public class UpmsUserController {
|
||||
}
|
||||
|
||||
@ApiOperation("根据组织id还有用户信息查询用户")
|
||||
@GetMapping("/organization")
|
||||
@GetMapping("/organization/getPageByCondition")
|
||||
public ServerResponse getUsersByOrgId(UpmsUser upmsUser,
|
||||
@RequestParam(defaultValue = "1", required = false) int pageNum,
|
||||
@RequestParam(defaultValue = "10", required = false) int pageSize,
|
||||
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
package com.micro.fast.upms.controller;
|
||||
|
||||
import com.micro.fast.boot.starter.common.response.ServerResponse;
|
||||
import com.micro.fast.upms.service.UpmsUserPermissionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author lsy
|
||||
*/
|
||||
@Api("upmsUserPermission")
|
||||
@RestController
|
||||
@RequestMapping("/upmsUserPermission")
|
||||
public class UpmsUserPermissionController {
|
||||
|
||||
@Autowired
|
||||
private UpmsUserPermissionService upmsUserPermissionService;
|
||||
|
||||
@ApiOperation("批量添加用户和组织的关系,一个用户可以属于多个组织")
|
||||
@PostMapping("/batch/oneUserWithManyOrganization")
|
||||
public ServerResponse batchAddUpmsUserPermission(@RequestParam("userId") Integer userId,@RequestParam("orgIds") ArrayList<Integer> orgIds) {
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.micro.fast.upms.dao;
|
||||
|
||||
import com.micro.fast.upms.pojo.UpmsUserPermission;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface UpmsUserPermissionMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(UpmsUserPermission record);
|
||||
|
||||
int insertSelective(UpmsUserPermission record);
|
||||
|
||||
UpmsUserPermission selectByPrimaryKey(Integer userPermissionId);
|
||||
|
||||
int updateByPrimaryKeySelective(UpmsUserPermission record);
|
||||
|
||||
int updateByPrimaryKey(UpmsUserPermission record);
|
||||
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
package com.micro.fast.upms.pojo;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class UpmsUserPermission implements Serializable {
|
||||
private Integer id;
|
||||
|
||||
private Integer userId;
|
||||
|
||||
private Integer permissionId;
|
||||
|
||||
private Byte type;
|
||||
|
||||
private Long ctime;
|
||||
|
||||
private Long uptime;
|
||||
|
||||
private Integer version;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public UpmsUserPermission(Integer id, Integer userId, Integer permissionId, Byte type, Long ctime, Long uptime, Integer version) {
|
||||
this.id = id;
|
||||
this.userId = userId;
|
||||
this.permissionId = permissionId;
|
||||
this.type = type;
|
||||
this.ctime = ctime;
|
||||
this.uptime = uptime;
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public UpmsUserPermission() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Integer userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Integer getPermissionId() {
|
||||
return permissionId;
|
||||
}
|
||||
|
||||
public void setPermissionId(Integer permissionId) {
|
||||
this.permissionId = permissionId;
|
||||
}
|
||||
|
||||
public Byte getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Byte type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Long getCtime() {
|
||||
return ctime;
|
||||
}
|
||||
|
||||
public void setCtime(Long ctime) {
|
||||
this.ctime = ctime;
|
||||
}
|
||||
|
||||
public Long getUptime() {
|
||||
return uptime;
|
||||
}
|
||||
|
||||
public void setUptime(Long uptime) {
|
||||
this.uptime = uptime;
|
||||
}
|
||||
|
||||
public Integer getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(Integer version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getClass().getSimpleName());
|
||||
sb.append(" [");
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", id=").append(id);
|
||||
sb.append(", userId=").append(userId);
|
||||
sb.append(", permissionId=").append(permissionId);
|
||||
sb.append(", type=").append(type);
|
||||
sb.append(", ctime=").append(ctime);
|
||||
sb.append(", uptime=").append(uptime);
|
||||
sb.append(", version=").append(version);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package com.micro.fast.upms.service;
|
||||
|
||||
/**
|
||||
* @author lsy
|
||||
*/
|
||||
public interface UpmsUserPermissionService{
|
||||
|
||||
|
||||
|
||||
}
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
package com.micro.fast.upms.service.impl;
|
||||
|
||||
import com.micro.fast.boot.starter.common.response.ServerResponse;
|
||||
import com.micro.fast.upms.dao.UpmsUserPermissionMapper;
|
||||
import com.micro.fast.upms.service.UpmsUserPermissionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lsy
|
||||
*/
|
||||
@Service
|
||||
public class UpmsUserPermissionServiceImpl implements UpmsUserPermissionService{
|
||||
|
||||
@Autowired
|
||||
private UpmsUserPermissionMapper mapper;
|
||||
|
||||
}
|
||||
@@ -25,7 +25,7 @@
|
||||
delete from upms_organization
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.micro.fast.upms.pojo.UpmsOrganization" >
|
||||
<insert id="insert" parameterType="com.micro.fast.upms.pojo.UpmsOrganization">
|
||||
insert into upms_organization (id, pid, name,
|
||||
description, ctime, uptime,
|
||||
version)
|
||||
@@ -33,7 +33,7 @@
|
||||
#{description,jdbcType=VARCHAR}, #{ctime,jdbcType=BIGINT}, #{uptime,jdbcType=BIGINT},
|
||||
#{version,jdbcType=INTEGER})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.micro.fast.upms.pojo.UpmsOrganization" >
|
||||
<insert id="insertSelective" parameterType="com.micro.fast.upms.pojo.UpmsOrganization" keyProperty="id" keyColumn="id">
|
||||
insert into upms_organization
|
||||
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
|
||||
@@ -1,119 +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.micro.fast.upms.dao.UpmsUserPermissionMapper" >
|
||||
<resultMap id="BaseResultMap" type="com.micro.fast.upms.pojo.UpmsUserPermission" >
|
||||
<constructor >
|
||||
<idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" />
|
||||
<arg column="user_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
|
||||
<arg column="permission_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
|
||||
<arg column="type" jdbcType="TINYINT" javaType="java.lang.Byte" />
|
||||
<arg column="ctime" jdbcType="BIGINT" javaType="java.lang.Long" />
|
||||
<arg column="uptime" jdbcType="BIGINT" javaType="java.lang.Long" />
|
||||
<arg column="version" jdbcType="INTEGER" javaType="java.lang.Integer" />
|
||||
</constructor>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List" >
|
||||
id, user_id, permission_id, type, ctime, uptime, version
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from upms_user_permission
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
|
||||
delete from upms_user_permission
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.micro.fast.upms.pojo.UpmsUserPermission" >
|
||||
insert into upms_user_permission (id, user_id, permission_id,
|
||||
type, ctime, uptime,
|
||||
version)
|
||||
values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{permissionId,jdbcType=INTEGER},
|
||||
#{type,jdbcType=TINYINT}, #{ctime,jdbcType=BIGINT}, #{uptime,jdbcType=BIGINT},
|
||||
#{version,jdbcType=INTEGER})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.micro.fast.upms.pojo.UpmsUserPermission" >
|
||||
insert into upms_user_permission
|
||||
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
id,
|
||||
</if>
|
||||
<if test="userId != null" >
|
||||
user_id,
|
||||
</if>
|
||||
<if test="permissionId != null" >
|
||||
permission_id,
|
||||
</if>
|
||||
<if test="type != null" >
|
||||
type,
|
||||
</if>
|
||||
<if test="ctime != null" >
|
||||
ctime,
|
||||
</if>
|
||||
<if test="uptime != null" >
|
||||
uptime,
|
||||
</if>
|
||||
<if test="version != null" >
|
||||
version,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="userId != null" >
|
||||
#{userId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="permissionId != null" >
|
||||
#{permissionId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="type != null" >
|
||||
#{type,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="ctime != null" >
|
||||
#{ctime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="uptime != null" >
|
||||
#{uptime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="version != null" >
|
||||
#{version,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.micro.fast.upms.pojo.UpmsUserPermission" >
|
||||
update upms_user_permission
|
||||
<set >
|
||||
<if test="userId != null" >
|
||||
user_id = #{userId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="permissionId != null" >
|
||||
permission_id = #{permissionId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="type != null" >
|
||||
type = #{type,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="ctime != null" >
|
||||
ctime = #{ctime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="uptime != null" >
|
||||
uptime = #{uptime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="version != null" >
|
||||
version = #{version,jdbcType=INTEGER},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.micro.fast.upms.pojo.UpmsUserPermission" >
|
||||
update upms_user_permission
|
||||
set user_id = #{userId,jdbcType=INTEGER},
|
||||
permission_id = #{permissionId,jdbcType=INTEGER},
|
||||
type = #{type,jdbcType=TINYINT},
|
||||
ctime = #{ctime,jdbcType=BIGINT},
|
||||
uptime = #{uptime,jdbcType=BIGINT},
|
||||
version = #{version,jdbcType=INTEGER}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user