Commit 0584fcd3 authored by 赵啸非's avatar 赵啸非

修改用户登录,数据库表,删除资源resource

parent a283f243
......@@ -35,7 +35,7 @@ CREATE TABLE mortals_xhx_role(
`roleSort` int(4) COMMENT '角色排序字段',
`roleType` tinyint(2) COMMENT '角色类型(0.系统内置角色,1.默认系统角色,2.普通角色)',
`remark` varchar(256) COMMENT '备注',
`roleType` tinyint(2) COMMENT '角色状态(0.停用,1.启用)',
`status` tinyint(2) COMMENT '角色状态(0.停用,1.启用)',
`createTime` datetime COMMENT '创建时间',
`createUserId` bigint(20) COMMENT '创建用户',
`createUserName` varchar(50) COMMENT '创建用户名称',
......@@ -216,4 +216,5 @@ INSERT INTO `mortals_xhx_role` VALUES (1, '管理员', '类似admin', 0, now(),
-- ----------------------------
INSERT INTO `mortals_xhx_task` VALUES (2, '分表创建任务', 'tableIndexService', 0, 'tableIndexService', NULL, NULL, 1, 0, '00:30', NULL, '192.168.1.106', '2021-08-18 00:30:01', 0, '2021-08-12 11:07:23', 1, '系统管理员');
INSERT INTO `mortals_xhx_user` VALUES (1, 'admin', '43442676c74ae59f219c2d87fd6bad52', NULL, '系统管理员', '13808095770', NULL, NULL, 1,"","","", 1, 1, now(), 1, 'admin', now(), '127.0.0.1');
INSERT INTO `mortals_xhx_user` VALUES (1, 'admin', '43442676c74ae59f219c2d87fd6bad52', NULL, '系统管理员', '13808095770', NULL, NULL,NULL, 0,"","", 1, now(), 1, 'admin', now(), '127.0.0.1');
\ No newline at end of file
......@@ -37,8 +37,8 @@ INSERT INTO `mortals_xhx_resource` VALUES (null, '角色信息-菜单管理-维
INSERT INTO `mortals_xhx_param` VALUES (null, '角色类型', 'Role', 'roleType', '0', '系统内置角色', 1, 4, 0, 'roleType', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '角色类型', 'Role', 'roleType', '1', '默认系统角色', 1, 4, 0, 'roleType', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '角色类型', 'Role', 'roleType', '2', '普通角色', 1, 4, 0, 'roleType', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '角色状态', 'Role', 'roleType', '0', '停用', 1, 4, 0, 'roleType', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '角色状态', 'Role', 'roleType', '1', '启用', 1, 4, 0, 'roleType', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '角色状态', 'Role', 'status', '0', '停用', 1, 4, 0, 'status', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '角色状态', 'Role', 'status', '1', '启用', 1, 4, 0, 'status', NULL, NULL, NULL);
-- ----------------------------
-- 角色用户关联菜单 SQL
-- ----------------------------
......
......@@ -7,11 +7,11 @@ import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.role.model.vo.RoleVo;
/**
* 角色信息实体对象
*
* @author zxfei
* @date 2022-06-02
*/
* 角色信息实体对象
*
* @author zxfei
* @date 2022-06-02
*/
public class RoleEntity extends RoleVo {
private static final long serialVersionUID = 1L;
......@@ -39,7 +39,7 @@ public class RoleEntity extends RoleVo {
/**
* 角色状态(0.停用,1.启用)
*/
private Integer roleType;
private Integer status;
/**
* 创建用户名称
*/
......@@ -122,15 +122,15 @@ public class RoleEntity extends RoleVo {
* 获取 角色状态(0.停用,1.启用)
* @return Integer
*/
public Integer getRoleType(){
return roleType;
public Integer getStatus(){
return status;
}
/**
* 设置 角色状态(0.停用,1.启用)
* @param roleType
* @param status
*/
public void setRoleType(Integer roleType){
this.roleType = roleType;
public void setStatus(Integer status){
this.status = status;
}
/**
* 获取 创建用户名称
......@@ -173,7 +173,7 @@ public class RoleEntity extends RoleVo {
sb.append(",roleSort:").append(getRoleSort());
sb.append(",roleType:").append(getRoleType());
sb.append(",remark:").append(getRemark());
sb.append(",roleType:").append(getRoleType());
sb.append(",status:").append(getStatus());
sb.append(",createUserName:").append(getCreateUserName());
return sb.toString();
}
......@@ -190,7 +190,7 @@ public class RoleEntity extends RoleVo {
this.remark = "";
this.roleType = 0;
this.status = 0;
this.createUserName = "";
}
......
......@@ -3,11 +3,11 @@ package com.mortals.xhx.module.role.model;
import java.util.List;
import com.mortals.xhx.module.role.model.RoleEntity;
/**
* 角色信息查询对象
*
* @author zxfei
* @date 2022-06-02
*/
* 角色信息查询对象
*
* @author zxfei
* @date 2022-06-02
*/
public class RoleQuery extends RoleEntity {
/** 开始 序号,主键,自增长 */
private Long idStart;
......@@ -55,16 +55,16 @@ public class RoleQuery extends RoleEntity {
private List<String> remarkList;
/** 开始 角色状态(0.停用,1.启用) */
private Integer roleTypeStart;
private Integer statusStart;
/** 结束 角色状态(0.停用,1.启用) */
private Integer roleTypeEnd;
private Integer statusEnd;
/** 增加 角色状态(0.停用,1.启用) */
private Integer roleTypeIncrement;
private Integer statusIncrement;
/** 角色状态(0.停用,1.启用)列表 */
private List <Integer> roleTypeList;
private List <Integer> statusList;
/** 开始 创建时间 */
private String createTimeStart;
......@@ -334,66 +334,66 @@ public class RoleQuery extends RoleEntity {
}
/**
* 获取 开始 角色状态(0.停用,1.启用)
* @return roleTypeStart
* @return statusStart
*/
public Integer getRoleTypeStart(){
return this.roleTypeStart;
public Integer getStatusStart(){
return this.statusStart;
}
/**
* 设置 开始 角色状态(0.停用,1.启用)
* @param roleTypeStart
* @param statusStart
*/
public void setRoleTypeStart(Integer roleTypeStart){
this.roleTypeStart = roleTypeStart;
public void setStatusStart(Integer statusStart){
this.statusStart = statusStart;
}
/**
* 获取 结束 角色状态(0.停用,1.启用)
* @return $roleTypeEnd
* @return $statusEnd
*/
public Integer getRoleTypeEnd(){
return this.roleTypeEnd;
public Integer getStatusEnd(){
return this.statusEnd;
}
/**
* 设置 结束 角色状态(0.停用,1.启用)
* @param roleTypeEnd
* @param statusEnd
*/
public void setRoleTypeEnd(Integer roleTypeEnd){
this.roleTypeEnd = roleTypeEnd;
public void setStatusEnd(Integer statusEnd){
this.statusEnd = statusEnd;
}
/**
* 获取 增加 角色状态(0.停用,1.启用)
* @return roleTypeIncrement
* @return statusIncrement
*/
public Integer getRoleTypeIncrement(){
return this.roleTypeIncrement;
public Integer getStatusIncrement(){
return this.statusIncrement;
}
/**
* 设置 增加 角色状态(0.停用,1.启用)
* @param roleTypeIncrement
* @param statusIncrement
*/
public void setRoleTypeIncrement(Integer roleTypeIncrement){
this.roleTypeIncrement = roleTypeIncrement;
public void setStatusIncrement(Integer statusIncrement){
this.statusIncrement = statusIncrement;
}
/**
* 获取 角色状态(0.停用,1.启用)
* @return roleTypeList
* @return statusList
*/
public List<Integer> getRoleTypeList(){
return this.roleTypeList;
public List<Integer> getStatusList(){
return this.statusList;
}
/**
* 设置 角色状态(0.停用,1.启用)
* @param roleTypeList
* @param statusList
*/
public void setRoleTypeList(List<Integer> roleTypeList){
this.roleTypeList = roleTypeList;
public void setStatusList(List<Integer> statusList){
this.statusList = statusList;
}
/**
......@@ -701,46 +701,46 @@ public class RoleQuery extends RoleEntity {
/**
* 设置 角色状态(0.停用,1.启用)
* @param roleType
* @param status
*/
public RoleQuery roleType(Integer roleType){
setRoleType(roleType);
public RoleQuery status(Integer status){
setStatus(status);
return this;
}
/**
* 设置 开始 角色状态(0.停用,1.启用)
* @param roleTypeStart
* @param statusStart
*/
public RoleQuery roleTypeStart(Integer roleTypeStart){
this.roleTypeStart = roleTypeStart;
public RoleQuery statusStart(Integer statusStart){
this.statusStart = statusStart;
return this;
}
/**
* 设置 结束 角色状态(0.停用,1.启用)
* @param roleTypeEnd
* @param statusEnd
*/
public RoleQuery roleTypeEnd(Integer roleTypeEnd){
this.roleTypeEnd = roleTypeEnd;
public RoleQuery statusEnd(Integer statusEnd){
this.statusEnd = statusEnd;
return this;
}
/**
* 设置 增加 角色状态(0.停用,1.启用)
* @param roleTypeIncrement
* @param statusIncrement
*/
public RoleQuery roleTypeIncrement(Integer roleTypeIncrement){
this.roleTypeIncrement = roleTypeIncrement;
public RoleQuery statusIncrement(Integer statusIncrement){
this.statusIncrement = statusIncrement;
return this;
}
/**
* 设置 角色状态(0.停用,1.启用)
* @param roleTypeList
* @param statusList
*/
public RoleQuery roleTypeList(List<Integer> roleTypeList){
this.roleTypeList = roleTypeList;
public RoleQuery statusList(List<Integer> statusList){
this.statusList = statusList;
return this;
}
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd">
"mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.role.dao.ibatis.RoleDaoImpl">
<!-- 字段和属性映射 -->
......@@ -11,7 +11,7 @@
<result property="roleSort" column="roleSort" />
<result property="roleType" column="roleType" />
<result property="remark" column="remark" />
<result property="roleType" column="roleType" />
<result property="status" column="status" />
<result property="createTime" column="createTime" />
<result property="createUserId" column="createUserId" />
<result property="createUserName" column="createUserName" />
......@@ -40,8 +40,8 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('remark') or colPickMode == 1 and data.containsKey('remark')))">
a.remark,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('roleType') or colPickMode == 1 and data.containsKey('roleType')))">
a.roleType,
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('status') or colPickMode == 1 and data.containsKey('status')))">
a.status,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createTime') or colPickMode == 1 and data.containsKey('createTime')))">
a.createTime,
......@@ -57,18 +57,18 @@
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="RoleEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_role
(name,roleCode,roleSort,roleType,remark,roleType,createTime,createUserId,createUserName)
(name,roleCode,roleSort,roleType,remark,status,createTime,createUserId,createUserName)
VALUES
(#{name},#{roleCode},#{roleSort},#{roleType},#{remark},#{roleType},#{createTime},#{createUserId},#{createUserName})
(#{name},#{roleCode},#{roleSort},#{roleType},#{remark},#{status},#{createTime},#{createUserId},#{createUserName})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_role
(name,roleCode,roleSort,roleType,remark,roleType,createTime,createUserId,createUserName)
(name,roleCode,roleSort,roleType,remark,status,createTime,createUserId,createUserName)
VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.name},#{item.roleCode},#{item.roleSort},#{item.roleType},#{item.remark},#{item.roleType},#{item.createTime},#{item.createUserId},#{item.createUserName})
(#{item.name},#{item.roleCode},#{item.roleSort},#{item.roleType},#{item.remark},#{item.status},#{item.createTime},#{item.createUserId},#{item.createUserName})
</foreach>
</insert>
......@@ -99,11 +99,11 @@
<if test="(colPickMode==0 and data.containsKey('remark')) or (colPickMode==1 and !data.containsKey('remark'))">
a.remark=#{data.remark},
</if>
<if test="(colPickMode==0 and data.containsKey('roleType')) or (colPickMode==1 and !data.containsKey('roleType'))">
a.roleType=#{data.roleType},
<if test="(colPickMode==0 and data.containsKey('status')) or (colPickMode==1 and !data.containsKey('status'))">
a.status=#{data.status},
</if>
<if test="(colPickMode==0 and data.containsKey('roleTypeIncrement')) or (colPickMode==1 and !data.containsKey('roleTypeIncrement'))">
a.roleType=ifnull(a.roleType,0) + #{data.roleTypeIncrement},
<if test="(colPickMode==0 and data.containsKey('statusIncrement')) or (colPickMode==1 and !data.containsKey('statusIncrement'))">
a.status=ifnull(a.status,0) + #{data.statusIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('createTime')) or (colPickMode==1 and !data.containsKey('createTime'))">
a.createTime=#{data.createTime},
......@@ -174,14 +174,14 @@
</if>
</foreach>
</trim>
<trim prefix="roleType=(case" suffix="ELSE roleType end),">
<trim prefix="status=(case" suffix="ELSE status end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('roleType')) or (colPickMode==1 and !item.containsKey('roleType'))">
when a.id=#{item.id} then #{item.roleType}
<when test="(colPickMode==0 and item.containsKey('status')) or (colPickMode==1 and !item.containsKey('status'))">
when a.id=#{item.id} then #{item.status}
</when>
<when test="(colPickMode==0 and item.containsKey('roleTypeIncrement')) or (colPickMode==1 and !item.containsKey('roleTypeIncrement'))">
when a.id=#{item.id} then ifnull(a.roleType,0) + #{item.roleTypeIncrement}
<when test="(colPickMode==0 and item.containsKey('statusIncrement')) or (colPickMode==1 and !item.containsKey('statusIncrement'))">
when a.id=#{item.id} then ifnull(a.status,0) + #{item.statusIncrement}
</when>
</choose>
</foreach>
......@@ -421,25 +421,25 @@
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('roleType')">
<if test="conditionParamRef.roleType != null ">
${_conditionType_} a.roleType = #{${_conditionParam_}.roleType}
<if test="conditionParamRef.containsKey('status')">
<if test="conditionParamRef.status != null ">
${_conditionType_} a.status = #{${_conditionParam_}.status}
</if>
<if test="conditionParamRef.roleType == null">
${_conditionType_} a.roleType is null
<if test="conditionParamRef.status == null">
${_conditionType_} a.status is null
</if>
</if>
<if test="conditionParamRef.containsKey('roleTypeList')">
${_conditionType_} a.roleType in
<foreach collection="conditionParamRef.roleTypeList" open="(" close=")" index="index" item="item" separator=",">
<if test="conditionParamRef.containsKey('statusList')">
${_conditionType_} a.status in
<foreach collection="conditionParamRef.statusList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('roleTypeStart') and conditionParamRef.roleTypeStart != null">
${_conditionType_} a.roleType <![CDATA[ >= ]]> #{${_conditionParam_}.roleTypeStart}
<if test="conditionParamRef.containsKey('statusStart') and conditionParamRef.statusStart != null">
${_conditionType_} a.status <![CDATA[ >= ]]> #{${_conditionParam_}.statusStart}
</if>
<if test="conditionParamRef.containsKey('roleTypeEnd') and conditionParamRef.roleTypeEnd != null">
${_conditionType_} a.roleType <![CDATA[ <= ]]> #{${_conditionParam_}.roleTypeEnd}
<if test="conditionParamRef.containsKey('statusEnd') and conditionParamRef.statusEnd != null">
${_conditionType_} a.status <![CDATA[ <= ]]> #{${_conditionParam_}.statusEnd}
</if>
......@@ -536,9 +536,9 @@
<if test='orderCol.remark != null and "DESC".equalsIgnoreCase(orderCol.remark)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('roleType')">
a.roleType
<if test='orderCol.roleType != null and "DESC".equalsIgnoreCase(orderCol.roleType)'>DESC</if>
<if test="orderCol.containsKey('status')">
a.status
<if test='orderCol.status != null and "DESC".equalsIgnoreCase(orderCol.status)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('createTime')">
......
......@@ -16,13 +16,13 @@ Authorization: {{authToken}}
Content-Type: application/json
{
"name":"e9e4uu",
"roleCode":"tzulbs",
"name":"9h8jlh",
"roleCode":"beliak",
"roleSort":0,
"roleType":2,
"remark":"4345a1",
"roleType":0,
"createUserName":"78k9cx"
"remark":"66tnax",
"status":0,
"createUserName":"6qo3fj"
}
> {%
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment