diff --git a/boot-service/src/main/java/com/xwbing/domain/entity/rest/FilesUpload.java b/boot-service/src/main/java/com/xwbing/domain/entity/rest/FilesUpload.java index 5aeac34..dd04c89 100644 --- a/boot-service/src/main/java/com/xwbing/domain/entity/rest/FilesUpload.java +++ b/boot-service/src/main/java/com/xwbing/domain/entity/rest/FilesUpload.java @@ -1,22 +1,22 @@ -package com.xwbing.domain.entity.rest; - -import com.xwbing.domain.entity.sys.JpaBaseEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import javax.persistence.Entity; - -/** - * @author xiangwb - * @version $Id: FilesUpload.java, v 0.1 2018年06月13日 17:23 wb-xwb402636 Exp $ - */ -@EqualsAndHashCode(callSuper = true) -@Data -@Entity(name = "file_upload") -public class FilesUpload extends JpaBaseEntity { - private static final long serialVersionUID = 3284231281346882055L; - public static String table = "file_upload"; - private String name; - private String type; - private String data; -} +package com.xwbing.domain.entity.rest; + +import com.xwbing.domain.entity.sys.JpaBaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import javax.persistence.Entity; + +/** + * @author xiangwb + * @version $Id: FilesUpload.java, v 0.1 2018年06月13日 17:23 wb-xwb402636 Exp $ + */ +@EqualsAndHashCode(callSuper = true) +@Data +@Entity(name = "file_upload") +public class FilesUpload extends JpaBaseEntity { + private static final long serialVersionUID = 3284231281346882055L; + public static String table = "file_upload"; + private String name; + private String type; + private String data; +} diff --git a/boot-service/src/main/java/com/xwbing/domain/entity/sys/JpaBaseEntity.java b/boot-service/src/main/java/com/xwbing/domain/entity/sys/JpaBaseEntity.java index 4049fd6..06cd1c9 100644 --- a/boot-service/src/main/java/com/xwbing/domain/entity/sys/JpaBaseEntity.java +++ b/boot-service/src/main/java/com/xwbing/domain/entity/sys/JpaBaseEntity.java @@ -1,42 +1,42 @@ -package com.xwbing.domain.entity.sys; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import org.hibernate.annotations.GenericGenerator; - -import javax.persistence.Column; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.MappedSuperclass; -import java.io.Serializable; -import java.util.Date; - -/** - * 说明: 基础类 - * 项目名称: boot-module-demo - * 创建时间: 2017/5/10 16:36 - * 作者: xiangwb - */ -@Data -@ApiModel -@MappedSuperclass -public class JpaBaseEntity implements Serializable { - private static final long serialVersionUID = 2657519817528673800L; - @Id - @GenericGenerator(name = "idGenerator", strategy = "uuid") - @GeneratedValue(generator = "idGenerator") - @Column(length = 50) - @ApiModelProperty(value = "主键") - private String id; - @ApiModelProperty(value = "创建者", hidden = true) - private String creator; - @ApiModelProperty(value = "修改者", hidden = true) - private String modifier; - @Column(name = "create_time") - @ApiModelProperty(value = "创建时间", hidden = true) - private Date createTime; - @Column(name = "modified_time") - @ApiModelProperty(value = "修改时间", hidden = true) - private Date modifiedTime; -} +package com.xwbing.domain.entity.sys; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.hibernate.annotations.GenericGenerator; + +import javax.persistence.Column; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.MappedSuperclass; +import java.io.Serializable; +import java.util.Date; + +/** + * 说明: 基础类 + * 项目名称: boot-module-demo + * 创建时间: 2017/5/10 16:36 + * 作者: xiangwb + */ +@Data +@ApiModel +@MappedSuperclass +public class JpaBaseEntity implements Serializable { + private static final long serialVersionUID = 2657519817528673800L; + @Id + @GenericGenerator(name = "idGenerator", strategy = "uuid") + @GeneratedValue(generator = "idGenerator") + @Column(length = 50) + @ApiModelProperty(value = "主键") + private String id; + @ApiModelProperty(value = "创建者", hidden = true) + private String creator; + @ApiModelProperty(value = "修改者", hidden = true) + private String modifier; + @Column(name = "create_time") + @ApiModelProperty(value = "创建时间", hidden = true) + private Date createTime; + @Column(name = "modified_time") + @ApiModelProperty(value = "修改时间", hidden = true) + private Date modifiedTime; +} diff --git a/boot-service/src/main/java/com/xwbing/domain/mapper/sys/SysRoleAuthorityMapper.java b/boot-service/src/main/java/com/xwbing/domain/mapper/sys/SysRoleAuthorityMapper.java index e68a4b9..a7866bf 100644 --- a/boot-service/src/main/java/com/xwbing/domain/mapper/sys/SysRoleAuthorityMapper.java +++ b/boot-service/src/main/java/com/xwbing/domain/mapper/sys/SysRoleAuthorityMapper.java @@ -1,16 +1,16 @@ -package com.xwbing.domain.mapper.sys; - -import com.xwbing.domain.entity.sys.SysRoleAuthority; -import com.xwbing.domain.mapper.BaseMapper; - -import java.util.List; - -/** - * 项目名称: boot-module-demo - * 创建时间: 2018/6/1 21:50 - * 作者: xiangwb - * 说明: - */ -public interface SysRoleAuthorityMapper extends BaseMapper { - List findByRoleId(String roleId); -} +package com.xwbing.domain.mapper.sys; + +import com.xwbing.domain.entity.sys.SysRoleAuthority; +import com.xwbing.domain.mapper.BaseMapper; + +import java.util.List; + +/** + * 项目名称: boot-module-demo + * 创建时间: 2018/6/1 21:50 + * 作者: xiangwb + * 说明: + */ +public interface SysRoleAuthorityMapper extends BaseMapper { + List findByRoleId(String roleId); +} diff --git a/boot-service/src/main/java/com/xwbing/domain/mapper/sys/SysRoleMapper.java b/boot-service/src/main/java/com/xwbing/domain/mapper/sys/SysRoleMapper.java index 9c9ae32..96cbdad 100644 --- a/boot-service/src/main/java/com/xwbing/domain/mapper/sys/SysRoleMapper.java +++ b/boot-service/src/main/java/com/xwbing/domain/mapper/sys/SysRoleMapper.java @@ -1,13 +1,13 @@ -package com.xwbing.domain.mapper.sys; - -import com.xwbing.domain.entity.sys.SysRole; -import com.xwbing.domain.mapper.BaseMapper; - -/** - * 项目名称: boot-module-demo - * 创建时间: 2018/6/1 21:50 - * 作者: xiangwb - * 说明: - */ -public interface SysRoleMapper extends BaseMapper { -} +package com.xwbing.domain.mapper.sys; + +import com.xwbing.domain.entity.sys.SysRole; +import com.xwbing.domain.mapper.BaseMapper; + +/** + * 项目名称: boot-module-demo + * 创建时间: 2018/6/1 21:50 + * 作者: xiangwb + * 说明: + */ +public interface SysRoleMapper extends BaseMapper { +} diff --git a/boot-service/src/main/java/com/xwbing/domain/mapper/sys/SysUserRoleMapper.java b/boot-service/src/main/java/com/xwbing/domain/mapper/sys/SysUserRoleMapper.java index 225d3ef..6b9942a 100644 --- a/boot-service/src/main/java/com/xwbing/domain/mapper/sys/SysUserRoleMapper.java +++ b/boot-service/src/main/java/com/xwbing/domain/mapper/sys/SysUserRoleMapper.java @@ -1,16 +1,16 @@ -package com.xwbing.domain.mapper.sys; - -import com.xwbing.domain.entity.sys.SysUserRole; -import com.xwbing.domain.mapper.BaseMapper; - -import java.util.List; - -/** - * 项目名称: boot-module-demo - * 创建时间: 2018/6/1 21:50 - * 作者: xiangwb - * 说明: - */ -public interface SysUserRoleMapper extends BaseMapper { - List findByUserId(String userId); -} +package com.xwbing.domain.mapper.sys; + +import com.xwbing.domain.entity.sys.SysUserRole; +import com.xwbing.domain.mapper.BaseMapper; + +import java.util.List; + +/** + * 项目名称: boot-module-demo + * 创建时间: 2018/6/1 21:50 + * 作者: xiangwb + * 说明: + */ +public interface SysUserRoleMapper extends BaseMapper { + List findByUserId(String userId); +} diff --git a/boot-service/src/main/java/com/xwbing/domain/repository/FilesUploadRepository.java b/boot-service/src/main/java/com/xwbing/domain/repository/FilesUploadRepository.java index 7204c03..49f9356 100644 --- a/boot-service/src/main/java/com/xwbing/domain/repository/FilesUploadRepository.java +++ b/boot-service/src/main/java/com/xwbing/domain/repository/FilesUploadRepository.java @@ -1,19 +1,19 @@ -package com.xwbing.domain.repository; - -import com.xwbing.domain.entity.rest.FilesUpload; -import org.springframework.data.domain.Sort; -import org.springframework.data.jpa.repository.JpaRepository; - -import java.util.List; - -/** - * @author xiangwb - * @version $Id: FilesUploadRepository.java, v 0.1 2018年06月13日 17:25 wb-xwb402636 Exp $ - */ -public interface FilesUploadRepository extends JpaRepository { - List getByName(String name, Sort sort); - - List getByTypeOrderByCreateTime(String type); - - List getByIdIn(List ids); -} +package com.xwbing.domain.repository; + +import com.xwbing.domain.entity.rest.FilesUpload; +import org.springframework.data.domain.Sort; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.List; + +/** + * @author xiangwb + * @version $Id: FilesUploadRepository.java, v 0.1 2018年06月13日 17:25 wb-xwb402636 Exp $ + */ +public interface FilesUploadRepository extends JpaRepository { + List getByName(String name, Sort sort); + + List getByTypeOrderByCreateTime(String type); + + List getByIdIn(List ids); +} diff --git a/boot-service/src/main/resources/mapper/sys/SysRoleAuthority.xml b/boot-service/src/main/resources/mapper/sys/SysRoleAuthority.xml index 5b41567..54391e8 100644 --- a/boot-service/src/main/resources/mapper/sys/SysRoleAuthority.xml +++ b/boot-service/src/main/resources/mapper/sys/SysRoleAuthority.xml @@ -1,60 +1,60 @@ - - - - - - - - - - - - sys_role_authority - - - id, - creator, - modifier, - create_time, - modified_time, - role_id, - authority_id - - - - INSERT INTO - ( - id, - creator, - create_time, - role_id, - authority_id - ) - VALUES - ( - (SELECT REPLACE(UUID(), '-', '') AS id), - #{obj.creator}, - now(), - #{obj.roleId}, - #{obj.authorityId} - ) - - - - - DELETE FROM - - WHERE id IN - - #{id} - - - - + + + + + + + + + + + + sys_role_authority + + + id, + creator, + modifier, + create_time, + modified_time, + role_id, + authority_id + + + + INSERT INTO + ( + id, + creator, + create_time, + role_id, + authority_id + ) + VALUES + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{obj.creator}, + now(), + #{obj.roleId}, + #{obj.authorityId} + ) + + + + + DELETE FROM + + WHERE id IN + + #{id} + + + + \ No newline at end of file diff --git a/boot-service/src/main/resources/mapper/sys/SysUserRole.xml b/boot-service/src/main/resources/mapper/sys/SysUserRole.xml index b438939..44c50d6 100644 --- a/boot-service/src/main/resources/mapper/sys/SysUserRole.xml +++ b/boot-service/src/main/resources/mapper/sys/SysUserRole.xml @@ -1,60 +1,60 @@ - - - - - - - - - - - - sys_role_authority - - - id, - creator, - modifier, - create_time, - modified_time, - role_id, - user_id - - - - INSERT INTO - ( - id, - creator, - create_time, - role_id, - user_id - ) - VALUES - ( - (SELECT REPLACE(UUID(), '-', '') AS id), - #{obj.creator}, - now(), - #{obj.roleId}, - #{obj.userId} - ) - - - - - DELETE FROM - - WHERE id IN - - #{id} - - - - + + + + + + + + + + + + sys_role_authority + + + id, + creator, + modifier, + create_time, + modified_time, + role_id, + user_id + + + + INSERT INTO + ( + id, + creator, + create_time, + role_id, + user_id + ) + VALUES + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{obj.creator}, + now(), + #{obj.roleId}, + #{obj.userId} + ) + + + + + DELETE FROM + + WHERE id IN + + #{id} + + + + \ No newline at end of file diff --git a/boot-service/src/main/resources/mapper/sys/sysRole.xml b/boot-service/src/main/resources/mapper/sys/sysRole.xml index ed854e2..e44ff85 100644 --- a/boot-service/src/main/resources/mapper/sys/sysRole.xml +++ b/boot-service/src/main/resources/mapper/sys/sysRole.xml @@ -1,224 +1,224 @@ - - - - - - - - - - sys_role - - - id, - creator, - modifier, - create_time, - modified_time, - name, - code, - enable, - remark - - - - - code=#{code} - - - and enable=#{enable} - - - and id in - - #{id} - - - - and id!=#{id} - - - - - - - SELECT REPLACE(UUID(), '-', '') - - INSERT INTO - ( - id, - creator, - create_time, - name, - code, - enable, - remark - ) - VALUES( - #{id}, - #{creator}, - now(), - #{name}, - #{code}, - #{enable}, - #{remark} - ) - - - - INSERT INTO - ( - id, - creator, - create_time, - name, - code, - enable, - remark - ) - VALUES - ( - (SELECT REPLACE(UUID(), '-', '') AS id), - #{obj.creator}, - now(), - #{obj.name}, - #{obj.code}, - #{obj.enable}, - #{obj.remark} - ) - - - - - DELETE FROM - - WHERE id=#{id} - - - - DELETE FROM - - WHERE id IN - - #{id} - - - - - DELETE FROM - - - - - - UPDATE - - - modified_time=now(), - modifier=#{modifier}, - name=#{name}, - code=#{code}, - enable=#{enable}, - remark=#{remark}, - - WHERE id=#{id} - - - - UPDATE - - - - - - when id=#{obj.id} then #{obj.modifier} - - - - - - - when id=#{obj.id} then #{obj.name} - - - - - - - when id=#{obj.id} then #{obj.code} - - - - - - - when id=#{obj.id} then #{obj.enable} - - - - - - - when id=#{obj.id} then #{obj.remark} - - - - - - - id=#{obj.id} - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + sys_role + + + id, + creator, + modifier, + create_time, + modified_time, + name, + code, + enable, + remark + + + + + code=#{code} + + + and enable=#{enable} + + + and id in + + #{id} + + + + and id!=#{id} + + + + + + + SELECT REPLACE(UUID(), '-', '') + + INSERT INTO + ( + id, + creator, + create_time, + name, + code, + enable, + remark + ) + VALUES( + #{id}, + #{creator}, + now(), + #{name}, + #{code}, + #{enable}, + #{remark} + ) + + + + INSERT INTO + ( + id, + creator, + create_time, + name, + code, + enable, + remark + ) + VALUES + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{obj.creator}, + now(), + #{obj.name}, + #{obj.code}, + #{obj.enable}, + #{obj.remark} + ) + + + + + DELETE FROM + + WHERE id=#{id} + + + + DELETE FROM + + WHERE id IN + + #{id} + + + + + DELETE FROM + + + + + + UPDATE + + + modified_time=now(), + modifier=#{modifier}, + name=#{name}, + code=#{code}, + enable=#{enable}, + remark=#{remark}, + + WHERE id=#{id} + + + + UPDATE + + + + + + when id=#{obj.id} then #{obj.modifier} + + + + + + + when id=#{obj.id} then #{obj.name} + + + + + + + when id=#{obj.id} then #{obj.code} + + + + + + + when id=#{obj.id} then #{obj.enable} + + + + + + + when id=#{obj.id} then #{obj.remark} + + + + + + + id=#{obj.id} + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file