Commit 483c7105 by fsn

修改表结构,重新生成entity

parent 17d58703
...@@ -45,7 +45,7 @@ public class GlobalExceptionHandler { ...@@ -45,7 +45,7 @@ public class GlobalExceptionHandler {
public ErrorTip notFount(BussinessException e) { public ErrorTip notFount(BussinessException e) {
LogManager.me().executeLog(LogTaskFactory.exceptionLog(ShiroKit.getUser().getId(), e)); LogManager.me().executeLog(LogTaskFactory.exceptionLog(ShiroKit.getUser().getId(), e));
getRequest().setAttribute("tip", e.getMessage()); getRequest().setAttribute("tip", e.getMessage());
log.error("业务异常:",e); log.error("业务异常:", e);
return new ErrorTip(e.getCode(), e.getMessage()); return new ErrorTip(e.getCode(), e.getMessage());
} }
...@@ -113,6 +113,7 @@ public class GlobalExceptionHandler { ...@@ -113,6 +113,7 @@ public class GlobalExceptionHandler {
@ResponseBody @ResponseBody
public ErrorTip credentials(UndeclaredThrowableException e) { public ErrorTip credentials(UndeclaredThrowableException e) {
getRequest().setAttribute("tip", "权限异常"); getRequest().setAttribute("tip", "权限异常");
log.error("权限异常!", e);
return new ErrorTip(BizExceptionEnum.NO_PERMITION); return new ErrorTip(BizExceptionEnum.NO_PERMITION);
} }
...@@ -127,7 +128,7 @@ public class GlobalExceptionHandler { ...@@ -127,7 +128,7 @@ public class GlobalExceptionHandler {
public ErrorTip notFount(RuntimeException e) { public ErrorTip notFount(RuntimeException e) {
LogManager.me().executeLog(LogTaskFactory.exceptionLog(ShiroKit.getUser().getId(), e)); LogManager.me().executeLog(LogTaskFactory.exceptionLog(ShiroKit.getUser().getId(), e));
getRequest().setAttribute("tip", "服务器未知运行时异常"); getRequest().setAttribute("tip", "服务器未知运行时异常");
log.error("运行时异常:",e); log.error("运行时异常:", e);
return new ErrorTip(BizExceptionEnum.SERVER_ERROR); return new ErrorTip(BizExceptionEnum.SERVER_ERROR);
} }
......
...@@ -80,7 +80,7 @@ public class LogController extends BaseController { ...@@ -80,7 +80,7 @@ public class LogController extends BaseController {
@Permission(Const.ADMIN_NAME) @Permission(Const.ADMIN_NAME)
@ResponseBody @ResponseBody
public Object delLog() { public Object delLog() {
SqlRunner.db().delete("delete from _operation_log"); SqlRunner.db().delete("delete from operation_log");
return super.SUCCESS_TIP; return super.SUCCESS_TIP;
} }
} }
...@@ -59,7 +59,7 @@ public class LoginLogController extends BaseController { ...@@ -59,7 +59,7 @@ public class LoginLogController extends BaseController {
@RequestMapping("/delLoginLog") @RequestMapping("/delLoginLog")
@ResponseBody @ResponseBody
public Object delLog() { public Object delLog() {
SqlRunner.db().delete("delete from _login_log"); SqlRunner.db().delete("delete from login_log");
return super.SUCCESS_TIP; return super.SUCCESS_TIP;
} }
} }
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
ELSE ELSE
'false' 'false'
END END
) as open from _dept ) as open from dept
</select> </select>
<select id="list" resultType="map"> <select id="list" resultType="map">
select * from _dept select * from dept
<if test="condition != null and condition != ''"> <if test="condition != null and condition != ''">
where simplename like CONCAT('%',#{condition},'%') or fullname like CONCAT('%',#{condition},'%') where simplename like CONCAT('%',#{condition},'%') or fullname like CONCAT('%',#{condition},'%')
</if> </if>
......
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
<select id="selectByCode" resultType="dict"> <select id="selectByCode" resultType="dict">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from _dict from dict
where code = #{code} where code = #{code}
</select> </select>
<select id="list" resultType="map"> <select id="list" resultType="map">
select * from _dict select * from dict
where num = 0 where num = 0
<if test="condition != null and condition != ''"> <if test="condition != null and condition != ''">
AND name like CONCAT('%',#{condition},'%') AND name like CONCAT('%',#{condition},'%')
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<mapper namespace="com.stylefeng.guns.modular.system.dao.LogDao"> <mapper namespace="com.stylefeng.guns.modular.system.dao.LogDao">
<select id="getOperationLogs" resultType="map"> <select id="getOperationLogs" resultType="map">
select * from _operation_log where 1 = 1 select * from operation_log where 1 = 1
<if test="beginTime != null and beginTime !='' and endTime != null and endTime != ''"> <if test="beginTime != null and beginTime !='' and endTime != null and endTime != ''">
and (createTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) and (createTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
</if> </if>
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</select> </select>
<select id="getLoginLogs" resultType="map"> <select id="getLoginLogs" resultType="map">
select * from _login_log where 1 = 1 select * from login_log where 1 = 1
<if test="beginTime != null and beginTime !='' and endTime != null and endTime != ''"> <if test="beginTime != null and beginTime !='' and endTime != null and endTime != ''">
and (createTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) and (createTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
</if> </if>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<select id="selectMenus" resultType="map"> <select id="selectMenus" resultType="map">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from _menu from menu
where status = 1 where status = 1
<if test="condition != null and condition != ''"> <if test="condition != null and condition != ''">
and (name like CONCAT('%',#{condition},'%') or code like CONCAT('%',#{condition},'%')) and (name like CONCAT('%',#{condition},'%') or code like CONCAT('%',#{condition},'%'))
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<select id="getMenuIdsByRoleId" resultType="int"> <select id="getMenuIdsByRoleId" resultType="int">
select menuid from select menuid from
_relation where roleid = #{roleId} relation where roleid = #{roleId}
</select> </select>
<select id="menuTreeList" resultType="com.stylefeng.guns.common.node.ZTreeNode"> <select id="menuTreeList" resultType="com.stylefeng.guns.common.node.ZTreeNode">
...@@ -48,8 +48,8 @@ ...@@ -48,8 +48,8 @@
END END
) as open ) as open
FROM FROM
_menu m1 menu m1
LEFT JOIN _menu m2 ON m1.pcode = m2. CODE LEFT JOIN menu m2 ON m1.pcode = m2. CODE
ORDER BY ORDER BY
m1.id ASC m1.id ASC
</select> </select>
...@@ -85,15 +85,15 @@ ...@@ -85,15 +85,15 @@
END END
) "checked" ) "checked"
FROM FROM
_menu m1 menu m1
LEFT JOIN LEFT JOIN
_menu m2 menu m2
ON m1.pcode = m2. CODE ON m1.pcode = m2. CODE
left join ( left join (
SELECT SELECT
ID ID
FROM FROM
_menu menu
WHERE WHERE
ID IN ID IN
<foreach collection="list" index="index" item="i" open="(" <foreach collection="list" index="index" item="i" open="("
...@@ -106,13 +106,13 @@ ...@@ -106,13 +106,13 @@
</select> </select>
<delete id="deleteRelationByMenu"> <delete id="deleteRelationByMenu">
delete from _relation where menuid = #{menuId} delete from relation where menuid = #{menuId}
</delete> </delete>
<select id="getResUrlsByRoleId" resultType="string"> <select id="getResUrlsByRoleId" resultType="string">
select url from select url from
_relation rel relation rel
inner join _menu m on rel.menuid = m.id inner join menu m on rel.menuid = m.id
where rel.roleid = #{roleId} where rel.roleid = #{roleId}
</select> </select>
...@@ -133,19 +133,19 @@ ...@@ -133,19 +133,19 @@
m1.levels as levels, m1.levels as levels,
m1.num as num m1.num as num
FROM FROM
_menu m1 menu m1
LEFT JOIN _menu m2 ON m1.pcode = m2. CODE LEFT JOIN menu m2 ON m1.pcode = m2. CODE
INNER JOIN ( INNER JOIN (
SELECT SELECT
ID ID
FROM FROM
_menu menu
WHERE WHERE
ID IN ( ID IN (
SELECT SELECT
menuid menuid
FROM FROM
_relation rela relation rela
WHERE WHERE
rela.roleid IN ( rela.roleid IN (
<foreach collection="list" index="index" item="i" open="(" separator="," close=")"> <foreach collection="list" index="index" item="i" open="(" separator="," close=")">
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<mapper namespace="com.stylefeng.guns.modular.system.dao.NoticeDao"> <mapper namespace="com.stylefeng.guns.modular.system.dao.NoticeDao">
<select id="list" resultType="map"> <select id="list" resultType="map">
select * from _notice select * from notice
<if test="condition != null and condition != ''"> <if test="condition != null and condition != ''">
where title like CONCAT('%',#{condition},'%') or content like CONCAT('%',#{condition},'%') where title like CONCAT('%',#{condition},'%') or content like CONCAT('%',#{condition},'%')
</if> </if>
......
...@@ -9,20 +9,20 @@ ...@@ -9,20 +9,20 @@
<select id="selectRoles" resultType="map"> <select id="selectRoles" resultType="map">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from _role from role
<if test="condition != null"> <if test="condition != null">
where name like CONCAT('%',#{condition},'%') where name like CONCAT('%',#{condition},'%')
</if> </if>
</select> </select>
<delete id="deleteRolesById"> <delete id="deleteRolesById">
delete from _relation where roleid = #{roleId} delete from relation where roleid = #{roleId}
</delete> </delete>
<select id="roleTreeList" resultType="com.stylefeng.guns.common.node.ZTreeNode"> <select id="roleTreeList" resultType="com.stylefeng.guns.common.node.ZTreeNode">
select id "id",pId select id "id",pId
"pId",name as "name",(case when (pId=0 or pId is null) then 'true' "pId",name as "name",(case when (pId=0 or pId is null) then 'true'
else 'false' end) "open" from _role else 'false' end) "open" from role
</select> </select>
<select id="roleTreeListByRoleId" resultType="com.stylefeng.guns.common.node.ZTreeNode"> <select id="roleTreeListByRoleId" resultType="com.stylefeng.guns.common.node.ZTreeNode">
...@@ -47,12 +47,12 @@ ...@@ -47,12 +47,12 @@
END END
) "checked" ) "checked"
FROM FROM
_role r role r
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
ID ID
FROM FROM
_role role
WHERE WHERE
ID IN ID IN
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<select id="selectUsers" resultType="map"> <select id="selectUsers" resultType="map">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from _user from user
where status != 3 where status != 3
<if test="name != null and name != ''"> <if test="name != null and name != ''">
and (phone like CONCAT('%',#{name},'%') and (phone like CONCAT('%',#{name},'%')
...@@ -32,24 +32,24 @@ ...@@ -32,24 +32,24 @@
</select> </select>
<update id="setStatus"> <update id="setStatus">
update _user set status = #{status} where id = update user set status = #{status} where id =
#{userId} #{userId}
</update> </update>
<update id="changePwd"> <update id="changePwd">
update _user set password = #{pwd} where id = update user set password = #{pwd} where id =
#{userId} #{userId}
</update> </update>
<update id="setRoles"> <update id="setRoles">
update _user set roleid = #{roleIds} where id = update user set roleid = #{roleIds} where id =
#{userId} #{userId}
</update> </update>
<select id="getByAccount" resultType="user"> <select id="getByAccount" resultType="user">
select select
<include refid="Base_Column_List_With_Pwd" /> <include refid="Base_Column_List_With_Pwd" />
from _user where account = #{account} and status != 3 from user where account = #{account} and status != 3
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -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-05-15 * @since 2017-05-16
*/ */
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-05-15 * @since 2017-05-16
*/ */
public interface DictMapper extends BaseMapper<Dict> { public interface DictMapper extends BaseMapper<Dict> {
......
package com.stylefeng.guns.persistence.dao;
import com.stylefeng.guns.persistence.model.Generate;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author stylefeng
* @since 2017-05-15
*/
public interface GenerateMapper extends BaseMapper<Generate> {
}
\ No newline at end of file
...@@ -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-05-15 * @since 2017-05-16
*/ */
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-05-15 * @since 2017-05-16
*/ */
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-05-15 * @since 2017-05-16
*/ */
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-05-15 * @since 2017-05-16
*/ */
public interface OperationLogMapper extends BaseMapper<OperationLog> { public interface OperationLogMapper extends BaseMapper<OperationLog> {
......
package com.stylefeng.guns.persistence.dao;
import com.stylefeng.guns.persistence.model.Parameter;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author stylefeng
* @since 2017-05-15
*/
public interface ParameterMapper extends BaseMapper<Parameter> {
}
\ No newline at end of file
...@@ -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-05-15 * @since 2017-05-16
*/ */
public interface RelationMapper extends BaseMapper<Relation> { public interface RelationMapper extends BaseMapper<Relation> {
......
package com.stylefeng.guns.persistence.dao;
import com.stylefeng.guns.persistence.model.RoleExt;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author stylefeng
* @since 2017-05-15
*/
public interface RoleExtMapper extends BaseMapper<RoleExt> {
}
\ No newline at end of file
...@@ -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-05-15 * @since 2017-05-16
*/ */
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-05-15 * @since 2017-05-16
*/ */
public interface UserMapper extends BaseMapper<User> { public interface UserMapper extends BaseMapper<User> {
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.stylefeng.guns.persistence.dao.GenerateMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.stylefeng.guns.persistence.model.Generate">
<id column="id" property="id" />
<result column="name" property="name" />
<result column="realpath" property="realpath" />
<result column="packagename" property="packagename" />
<result column="modelname" property="modelname" />
<result column="tablename" property="tablename" />
<result column="pkname" property="pkname" />
<result column="tips" property="tips" />
</resultMap>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.stylefeng.guns.persistence.dao.ParameterMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.stylefeng.guns.persistence.model.Parameter">
<id column="id" property="id" />
<result column="code" property="code" />
<result column="num" property="num" />
<result column="name" property="name" />
<result column="para" property="para" />
<result column="tips" property="tips" />
<result column="status" property="status" />
<result column="version" property="version" />
</resultMap>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.stylefeng.guns.persistence.dao.RoleExtMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.stylefeng.guns.persistence.model.RoleExt">
<id column="id" property="id" />
<result column="userid" property="userid" />
<result column="rolein" property="rolein" />
<result column="roleout" property="roleout" />
</resultMap>
</mapper>
...@@ -3,7 +3,6 @@ package com.stylefeng.guns.persistence.model; ...@@ -3,7 +3,6 @@ package com.stylefeng.guns.persistence.model;
import com.baomidou.mybatisplus.enums.IdType; import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.activerecord.Model; import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable; import java.io.Serializable;
/** /**
...@@ -12,9 +11,8 @@ import java.io.Serializable; ...@@ -12,9 +11,8 @@ import java.io.Serializable;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-05-15 * @since 2017-05-16
*/ */
@TableName("_dept")
public class Dept extends Model<Dept> { public class Dept extends Model<Dept> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -3,7 +3,6 @@ package com.stylefeng.guns.persistence.model; ...@@ -3,7 +3,6 @@ package com.stylefeng.guns.persistence.model;
import com.baomidou.mybatisplus.enums.IdType; import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.activerecord.Model; import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable; import java.io.Serializable;
/** /**
...@@ -12,9 +11,8 @@ import java.io.Serializable; ...@@ -12,9 +11,8 @@ import java.io.Serializable;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-05-15 * @since 2017-05-16
*/ */
@TableName("_dict")
public class Dict extends Model<Dict> { public class Dict extends Model<Dict> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
package com.stylefeng.guns.persistence.model;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author stylefeng
* @since 2017-05-15
*/
@TableName("_generate")
public class Generate extends Model<Generate> {
private static final long serialVersionUID = 1L;
@TableId(value="id", type= IdType.AUTO)
private Integer id;
private String name;
private String realpath;
private String packagename;
private String modelname;
private String tablename;
private String pkname;
private String tips;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getRealpath() {
return realpath;
}
public void setRealpath(String realpath) {
this.realpath = realpath;
}
public String getPackagename() {
return packagename;
}
public void setPackagename(String packagename) {
this.packagename = packagename;
}
public String getModelname() {
return modelname;
}
public void setModelname(String modelname) {
this.modelname = modelname;
}
public String getTablename() {
return tablename;
}
public void setTablename(String tablename) {
this.tablename = tablename;
}
public String getPkname() {
return pkname;
}
public void setPkname(String pkname) {
this.pkname = pkname;
}
public String getTips() {
return tips;
}
public void setTips(String tips) {
this.tips = tips;
}
@Override
protected Serializable pkVal() {
return this.id;
}
}
package com.stylefeng.guns.persistence.model; package com.stylefeng.guns.persistence.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.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName; import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
/** /**
* <p> * <p>
...@@ -13,9 +14,9 @@ import java.io.Serializable; ...@@ -13,9 +14,9 @@ import java.io.Serializable;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-05-15 * @since 2017-05-16
*/ */
@TableName("_login_log") @TableName("login_log")
public class LoginLog extends Model<LoginLog> { public class LoginLog extends Model<LoginLog> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -3,7 +3,6 @@ package com.stylefeng.guns.persistence.model; ...@@ -3,7 +3,6 @@ package com.stylefeng.guns.persistence.model;
import com.baomidou.mybatisplus.enums.IdType; import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.activerecord.Model; import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable; import java.io.Serializable;
/** /**
...@@ -12,9 +11,8 @@ import java.io.Serializable; ...@@ -12,9 +11,8 @@ import java.io.Serializable;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-05-15 * @since 2017-05-16
*/ */
@TableName("_menu")
public class Menu extends Model<Menu> { public class Menu extends Model<Menu> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.enums.IdType; ...@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date; 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.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable; import java.io.Serializable;
/** /**
...@@ -13,9 +12,8 @@ import java.io.Serializable; ...@@ -13,9 +12,8 @@ import java.io.Serializable;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-05-15 * @since 2017-05-16
*/ */
@TableName("_notice")
public class Notice extends Model<Notice> { public class Notice extends Model<Notice> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -13,9 +13,9 @@ import java.io.Serializable; ...@@ -13,9 +13,9 @@ import java.io.Serializable;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-05-15 * @since 2017-05-16
*/ */
@TableName("_operation_log") @TableName("operation_log")
public class OperationLog extends Model<OperationLog> { public class OperationLog extends Model<OperationLog> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
package com.stylefeng.guns.persistence.model;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author stylefeng
* @since 2017-05-15
*/
@TableName("_parameter")
public class Parameter extends Model<Parameter> {
private static final long serialVersionUID = 1L;
@TableId(value="id", type= IdType.AUTO)
private Integer id;
private String code;
private Integer num;
private String name;
private String para;
private String tips;
private Integer status;
private Integer version;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public Integer getNum() {
return num;
}
public void setNum(Integer num) {
this.num = num;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPara() {
return para;
}
public void setPara(String para) {
this.para = para;
}
public String getTips() {
return tips;
}
public void setTips(String tips) {
this.tips = tips;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
@Override
protected Serializable pkVal() {
return this.id;
}
}
...@@ -3,7 +3,6 @@ package com.stylefeng.guns.persistence.model; ...@@ -3,7 +3,6 @@ package com.stylefeng.guns.persistence.model;
import com.baomidou.mybatisplus.enums.IdType; import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.activerecord.Model; import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable; import java.io.Serializable;
/** /**
...@@ -12,9 +11,8 @@ import java.io.Serializable; ...@@ -12,9 +11,8 @@ import java.io.Serializable;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-05-15 * @since 2017-05-16
*/ */
@TableName("_relation")
public class Relation extends Model<Relation> { public class Relation extends Model<Relation> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -3,7 +3,6 @@ package com.stylefeng.guns.persistence.model; ...@@ -3,7 +3,6 @@ package com.stylefeng.guns.persistence.model;
import com.baomidou.mybatisplus.enums.IdType; import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.activerecord.Model; import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable; import java.io.Serializable;
/** /**
...@@ -12,9 +11,8 @@ import java.io.Serializable; ...@@ -12,9 +11,8 @@ import java.io.Serializable;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-05-15 * @since 2017-05-16
*/ */
@TableName("_role")
public class Role extends Model<Role> { public class Role extends Model<Role> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
package com.stylefeng.guns.persistence.model;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author stylefeng
* @since 2017-05-15
*/
@TableName("_role_ext")
public class RoleExt extends Model<RoleExt> {
private static final long serialVersionUID = 1L;
@TableId(value="id", type= IdType.AUTO)
private Integer id;
private String userid;
private String rolein;
private String roleout;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUserid() {
return userid;
}
public void setUserid(String userid) {
this.userid = userid;
}
public String getRolein() {
return rolein;
}
public void setRolein(String rolein) {
this.rolein = rolein;
}
public String getRoleout() {
return roleout;
}
public void setRoleout(String roleout) {
this.roleout = roleout;
}
@Override
protected Serializable pkVal() {
return this.id;
}
}
...@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.enums.IdType; ...@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date; 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.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable; import java.io.Serializable;
/** /**
...@@ -13,9 +12,8 @@ import java.io.Serializable; ...@@ -13,9 +12,8 @@ import java.io.Serializable;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-05-15 * @since 2017-05-16
*/ */
@TableName("_user")
public class User extends Model<User> { public class User extends Model<User> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -59,7 +59,7 @@ public class MpGenerator { ...@@ -59,7 +59,7 @@ public class MpGenerator {
// 策略配置 // 策略配置
StrategyConfig strategy = new StrategyConfig(); StrategyConfig strategy = new StrategyConfig();
strategy.setTablePrefix(new String[]{"_"});// 此处可以修改为您的表前缀 //strategy.setTablePrefix(new String[]{"_"});// 此处可以修改为您的表前缀
strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略 strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略
mpg.setStrategy(strategy); mpg.setStrategy(strategy);
......
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