Commit 469a762c by fsn

更改字典表数据结构,字典列表格式更改

parent f4ff3508
......@@ -6,6 +6,7 @@ import com.stylefeng.guns.common.exception.BizExceptionEnum;
import com.stylefeng.guns.common.exception.BussinessException;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.system.dao.DictDao;
import com.stylefeng.guns.modular.system.warpper.DictWarpper;
import com.stylefeng.guns.persistence.dao.DictMapper;
import com.stylefeng.guns.persistence.model.Dict;
import org.springframework.stereotype.Controller;
......@@ -82,7 +83,7 @@ public class DictController extends BaseController {
@ResponseBody
public Object list(String condition) {
List<Map<String, Object>> list = this.dictDao.list(condition);
return list;
return super.warpObject(new DictWarpper(list));
}
/**
......
......@@ -3,7 +3,7 @@
<mapper namespace="com.stylefeng.guns.modular.system.dao.DictDao">
<sql id="Base_Column_List">
id, code, num, pid, name, tips, version
id, num, pid, name, tips
</sql>
<select id="selectByCode" resultType="dict">
......@@ -15,10 +15,11 @@
<select id="list" resultType="map">
select * from _dict
where num = 0
<if test="condition != null and condition != ''">
where name like CONCAT('%',#{condition},'%') or num like CONCAT('%',#{condition},'%')
AND name like CONCAT('%',#{condition},'%')
</if>
order by code ASC
order by id ASC
</select>
</mapper>
\ No newline at end of file
package com.stylefeng.guns.modular.system.warpper;
import com.stylefeng.guns.common.warpper.BaseControllerWarpper;
import java.util.Map;
/**
* 字典列表的包装
*
* @author fengshuonan
* @date 2017年4月25日 18:10:31
*/
public class DictWarpper extends BaseControllerWarpper {
public DictWarpper(Object list) {
super(list);
}
@Override
public void warpTheMap(Map<String, Object> map) {
}
}
......@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
* </p>
*
* @author stylefeng
* @since 2017-04-08
* @since 2017-04-26
*/
public interface AttachMapper extends BaseMapper<Attach> {
......
......@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
* </p>
*
* @author stylefeng
* @since 2017-04-16
* @since 2017-04-26
*/
public interface DeptMapper extends BaseMapper<Dept> {
......
......@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
* </p>
*
* @author stylefeng
* @since 2017-04-16
* @since 2017-04-26
*/
public interface DictMapper extends BaseMapper<Dict> {
......
......@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
* </p>
*
* @author stylefeng
* @since 2017-04-08
* @since 2017-04-26
*/
public interface GenerateMapper extends BaseMapper<Generate> {
......
......@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
* </p>
*
* @author stylefeng
* @since 2017-04-16
* @since 2017-04-26
*/
public interface LoginLogMapper extends BaseMapper<LoginLog> {
......
......@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
* </p>
*
* @author stylefeng
* @since 2017-04-16
* @since 2017-04-26
*/
public interface MenuMapper extends BaseMapper<Menu> {
......
......@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
* </p>
*
* @author stylefeng
* @since 2017-04-16
* @since 2017-04-26
*/
public interface NoticeMapper extends BaseMapper<Notice> {
......
......@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
* </p>
*
* @author stylefeng
* @since 2017-04-16
* @since 2017-04-26
*/
public interface OperationLogMapper extends BaseMapper<OperationLog> {
......
......@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
* </p>
*
* @author stylefeng
* @since 2017-04-16
* @since 2017-04-26
*/
public interface ParameterMapper extends BaseMapper<Parameter> {
......
......@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
* </p>
*
* @author stylefeng
* @since 2017-04-16
* @since 2017-04-26
*/
public interface RelationMapper extends BaseMapper<Relation> {
......
......@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
* </p>
*
* @author stylefeng
* @since 2017-04-16
* @since 2017-04-26
*/
public interface RoleExtMapper extends BaseMapper<RoleExt> {
......
......@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
* </p>
*
* @author stylefeng
* @since 2017-04-16
* @since 2017-04-26
*/
public interface RoleMapper extends BaseMapper<Role> {
......
......@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
* </p>
*
* @author stylefeng
* @since 2017-04-16
* @since 2017-04-26
*/
public interface UserMapper extends BaseMapper<User> {
......
......@@ -5,12 +5,10 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.stylefeng.guns.persistence.model.Dict">
<id column="id" property="id" />
<result column="code" property="code" />
<result column="num" property="num" />
<result column="pid" property="pid" />
<result column="name" property="name" />
<result column="tips" property="tips" />
<result column="version" property="version" />
</resultMap>
</mapper>
......@@ -13,7 +13,7 @@ import java.io.Serializable;
* </p>
*
* @author stylefeng
* @since 2017-04-08
* @since 2017-04-26
*/
@TableName("_attach")
public class Attach extends Model<Attach> {
......
......@@ -12,7 +12,7 @@ import java.io.Serializable;
* </p>
*
* @author stylefeng
* @since 2017-04-16
* @since 2017-04-26
*/
@TableName("_dept")
public class Dept extends Model<Dept> {
......
......@@ -12,7 +12,7 @@ import java.io.Serializable;
* </p>
*
* @author stylefeng
* @since 2017-04-16
* @since 2017-04-26
*/
@TableName("_dict")
public class Dict extends Model<Dict> {
......@@ -21,12 +21,10 @@ public class Dict extends Model<Dict> {
@TableId(value="id", type= IdType.AUTO)
private Integer id;
private String code;
private Integer num;
private Integer pid;
private String name;
private String tips;
private Integer version;
public Integer getId() {
......@@ -37,14 +35,6 @@ public class Dict extends Model<Dict> {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public Integer getNum() {
return num;
}
......@@ -77,14 +67,6 @@ public class Dict extends Model<Dict> {
this.tips = tips;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
@Override
protected Serializable pkVal() {
return this.id;
......
......@@ -12,7 +12,7 @@ import java.io.Serializable;
* </p>
*
* @author stylefeng
* @since 2017-04-08
* @since 2017-04-26
*/
@TableName("_generate")
public class Generate extends Model<Generate> {
......
......@@ -13,7 +13,7 @@ import java.io.Serializable;
* </p>
*
* @author stylefeng
* @since 2017-04-16
* @since 2017-04-26
*/
@TableName("_login_log")
public class LoginLog extends Model<LoginLog> {
......
......@@ -12,7 +12,7 @@ import java.io.Serializable;
* </p>
*
* @author stylefeng
* @since 2017-04-16
* @since 2017-04-26
*/
@TableName("_menu")
public class Menu extends Model<Menu> {
......
......@@ -13,7 +13,7 @@ import java.io.Serializable;
* </p>
*
* @author stylefeng
* @since 2017-04-16
* @since 2017-04-26
*/
@TableName("_notice")
public class Notice extends Model<Notice> {
......
......@@ -13,7 +13,7 @@ import java.io.Serializable;
* </p>
*
* @author stylefeng
* @since 2017-04-16
* @since 2017-04-26
*/
@TableName("_operation_log")
public class OperationLog extends Model<OperationLog> {
......
......@@ -12,7 +12,7 @@ import java.io.Serializable;
* </p>
*
* @author stylefeng
* @since 2017-04-16
* @since 2017-04-26
*/
@TableName("_parameter")
public class Parameter extends Model<Parameter> {
......
......@@ -12,7 +12,7 @@ import java.io.Serializable;
* </p>
*
* @author stylefeng
* @since 2017-04-16
* @since 2017-04-26
*/
@TableName("_relation")
public class Relation extends Model<Relation> {
......
......@@ -12,7 +12,7 @@ import java.io.Serializable;
* </p>
*
* @author stylefeng
* @since 2017-04-16
* @since 2017-04-26
*/
@TableName("_role")
public class Role extends Model<Role> {
......
......@@ -12,7 +12,7 @@ import java.io.Serializable;
* </p>
*
* @author stylefeng
* @since 2017-04-16
* @since 2017-04-26
*/
@TableName("_role_ext")
public class RoleExt extends Model<RoleExt> {
......
package com.stylefeng.guns.persistence.model;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
......@@ -15,7 +13,7 @@ import java.util.Date;
* </p>
*
* @author stylefeng
* @since 2017-04-16
* @since 2017-04-26
*/
@TableName("_user")
public class User extends Model<User> {
......@@ -28,8 +26,6 @@ public class User extends Model<User> {
private String password;
private String salt;
private String name;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date birthday;
private Integer sex;
private String email;
......
......@@ -14,11 +14,9 @@ var Dict = {
Dict.initColumn = function () {
return [
{field: 'selectItem', radio: true},
{title: 'id', field: 'id', align: 'center', valign: 'middle'},
{title: '编号', field: 'code', align: 'center', valign: 'middle'},
{title: '值', field: 'num', align: 'center', valign: 'middle'},
{title: '父id', field: 'pid', align: 'center', valign: 'middle'},
{title: 'id', field: 'id', visible: true, align: 'center', valign: 'middle'},
{title: '名称', field: 'name', align: 'center', valign: 'middle'},
{title: '详情', field: 'detail', align: 'center', valign: 'middle'},
{title: '备注', field: 'tips', align: 'center', valign: 'middle'}];
};
......
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