新增角色字段
This commit is contained in:
parent
7d61249e97
commit
56ea1934bb
|
@ -4,6 +4,7 @@
|
||||||
<resultMap id="BaseResultMap" type="com.zheng.upms.dao.model.UpmsRole">
|
<resultMap id="BaseResultMap" type="com.zheng.upms.dao.model.UpmsRole">
|
||||||
<id column="role_id" jdbcType="INTEGER" property="roleId" />
|
<id column="role_id" jdbcType="INTEGER" property="roleId" />
|
||||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||||
|
<result column="title" jdbcType="VARCHAR" property="title" />
|
||||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||||
<result column="ctime" jdbcType="BIGINT" property="ctime" />
|
<result column="ctime" jdbcType="BIGINT" property="ctime" />
|
||||||
<result column="orders" jdbcType="BIGINT" property="orders" />
|
<result column="orders" jdbcType="BIGINT" property="orders" />
|
||||||
|
@ -67,7 +68,7 @@
|
||||||
</where>
|
</where>
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
role_id, name, description, ctime, orders
|
role_id, name, title, description, ctime, orders
|
||||||
</sql>
|
</sql>
|
||||||
<select id="selectByExample" parameterType="com.zheng.upms.dao.model.UpmsRoleExample" resultMap="BaseResultMap">
|
<select id="selectByExample" parameterType="com.zheng.upms.dao.model.UpmsRoleExample" resultMap="BaseResultMap">
|
||||||
select
|
select
|
||||||
|
@ -108,10 +109,12 @@
|
||||||
</if>
|
</if>
|
||||||
</delete>
|
</delete>
|
||||||
<insert id="insert" parameterType="com.zheng.upms.dao.model.UpmsRole">
|
<insert id="insert" parameterType="com.zheng.upms.dao.model.UpmsRole">
|
||||||
insert into upms_role (role_id, name, description,
|
insert into upms_role (role_id, name, title,
|
||||||
ctime, orders)
|
description, ctime, orders
|
||||||
values (#{roleId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
|
)
|
||||||
#{ctime,jdbcType=BIGINT}, #{orders,jdbcType=BIGINT})
|
values (#{roleId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR},
|
||||||
|
#{description,jdbcType=VARCHAR}, #{ctime,jdbcType=BIGINT}, #{orders,jdbcType=BIGINT}
|
||||||
|
)
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" parameterType="com.zheng.upms.dao.model.UpmsRole">
|
<insert id="insertSelective" parameterType="com.zheng.upms.dao.model.UpmsRole">
|
||||||
insert into upms_role
|
insert into upms_role
|
||||||
|
@ -122,6 +125,9 @@
|
||||||
<if test="name != null">
|
<if test="name != null">
|
||||||
name,
|
name,
|
||||||
</if>
|
</if>
|
||||||
|
<if test="title != null">
|
||||||
|
title,
|
||||||
|
</if>
|
||||||
<if test="description != null">
|
<if test="description != null">
|
||||||
description,
|
description,
|
||||||
</if>
|
</if>
|
||||||
|
@ -139,6 +145,9 @@
|
||||||
<if test="name != null">
|
<if test="name != null">
|
||||||
#{name,jdbcType=VARCHAR},
|
#{name,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="title != null">
|
||||||
|
#{title,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
<if test="description != null">
|
<if test="description != null">
|
||||||
#{description,jdbcType=VARCHAR},
|
#{description,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
@ -165,6 +174,9 @@
|
||||||
<if test="record.name != null">
|
<if test="record.name != null">
|
||||||
name = #{record.name,jdbcType=VARCHAR},
|
name = #{record.name,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="record.title != null">
|
||||||
|
title = #{record.title,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
<if test="record.description != null">
|
<if test="record.description != null">
|
||||||
description = #{record.description,jdbcType=VARCHAR},
|
description = #{record.description,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
@ -183,6 +195,7 @@
|
||||||
update upms_role
|
update upms_role
|
||||||
set role_id = #{record.roleId,jdbcType=INTEGER},
|
set role_id = #{record.roleId,jdbcType=INTEGER},
|
||||||
name = #{record.name,jdbcType=VARCHAR},
|
name = #{record.name,jdbcType=VARCHAR},
|
||||||
|
title = #{record.title,jdbcType=VARCHAR},
|
||||||
description = #{record.description,jdbcType=VARCHAR},
|
description = #{record.description,jdbcType=VARCHAR},
|
||||||
ctime = #{record.ctime,jdbcType=BIGINT},
|
ctime = #{record.ctime,jdbcType=BIGINT},
|
||||||
orders = #{record.orders,jdbcType=BIGINT}
|
orders = #{record.orders,jdbcType=BIGINT}
|
||||||
|
@ -196,6 +209,9 @@
|
||||||
<if test="name != null">
|
<if test="name != null">
|
||||||
name = #{name,jdbcType=VARCHAR},
|
name = #{name,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="title != null">
|
||||||
|
title = #{title,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
<if test="description != null">
|
<if test="description != null">
|
||||||
description = #{description,jdbcType=VARCHAR},
|
description = #{description,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
@ -211,6 +227,7 @@
|
||||||
<update id="updateByPrimaryKey" parameterType="com.zheng.upms.dao.model.UpmsRole">
|
<update id="updateByPrimaryKey" parameterType="com.zheng.upms.dao.model.UpmsRole">
|
||||||
update upms_role
|
update upms_role
|
||||||
set name = #{name,jdbcType=VARCHAR},
|
set name = #{name,jdbcType=VARCHAR},
|
||||||
|
title = #{title,jdbcType=VARCHAR},
|
||||||
description = #{description,jdbcType=VARCHAR},
|
description = #{description,jdbcType=VARCHAR},
|
||||||
ctime = #{ctime,jdbcType=BIGINT},
|
ctime = #{ctime,jdbcType=BIGINT},
|
||||||
orders = #{orders,jdbcType=BIGINT}
|
orders = #{orders,jdbcType=BIGINT}
|
||||||
|
|
|
@ -17,6 +17,13 @@ public class UpmsRole implements Serializable {
|
||||||
*/
|
*/
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色标题
|
||||||
|
*
|
||||||
|
* @mbg.generated
|
||||||
|
*/
|
||||||
|
private String title;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色描述
|
* 角色描述
|
||||||
*
|
*
|
||||||
|
@ -56,6 +63,14 @@ public class UpmsRole implements Serializable {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
return description;
|
return description;
|
||||||
}
|
}
|
||||||
|
@ -88,6 +103,7 @@ public class UpmsRole implements Serializable {
|
||||||
sb.append("Hash = ").append(hashCode());
|
sb.append("Hash = ").append(hashCode());
|
||||||
sb.append(", roleId=").append(roleId);
|
sb.append(", roleId=").append(roleId);
|
||||||
sb.append(", name=").append(name);
|
sb.append(", name=").append(name);
|
||||||
|
sb.append(", title=").append(title);
|
||||||
sb.append(", description=").append(description);
|
sb.append(", description=").append(description);
|
||||||
sb.append(", ctime=").append(ctime);
|
sb.append(", ctime=").append(ctime);
|
||||||
sb.append(", orders=").append(orders);
|
sb.append(", orders=").append(orders);
|
||||||
|
@ -109,6 +125,7 @@ public class UpmsRole implements Serializable {
|
||||||
UpmsRole other = (UpmsRole) that;
|
UpmsRole other = (UpmsRole) that;
|
||||||
return (this.getRoleId() == null ? other.getRoleId() == null : this.getRoleId().equals(other.getRoleId()))
|
return (this.getRoleId() == null ? other.getRoleId() == null : this.getRoleId().equals(other.getRoleId()))
|
||||||
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
|
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
|
||||||
|
&& (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
|
||||||
&& (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
|
&& (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
|
||||||
&& (this.getCtime() == null ? other.getCtime() == null : this.getCtime().equals(other.getCtime()))
|
&& (this.getCtime() == null ? other.getCtime() == null : this.getCtime().equals(other.getCtime()))
|
||||||
&& (this.getOrders() == null ? other.getOrders() == null : this.getOrders().equals(other.getOrders()));
|
&& (this.getOrders() == null ? other.getOrders() == null : this.getOrders().equals(other.getOrders()));
|
||||||
|
@ -120,6 +137,7 @@ public class UpmsRole implements Serializable {
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + ((getRoleId() == null) ? 0 : getRoleId().hashCode());
|
result = prime * result + ((getRoleId() == null) ? 0 : getRoleId().hashCode());
|
||||||
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
|
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
|
||||||
|
result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
|
||||||
result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
|
result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
|
||||||
result = prime * result + ((getCtime() == null) ? 0 : getCtime().hashCode());
|
result = prime * result + ((getCtime() == null) ? 0 : getCtime().hashCode());
|
||||||
result = prime * result + ((getOrders() == null) ? 0 : getOrders().hashCode());
|
result = prime * result + ((getOrders() == null) ? 0 : getOrders().hashCode());
|
||||||
|
|
|
@ -257,6 +257,76 @@ public class UpmsRoleExample implements Serializable {
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Criteria andTitleIsNull() {
|
||||||
|
addCriterion("title is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andTitleIsNotNull() {
|
||||||
|
addCriterion("title is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andTitleEqualTo(String value) {
|
||||||
|
addCriterion("title =", value, "title");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andTitleNotEqualTo(String value) {
|
||||||
|
addCriterion("title <>", value, "title");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andTitleGreaterThan(String value) {
|
||||||
|
addCriterion("title >", value, "title");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andTitleGreaterThanOrEqualTo(String value) {
|
||||||
|
addCriterion("title >=", value, "title");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andTitleLessThan(String value) {
|
||||||
|
addCriterion("title <", value, "title");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andTitleLessThanOrEqualTo(String value) {
|
||||||
|
addCriterion("title <=", value, "title");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andTitleLike(String value) {
|
||||||
|
addCriterion("title like", value, "title");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andTitleNotLike(String value) {
|
||||||
|
addCriterion("title not like", value, "title");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andTitleIn(List<String> values) {
|
||||||
|
addCriterion("title in", values, "title");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andTitleNotIn(List<String> values) {
|
||||||
|
addCriterion("title not in", values, "title");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andTitleBetween(String value1, String value2) {
|
||||||
|
addCriterion("title between", value1, value2, "title");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andTitleNotBetween(String value1, String value2) {
|
||||||
|
addCriterion("title not between", value1, value2, "title");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
public Criteria andDescriptionIsNull() {
|
public Criteria andDescriptionIsNull() {
|
||||||
addCriterion("description is null");
|
addCriterion("description is null");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
<resultMap id="UpmsRoleResultMap" type="com.zheng.upms.dao.model.UpmsRole">
|
<resultMap id="UpmsRoleResultMap" type="com.zheng.upms.dao.model.UpmsRole">
|
||||||
<id column="role_id" jdbcType="INTEGER" property="roleId" />
|
<id column="role_id" jdbcType="INTEGER" property="roleId" />
|
||||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||||
|
<result column="title" jdbcType="VARCHAR" property="title" />
|
||||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||||
<result column="ctime" jdbcType="BIGINT" property="ctime" />
|
<result column="ctime" jdbcType="BIGINT" property="ctime" />
|
||||||
<result column="orders" jdbcType="BIGINT" property="orders" />
|
<result column="orders" jdbcType="BIGINT" property="orders" />
|
||||||
|
@ -33,7 +34,7 @@
|
||||||
|
|
||||||
<!-- 角色字段 -->
|
<!-- 角色字段 -->
|
||||||
<sql id="UpmsRole_Column_List">
|
<sql id="UpmsRole_Column_List">
|
||||||
role_id, name, description, ctime, orders
|
role_id, name, title, description, ctime, orders
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 根据用户获取所拥有的权限 -->
|
<!-- 根据用户获取所拥有的权限 -->
|
||||||
|
|
|
@ -42,12 +42,6 @@
|
||||||
<artifactId>jstl</artifactId>
|
<artifactId>jstl</artifactId>
|
||||||
<version>1.2</version>
|
<version>1.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- zheng-upms-client -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.zheng</groupId>
|
|
||||||
<artifactId>zheng-upms-client</artifactId>
|
|
||||||
<version>1.0.0</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
|
|
|
@ -83,6 +83,7 @@ public class UpmsRoleController extends BaseController {
|
||||||
public Object create(UpmsRole upmsRole) {
|
public Object create(UpmsRole upmsRole) {
|
||||||
ComplexResult result = FluentValidator.checkAll()
|
ComplexResult result = FluentValidator.checkAll()
|
||||||
.on(upmsRole.getName(), new LengthValidator(1, 20, "名称"))
|
.on(upmsRole.getName(), new LengthValidator(1, 20, "名称"))
|
||||||
|
.on(upmsRole.getTitle(), new LengthValidator(1, 20, "标题"))
|
||||||
.doValidate()
|
.doValidate()
|
||||||
.result(ResultCollectors.toComplex());
|
.result(ResultCollectors.toComplex());
|
||||||
if (!result.isSuccess()) {
|
if (!result.isSuccess()) {
|
||||||
|
@ -120,6 +121,7 @@ public class UpmsRoleController extends BaseController {
|
||||||
public Object update(@PathVariable("id") int id, UpmsRole upmsRole) {
|
public Object update(@PathVariable("id") int id, UpmsRole upmsRole) {
|
||||||
ComplexResult result = FluentValidator.checkAll()
|
ComplexResult result = FluentValidator.checkAll()
|
||||||
.on(upmsRole.getName(), new LengthValidator(1, 20, "名称"))
|
.on(upmsRole.getName(), new LengthValidator(1, 20, "名称"))
|
||||||
|
.on(upmsRole.getTitle(), new LengthValidator(1, 20, "标题"))
|
||||||
.doValidate()
|
.doValidate()
|
||||||
.result(ResultCollectors.toComplex());
|
.result(ResultCollectors.toComplex());
|
||||||
if (!result.isSuccess()) {
|
if (!result.isSuccess()) {
|
||||||
|
|
|
@ -12,6 +12,10 @@
|
||||||
<label for="name">名称</label>
|
<label for="name">名称</label>
|
||||||
<input id="name" type="text" class="form-control" name="name" maxlength="20">
|
<input id="name" type="text" class="form-control" name="name" maxlength="20">
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="title">标题</label>
|
||||||
|
<input id="title" type="text" class="form-control" name="title" maxlength="20">
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="description">描述</label>
|
<label for="description">描述</label>
|
||||||
<input id="description" type="text" class="form-control" name="description" maxlength="300">
|
<input id="description" type="text" class="form-control" name="description" maxlength="300">
|
||||||
|
@ -33,6 +37,10 @@ function createSubmit() {
|
||||||
$('#name').focus();
|
$('#name').focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if ($('#title').val() == '') {
|
||||||
|
$('#title').focus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
success: function(result) {
|
success: function(result) {
|
||||||
if (result.code != 1) {
|
if (result.code != 1) {
|
||||||
|
|
|
@ -72,6 +72,7 @@ $(function() {
|
||||||
{field: 'ck', checkbox: true},
|
{field: 'ck', checkbox: true},
|
||||||
{field: 'roleId', title: '编号', sortable: true, align: 'center'},
|
{field: 'roleId', title: '编号', sortable: true, align: 'center'},
|
||||||
{field: 'name', title: '角色名称'},
|
{field: 'name', title: '角色名称'},
|
||||||
|
{field: 'title', title: '角色标题'},
|
||||||
{field: 'description', title: '角色描述'},
|
{field: 'description', title: '角色描述'},
|
||||||
{field: 'action', title: '操作', align: 'center', formatter: 'actionFormatter', events: 'actionEvents', clickToSelect: false}
|
{field: 'action', title: '操作', align: 'center', formatter: 'actionFormatter', events: 'actionEvents', clickToSelect: false}
|
||||||
]
|
]
|
||||||
|
|
|
@ -12,6 +12,10 @@
|
||||||
<label for="name">名称</label>
|
<label for="name">名称</label>
|
||||||
<input id="name" type="text" class="form-control" name="name" maxlength="20" value="${role.name}">
|
<input id="name" type="text" class="form-control" name="name" maxlength="20" value="${role.name}">
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="title">标题</label>
|
||||||
|
<input id="title" type="text" class="form-control" name="title" maxlength="20" value="${role.title}">
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="description">描述</label>
|
<label for="description">描述</label>
|
||||||
<input id="description" type="text" class="form-control" name="description" maxlength="300" value="${role.description}">
|
<input id="description" type="text" class="form-control" name="description" maxlength="300" value="${role.description}">
|
||||||
|
@ -29,10 +33,14 @@ function createSubmit() {
|
||||||
url: '${basePath}/manage/role/update/${role.roleId}',
|
url: '${basePath}/manage/role/update/${role.roleId}',
|
||||||
data: $('#updateForm').serialize(),
|
data: $('#updateForm').serialize(),
|
||||||
beforeSend: function() {
|
beforeSend: function() {
|
||||||
if ($('#name').val() == '') {
|
if ($('#name').val() == '') {
|
||||||
$('#name').focus();
|
$('#name').focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if ($('#title').val() == '') {
|
||||||
|
$('#title').focus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
success: function(result) {
|
success: function(result) {
|
||||||
if (result.code != 1) {
|
if (result.code != 1) {
|
||||||
|
|
Loading…
Reference in New Issue