Parcourir la source

1、增加自动生成代码功能
2、对响应结果进行封装
3、去除不完善的权限验证模块

zhangzhenjun il y a 4 ans
Parent
commit
afcf73d4e9
61 fichiers modifiés avec 548 ajouts et 2668 suppressions
  1. 20 4
      backend-admin/src/main/java/com/ittim/admin/IttimBackendApplication.java
  2. 0 28
      backend-admin/src/main/java/com/ittim/admin/config/CommonFieldHandler.java
  3. 77 0
      backend-admin/src/main/java/com/ittim/admin/controller/CndPersonController.java
  4. 0 57
      backend-admin/src/main/java/com/ittim/admin/controller/DemoController.java
  5. 0 105
      backend-admin/src/main/java/com/ittim/admin/controller/security/LoginController.java
  6. 52 0
      backend-admin/src/main/java/com/ittim/admin/entity/CndPerson.java
  7. 0 85
      backend-admin/src/main/java/com/ittim/admin/entity/OauthToken.java
  8. 0 46
      backend-admin/src/main/java/com/ittim/admin/entity/OauthTokenKey.java
  9. 0 85
      backend-admin/src/main/java/com/ittim/admin/entity/Person.java
  10. 0 79
      backend-admin/src/main/java/com/ittim/admin/entity/SysAuthorities.java
  11. 0 106
      backend-admin/src/main/java/com/ittim/admin/entity/SysMenu.java
  12. 0 70
      backend-admin/src/main/java/com/ittim/admin/entity/SysRole.java
  13. 0 61
      backend-admin/src/main/java/com/ittim/admin/entity/SysRoleAuthorities.java
  14. 0 97
      backend-admin/src/main/java/com/ittim/admin/entity/SysUser.java
  15. 0 61
      backend-admin/src/main/java/com/ittim/admin/entity/SysUserRole.java
  16. 16 0
      backend-admin/src/main/java/com/ittim/admin/mapper/CndPersonMapper.java
  17. 0 23
      backend-admin/src/main/java/com/ittim/admin/mapper/OauthTokenKeyMapper.java
  18. 0 23
      backend-admin/src/main/java/com/ittim/admin/mapper/OauthTokenMapper.java
  19. 0 28
      backend-admin/src/main/java/com/ittim/admin/mapper/PersonMapper.java
  20. 0 23
      backend-admin/src/main/java/com/ittim/admin/mapper/SysAuthoritiesMapper.java
  21. 0 23
      backend-admin/src/main/java/com/ittim/admin/mapper/SysMenuMapper.java
  22. 0 23
      backend-admin/src/main/java/com/ittim/admin/mapper/SysRoleAuthoritiesMapper.java
  23. 0 23
      backend-admin/src/main/java/com/ittim/admin/mapper/SysRoleMapper.java
  24. 0 23
      backend-admin/src/main/java/com/ittim/admin/mapper/SysUserMapper.java
  25. 0 23
      backend-admin/src/main/java/com/ittim/admin/mapper/SysUserRoleMapper.java
  26. 16 0
      backend-admin/src/main/java/com/ittim/admin/service/ICndPersonService.java
  27. 0 21
      backend-admin/src/main/java/com/ittim/admin/service/OauthTokenKeyService.java
  28. 0 21
      backend-admin/src/main/java/com/ittim/admin/service/OauthTokenService.java
  29. 0 25
      backend-admin/src/main/java/com/ittim/admin/service/PersonService.java
  30. 0 21
      backend-admin/src/main/java/com/ittim/admin/service/SysAuthoritiesService.java
  31. 0 21
      backend-admin/src/main/java/com/ittim/admin/service/SysMenuService.java
  32. 0 21
      backend-admin/src/main/java/com/ittim/admin/service/SysRoleAuthoritiesService.java
  33. 0 21
      backend-admin/src/main/java/com/ittim/admin/service/SysRoleService.java
  34. 0 21
      backend-admin/src/main/java/com/ittim/admin/service/SysUserRoleService.java
  35. 0 22
      backend-admin/src/main/java/com/ittim/admin/service/SysUserService.java
  36. 20 0
      backend-admin/src/main/java/com/ittim/admin/service/impl/CndPersonServiceImpl.java
  37. 0 38
      backend-admin/src/main/java/com/ittim/admin/service/impl/OauthTokenKeyServiceImpl.java
  38. 0 38
      backend-admin/src/main/java/com/ittim/admin/service/impl/OauthTokenServiceImpl.java
  39. 0 45
      backend-admin/src/main/java/com/ittim/admin/service/impl/PersonServiceImpl.java
  40. 0 38
      backend-admin/src/main/java/com/ittim/admin/service/impl/SysAuthoritiesServiceImpl.java
  41. 0 38
      backend-admin/src/main/java/com/ittim/admin/service/impl/SysMenuServiceImpl.java
  42. 0 38
      backend-admin/src/main/java/com/ittim/admin/service/impl/SysRoleAuthoritiesServiceImpl.java
  43. 0 38
      backend-admin/src/main/java/com/ittim/admin/service/impl/SysRoleServiceImpl.java
  44. 0 38
      backend-admin/src/main/java/com/ittim/admin/service/impl/SysUserRoleServiceImpl.java
  45. 0 38
      backend-admin/src/main/java/com/ittim/admin/service/impl/SysUserServiceImpl.java
  46. 0 9
      backend-admin/src/main/resources/application.yml
  47. 21 0
      backend-admin/src/main/resources/mappers/CndPersonMapper.xml
  48. 0 68
      backend-admin/src/main/resources/mappers/OauthTokenKeyMapper.xml
  49. 0 166
      backend-admin/src/main/resources/mappers/OauthTokenMapper.xml
  50. 0 109
      backend-admin/src/main/resources/mappers/PersonMapper.xml
  51. 0 108
      backend-admin/src/main/resources/mappers/SysAuthoritiesMapper.xml
  52. 0 150
      backend-admin/src/main/resources/mappers/SysMenuMapper.xml
  53. 0 81
      backend-admin/src/main/resources/mappers/SysRoleAuthoritiesMapper.xml
  54. 0 96
      backend-admin/src/main/resources/mappers/SysRoleMapper.xml
  55. 0 135
      backend-admin/src/main/resources/mappers/SysUserMapper.xml
  56. 0 82
      backend-admin/src/main/resources/mappers/SysUserRoleMapper.xml
  57. 121 0
      backend-admin/src/test/java/CodeGenerator.java
  58. 94 0
      backend-admin/src/test/resources/templates/controller.java.ftl
  59. 9 12
      backend-common/src/main/java/com/ittim/common/enums/Status.java
  60. 60 0
      backend-common/src/main/java/com/ittim/common/util/Result.java
  61. 42 13
      pom.xml

+ 20 - 4
backend-admin/src/main/java/com/ittim/admin/IttimBackendApplication.java

@@ -4,18 +4,34 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.web.servlet.ServletComponentScan;
+import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.context.annotation.ComponentScan;
-import org.wf.jwtp.configuration.EnableJwtPermission;
+import org.springframework.core.env.Environment;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
 
 @Slf4j
-@EnableJwtPermission
 @ServletComponentScan
 @ComponentScan(value = "com.ittim.*")
 @SpringBootApplication
 public class IttimBackendApplication {
 
-    public static void main(String[] args) {
-        SpringApplication.run(IttimBackendApplication.class, args);
+    public static void main(String[] args) throws UnknownHostException {
+        ConfigurableApplicationContext application = SpringApplication.run(IttimBackendApplication.class, args);
+        Environment env = application.getEnvironment();
+        log.info("\n----------------------------------------------------------\n\t" +
+                        "Application '{}' is running! Access URLs:\n\t" +
+                        "Local: \t\thttp://localhost:{}/banckend\n\t" +
+                        "External: \thttp://{}:{}/banckend\n\t" +
+                        "Doc: \thttp://{}:{}/banckend/doc.html\n" +
+                        "----------------------------------------------------------",
+                env.getProperty("spring.application.name"),
+                env.getProperty("server.port"),
+                InetAddress.getLocalHost().getHostAddress(),
+                env.getProperty("server.port"),
+                InetAddress.getLocalHost().getHostAddress(),
+                env.getProperty("server.port"));
     }
 
 }

+ 0 - 28
backend-admin/src/main/java/com/ittim/admin/config/CommonFieldHandler.java

@@ -1,28 +0,0 @@
-package com.ittim.admin.config;
-
-import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.ibatis.reflection.MetaObject;
-import org.springframework.stereotype.Component;
-
-import java.util.Date;
-
-/**
- * 通用字段填充
- */
-@Slf4j
-@Component
-public class CommonFieldHandler implements MetaObjectHandler {
-
-    @Override
-    public void insertFill(MetaObject metaObject) {
-        log.info("start insert fill ....");
-        this.setFieldValByName("createTime", new Date(), metaObject);
-    }
-
-    @Override
-    public void updateFill(MetaObject metaObject) {
-        log.info("start update fill ....");
-        this.setFieldValByName("updateTime", new Date(), metaObject);
-    }
-}

+ 77 - 0
backend-admin/src/main/java/com/ittim/admin/controller/CndPersonController.java

@@ -0,0 +1,77 @@
+package com.ittim.admin.controller;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ittim.common.enums.ResultCode;
+import com.ittim.common.util.Result;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import org.springframework.web.bind.annotation.*;
+import com.ittim.admin.service.ICndPersonService;
+import com.ittim.admin.entity.CndPerson;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import javax.annotation.Resource;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 人员信息表 前端控制器
+ * </p>
+ *
+ * @author zzj
+ * @since 2020-10-13
+ */
+@Api(tags = {"CndPersonController-人员信息表"})
+@Slf4j
+@RestController
+@RequestMapping("/cnd-person")
+public class CndPersonController {
+
+    @Resource
+    private ICndPersonService cndPersonService;
+
+
+    @ApiOperation(value = "新增人员信息表")
+    @PostMapping("add")
+    public Result add(@RequestBody CndPerson cndPerson){
+        boolean save = cndPersonService.save(cndPerson);
+        return save ? Result.success() : Result.error(ResultCode.FAILED);
+    }
+
+    @ApiOperation(value = "删除人员信息表")
+    @PostMapping("delete/{id}")
+    public Result delete(@PathVariable("id") Long id){
+        boolean remove = cndPersonService.removeById(id);
+        return remove ? Result.success() : Result.error(ResultCode.FAILED);
+    }
+
+    @ApiOperation(value = "更新人员信息表")
+    @PostMapping("update")
+    public Result update(@RequestBody CndPerson cndPerson){
+        boolean update = cndPersonService.updateById(cndPerson);
+        return update ? Result.success() : Result.error(ResultCode.FAILED);
+    }
+
+    @ApiOperation(value = "查询人员信息表分页数据")
+    @ApiImplicitParams({
+        @ApiImplicitParam(name = "currentPage", value = "页码"),
+        @ApiImplicitParam(name = "pageCount", value = "每页条数")
+    })
+    @GetMapping("listByPage")
+    public Result findListByPage(@RequestParam Integer currentPage,
+                                   @RequestParam Integer pageCount){
+        IPage<CndPerson> page = new Page<>(currentPage,pageCount);
+        IPage<CndPerson> iPage = cndPersonService.page(page);
+        return Result.success(iPage);
+    }
+
+    @ApiOperation(value = "id查询人员信息表")
+    @GetMapping("getById/{id}")
+    public Result findById(@PathVariable Long id){
+        return Result.success(cndPersonService.getById(id));
+    }
+
+}

+ 0 - 57
backend-admin/src/main/java/com/ittim/admin/controller/DemoController.java

@@ -1,57 +0,0 @@
-package com.ittim.admin.controller;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.api.R;
-import com.ittim.admin.entity.Person;
-import com.ittim.admin.service.PersonService;
-import com.ittim.common.bean.PageRequest;
-import com.ittim.common.enums.Status;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import org.wf.jwtp.annotation.Ignore;
-
-/**
- * @author zzj
- * @Description 测试控制器
- * @date 2020/9/17
- */
-@Slf4j
-@RestController
-@Api(value = "测试控制器",tags = "测试控制器")
-@RequestMapping("/api/demo")
-public class DemoController {
-
-    private final PersonService personService;
-
-    public DemoController(PersonService personService) {
-        this.personService = personService;
-    }
-
-    @Ignore
-    @GetMapping("/person")
-    @ApiOperation(value = "列表全查", notes = "列表全查")
-    public R<IPage<Person>> getPerson(PageRequest page) {
-        IPage<Person> personPage = personService.selectOrderByCreateTime(page);
-        return R.ok(personPage);
-    }
-
-    @Ignore
-    @GetMapping("/personNew")
-    @ApiOperation(value = "返回失败状态格式测试", notes = "返回失败状态格式测试")
-    public R<String> getPersonNew() {
-        return R.failed("这是测试失败");
-    }
-
-    @Ignore
-    @GetMapping("/personTwo")
-    @ApiOperation(value = "列表全查,自定义状态", notes = "列表全查,自定义状态")
-    public R<IPage<Person>> getPersonTwo(PageRequest page,Person person) {
-        IPage<Person> personPage = personService.selectByAll(page,person);
-        return R.restResult(personPage, Status.SUCCESS);
-    }
-
-}

+ 0 - 105
backend-admin/src/main/java/com/ittim/admin/controller/security/LoginController.java

@@ -1,105 +0,0 @@
-package com.ittim.admin.controller.security;
-
-import com.baomidou.mybatisplus.extension.api.R;
-import com.ittim.common.bean.RedisKeys;
-import com.ittim.common.enums.Status;
-import com.wf.captcha.SpecCaptcha;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import org.wf.jwtp.provider.Token;
-import org.wf.jwtp.provider.TokenStore;
-
-import javax.annotation.Resource;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
-import java.util.concurrent.TimeUnit;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-@RestController
-@Api(tags = "登录模块")
-@RequestMapping("/auth")
-public class LoginController {
-
-    @Resource(name = "zeroRedisTemplate")
-    private RedisTemplate<String, Object> zeroRedisTemplate;
-
-    private final TokenStore tokenStore;
-
-    public LoginController(@Qualifier("jdbcTokenStore") TokenStore tokenStore) {
-        this.tokenStore = tokenStore;
-    }
-
-    /**
-     * 获取验证码
-     *
-     * @return 验证码Key 与 图片信息
-     */
-    @RequestMapping("/captcha")
-    @ApiOperation(value = "获取验证码", notes = "获取验证码(验证码Key 与 图片信息)")
-    public R<Map<String, String>> captcha() {
-        SpecCaptcha specCaptcha = new SpecCaptcha(130, 48, 5);
-        String verCode = specCaptcha.text().toLowerCase();
-        // 存入redis并设置过期时间为30分钟
-        zeroRedisTemplate.opsForValue().set(RedisKeys.CAPTCHA_KEY, verCode, 30, TimeUnit.MINUTES);
-        // 将key和base64返回给前端
-        Map<String, String> resultMap = new HashMap<>(16);
-        resultMap.put("key", RedisKeys.CAPTCHA_KEY);
-        resultMap.put("image", specCaptcha.toBase64());
-        return R.ok(resultMap);
-    }
-
-    /**
-     * 用户登录
-     *
-     * @param username 用户名
-     * @param password 密码
-     * @param verCode  验证码
-     * @param verKey   验证码Key
-     * @return 返回登录状态
-     */
-    @PostMapping("/login")
-    @ApiOperation(value = "用户登录", notes = "用户登录(登录状态)")
-    public R<Object> login(String username, String password, String verCode, String verKey) {
-        // 获取redis中的验证码
-        String redisCode = (String) zeroRedisTemplate.opsForValue().get(RedisKeys.CAPTCHA_KEY);
-        // 判断验证码
-        if (verCode == null || !Objects.equals(redisCode, verCode.trim().toLowerCase())) {
-            return R.restResult("验证码不正确", Status.CAPTCHA_INCORRECT);
-        }
-
-        //未完成
-        // 签发token
-//        Token token = tokenStore.createNewToken(userId, permissions, roles, 60 * 60 * 24 * 30);
-
-        //返回访问令牌Token
-        Map<String, String> resultMap = new HashMap<>(16);
-//        String accessToken = token.getAccessToken();
-//        resultMap.put("access_token", accessToken);
-        return R.restResult(resultMap, Status.LOGIN);
-    }
-
-    /**
-     * 更新Token
-     *
-     * @param refreshToken 旧Token
-     * @return 新Token
-     */
-    @PostMapping("/token/refresh")
-    @ApiOperation(value = "更新Token", notes = "更新Token(新Token)")
-    public R<String> login(String refreshToken) {
-        Token token = tokenStore.refreshToken(refreshToken);
-        System.out.println("access_token:" + token.getAccessToken());
-        return R.ok(token.getAccessToken());
-    }
-
-}

+ 52 - 0
backend-admin/src/main/java/com/ittim/admin/entity/CndPerson.java

@@ -0,0 +1,52 @@
+package com.ittim.admin.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 人员信息表
+ * </p>
+ *
+ * @author zzj
+ * @since 2020-10-13
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="CndPerson对象", description="人员信息表")
+public class CndPerson implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "主键ID")
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value = "人名")
+    private String personName;
+
+    @ApiModelProperty(value = "年龄")
+    private Integer personAge;
+
+    @ApiModelProperty(value = "电话")
+    private Long personPhone;
+
+    @ApiModelProperty(value = "住址")
+    private String personAddress;
+
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+
+
+}

