Commit 469a762c by fsn

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

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