常见问题模块
This commit is contained in:
parent
66577fe170
commit
ed4fb6e5cd
|
|
@ -26,6 +26,10 @@ public class CommonProblem extends BaseEntity
|
|||
@Excel(name = "内容")
|
||||
private String content;
|
||||
|
||||
/** 内容 */
|
||||
@Excel(name = "解析")
|
||||
private String explains;
|
||||
|
||||
/** 点击量 */
|
||||
@Excel(name = "点击量")
|
||||
private Integer hits;
|
||||
|
|
@ -79,6 +83,14 @@ public class CommonProblem extends BaseEntity
|
|||
return delFlag;
|
||||
}
|
||||
|
||||
public String getExplains() {
|
||||
return explains;
|
||||
}
|
||||
|
||||
public void setExplains(String explains) {
|
||||
this.explains = explains;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="id" column="id" />
|
||||
<result property="title" column="title" />
|
||||
<result property="content" column="content" />
|
||||
<result property="explains" column="explains" />
|
||||
<result property="hits" column="hits" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
|
|
@ -17,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectCommonProblemVo">
|
||||
select id, title, content, hits, del_flag, create_by, create_time, update_by, update_time from common_problem
|
||||
select id, title, content, explains, hits, del_flag, create_by, create_time, update_by, update_time from common_problem
|
||||
</sql>
|
||||
|
||||
<select id="selectCommonProblemList" parameterType="CommonProblem" resultMap="CommonProblemResult">
|
||||
|
|
@ -39,6 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="title != null and title != ''">title,</if>
|
||||
<if test="content != null and content != ''">content,</if>
|
||||
<if test="explains != null and explains != ''">explains,</if>
|
||||
<if test="hits != null">hits,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
|
|
@ -49,6 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="title != null and title != ''">#{title},</if>
|
||||
<if test="content != null and content != ''">#{content},</if>
|
||||
<if test="explains != null and explains != ''">#{explains},</if>
|
||||
<if test="hits != null">#{hits},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
|
|
@ -63,6 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="title != null and title != ''">title = #{title},</if>
|
||||
<if test="content != null and content != ''">content = #{content},</if>
|
||||
<if test="explains != null and explains != ''">explains = #{explains},</if>
|
||||
<if test="hits != null">hits = #{hits},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
|
|
|
|||
|
|
@ -14,22 +14,17 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">内容:</label>
|
||||
<label class="col-sm-3 control-label is-required">问题描述:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" class="form-control" name="content">
|
||||
<div class="summernote" id="content"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">点击量:</label>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">解析:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="hits" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">删除标志:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="delFlag" class="form-control" type="text">
|
||||
<input type="hidden" class="form-control" name="explains">
|
||||
<div class="summernote" id="explains"></div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -15,18 +15,25 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">内容:</label>
|
||||
<label class="col-sm-3 control-label is-required">问题描述:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" class="form-control" th:field="*{content}">
|
||||
<div class="summernote" id="content"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">解析:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" class="form-control" th:field="*{explains}">
|
||||
<div class="summernote" id="explains"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!--<div class="form-group">
|
||||
<label class="col-sm-3 control-label">点击量:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="hits" th:field="*{hits}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@
|
|||
<label>标题:</label>
|
||||
<input type="text" name="title"/>
|
||||
</li>
|
||||
<li>
|
||||
<!--<li>
|
||||
<label>点击量:</label>
|
||||
<input type="text" name="hits"/>
|
||||
</li>
|
||||
</li>-->
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
|
|
@ -28,18 +28,18 @@
|
|||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="front:problem:add">
|
||||
<a class="btn btn-success" onclick="$.operate.addFull()" shiro:hasPermission="front:problem:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="front:problem:edit">
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.editFull()" shiro:hasPermission="front:problem:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="front:problem:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="front:problem:export">
|
||||
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="front:problem:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</a>-->
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
|
|
@ -74,18 +74,26 @@
|
|||
},
|
||||
{
|
||||
field: 'content',
|
||||
title: '内容'
|
||||
title: '问题描述'
|
||||
},
|
||||
{
|
||||
field: 'explains',
|
||||
title: '解析'
|
||||
},
|
||||
{
|
||||
field: 'hits',
|
||||
title: '点击量'
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editFull(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -191,7 +191,8 @@ drop table if exists common_problem;
|
|||
create table common_problem (
|
||||
id bigint(20) not null auto_increment comment 'ID',
|
||||
title varchar(50) not null comment '标题',
|
||||
content text not null comment '内容',
|
||||
content text not null comment '问题描述内容',
|
||||
explains text not null comment '内容',
|
||||
hits int (6) default 0 comment '点击量',
|
||||
del_flag char(1) default '0' comment '删除标志(0代表存在 2代表删除)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
|
|
|
|||
Loading…
Reference in New Issue