+ 0 - 85
backend-admin/src/main/java/com/ittim/admin/entity/OauthToken.java

@@ -1,85 +0,0 @@
-package com.ittim.admin.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import lombok.Data;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-@ApiModel(value = "com-ittim-admin-entity-OauthToken")
-@Data
-@TableName(value = "oauth_token")
-public class OauthToken implements Serializable {
-    @TableId(value = "token_id", type = IdType.INPUT)
-    @ApiModelProperty(value = "令牌ID")
-    private Integer tokenId;
-
-    @TableField(value = "user_id")
-    @ApiModelProperty(value = "用户ID")
-    private String userId;
-
-    @TableField(value = "access_token")
-    @ApiModelProperty(value = "访问令牌")
-    private String accessToken;
-
-    @TableField(value = "refresh_token")
-    @ApiModelProperty(value = "刷新令牌")
-    private String refreshToken;
-
-    @TableField(value = "expire_time")
-    @ApiModelProperty(value = "过期时间")
-    private Date expireTime;
-
-    @TableField(value = "refresh_token_expire_time")
-    @ApiModelProperty(value = "刷新令牌过期时间")
-    private Date refreshTokenExpireTime;
-
-    @TableField(value = "roles")
-    @ApiModelProperty(value = "角色")
-    private String roles;
-
-    @TableField(value = "permissions")
-    @ApiModelProperty(value = "权限")
-    private String permissions;
-
-    @TableField(value = "create_time")
-    @ApiModelProperty(value = "创建时间")
-    private Date createTime;
-
-    @TableField(value = "update_time")
-    @ApiModelProperty(value = "更新时间")
-    private Date updateTime;
-
-    private static final long serialVersionUID = 1L;
-
-    public static final String COL_TOKEN_ID = "token_id";
-
-    public static final String COL_USER_ID = "user_id";
-
-    public static final String COL_ACCESS_TOKEN = "access_token";
-
-    public static final String COL_REFRESH_TOKEN = "refresh_token";
-
-    public static final String COL_EXPIRE_TIME = "expire_time";
-
-    public static final String COL_REFRESH_TOKEN_EXPIRE_TIME = "refresh_token_expire_time";
-
-    public static final String COL_ROLES = "roles";
-
-    public static final String COL_PERMISSIONS = "permissions";
-
-    public static final String COL_CREATE_TIME = "create_time";
-
-    public static final String COL_UPDATE_TIME = "update_time";
-}

+ 0 - 46
backend-admin/src/main/java/com/ittim/admin/entity/OauthTokenKey.java

@@ -1,46 +0,0 @@
-package com.ittim.admin.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import lombok.Data;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-@ApiModel(value = "com-ittim-admin-entity-OauthTokenKey")
-@Data
-@TableName(value = "oauth_token_key")
-public class OauthTokenKey implements Serializable {
-    @TableId(value = "id", type = IdType.INPUT)
-    @ApiModelProperty(value = "主键ID")
-    private Integer id;
-
-    /**
-     * 生成token时的key
-     */
-    @TableField(value = "token_key")
-    @ApiModelProperty(value = "生成token时的key")
-    private String tokenKey;
-
-    @TableField(value = "create_time")
-    @ApiModelProperty(value = "创建时间")
-    private Date createTime;
-
-    private static final long serialVersionUID = 1L;
-
-    public static final String COL_ID = "id";
-
-    public static final String COL_TOKEN_KEY = "token_key";
-
-    public static final String COL_CREATE_TIME = "create_time";
-}

+ 0 - 85
backend-admin/src/main/java/com/ittim/admin/entity/Person.java

@@ -1,85 +0,0 @@
-package com.ittim.admin.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-import java.util.Date;
-
-import lombok.Data;
-
-/**
- * @author zzj
- * @Description 人员表
- * @date 2020/9/28
- */
-@ApiModel(value = "com-ittim-admin-entity-Person")
-@Data
-@TableName(value = "cnd_person")
-public class Person {
-
-    @TableId(value = "id", type = IdType.INPUT)
-    @ApiModelProperty(value = "主键ID")
-    private Integer id;
-
-    /**
-     * 人名
-     */
-    @TableField(value = "person_name")
-    @ApiModelProperty(value = "人名")
-    private String personName;
-
-    /**
-     * 年龄
-     */
-    @TableField(value = "person_age")
-    @ApiModelProperty(value = "年龄")
-    private Integer personAge;
-
-    /**
-     * 电话
-     */
-    @TableField(value = "person_phone")
-    @ApiModelProperty(value = "电话")
-    private Long personPhone;
-
-    /**
-     * 住址
-     */
-    @TableField(value = "person_address")
-    @ApiModelProperty(value = "住址")
-    private String personAddress;
-
-    /**
-     * 创建时间
-     */
-    @TableField(value = "create_time")
-    @ApiModelProperty(value = "创建时间")
-    private Date createTime;
-
-    /**
-     * 更新时间
-     */
-    @TableField(value = "update_time")
-    @ApiModelProperty(value = "更新时间")
-    private Date updateTime;
-
-    private static final long serialVersionUID = 1L;
-
-    public static final String COL_ID = "id";
-
-    public static final String COL_PERSON_NAME = "person_name";
-
-    public static final String COL_PERSON_AGE = "person_age";
-
-    public static final String COL_PERSON_PHONE = "person_phone";
-
-    public static final String COL_PERSON_ADDRESS = "person_address";
-
-    public static final String COL_CREATE_TIME = "create_time";
-
-    public static final String COL_UPDATE_TIME = "update_time";
-}

+ 0 - 79
backend-admin/src/main/java/com/ittim/admin/entity/SysAuthorities.java

@@ -1,79 +0,0 @@
-package com.ittim.admin.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import lombok.Data;
-
-/**
- * @author zzj
- * @Description 权限表
- * @date 2020/9/30
- */
-@ApiModel(value = "com-ittim-admin-entity-SysAuthorities")
-@Data
-@TableName(value = "sys_authorities")
-public class SysAuthorities implements Serializable {
-    /**
-     * (主键,自增)
-     */
-    @TableId(value = "id", type = IdType.INPUT)
-    @ApiModelProperty(value = "(主键,自增)")
-    private Integer id;
-
-    /**
-     * 授权标识
-     */
-    @TableField(value = "authority")
-    @ApiModelProperty(value = "授权标识")
-    private String authority;
-
-    /**
-     * 权限名称
-     */
-    @TableField(value = "authority_name")
-    @ApiModelProperty(value = "权限名称,")
-    private String authorityName;
-
-    /**
-     * 模块名称
-     */
-    @TableField(value = "parent_name")
-    @ApiModelProperty(value = "模块名称")
-    private String parentName;
-
-    /**
-     * 排序号
-     */
-    @TableField(value = "sort")
-    @ApiModelProperty(value = "排序号")
-    private Integer sort;
-
-    /**
-     * 创建时间
-     */
-    @TableField(value = "create_time")
-    @ApiModelProperty(value = "创建时间")
-    private Date createTime;
-
-    private static final long serialVersionUID = 1L;
-
-    public static final String COL_ID = "id";
-
-    public static final String COL_AUTHORITY = "authority";
-
-    public static final String COL_AUTHORITY_NAME = "authority_name";
-
-    public static final String COL_PARENT_NAME = "parent_name";
-
-    public static final String COL_SORT = "sort";
-
-    public static final String COL_CREATE_TIME = "create_time";
-}

+ 0 - 106
backend-admin/src/main/java/com/ittim/admin/entity/SysMenu.java

@@ -1,106 +0,0 @@
-package com.ittim.admin.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import lombok.Data;
-
-/**
- * @author zzj
- * @Description 菜单表
- * @date 2020/9/30
- */
-@ApiModel(value = "com-ittim-admin-entity-SysMenu")
-@Data
-@TableName(value = "sys_menu")
-public class SysMenu implements Serializable {
-    /**
-     * 菜单id(主键,自增)
-     */
-    @TableId(value = "menu_id", type = IdType.INPUT)
-    @ApiModelProperty(value = "菜单id(主键,自增)")
-    private Integer menuId;
-
-    /**
-     * 上级菜单id
-     */
-    @TableField(value = "parent_id")
-    @ApiModelProperty(value = "上级菜单id")
-    private Integer parentId;
-
-    /**
-     * 菜单名称
-     */
-    @TableField(value = "menu_name")
-    @ApiModelProperty(value = "菜单名称")
-    private String menuName;
-
-    /**
-     * 菜单hash地址(路由地址)
-     */
-    @TableField(value = "menu_url")
-    @ApiModelProperty(value = "菜单hash地址(路由地址)")
-    private String menuUrl;
-
-    /**
-     * 菜单图标
-     */
-    @TableField(value = "menu_icon")
-    @ApiModelProperty(value = "菜单图标")
-    private String menuIcon;
-
-    /**
-     * 排序号
-     */
-    @TableField(value = "sort_number")
-    @ApiModelProperty(value = "排序号")
-    private String sortNumber;
-
-    /**
-     * 对应的权限标识
-     */
-    @TableField(value = "authority")
-    @ApiModelProperty(value = "对应的权限标识")
-    private String authority;
-
-    /**
-     * 创建时间
-     */
-    @TableField(value = "create_time")
-    @ApiModelProperty(value = "创建时间")
-    private Date createTime;
-
-    /**
-     * 修改时间
-     */
-    @TableField(value = "update_time")
-    @ApiModelProperty(value = "修改时间")
-    private Date updateTime;
-
-    private static final long serialVersionUID = 1L;
-
-    public static final String COL_MENU_ID = "menu_id";
-
-    public static final String COL_PARENT_ID = "parent_id";
-
-    public static final String COL_MENU_NAME = "menu_name";
-
-    public static final String COL_MENU_URL = "menu_url";
-
-    public static final String COL_MENU_ICON = "menu_icon";
-
-    public static final String COL_SORT_NUMBER = "sort_number";
-
-    public static final String COL_AUTHORITY = "authority";
-
-    public static final String COL_CREATE_TIME = "create_time";
-
-    public static final String COL_UPDATE_TIME = "update_time";
-}

+ 0 - 70
backend-admin/src/main/java/com/ittim/admin/entity/SysRole.java

@@ -1,70 +0,0 @@
-package com.ittim.admin.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import lombok.Data;
-
-/**
- * @author zzj
- * @Description 角色表
- * @date 2020/9/30
- */
-@ApiModel(value = "com-ittim-admin-entity-SysRole")
-@Data
-@TableName(value = "sys_role")
-public class SysRole implements Serializable {
-    /**
-     * 角色id(主键,自增)
-     */
-    @TableId(value = "role_id", type = IdType.INPUT)
-    @ApiModelProperty(value = "角色id(主键,自增)")
-    private Integer roleId;
-
-    /**
-     * 角色名称
-     */
-    @TableField(value = "role_name")
-    @ApiModelProperty(value = "角色名称")
-    private String roleName;
-
-    /**
-     * 备注
-     */
-    @TableField(value = "comments")
-    @ApiModelProperty(value = "备注")
-    private String comments;
-
-    /**
-     * 创建时间
-     */
-    @TableField(value = "create_time")
-    @ApiModelProperty(value = "创建时间")
-    private Date createTime;
-
-    /**
-     * 修改时间
-     */
-    @TableField(value = "update_time")
-    @ApiModelProperty(value = "修改时间")
-    private Date updateTime;
-
-    private static final long serialVersionUID = 1L;
-
-    public static final String COL_ROLE_ID = "role_id";
-
-    public static final String COL_ROLE_NAME = "role_name";
-
-    public static final String COL_COMMENTS = "comments";
-
-    public static final String COL_CREATE_TIME = "create_time";
-
-    public static final String COL_UPDATE_TIME = "update_time";
-}

+ 0 - 61
backend-admin/src/main/java/com/ittim/admin/entity/SysRoleAuthorities.java

@@ -1,61 +0,0 @@
-package com.ittim.admin.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import lombok.Data;
-
-/**
- * @author zzj
- * @Description 角色权限关联表
- * @date 2020/9/30
- */
-@ApiModel(value = "com-ittim-admin-entity-SysRoleAuthorities")
-@Data
-@TableName(value = "sys_role_authorities")
-public class SysRoleAuthorities implements Serializable {
-    /**
-     * (主键,自增)
-     */
-    @TableId(value = "id", type = IdType.INPUT)
-    @ApiModelProperty(value = "(主键,自增)")
-    private Integer id;
-
-    /**
-     * 角色id
-     */
-    @TableField(value = "role_id")
-    @ApiModelProperty(value = "角色id")
-    private Integer roleId;
-
-    /**
-     * 权限标识
-     */
-    @TableField(value = "authority")
-    @ApiModelProperty(value = "权限标识")
-    private String authority;
-
-    /**
-     * 创建时间
-     */
-    @TableField(value = "create_time")
-    @ApiModelProperty(value = "创建时间")
-    private Date createTime;
-
-    private static final long serialVersionUID = 1L;
-
-    public static final String COL_ID = "id";
-
-    public static final String COL_ROLE_ID = "role_id";
-
-    public static final String COL_AUTHORITY = "authority";
-
-    public static final String COL_CREATE_TIME = "create_time";
-}

+ 0 - 97
backend-admin/src/main/java/com/ittim/admin/entity/SysUser.java

@@ -1,97 +0,0 @@
-package com.ittim.admin.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import lombok.Data;
-
-/**
- * @author zzj
- * @Description 用户表
- * @date 2020/9/30
- */
-@ApiModel(value = "com-ittim-admin-entity-SysUser")
-@Data
-@TableName(value = "sys_user")
-public class SysUser implements Serializable {
-    /**
-     * 用户id(主键,自增)
-     */
-    @TableId(value = "user_id", type = IdType.INPUT)
-    @ApiModelProperty(value = "用户id(主键,自增)")
-    private Integer userId;
-
-    /**
-     * 账号
-     */
-    @TableField(value = "username")
-    @ApiModelProperty(value = "账号")
-    private String username;
-
-    /**
-     * 密码
-     */
-    @TableField(value = "`password`")
-    @ApiModelProperty(value = "密码")
-    private String password;
-
-    /**
-     * 昵称
-     */
-    @TableField(value = "nick_name")
-    @ApiModelProperty(value = "昵称")
-    private String nickName;
-
-    /**
-     * 性别
-     */
-    @TableField(value = "sex")
-    @ApiModelProperty(value = "性别")
-    private String sex;
-
-    /**
-     * 状态,0正常,1冻结
-     */
-    @TableField(value = "`state`")
-    @ApiModelProperty(value = "状态,0正常,1冻结")
-    private Integer state;
-
-    /**
-     * 注册时间
-     */
-    @TableField(value = "create_time")
-    @ApiModelProperty(value = "注册时间,")
-    private Date createTime;
-
-    /**
-     * 修改时间
-     */
-    @TableField(value = "update_time")
-    @ApiModelProperty(value = "修改时间,")
-    private Date updateTime;
-
-    private static final long serialVersionUID = 1L;
-
-    public static final String COL_USER_ID = "user_id";
-
-    public static final String COL_USERNAME = "username";
-
-    public static final String COL_PASSWORD = "password";
-
-    public static final String COL_NICK_NAME = "nick_name";
-
-    public static final String COL_SEX = "sex";
-
-    public static final String COL_STATE = "state";
-
-    public static final String COL_CREATE_TIME = "create_time";
-
-    public static final String COL_UPDATE_TIME = "update_time";
-}

+ 0 - 61
backend-admin/src/main/java/com/ittim/admin/entity/SysUserRole.java

@@ -1,61 +0,0 @@
-package com.ittim.admin.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import lombok.Data;
-
-/**
- * @author zzj
- * @Description 用户角色关联表
- * @date 2020/9/30
- */
-@ApiModel(value = "com-ittim-admin-entity-SysUserRole")
-@Data
-@TableName(value = "sys_user_role")
-public class SysUserRole implements Serializable {
-    /**
-     * (主键,自增)
-     */
-    @TableId(value = "id", type = IdType.INPUT)
-    @ApiModelProperty(value = "(主键,自增)")
-    private Integer id;
-
-    /**
-     * 用户id
-     */
-    @TableField(value = "user_id")
-    @ApiModelProperty(value = "用户id")
-    private Integer userId;
-
-    /**
-     * 角色id
-     */
-    @TableField(value = "role_id")
-    @ApiModelProperty(value = "角色id,")
-    private Integer roleId;
-
-    /**
-     * 创建时间
-     */
-    @TableField(value = "create_time")
-    @ApiModelProperty(value = "创建时间,")
-    private Date createTime;
-
-    private static final long serialVersionUID = 1L;
-
-    public static final String COL_ID = "id";
-
-    public static final String COL_USER_ID = "user_id";
-
-    public static final String COL_ROLE_ID = "role_id";
-
-    public static final String COL_CREATE_TIME = "create_time";
-}

+ 16 - 0
backend-admin/src/main/java/com/ittim/admin/mapper/CndPersonMapper.java

@@ -0,0 +1,16 @@
+package com.ittim.admin.mapper;
+
+import com.ittim.admin.entity.CndPerson;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 人员信息表 Mapper 接口
+ * </p>
+ *
+ * @author zzj
+ * @since 2020-10-13
+ */
+public interface CndPersonMapper extends BaseMapper<CndPerson> {
+
+}

+ 0 - 23
backend-admin/src/main/java/com/ittim/admin/mapper/OauthTokenKeyMapper.java

@@ -1,23 +0,0 @@
-package com.ittim.admin.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.ittim.admin.entity.OauthTokenKey;
-
-import java.util.List;
-
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-@Mapper
-public interface OauthTokenKeyMapper extends BaseMapper<OauthTokenKey> {
-    int updateBatch(List<OauthTokenKey> list);
-
-    int updateBatchSelective(List<OauthTokenKey> list);
-
-    int batchInsert(@Param("list") List<OauthTokenKey> list);
-}

+ 0 - 23
backend-admin/src/main/java/com/ittim/admin/mapper/OauthTokenMapper.java

@@ -1,23 +0,0 @@
-package com.ittim.admin.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.ittim.admin.entity.OauthToken;
-
-import java.util.List;
-
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-@Mapper
-public interface OauthTokenMapper extends BaseMapper<OauthToken> {
-    int updateBatch(List<OauthToken> list);
-
-    int updateBatchSelective(List<OauthToken> list);
-
-    int batchInsert(@Param("list") List<OauthToken> list);
-}

+ 0 - 28
backend-admin/src/main/java/com/ittim/admin/mapper/PersonMapper.java

@@ -1,28 +0,0 @@
-package com.ittim.admin.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.ittim.admin.entity.Person;
-
-import java.util.List;
-
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/28
- */
-@Mapper
-public interface PersonMapper extends BaseMapper<Person> {
-
-    int updateBatch(List<Person> list);
-
-    int batchInsert(@Param("list") List<Person> list);
-
-    IPage<Person> selectOrderByCreateTime(IPage<Person> page);
-
-    IPage<Person> selectByAll(IPage<Person> page, @Param("person") Person person);
-
-}

+ 0 - 23
backend-admin/src/main/java/com/ittim/admin/mapper/SysAuthoritiesMapper.java

@@ -1,23 +0,0 @@
-package com.ittim.admin.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.ittim.admin.entity.SysAuthorities;
-
-import java.util.List;
-
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-@Mapper
-public interface SysAuthoritiesMapper extends BaseMapper<SysAuthorities> {
-    int updateBatch(List<SysAuthorities> list);
-
-    int updateBatchSelective(List<SysAuthorities> list);
-
-    int batchInsert(@Param("list") List<SysAuthorities> list);
-}

+ 0 - 23
backend-admin/src/main/java/com/ittim/admin/mapper/SysMenuMapper.java

@@ -1,23 +0,0 @@
-package com.ittim.admin.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.ittim.admin.entity.SysMenu;
-
-import java.util.List;
-
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-@Mapper
-public interface SysMenuMapper extends BaseMapper<SysMenu> {
-    int updateBatch(List<SysMenu> list);
-
-    int updateBatchSelective(List<SysMenu> list);
-
-    int batchInsert(@Param("list") List<SysMenu> list);
-}

+ 0 - 23
backend-admin/src/main/java/com/ittim/admin/mapper/SysRoleAuthoritiesMapper.java

@@ -1,23 +0,0 @@
-package com.ittim.admin.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.ittim.admin.entity.SysRoleAuthorities;
-
-import java.util.List;
-
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-@Mapper
-public interface SysRoleAuthoritiesMapper extends BaseMapper<SysRoleAuthorities> {
-    int updateBatch(List<SysRoleAuthorities> list);
-
-    int updateBatchSelective(List<SysRoleAuthorities> list);
-
-    int batchInsert(@Param("list") List<SysRoleAuthorities> list);
-}

+ 0 - 23
backend-admin/src/main/java/com/ittim/admin/mapper/SysRoleMapper.java

@@ -1,23 +0,0 @@
-package com.ittim.admin.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.ittim.admin.entity.SysRole;
-
-import java.util.List;
-
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-@Mapper
-public interface SysRoleMapper extends BaseMapper<SysRole> {
-    int updateBatch(List<SysRole> list);
-
-    int updateBatchSelective(List<SysRole> list);
-
-    int batchInsert(@Param("list") List<SysRole> list);
-}

+ 0 - 23
backend-admin/src/main/java/com/ittim/admin/mapper/SysUserMapper.java

@@ -1,23 +0,0 @@
-package com.ittim.admin.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.ittim.admin.entity.SysUser;
-
-import java.util.List;
-
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-@Mapper
-public interface SysUserMapper extends BaseMapper<SysUser> {
-    int updateBatch(List<SysUser> list);
-
-    int updateBatchSelective(List<SysUser> list);
-
-    int batchInsert(@Param("list") List<SysUser> list);
-}

+ 0 - 23
backend-admin/src/main/java/com/ittim/admin/mapper/SysUserRoleMapper.java

@@ -1,23 +0,0 @@
-package com.ittim.admin.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.ittim.admin.entity.SysUserRole;
-
-import java.util.List;
-
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-@Mapper
-public interface SysUserRoleMapper extends BaseMapper<SysUserRole> {
-    int updateBatch(List<SysUserRole> list);
-
-    int updateBatchSelective(List<SysUserRole> list);
-
-    int batchInsert(@Param("list") List<SysUserRole> list);
-}

+ 16 - 0
backend-admin/src/main/java/com/ittim/admin/service/ICndPersonService.java

@@ -0,0 +1,16 @@
+package com.ittim.admin.service;
+
+import com.ittim.admin.entity.CndPerson;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 人员信息表 服务类
+ * </p>
+ *
+ * @author zzj
+ * @since 2020-10-13
+ */
+public interface ICndPersonService extends IService<CndPerson> {
+
+}

+ 0 - 21
backend-admin/src/main/java/com/ittim/admin/service/OauthTokenKeyService.java

@@ -1,21 +0,0 @@
-package com.ittim.admin.service;
-
-import java.util.List;
-
-import com.ittim.admin.entity.OauthTokenKey;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-public interface OauthTokenKeyService extends IService<OauthTokenKey> {
-
-    int updateBatch(List<OauthTokenKey> list);
-
-    int updateBatchSelective(List<OauthTokenKey> list);
-
-    int batchInsert(List<OauthTokenKey> list);
-
-}

+ 0 - 21
backend-admin/src/main/java/com/ittim/admin/service/OauthTokenService.java

@@ -1,21 +0,0 @@
-package com.ittim.admin.service;
-
-import java.util.List;
-
-import com.ittim.admin.entity.OauthToken;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-public interface OauthTokenService extends IService<OauthToken> {
-
-    int updateBatch(List<OauthToken> list);
-
-    int updateBatchSelective(List<OauthToken> list);
-
-    int batchInsert(List<OauthToken> list);
-
-}

+ 0 - 25
backend-admin/src/main/java/com/ittim/admin/service/PersonService.java

@@ -1,25 +0,0 @@
-package com.ittim.admin.service;
-
-import java.util.List;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.ittim.admin.entity.Person;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.ittim.common.bean.PageRequest;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/28
- */
-public interface PersonService extends IService<Person> {
-
-    int updateBatch(List<Person> list);
-
-    int batchInsert(List<Person> list);
-
-    IPage<Person> selectOrderByCreateTime(PageRequest page);
-
-    IPage<Person> selectByAll(PageRequest page,Person person);
-
-}

+ 0 - 21
backend-admin/src/main/java/com/ittim/admin/service/SysAuthoritiesService.java

@@ -1,21 +0,0 @@
-package com.ittim.admin.service;
-
-import java.util.List;
-
-import com.ittim.admin.entity.SysAuthorities;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-public interface SysAuthoritiesService extends IService<SysAuthorities> {
-
-    int updateBatch(List<SysAuthorities> list);
-
-    int updateBatchSelective(List<SysAuthorities> list);
-
-    int batchInsert(List<SysAuthorities> list);
-
-}

+ 0 - 21
backend-admin/src/main/java/com/ittim/admin/service/SysMenuService.java

@@ -1,21 +0,0 @@
-package com.ittim.admin.service;
-
-import java.util.List;
-
-import com.ittim.admin.entity.SysMenu;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-public interface SysMenuService extends IService<SysMenu> {
-
-    int updateBatch(List<SysMenu> list);
-
-    int updateBatchSelective(List<SysMenu> list);
-
-    int batchInsert(List<SysMenu> list);
-
-}

+ 0 - 21
backend-admin/src/main/java/com/ittim/admin/service/SysRoleAuthoritiesService.java

@@ -1,21 +0,0 @@
-package com.ittim.admin.service;
-
-import java.util.List;
-
-import com.ittim.admin.entity.SysRoleAuthorities;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-public interface SysRoleAuthoritiesService extends IService<SysRoleAuthorities> {
-
-    int updateBatch(List<SysRoleAuthorities> list);
-
-    int updateBatchSelective(List<SysRoleAuthorities> list);
-
-    int batchInsert(List<SysRoleAuthorities> list);
-
-}

+ 0 - 21
backend-admin/src/main/java/com/ittim/admin/service/SysRoleService.java

@@ -1,21 +0,0 @@
-package com.ittim.admin.service;
-
-import java.util.List;
-
-import com.ittim.admin.entity.SysRole;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-public interface SysRoleService extends IService<SysRole> {
-
-    int updateBatch(List<SysRole> list);
-
-    int updateBatchSelective(List<SysRole> list);
-
-    int batchInsert(List<SysRole> list);
-
-}

+ 0 - 21
backend-admin/src/main/java/com/ittim/admin/service/SysUserRoleService.java

@@ -1,21 +0,0 @@
-package com.ittim.admin.service;
-
-import java.util.List;
-
-import com.ittim.admin.entity.SysUserRole;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-public interface SysUserRoleService extends IService<SysUserRole> {
-
-    int updateBatch(List<SysUserRole> list);
-
-    int updateBatchSelective(List<SysUserRole> list);
-
-    int batchInsert(List<SysUserRole> list);
-
-}

+ 0 - 22
backend-admin/src/main/java/com/ittim/admin/service/SysUserService.java

@@ -1,22 +0,0 @@
-package com.ittim.admin.service;
-
-import com.ittim.admin.entity.SysUser;
-
-import java.util.List;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-public interface SysUserService extends IService<SysUser> {
-
-    int updateBatch(List<SysUser> list);
-
-    int updateBatchSelective(List<SysUser> list);
-
-    int batchInsert(List<SysUser> list);
-
-}

+ 20 - 0
backend-admin/src/main/java/com/ittim/admin/service/impl/CndPersonServiceImpl.java

@@ -0,0 +1,20 @@
+package com.ittim.admin.service.impl;
+
+import com.ittim.admin.entity.CndPerson;
+import com.ittim.admin.mapper.CndPersonMapper;
+import com.ittim.admin.service.ICndPersonService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 人员信息表 服务实现类
+ * </p>
+ *
+ * @author zzj
+ * @since 2020-10-13
+ */
+@Service
+public class CndPersonServiceImpl extends ServiceImpl<CndPersonMapper, CndPerson> implements ICndPersonService {
+
+}

+ 0 - 38
backend-admin/src/main/java/com/ittim/admin/service/impl/OauthTokenKeyServiceImpl.java

@@ -1,38 +0,0 @@
-package com.ittim.admin.service.impl;
-
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.List;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-
-import java.util.List;
-
-import com.ittim.admin.mapper.OauthTokenKeyMapper;
-import com.ittim.admin.entity.OauthTokenKey;
-import com.ittim.admin.service.OauthTokenKeyService;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-@Service
-public class OauthTokenKeyServiceImpl extends ServiceImpl<OauthTokenKeyMapper, OauthTokenKey> implements OauthTokenKeyService {
-
-    @Override
-    public int updateBatch(List<OauthTokenKey> list) {
-        return baseMapper.updateBatch(list);
-    }
-
-    @Override
-    public int updateBatchSelective(List<OauthTokenKey> list) {
-        return baseMapper.updateBatchSelective(list);
-    }
-
-    @Override
-    public int batchInsert(List<OauthTokenKey> list) {
-        return baseMapper.batchInsert(list);
-    }
-}

+ 0 - 38
backend-admin/src/main/java/com/ittim/admin/service/impl/OauthTokenServiceImpl.java

@@ -1,38 +0,0 @@
-package com.ittim.admin.service.impl;
-
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.List;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.ittim.admin.mapper.OauthTokenMapper;
-
-import java.util.List;
-
-import com.ittim.admin.entity.OauthToken;
-import com.ittim.admin.service.OauthTokenService;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-@Service
-public class OauthTokenServiceImpl extends ServiceImpl<OauthTokenMapper, OauthToken> implements OauthTokenService {
-
-    @Override
-    public int updateBatch(List<OauthToken> list) {
-        return baseMapper.updateBatch(list);
-    }
-
-    @Override
-    public int updateBatchSelective(List<OauthToken> list) {
-        return baseMapper.updateBatchSelective(list);
-    }
-
-    @Override
-    public int batchInsert(List<OauthToken> list) {
-        return baseMapper.batchInsert(list);
-    }
-}

+ 0 - 45
backend-admin/src/main/java/com/ittim/admin/service/impl/PersonServiceImpl.java

@@ -1,45 +0,0 @@
-package com.ittim.admin.service.impl;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.ittim.common.bean.PageRequest;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.ittim.admin.entity.Person;
-import com.ittim.admin.mapper.PersonMapper;
-import com.ittim.admin.service.PersonService;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/28
- */
-@Service
-public class PersonServiceImpl extends ServiceImpl<PersonMapper, Person> implements PersonService {
-
-    @Override
-    public int updateBatch(List<Person> list) {
-        return baseMapper.updateBatch(list);
-    }
-
-    @Override
-    public int batchInsert(List<Person> list) {
-        return baseMapper.batchInsert(list);
-    }
-
-    @Override
-    public IPage<Person> selectOrderByCreateTime(PageRequest pageRequest) {
-        IPage<Person> page = new Page<>(pageRequest.getPage(), pageRequest.getPageSize());
-        return baseMapper.selectOrderByCreateTime(page);
-    }
-
-    @Override
-    public IPage<Person> selectByAll(PageRequest pageRequest, Person person) {
-        IPage<Person> page = new Page<>(pageRequest.getPage(), pageRequest.getPageSize());
-        return baseMapper.selectByAll(page, person);
-    }
-
-}

+ 0 - 38
backend-admin/src/main/java/com/ittim/admin/service/impl/SysAuthoritiesServiceImpl.java

@@ -1,38 +0,0 @@
-package com.ittim.admin.service.impl;
-
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.List;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-
-import java.util.List;
-
-import com.ittim.admin.entity.SysAuthorities;
-import com.ittim.admin.mapper.SysAuthoritiesMapper;
-import com.ittim.admin.service.SysAuthoritiesService;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-@Service
-public class SysAuthoritiesServiceImpl extends ServiceImpl<SysAuthoritiesMapper, SysAuthorities> implements SysAuthoritiesService {
-
-    @Override
-    public int updateBatch(List<SysAuthorities> list) {
-        return baseMapper.updateBatch(list);
-    }
-
-    @Override
-    public int updateBatchSelective(List<SysAuthorities> list) {
-        return baseMapper.updateBatchSelective(list);
-    }
-
-    @Override
-    public int batchInsert(List<SysAuthorities> list) {
-        return baseMapper.batchInsert(list);
-    }
-}

+ 0 - 38
backend-admin/src/main/java/com/ittim/admin/service/impl/SysMenuServiceImpl.java

@@ -1,38 +0,0 @@
-package com.ittim.admin.service.impl;
-
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.List;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-
-import java.util.List;
-
-import com.ittim.admin.entity.SysMenu;
-import com.ittim.admin.mapper.SysMenuMapper;
-import com.ittim.admin.service.SysMenuService;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-@Service
-public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements SysMenuService {
-
-    @Override
-    public int updateBatch(List<SysMenu> list) {
-        return baseMapper.updateBatch(list);
-    }
-
-    @Override
-    public int updateBatchSelective(List<SysMenu> list) {
-        return baseMapper.updateBatchSelective(list);
-    }
-
-    @Override
-    public int batchInsert(List<SysMenu> list) {
-        return baseMapper.batchInsert(list);
-    }
-}

+ 0 - 38
backend-admin/src/main/java/com/ittim/admin/service/impl/SysRoleAuthoritiesServiceImpl.java

@@ -1,38 +0,0 @@
-package com.ittim.admin.service.impl;
-
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.List;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-
-import java.util.List;
-
-import com.ittim.admin.mapper.SysRoleAuthoritiesMapper;
-import com.ittim.admin.entity.SysRoleAuthorities;
-import com.ittim.admin.service.SysRoleAuthoritiesService;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-@Service
-public class SysRoleAuthoritiesServiceImpl extends ServiceImpl<SysRoleAuthoritiesMapper, SysRoleAuthorities> implements SysRoleAuthoritiesService {
-
-    @Override
-    public int updateBatch(List<SysRoleAuthorities> list) {
-        return baseMapper.updateBatch(list);
-    }
-
-    @Override
-    public int updateBatchSelective(List<SysRoleAuthorities> list) {
-        return baseMapper.updateBatchSelective(list);
-    }
-
-    @Override
-    public int batchInsert(List<SysRoleAuthorities> list) {
-        return baseMapper.batchInsert(list);
-    }
-}

+ 0 - 38
backend-admin/src/main/java/com/ittim/admin/service/impl/SysRoleServiceImpl.java

@@ -1,38 +0,0 @@
-package com.ittim.admin.service.impl;
-
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.List;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-
-import java.util.List;
-
-import com.ittim.admin.mapper.SysRoleMapper;
-import com.ittim.admin.entity.SysRole;
-import com.ittim.admin.service.SysRoleService;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-@Service
-public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService {
-
-    @Override
-    public int updateBatch(List<SysRole> list) {
-        return baseMapper.updateBatch(list);
-    }
-
-    @Override
-    public int updateBatchSelective(List<SysRole> list) {
-        return baseMapper.updateBatchSelective(list);
-    }
-
-    @Override
-    public int batchInsert(List<SysRole> list) {
-        return baseMapper.batchInsert(list);
-    }
-}

+ 0 - 38
backend-admin/src/main/java/com/ittim/admin/service/impl/SysUserRoleServiceImpl.java

@@ -1,38 +0,0 @@
-package com.ittim.admin.service.impl;
-
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.List;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-
-import java.util.List;
-
-import com.ittim.admin.mapper.SysUserRoleMapper;
-import com.ittim.admin.entity.SysUserRole;
-import com.ittim.admin.service.SysUserRoleService;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-@Service
-public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUserRole> implements SysUserRoleService {
-
-    @Override
-    public int updateBatch(List<SysUserRole> list) {
-        return baseMapper.updateBatch(list);
-    }
-
-    @Override
-    public int updateBatchSelective(List<SysUserRole> list) {
-        return baseMapper.updateBatchSelective(list);
-    }
-
-    @Override
-    public int batchInsert(List<SysUserRole> list) {
-        return baseMapper.batchInsert(list);
-    }
-}

+ 0 - 38
backend-admin/src/main/java/com/ittim/admin/service/impl/SysUserServiceImpl.java

@@ -1,38 +0,0 @@
-package com.ittim.admin.service.impl;
-
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.List;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.ittim.admin.entity.SysUser;
-
-import java.util.List;
-
-import com.ittim.admin.mapper.SysUserMapper;
-import com.ittim.admin.service.SysUserService;
-
-/**
- * @author zzj
- * @Description TODO
- * @date 2020/9/30
- */
-@Service
-public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService {
-
-    @Override
-    public int updateBatch(List<SysUser> list) {
-        return baseMapper.updateBatch(list);
-    }
-
-    @Override
-    public int updateBatchSelective(List<SysUser> list) {
-        return baseMapper.updateBatchSelective(list);
-    }
-
-    @Override
-    public int batchInsert(List<SysUser> list) {
-        return baseMapper.batchInsert(list);
-    }
-}

+ 0 - 9
backend-admin/src/main/resources/application.yml

@@ -35,12 +35,3 @@ knife4j:
     enable: true  #是否开启SwaggerApi页面访问验证
     username: admin
     password: ittimBackend
-
-jwtp:
-  store-type: 1   # 0是 redisTokenStore ,1是 jdbcTokenStore ,默认是0
-  path: /banckend/api  # 拦截路径,默认是/**
-  exclude-path: /doc.htm  # 排除拦截路径,默认无
-  max-token: 10   # 单个用户最大token数,默认-1不限制
-  url-perm-type: 0  # url自动对应权限方式,0 简易模式,1 RESTful模式
-  #find-permissions-sql: SELECT auth FROM user_auth WHERE user_id = ?  # 自定义查询用户权限的sql
-  #find-roles-sql: SELECT role_id FROM user_role WHERE user_id= ?  # 自定义查询用户角色的sql

+ 21 - 0
backend-admin/src/main/resources/mappers/CndPersonMapper.xml

@@ -0,0 +1,21 @@
+<?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.ittim.admin.mapper.CndPersonMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.ittim.admin.entity.CndPerson">
+        <id column="id" property="id" />
+        <result column="person_name" property="personName" />
+        <result column="person_age" property="personAge" />
+        <result column="person_phone" property="personPhone" />
+        <result column="person_address" property="personAddress" />
+        <result column="create_time" property="createTime" />
+        <result column="update_time" property="updateTime" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, person_name, person_age, person_phone, person_address, create_time, update_time
+    </sql>
+
+</mapper>

+ 0 - 68
backend-admin/src/main/resources/mappers/OauthTokenKeyMapper.xml

@@ -1,68 +0,0 @@
-<?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.ittim.admin.mapper.OauthTokenKeyMapper">
-    <resultMap id="BaseResultMap" type="com.ittim.admin.entity.OauthTokenKey">
-        <!--@mbg.generated-->
-        <!--@Table oauth_token_key-->
-        <id column="id" jdbcType="INTEGER" property="id"/>
-        <result column="token_key" jdbcType="VARCHAR" property="tokenKey"/>
-        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
-    </resultMap>
-    <sql id="Base_Column_List">
-        <!--@mbg.generated-->
-        id, token_key, create_time
-    </sql>
-    <update id="updateBatch" parameterType="java.util.List">
-        <!--@mbg.generated-->
-        update oauth_token_key
-        <trim prefix="set" suffixOverrides=",">
-            <trim prefix="token_key = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when id = #{item.id,jdbcType=INTEGER} then #{item.tokenKey,jdbcType=VARCHAR}
-                </foreach>
-            </trim>
-            <trim prefix="create_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
-                </foreach>
-            </trim>
-        </trim>
-        where id in
-        <foreach close=")" collection="list" item="item" open="(" separator=", ">
-            #{item.id,jdbcType=INTEGER}
-        </foreach>
-    </update>
-    <update id="updateBatchSelective" parameterType="java.util.List">
-        <!--@mbg.generated-->
-        update oauth_token_key
-        <trim prefix="set" suffixOverrides=",">
-            <trim prefix="token_key = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.tokenKey != null">
-                        when id = #{item.id,jdbcType=INTEGER} then #{item.tokenKey,jdbcType=VARCHAR}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="create_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.createTime != null">
-                        when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
-                    </if>
-                </foreach>
-            </trim>
-        </trim>
-        where id in
-        <foreach close=")" collection="list" item="item" open="(" separator=", ">
-            #{item.id,jdbcType=INTEGER}
-        </foreach>
-    </update>
-    <insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
-        <!--@mbg.generated-->
-        insert into oauth_token_key
-                (token_key, create_time)
-                values
-        <foreach collection="list" item="item" separator=",">
-            (#{item.tokenKey,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP})
-        </foreach>
-    </insert>
-</mapper>

+ 0 - 166
backend-admin/src/main/resources/mappers/OauthTokenMapper.xml

@@ -1,166 +0,0 @@
-<?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.ittim.admin.mapper.OauthTokenMapper">
-    <resultMap id="BaseResultMap" type="com.ittim.admin.entity.OauthToken">
-        <!--@mbg.generated-->
-        <!--@Table oauth_token-->
-        <id column="token_id" jdbcType="INTEGER" property="tokenId"/>
-        <result column="user_id" jdbcType="VARCHAR" property="userId"/>
-        <result column="access_token" jdbcType="VARCHAR" property="accessToken"/>
-        <result column="refresh_token" jdbcType="VARCHAR" property="refreshToken"/>
-        <result column="expire_time" jdbcType="TIMESTAMP" property="expireTime"/>
-        <result column="refresh_token_expire_time" jdbcType="TIMESTAMP" property="refreshTokenExpireTime"/>
-        <result column="roles" jdbcType="VARCHAR" property="roles"/>
-        <result column="permissions" jdbcType="VARCHAR" property="permissions"/>
-        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
-        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
-    </resultMap>
-    <sql id="Base_Column_List">
-        <!--@mbg.generated-->
-        token_id, user_id, access_token, refresh_token, expire_time, refresh_token_expire_time,
-        roles, permissions, create_time, update_time
-    </sql>
-    <update id="updateBatch" parameterType="java.util.List">
-        <!--@mbg.generated-->
-        update oauth_token
-        <trim prefix="set" suffixOverrides=",">
-            <trim prefix="user_id = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.userId,jdbcType=VARCHAR}
-                </foreach>
-            </trim>
-            <trim prefix="access_token = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.accessToken,jdbcType=VARCHAR}
-                </foreach>
-            </trim>
-            <trim prefix="refresh_token = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.refreshToken,jdbcType=VARCHAR}
-                </foreach>
-            </trim>
-            <trim prefix="expire_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.expireTime,jdbcType=TIMESTAMP}
-                </foreach>
-            </trim>
-            <trim prefix="refresh_token_expire_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.refreshTokenExpireTime,jdbcType=TIMESTAMP}
-                </foreach>
-            </trim>
-            <trim prefix="roles = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.roles,jdbcType=VARCHAR}
-                </foreach>
-            </trim>
-            <trim prefix="permissions = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.permissions,jdbcType=VARCHAR}
-                </foreach>
-            </trim>
-            <trim prefix="create_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
-                </foreach>
-            </trim>
-            <trim prefix="update_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
-                </foreach>
-            </trim>
-        </trim>
-        where token_id in
-        <foreach close=")" collection="list" item="item" open="(" separator=", ">
-            #{item.tokenId,jdbcType=INTEGER}
-        </foreach>
-    </update>
-    <update id="updateBatchSelective" parameterType="java.util.List">
-        <!--@mbg.generated-->
-        update oauth_token
-        <trim prefix="set" suffixOverrides=",">
-            <trim prefix="user_id = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.userId != null">
-                        when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.userId,jdbcType=VARCHAR}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="access_token = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.accessToken != null">
-                        when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.accessToken,jdbcType=VARCHAR}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="refresh_token = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.refreshToken != null">
-                        when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.refreshToken,jdbcType=VARCHAR}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="expire_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.expireTime != null">
-                        when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.expireTime,jdbcType=TIMESTAMP}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="refresh_token_expire_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.refreshTokenExpireTime != null">
-                        when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.refreshTokenExpireTime,jdbcType=TIMESTAMP}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="roles = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.roles != null">
-                        when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.roles,jdbcType=VARCHAR}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="permissions = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.permissions != null">
-                        when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.permissions,jdbcType=VARCHAR}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="create_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.createTime != null">
-                        when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="update_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.updateTime != null">
-                        when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
-                    </if>
-                </foreach>
-            </trim>
-        </trim>
-        where token_id in
-        <foreach close=")" collection="list" item="item" open="(" separator=", ">
-            #{item.tokenId,jdbcType=INTEGER}
-        </foreach>
-    </update>
-    <insert id="batchInsert" keyColumn="token_id" keyProperty="tokenId" parameterType="map" useGeneratedKeys="true">
-        <!--@mbg.generated-->
-        insert into oauth_token
-                (user_id, access_token, refresh_token, expire_time, refresh_token_expire_time, roles,
-                 permissions, create_time, update_time)
-                values
-        <foreach collection="list" item="item" separator=",">
-            (#{item.userId,jdbcType=VARCHAR}, #{item.accessToken,jdbcType=VARCHAR},
-             #{item.refreshToken,jdbcType=VARCHAR},
-             #{item.expireTime,jdbcType=TIMESTAMP}, #{item.refreshTokenExpireTime,jdbcType=TIMESTAMP},
-             #{item.roles,jdbcType=VARCHAR}, #{item.permissions,jdbcType=VARCHAR},
-             #{item.createTime,jdbcType=TIMESTAMP},
-             #{item.updateTime,jdbcType=TIMESTAMP})
-        </foreach>
-    </insert>
-</mapper>

+ 0 - 109
backend-admin/src/main/resources/mappers/PersonMapper.xml

@@ -1,109 +0,0 @@
-<?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.ittim.admin.mapper.PersonMapper">
-    <resultMap id="BaseResultMap" type="com.ittim.admin.entity.Person">
-        <!--@mbg.generated-->
-        <!--@Table cnd_person-->
-        <id column="id" jdbcType="INTEGER" property="id"/>
-        <result column="person_name" jdbcType="VARCHAR" property="personName"/>
-        <result column="person_age" jdbcType="INTEGER" property="personAge"/>
-        <result column="person_phone" jdbcType="BIGINT" property="personPhone"/>
-        <result column="person_address" jdbcType="VARCHAR" property="personAddress"/>
-        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
-        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
-    </resultMap>
-    <sql id="Base_Column_List">
-        <!--@mbg.generated-->
-        id, person_name, person_age, person_phone, person_address, create_time, update_time
-    </sql>
-    <update id="updateBatch" parameterType="java.util.List">
-        <!--@mbg.generated-->
-        update cnd_person
-        <trim prefix="set" suffixOverrides=",">
-            <trim prefix="person_name = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when id = #{item.id,jdbcType=INTEGER} then #{item.personName,jdbcType=VARCHAR}
-                </foreach>
-            </trim>
-            <trim prefix="person_age = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when id = #{item.id,jdbcType=INTEGER} then #{item.personAge,jdbcType=INTEGER}
-                </foreach>
-            </trim>
-            <trim prefix="person_phone = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when id = #{item.id,jdbcType=INTEGER} then #{item.personPhone,jdbcType=BIGINT}
-                </foreach>
-            </trim>
-            <trim prefix="person_address = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when id = #{item.id,jdbcType=INTEGER} then #{item.personAddress,jdbcType=VARCHAR}
-                </foreach>
-            </trim>
-            <trim prefix="create_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
-                </foreach>
-            </trim>
-            <trim prefix="update_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
-                </foreach>
-            </trim>
-        </trim>
-        where id in
-        <foreach close=")" collection="list" item="item" open="(" separator=", ">
-            #{item.id,jdbcType=INTEGER}
-        </foreach>
-    </update>
-    <insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
-        <!--@mbg.generated-->
-        insert into cnd_person
-                (person_name, person_age, person_phone, person_address, create_time, update_time)
-                values
-        <foreach collection="list" item="item" separator=",">
-            (#{item.personName,jdbcType=VARCHAR}, #{item.personAge,jdbcType=INTEGER},
-             #{item.personPhone,jdbcType=BIGINT},
-             #{item.personAddress,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
-             #{item.updateTime,jdbcType=TIMESTAMP})
-        </foreach>
-    </insert>
-
-    <!--auto generated by MybatisCodeHelper on 2020-09-28-->
-    <select id="selectOrderByCreateTime" resultMap="BaseResultMap">
-        select
-        <include refid="Base_Column_List"/>
-        from cnd_person
-        order by create_time asc
-    </select>
-
-    <!--auto generated by MybatisCodeHelper on 2020-09-28-->
-    <select id="selectByAll" resultMap="BaseResultMap">
-        select
-        <include refid="Base_Column_List"/>
-        from cnd_person
-        <where>
-            <if test="person.id != null">
-                and id = #{person.id,jdbcType=INTEGER}
-            </if>
-            <if test="person.personName != null">
-                and person_name = #{person.personName,jdbcType=VARCHAR}
-            </if>
-            <if test="person.personAge != null">
-                and person_age = #{person.personAge,jdbcType=INTEGER}
-            </if>
-            <if test="person.personPhone != null">
-                and person_phone = #{person.personPhone,jdbcType=BIGINT}
-            </if>
-            <if test="person.personAddress != null">
-                and person_address = #{person.personAddress,jdbcType=VARCHAR}
-            </if>
-            <if test="person.createTime != null">
-                and create_time = #{person.createTime,jdbcType=TIMESTAMP}
-            </if>
-            <if test="person.updateTime != null">
-                and update_time = #{person.updateTime,jdbcType=TIMESTAMP}
-            </if>
-        </where>
-    </select>
-</mapper>

+ 0 - 108
backend-admin/src/main/resources/mappers/SysAuthoritiesMapper.xml

@@ -1,108 +0,0 @@
-<?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.ittim.admin.mapper.SysAuthoritiesMapper">
-    <resultMap id="BaseResultMap" type="com.ittim.admin.entity.SysAuthorities">
-        <!--@mbg.generated-->
-        <!--@Table sys_authorities-->
-        <id column="id" jdbcType="INTEGER" property="id"/>
-        <result column="authority" jdbcType="VARCHAR" property="authority"/>
-        <result column="authority_name" jdbcType="VARCHAR" property="authorityName"/>
-        <result column="parent_name" jdbcType="VARCHAR" property="parentName"/>
-        <result column="sort" jdbcType="INTEGER" property="sort"/>
-        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
-    </resultMap>
-    <sql id="Base_Column_List">
-        <!--@mbg.generated-->
-        id, authority, authority_name, parent_name, sort, create_time
-    </sql>
-    <update id="updateBatch" parameterType="java.util.List">
-        <!--@mbg.generated-->
-        update sys_authorities
-        <trim prefix="set" suffixOverrides=",">
-            <trim prefix="authority = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when id = #{item.id,jdbcType=INTEGER} then #{item.authority,jdbcType=VARCHAR}
-                </foreach>
-            </trim>
-            <trim prefix="authority_name = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when id = #{item.id,jdbcType=INTEGER} then #{item.authorityName,jdbcType=VARCHAR}
-                </foreach>
-            </trim>
-            <trim prefix="parent_name = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when id = #{item.id,jdbcType=INTEGER} then #{item.parentName,jdbcType=VARCHAR}
-                </foreach>
-            </trim>
-            <trim prefix="sort = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when id = #{item.id,jdbcType=INTEGER} then #{item.sort,jdbcType=INTEGER}
-                </foreach>
-            </trim>
-            <trim prefix="create_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
-                </foreach>
-            </trim>
-        </trim>
-        where id in
-        <foreach close=")" collection="list" item="item" open="(" separator=", ">
-            #{item.id,jdbcType=INTEGER}
-        </foreach>
-    </update>
-    <update id="updateBatchSelective" parameterType="java.util.List">
-        <!--@mbg.generated-->
-        update sys_authorities
-        <trim prefix="set" suffixOverrides=",">
-            <trim prefix="authority = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.authority != null">
-                        when id = #{item.id,jdbcType=INTEGER} then #{item.authority,jdbcType=VARCHAR}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="authority_name = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.authorityName != null">
-                        when id = #{item.id,jdbcType=INTEGER} then #{item.authorityName,jdbcType=VARCHAR}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="parent_name = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.parentName != null">
-                        when id = #{item.id,jdbcType=INTEGER} then #{item.parentName,jdbcType=VARCHAR}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="sort = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.sort != null">
-                        when id = #{item.id,jdbcType=INTEGER} then #{item.sort,jdbcType=INTEGER}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="create_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.createTime != null">
-                        when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
-                    </if>
-                </foreach>
-            </trim>
-        </trim>
-        where id in
-        <foreach close=")" collection="list" item="item" open="(" separator=", ">
-            #{item.id,jdbcType=INTEGER}
-        </foreach>
-    </update>
-    <insert id="batchInsert" parameterType="map">
-        <!--@mbg.generated-->
-        insert into sys_authorities
-                (id, authority, authority_name, parent_name, sort, create_time)
-                values
-        <foreach collection="list" item="item" separator=",">
-            (#{item.id,jdbcType=INTEGER}, #{item.authority,jdbcType=VARCHAR}, #{item.authorityName,jdbcType=VARCHAR},
-             #{item.parentName,jdbcType=VARCHAR}, #{item.sort,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP})
-        </foreach>
-    </insert>
-</mapper>

+ 0 - 150
backend-admin/src/main/resources/mappers/SysMenuMapper.xml

@@ -1,150 +0,0 @@
-<?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.ittim.admin.mapper.SysMenuMapper">
-    <resultMap id="BaseResultMap" type="com.ittim.admin.entity.SysMenu">
-        <!--@mbg.generated-->
-        <!--@Table sys_menu-->
-        <id column="menu_id" jdbcType="INTEGER" property="menuId"/>
-        <result column="parent_id" jdbcType="INTEGER" property="parentId"/>
-        <result column="menu_name" jdbcType="VARCHAR" property="menuName"/>
-        <result column="menu_url" jdbcType="VARCHAR" property="menuUrl"/>
-        <result column="menu_icon" jdbcType="VARCHAR" property="menuIcon"/>
-        <result column="sort_number" jdbcType="VARCHAR" property="sortNumber"/>
-        <result column="authority" jdbcType="VARCHAR" property="authority"/>
-        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
-        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
-    </resultMap>
-    <sql id="Base_Column_List">
-        <!--@mbg.generated-->
-        menu_id, parent_id, menu_name, menu_url, menu_icon, sort_number, authority, create_time,
-        update_time
-    </sql>
-    <update id="updateBatch" parameterType="java.util.List">
-        <!--@mbg.generated-->
-        update sys_menu
-        <trim prefix="set" suffixOverrides=",">
-            <trim prefix="parent_id = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.parentId,jdbcType=INTEGER}
-                </foreach>
-            </trim>
-            <trim prefix="menu_name = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.menuName,jdbcType=VARCHAR}
-                </foreach>
-            </trim>
-            <trim prefix="menu_url = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.menuUrl,jdbcType=VARCHAR}
-                </foreach>
-            </trim>
-            <trim prefix="menu_icon = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.menuIcon,jdbcType=VARCHAR}
-                </foreach>
-            </trim>
-            <trim prefix="sort_number = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.sortNumber,jdbcType=VARCHAR}
-                </foreach>
-            </trim>
-            <trim prefix="authority = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.authority,jdbcType=VARCHAR}
-                </foreach>
-            </trim>
-            <trim prefix="create_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
-                </foreach>
-            </trim>
-            <trim prefix="update_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
-                </foreach>
-            </trim>
-        </trim>
-        where menu_id in
-        <foreach close=")" collection="list" item="item" open="(" separator=", ">
-            #{item.menuId,jdbcType=INTEGER}
-        </foreach>
-    </update>
-    <update id="updateBatchSelective" parameterType="java.util.List">
-        <!--@mbg.generated-->
-        update sys_menu
-        <trim prefix="set" suffixOverrides=",">
-            <trim prefix="parent_id = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.parentId != null">
-                        when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.parentId,jdbcType=INTEGER}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="menu_name = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.menuName != null">
-                        when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.menuName,jdbcType=VARCHAR}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="menu_url = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.menuUrl != null">
-                        when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.menuUrl,jdbcType=VARCHAR}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="menu_icon = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.menuIcon != null">
-                        when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.menuIcon,jdbcType=VARCHAR}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="sort_number = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.sortNumber != null">
-                        when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.sortNumber,jdbcType=VARCHAR}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="authority = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.authority != null">
-                        when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.authority,jdbcType=VARCHAR}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="create_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.createTime != null">
-                        when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="update_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.updateTime != null">
-                        when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
-                    </if>
-                </foreach>
-            </trim>
-        </trim>
-        where menu_id in
-        <foreach close=")" collection="list" item="item" open="(" separator=", ">
-            #{item.menuId,jdbcType=INTEGER}
-        </foreach>
-    </update>
-    <insert id="batchInsert" keyColumn="menu_id" keyProperty="menuId" parameterType="map" useGeneratedKeys="true">
-        <!--@mbg.generated-->
-        insert into sys_menu
-                (parent_id, menu_name, menu_url, menu_icon, sort_number, authority, create_time,
-                 update_time)
-                values
-        <foreach collection="list" item="item" separator=",">
-            (#{item.parentId,jdbcType=INTEGER}, #{item.menuName,jdbcType=VARCHAR}, #{item.menuUrl,jdbcType=VARCHAR},
-             #{item.menuIcon,jdbcType=VARCHAR}, #{item.sortNumber,jdbcType=VARCHAR}, #{item.authority,jdbcType=VARCHAR},
-             #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateTime,jdbcType=TIMESTAMP})
-        </foreach>
-    </insert>
-</mapper>

+ 0 - 81
backend-admin/src/main/resources/mappers/SysRoleAuthoritiesMapper.xml

@@ -1,81 +0,0 @@
-<?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.ittim.admin.mapper.SysRoleAuthoritiesMapper">
-    <resultMap id="BaseResultMap" type="com.ittim.admin.entity.SysRoleAuthorities">
-        <!--@mbg.generated-->
-        <!--@Table sys_role_authorities-->
-        <id column="id" jdbcType="INTEGER" property="id"/>
-        <result column="role_id" jdbcType="INTEGER" property="roleId"/>
-        <result column="authority" jdbcType="VARCHAR" property="authority"/>
-        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
-    </resultMap>
-    <sql id="Base_Column_List">
-        <!--@mbg.generated-->
-        id, role_id, authority, create_time
-    </sql>
-    <update id="updateBatch" parameterType="java.util.List">
-        <!--@mbg.generated-->
-        update sys_role_authorities
-        <trim prefix="set" suffixOverrides=",">
-            <trim prefix="role_id = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when id = #{item.id,jdbcType=INTEGER} then #{item.roleId,jdbcType=INTEGER}
-                </foreach>
-            </trim>
-            <trim prefix="authority = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when id = #{item.id,jdbcType=INTEGER} then #{item.authority,jdbcType=VARCHAR}
-                </foreach>
-            </trim>
-            <trim prefix="create_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
-                </foreach>
-            </trim>
-        </trim>
-        where id in
-        <foreach close=")" collection="list" item="item" open="(" separator=", ">
-            #{item.id,jdbcType=INTEGER}
-        </foreach>
-    </update>
-    <update id="updateBatchSelective" parameterType="java.util.List">
-        <!--@mbg.generated-->
-        update sys_role_authorities
-        <trim prefix="set" suffixOverrides=",">
-            <trim prefix="role_id = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.roleId != null">
-                        when id = #{item.id,jdbcType=INTEGER} then #{item.roleId,jdbcType=INTEGER}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="authority = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.authority != null">
-                        when id = #{item.id,jdbcType=INTEGER} then #{item.authority,jdbcType=VARCHAR}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="create_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.createTime != null">
-                        when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
-                    </if>
-                </foreach>
-            </trim>
-        </trim>
-        where id in
-        <foreach close=")" collection="list" item="item" open="(" separator=", ">
-            #{item.id,jdbcType=INTEGER}
-        </foreach>
-    </update>
-    <insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
-        <!--@mbg.generated-->
-        insert into sys_role_authorities
-                (role_id, authority, create_time)
-                values
-        <foreach collection="list" item="item" separator=",">
-            (#{item.roleId,jdbcType=INTEGER}, #{item.authority,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP})
-        </foreach>
-    </insert>
-</mapper>

+ 0 - 96
backend-admin/src/main/resources/mappers/SysRoleMapper.xml

@@ -1,96 +0,0 @@
-<?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.ittim.admin.mapper.SysRoleMapper">
-    <resultMap id="BaseResultMap" type="com.ittim.admin.entity.SysRole">
-        <!--@mbg.generated-->
-        <!--@Table sys_role-->
-        <id column="role_id" jdbcType="INTEGER" property="roleId"/>
-        <result column="role_name" jdbcType="VARCHAR" property="roleName"/>
-        <result column="comments" jdbcType="VARCHAR" property="comments"/>
-        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
-        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
-    </resultMap>
-    <sql id="Base_Column_List">
-        <!--@mbg.generated-->
-        role_id, role_name, comments, create_time, update_time
-    </sql>
-    <update id="updateBatch" parameterType="java.util.List">
-        <!--@mbg.generated-->
-        update sys_role
-        <trim prefix="set" suffixOverrides=",">
-            <trim prefix="role_name = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when role_id = #{item.roleId,jdbcType=INTEGER} then #{item.roleName,jdbcType=VARCHAR}
-                </foreach>
-            </trim>
-            <trim prefix="comments = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when role_id = #{item.roleId,jdbcType=INTEGER} then #{item.comments,jdbcType=VARCHAR}
-                </foreach>
-            </trim>
-            <trim prefix="create_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when role_id = #{item.roleId,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
-                </foreach>
-            </trim>
-            <trim prefix="update_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when role_id = #{item.roleId,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
-                </foreach>
-            </trim>
-        </trim>
-        where role_id in
-        <foreach close=")" collection="list" item="item" open="(" separator=", ">
-            #{item.roleId,jdbcType=INTEGER}
-        </foreach>
-    </update>
-    <update id="updateBatchSelective" parameterType="java.util.List">
-        <!--@mbg.generated-->
-        update sys_role
-        <trim prefix="set" suffixOverrides=",">
-            <trim prefix="role_name = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.roleName != null">
-                        when role_id = #{item.roleId,jdbcType=INTEGER} then #{item.roleName,jdbcType=VARCHAR}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="comments = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.comments != null">
-                        when role_id = #{item.roleId,jdbcType=INTEGER} then #{item.comments,jdbcType=VARCHAR}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="create_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.createTime != null">
-                        when role_id = #{item.roleId,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="update_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.updateTime != null">
-                        when role_id = #{item.roleId,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
-                    </if>
-                </foreach>
-            </trim>
-        </trim>
-        where role_id in
-        <foreach close=")" collection="list" item="item" open="(" separator=", ">
-            #{item.roleId,jdbcType=INTEGER}
-        </foreach>
-    </update>
-    <insert id="batchInsert" keyColumn="role_id" keyProperty="roleId" parameterType="map" useGeneratedKeys="true">
-        <!--@mbg.generated-->
-        insert into sys_role
-                (role_name, comments, create_time, update_time)
-                values
-        <foreach collection="list" item="item" separator=",">
-            (#{item.roleName,jdbcType=VARCHAR}, #{item.comments,jdbcType=VARCHAR},
-             #{item.createTime,jdbcType=TIMESTAMP},
-             #{item.updateTime,jdbcType=TIMESTAMP})
-        </foreach>
-    </insert>
-</mapper>

+ 0 - 135
backend-admin/src/main/resources/mappers/SysUserMapper.xml

@@ -1,135 +0,0 @@
-<?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.ittim.admin.mapper.SysUserMapper">
-    <resultMap id="BaseResultMap" type="com.ittim.admin.entity.SysUser">
-        <!--@mbg.generated-->
-        <!--@Table sys_user-->
-        <id column="user_id" jdbcType="INTEGER" property="userId"/>
-        <result column="username" jdbcType="VARCHAR" property="username"/>
-        <result column="password" jdbcType="VARCHAR" property="password"/>
-        <result column="nick_name" jdbcType="VARCHAR" property="nickName"/>
-        <result column="sex" jdbcType="VARCHAR" property="sex"/>
-        <result column="state" jdbcType="INTEGER" property="state"/>
-        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
-        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
-    </resultMap>
-    <sql id="Base_Column_List">
-        <!--@mbg.generated-->
-        user_id, username, `password`, nick_name, sex, `state`, create_time, update_time
-    </sql>
-    <update id="updateBatch" parameterType="java.util.List">
-        <!--@mbg.generated-->
-        update sys_user
-        <trim prefix="set" suffixOverrides=",">
-            <trim prefix="username = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when user_id = #{item.userId,jdbcType=INTEGER} then #{item.username,jdbcType=VARCHAR}
-                </foreach>
-            </trim>
-            <trim prefix="`password` = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when user_id = #{item.userId,jdbcType=INTEGER} then #{item.password,jdbcType=VARCHAR}
-                </foreach>
-            </trim>
-            <trim prefix="nick_name = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when user_id = #{item.userId,jdbcType=INTEGER} then #{item.nickName,jdbcType=VARCHAR}
-                </foreach>
-            </trim>
-            <trim prefix="sex = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when user_id = #{item.userId,jdbcType=INTEGER} then #{item.sex,jdbcType=VARCHAR}
-                </foreach>
-            </trim>
-            <trim prefix="`state` = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when user_id = #{item.userId,jdbcType=INTEGER} then #{item.state,jdbcType=INTEGER}
-                </foreach>
-            </trim>
-            <trim prefix="create_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when user_id = #{item.userId,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
-                </foreach>
-            </trim>
-            <trim prefix="update_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when user_id = #{item.userId,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
-                </foreach>
-            </trim>
-        </trim>
-        where user_id in
-        <foreach close=")" collection="list" item="item" open="(" separator=", ">
-            #{item.userId,jdbcType=INTEGER}
-        </foreach>
-    </update>
-    <update id="updateBatchSelective" parameterType="java.util.List">
-        <!--@mbg.generated-->
-        update sys_user
-        <trim prefix="set" suffixOverrides=",">
-            <trim prefix="username = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.username != null">
-                        when user_id = #{item.userId,jdbcType=INTEGER} then #{item.username,jdbcType=VARCHAR}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="`password` = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.password != null">
-                        when user_id = #{item.userId,jdbcType=INTEGER} then #{item.password,jdbcType=VARCHAR}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="nick_name = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.nickName != null">
-                        when user_id = #{item.userId,jdbcType=INTEGER} then #{item.nickName,jdbcType=VARCHAR}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="sex = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.sex != null">
-                        when user_id = #{item.userId,jdbcType=INTEGER} then #{item.sex,jdbcType=VARCHAR}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="`state` = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.state != null">
-                        when user_id = #{item.userId,jdbcType=INTEGER} then #{item.state,jdbcType=INTEGER}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="create_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.createTime != null">
-                        when user_id = #{item.userId,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="update_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.updateTime != null">
-                        when user_id = #{item.userId,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
-                    </if>
-                </foreach>
-            </trim>
-        </trim>
-        where user_id in
-        <foreach close=")" collection="list" item="item" open="(" separator=", ">
-            #{item.userId,jdbcType=INTEGER}
-        </foreach>
-    </update>
-    <insert id="batchInsert" keyColumn="user_id" keyProperty="userId" parameterType="map" useGeneratedKeys="true">
-        <!--@mbg.generated-->
-        insert into sys_user
-                (username, `password`, nick_name, sex, `state`, create_time, update_time)
-                values
-        <foreach collection="list" item="item" separator=",">
-            (#{item.username,jdbcType=VARCHAR}, #{item.password,jdbcType=VARCHAR}, #{item.nickName,jdbcType=VARCHAR},
-             #{item.sex,jdbcType=VARCHAR}, #{item.state,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP},
-             #{item.updateTime,jdbcType=TIMESTAMP})
-        </foreach>
-    </insert>
-</mapper>

+ 0 - 82
backend-admin/src/main/resources/mappers/SysUserRoleMapper.xml

@@ -1,82 +0,0 @@
-<?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.ittim.admin.mapper.SysUserRoleMapper">
-    <resultMap id="BaseResultMap" type="com.ittim.admin.entity.SysUserRole">
-        <!--@mbg.generated-->
-        <!--@Table sys_user_role-->
-        <id column="id" jdbcType="INTEGER" property="id"/>
-        <result column="user_id" jdbcType="INTEGER" property="userId"/>
-        <result column="role_id" jdbcType="INTEGER" property="roleId"/>
-        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
-    </resultMap>
-    <sql id="Base_Column_List">
-        <!--@mbg.generated-->
-        id, user_id, role_id, create_time
-    </sql>
-    <update id="updateBatch" parameterType="java.util.List">
-        <!--@mbg.generated-->
-        update sys_user_role
-        <trim prefix="set" suffixOverrides=",">
-            <trim prefix="user_id = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when id = #{item.id,jdbcType=INTEGER} then #{item.userId,jdbcType=INTEGER}
-                </foreach>
-            </trim>
-            <trim prefix="role_id = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when id = #{item.id,jdbcType=INTEGER} then #{item.roleId,jdbcType=INTEGER}
-                </foreach>
-            </trim>
-            <trim prefix="create_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
-                </foreach>
-            </trim>
-        </trim>
-        where id in
-        <foreach close=")" collection="list" item="item" open="(" separator=", ">
-            #{item.id,jdbcType=INTEGER}
-        </foreach>
-    </update>
-    <update id="updateBatchSelective" parameterType="java.util.List">
-        <!--@mbg.generated-->
-        update sys_user_role
-        <trim prefix="set" suffixOverrides=",">
-            <trim prefix="user_id = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.userId != null">
-                        when id = #{item.id,jdbcType=INTEGER} then #{item.userId,jdbcType=INTEGER}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="role_id = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.roleId != null">
-                        when id = #{item.id,jdbcType=INTEGER} then #{item.roleId,jdbcType=INTEGER}
-                    </if>
-                </foreach>
-            </trim>
-            <trim prefix="create_time = case" suffix="end,">
-                <foreach collection="list" index="index" item="item">
-                    <if test="item.createTime != null">
-                        when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
-                    </if>
-                </foreach>
-            </trim>
-        </trim>
-        where id in
-        <foreach close=")" collection="list" item="item" open="(" separator=", ">
-            #{item.id,jdbcType=INTEGER}
-        </foreach>
-    </update>
-    <insert id="batchInsert" parameterType="map">
-        <!--@mbg.generated-->
-        insert into sys_user_role
-                (id, user_id, role_id, create_time)
-                values
-        <foreach collection="list" item="item" separator=",">
-            (#{item.id,jdbcType=INTEGER}, #{item.userId,jdbcType=INTEGER}, #{item.roleId,jdbcType=INTEGER},
-             #{item.createTime,jdbcType=TIMESTAMP})
-        </foreach>
-    </insert>
-</mapper>

+ 121 - 0
backend-admin/src/test/java/CodeGenerator.java

@@ -0,0 +1,121 @@
+import com.baomidou.mybatisplus.core.toolkit.StringPool;
+import com.baomidou.mybatisplus.generator.AutoGenerator;
+import com.baomidou.mybatisplus.generator.InjectionConfig;
+import com.baomidou.mybatisplus.generator.config.*;
+import com.baomidou.mybatisplus.generator.config.po.TableInfo;
+import com.baomidou.mybatisplus.generator.config.rules.DateType;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description 执行 main 方法自动生成对应项目目录中,具体内容参考文档【https://baomidou.com/guide/generator.html】
+ *              可以快速生成 Entity、Mapper、Mapper XML、Service、Controller 等各个模块的代码
+ * @author zzj
+ * @date 2020/10/12
+ */
+public class CodeGenerator {
+
+    //需要生成代码的表名,多个表之间用逗号分隔
+    static String tableName = "cnd_person";
+
+    //逻辑删除字段名, 假如表没有逻辑删除字段,请忽视
+//    static String logicDeleteFieldName = "del_flag";
+
+    public static void main(String[] args) {
+        // 代码生成器
+        AutoGenerator mpg = new AutoGenerator();
+
+        // 全局配置
+        GlobalConfig gc = new GlobalConfig();
+        //获取要生成的包路径
+        String projectPath = System.getProperty("user.dir");
+        gc.setOutputDir(projectPath + "/src/main/java");
+        gc.setAuthor("zzj");
+        gc.setOpen(false);
+        gc.setBaseColumnList(true);
+        gc.setBaseResultMap(true);
+        gc.setDateType(DateType.ONLY_DATE);
+        //实体属性 Swagger2 注解
+        gc.setSwagger2(true);
+        mpg.setGlobalConfig(gc);
+
+        // 数据源配置
+        DataSourceConfig dsc = new DataSourceConfig();
+        dsc.setUrl("jdbc:mysql://localhost:3306/ittimbackend?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=UTC");
+        // dsc.setSchemaName("public");
+        dsc.setDriverName("com.mysql.cj.jdbc.Driver");
+        dsc.setUsername("root");
+        dsc.setPassword("root");
+        mpg.setDataSource(dsc);
+
+        // 包配置
+        PackageConfig pc = new PackageConfig();
+        pc.setParent("com.ittim.admin");
+        pc.setEntity("entity");
+        pc.setMapper("mapper");
+        pc.setController("controller");
+        mpg.setPackageInfo(pc);
+
+        // 自定义配置
+        InjectionConfig cfg = new InjectionConfig() {
+            @Override
+            public void initMap() {
+                // to do nothing
+            }
+        };
+
+        // 如果模板引擎是 freemarker
+        String templatePath = "/templates/mapper.xml.ftl";
+        // 如果模板引擎是 velocity
+        // String templatePath = "/templates/mapper.xml.vm";
+
+        // 自定义输出配置
+        List<FileOutConfig> focList = new ArrayList<>();
+        // 自定义配置会被优先输出
+        focList.add(new FileOutConfig(templatePath) {
+            @Override
+            public String outputFile(TableInfo tableInfo) {
+                // 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
+                return projectPath + "/src/main/resources/mappers/" +
+                        tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
+            }
+        });
+        cfg.setFileOutConfigList(focList);
+        mpg.setCfg(cfg);
+
+        // 配置模板
+        TemplateConfig templateConfig = new TemplateConfig();
+
+        // 配置自定义输出模板
+        //指定自定义模板路径,注意不要带上.ftl/.vm, 会根据使用的模板引擎自动识别
+        //templateConfig.setEntity("templates/entity.java");
+        // templateConfig.setService();
+        templateConfig.setController("templates/controller.java");
+
+        templateConfig.setXml(null);
+        mpg.setTemplate(templateConfig);
+
+        // 策略配置
+        StrategyConfig strategy = new StrategyConfig();
+        strategy.setNaming(NamingStrategy.underline_to_camel);
+        strategy.setColumnNaming(NamingStrategy.underline_to_camel);
+//        strategy.setSuperEntityClass("你自己的父类实体,没有就不用设置!");
+        strategy.setEntityLombokModel(true);
+        strategy.setRestControllerStyle(true);
+        // 公共父类
+//        strategy.setSuperControllerClass("你自己的父类控制器,没有就不用设置!");
+        // 写于父类中的公共字段
+//        strategy.setSuperEntityColumns("id");
+        strategy.setInclude(tableName.split(","));
+        strategy.setControllerMappingHyphenStyle(true);
+//        strategy.setLogicDeleteFieldName(logicDeleteFieldName); // 逻辑删除字段名称
+        strategy.setTablePrefix(pc.getModuleName() + "_");
+        mpg.setStrategy(strategy);
+        mpg.setTemplateEngine(new FreemarkerTemplateEngine());
+        mpg.execute();
+    }
+
+}

+ 94 - 0
backend-admin/src/test/resources/templates/controller.java.ftl

@@ -0,0 +1,94 @@
+package ${package.Controller};
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ittim.common.enums.ResultCode;
+import com.ittim.common.util.Result;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import org.springframework.web.bind.annotation.*;
+import ${package.Service}.${table.serviceName};
+import ${package.Entity}.${entity};
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import javax.annotation.Resource;
+<#if restControllerStyle>
+import org.springframework.web.bind.annotation.RestController;
+<#else>
+import org.springframework.stereotype.Controller;
+</#if>
+<#if superControllerClassPackage??>
+import ${superControllerClassPackage};
+</#if>
+
+/**
+ * <p>
+ * ${table.comment!} 前端控制器
+ * </p>
+ *
+ * @author ${author}
+ * @since ${date}
+ */
+<#if restControllerStyle>
+@Api(tags = {"${table.controllerName}-${table.comment!}"})
+@Slf4j
+@RestController
+<#else>
+@Controller
+</#if>
+@RequestMapping("<#if package.ModuleName??>/${package.ModuleName}</#if>/<#if controllerMappingHyphenStyle??>${controllerMappingHyphen}<#else>${table.entityPath}</#if>")
+<#if kotlin>
+class ${table.controllerName}<#if superControllerClass??>:${superControllerClass}()</#if>
+<#else>
+<#if superControllerClass??>public class ${table.controllerName} extends ${superControllerClass}{
+<#else>public class ${table.controllerName} {
+</#if>
+
+    @Resource
+    private ${table.serviceName} ${(table.serviceName?substring(1))?uncap_first};
+
+
+    @ApiOperation(value = "新增${table.comment!}")
+    @PostMapping("add")
+    public Result add(@RequestBody ${entity} ${entity?uncap_first}){
+        boolean save = ${(table.serviceName?substring(1))?uncap_first}.save(${entity?uncap_first});
+        return save ? Result.success() : Result.error(ResultCode.FAILED);
+    }
+
+    @ApiOperation(value = "删除${table.comment!}")
+    @PostMapping("delete/{id}")
+    public Result delete(@PathVariable("id") Long id){
+        boolean remove = ${(table.serviceName?substring(1))?uncap_first}.removeById(id);
+        return remove ? Result.success() : Result.error(ResultCode.FAILED);
+    }
+
+    @ApiOperation(value = "更新${table.comment!}")
+    @PostMapping("update")
+    public Result update(@RequestBody ${entity} ${entity?uncap_first}){
+        boolean update = ${(table.serviceName?substring(1))?uncap_first}.updateById(${entity?uncap_first});
+        return update ? Result.success() : Result.error(ResultCode.FAILED);
+    }
+
+    @ApiOperation(value = "查询${table.comment!}分页数据")
+    @ApiImplicitParams({
+        @ApiImplicitParam(name = "currentPage", value = "页码"),
+        @ApiImplicitParam(name = "pageCount", value = "每页条数")
+    })
+    @GetMapping("listByPage")
+    public Result findListByPage(@RequestParam Integer currentPage,
+                                   @RequestParam Integer pageCount){
+        IPage<${entity}> page = new Page<>(currentPage,pageCount);
+        IPage<${entity}> iPage = ${(table.serviceName?substring(1))?uncap_first}.page(page);
+        return Result.success(iPage);
+    }
+
+    @ApiOperation(value = "id查询${table.comment!}")
+    @GetMapping("getById/{id}")
+    public Result findById(@PathVariable Long id){
+        return Result.success(${(table.serviceName?substring(1))?uncap_first}.getById(id));
+    }
+
+}
+</#if>

+ 9 - 12
backend-common/src/main/java/com/ittim/common/enums/Status.java

@@ -1,15 +1,14 @@
 package com.ittim.common.enums;
 
-import com.baomidou.mybatisplus.extension.api.IErrorCode;
 import lombok.Getter;
 
 /**
  * @author zzj
- * @Description 通用状态码
+ * @Description 定义响应状态码
  * @date 2020/9/26
  */
 @Getter
-public enum Status implements IErrorCode {
+public enum ResultCode {
     /**
      * 操作成功!
      */
@@ -18,7 +17,7 @@ public enum Status implements IErrorCode {
     /**
      * 失败
      */
-    FAILED(500, "操作失败"),
+    FAILED(500, "操作失败"),
 
     /**
      * 操作异常!
@@ -105,18 +104,18 @@ public enum Status implements IErrorCode {
      */
     CAPTCHA_INCORRECT(5005, "验证码不正确!");
 
-    private final long code;
+    private final int code;
 
     private final String msg;
 
-    Status(final long code, final String msg) {
+    ResultCode(final int code, final String msg) {
         this.code = code;
         this.msg = msg;
     }
 
-    public static Status fromCode(long code) {
-        Status[] ecs = Status.values();
-        for (Status ec : ecs) {
+    public static ResultCode fromCode(int code) {
+        ResultCode[] ecs = ResultCode.values();
+        for (ResultCode ec : ecs) {
             if (ec.getCode() == code) {
                 return ec;
             }
@@ -124,12 +123,10 @@ public enum Status implements IErrorCode {
         return SUCCESS;
     }
 
-    @Override
-    public long getCode() {
+    public int getCode() {
         return code;
     }
 
-    @Override
     public String getMsg() {
         return msg;
     }

+ 60 - 0
backend-common/src/main/java/com/ittim/common/util/Result.java

@@ -0,0 +1,60 @@
+package com.ittim.common.util;
+
+import com.ittim.common.enums.ResultCode;
+
+/**
+ * @author zzj
+ * @Description 统一响应结果封装
+ * @date 2020/10/13
+ */
+public class Result {
+
+    private int code;
+    private String msg;
+    private Object data;
+
+    public int getCode() {
+        return code;
+    }
+
+    public void setCode(int code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    public Object getData() {
+        return data;
+    }
+
+    public void setData(Object data) {
+        this.data = data;
+    }
+
+    public static Result error(ResultCode resultCode) {
+        Result result = new Result();
+        result.setCode(resultCode.getCode());
+        result.setMsg(resultCode.getMsg());
+        result.setData(null);
+        return result;
+    }
+
+    public static Result success() {
+        return success(null);
+    }
+
+    public static Result success(Object data) {
+        Result result = new Result();
+        result.setCode(ResultCode.SUCCESS.getCode());
+        result.setMsg(ResultCode.SUCCESS.getMsg());
+        result.setData(data);
+        return result;
+    }
+
+}

+ 42 - 13
pom.xml

@@ -29,7 +29,7 @@
         <alibaba.fastjson>1.2.72</alibaba.fastjson>
         <springfox.swagger>2.9.2</springfox.swagger>
         <user.agent.version>1.20</user.agent.version>
-        <mybatis.plus.version>3.1.0</mybatis.plus.version>
+        <mybatis-plus.version>3.3.0</mybatis-plus.version>
         <jakarta.validation.version>2.0.1</jakarta.validation.version>
     </properties>
 
@@ -61,11 +61,6 @@
         </dependency>
 
         <dependency>
-            <groupId>org.projectlombok</groupId>
-            <artifactId>lombok</artifactId>
-            <optional>true</optional>
-        </dependency>
-        <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-test</artifactId>
             <scope>test</scope>
@@ -121,19 +116,43 @@
             <version>2.1.5.RELEASE</version>
         </dependency>
         <dependency>
+            <groupId>redis.clients</groupId>
+            <artifactId>jedis</artifactId>
+            <version>${jedis.version}</version>
+        </dependency>
+        <!--MyBatis 及 插件依赖-->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
+            <version>2.5.5</version>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus</artifactId>
+            <version>${mybatis-plus.version}</version>
+        </dependency>
+        <dependency>
             <groupId>com.baomidou</groupId>
             <artifactId>mybatis-plus-boot-starter</artifactId>
-            <version>${mybatis.plus.version}</version>
+            <version>${mybatis-plus.version}</version>
         </dependency>
         <dependency>
-            <groupId>com.github.whvcse</groupId>
-            <artifactId>jwtp-spring-boot-starter</artifactId>
-            <version>3.1.1</version>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-generator</artifactId>
+            <version>${mybatis-plus.version}</version>
         </dependency>
         <dependency>
-            <groupId>redis.clients</groupId>
-            <artifactId>jedis</artifactId>
-            <version>${jedis.version}</version>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>1.18.10</version>
+            <scope>provided</scope>
+        </dependency>
+        <!--代码生成器依赖-->
+        <dependency>
+            <groupId>org.freemarker</groupId>
+            <artifactId>freemarker</artifactId>
+            <version>2.3.30</version>
+            <scope>test</scope>
         </dependency>
         <!--fastjson-->
         <dependency>
@@ -160,6 +179,16 @@
             <!--在引用时请在maven中央仓库搜索最新版本号-->
             <version>2.0.2</version>
         </dependency>
+        <!--常用库依赖-->
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <version>3.6</version>
+        </dependency>
     </dependencies>
 
     <!-- 阿里云maven仓库 -->