Browse Source

社区小程序代码上传, 新增首页文章信息接口

fangzhen 9 months ago
parent
commit
ab39418d5e
19 changed files with 954 additions and 341 deletions
  1. 2 2
      ruoyi-admin/src/main/resources/application-druid.yml
  2. 3 3
      ruoyi-admin/src/main/resources/application.yml
  3. 5 0
      ruoyi-common/pom.xml
  4. 11 1
      ruoyi-generator/pom.xml
  5. 44 0
      ruoyi-generator/src/main/java/com/ruoyi/generator/controller/CommunityArticleController.java
  6. 57 0
      ruoyi-generator/src/main/java/com/ruoyi/generator/domain/Community/CommunityArticle.java
  7. 40 0
      ruoyi-generator/src/main/java/com/ruoyi/generator/domain/Community/CommunityArticleImages.java
  8. 52 0
      ruoyi-generator/src/main/java/com/ruoyi/generator/domain/Community/CommunityUser.java
  9. 25 0
      ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/community/CommunityArticleImagesMapper.java
  10. 22 0
      ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/community/CommunityArticleMapper.java
  11. 15 0
      ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/community/CommunityUserMapper.java
  12. 36 0
      ruoyi-generator/src/main/java/com/ruoyi/generator/service/CommunityArticleServiceImpl.java
  13. 22 0
      ruoyi-generator/src/main/java/com/ruoyi/generator/service/ICommunityArticleService.java
  14. 69 0
      ruoyi-generator/src/main/java/com/ruoyi/generator/vo/CommunityArticleVo.java
  15. 91 0
      ruoyi-generator/src/main/resources/mapper/community/ArticleMapper.xml
  16. 106 0
      ruoyi-generator/src/main/resources/mapper/community/CommunityArticleImagesMapper.xml
  17. 19 0
      ruoyi-generator/src/main/resources/mapper/community/CommunityUserMapper.xml
  18. 126 126
      ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml
  19. 209 209
      ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml

+ 2 - 2
ruoyi-admin/src/main/resources/application-druid.yml

@@ -6,9 +6,9 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                url: jdbc:mysql://121.4.140.159:3306/ruoyi-community?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                 username: root
-                password: password
+                password: fangzhen,7410
             # 从库数据源
             slave:
                 # 从数据源开关/默认关闭

+ 3 - 3
ruoyi-admin/src/main/resources/application.yml

@@ -68,13 +68,13 @@ spring:
   # redis 配置
   redis:
     # 地址
-    host: localhost
+    host: 121.4.140.159
     # 端口,默认为6379
     port: 6379
     # 数据库索引
     database: 0
     # 密码
-    password:
+    password: fangzhen,7410
     # 连接超时时间
     timeout: 10s
     lettuce:
@@ -117,7 +117,7 @@ swagger:
   # 是否开启swagger
   enabled: true
   # 请求前缀
-  pathMapping: /dev-api
+  pathMapping: /
 
 # 防止XSS攻击
 xss:

+ 5 - 0
ruoyi-common/pom.xml

@@ -119,6 +119,11 @@
             <artifactId>javax.servlet-api</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+
     </dependencies>
 
 </project>

+ 11 - 1
ruoyi-generator/pom.xml

@@ -34,7 +34,17 @@
             <groupId>com.alibaba</groupId>
             <artifactId>druid-spring-boot-starter</artifactId>
         </dependency>
-
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 -->
+        <dependency>
+            <groupId>io.swagger</groupId>
+            <artifactId>swagger-models</artifactId>
+            <version>1.6.2</version>
+        </dependency>
     </dependencies>
 
 </project>

+ 44 - 0
ruoyi-generator/src/main/java/com/ruoyi/generator/controller/CommunityArticleController.java

@@ -0,0 +1,44 @@
+package com.ruoyi.generator.controller;
+
+import com.ruoyi.common.annotation.Anonymous;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.generator.domain.Community.CommunityArticle;
+import com.ruoyi.generator.service.ICommunityArticleService;
+import com.ruoyi.generator.vo.CommunityArticleVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 社区文章管理
+ * 
+ * @author fangzhen
+ */
+@Api(tags = "社区文章管理")
+@RestController
+@RequestMapping("/community/article")
+public class CommunityArticleController extends BaseController
+{
+    @Autowired
+    private ICommunityArticleService communityArticleService;
+
+
+    /**
+     * 获取文章列表信息
+     */
+    @ApiOperation("获取文章列表")
+    @GetMapping("/list")
+    @Anonymous
+    public TableDataInfo genList(CommunityArticle communityArticle)
+    {
+        startPage();
+        List<CommunityArticleVo> list = communityArticleService.selectCommunityArticleList(communityArticle);
+        return getDataTable(list);
+    }
+}

+ 57 - 0
ruoyi-generator/src/main/java/com/ruoyi/generator/domain/Community/CommunityArticle.java

@@ -0,0 +1,57 @@
+package com.ruoyi.generator.domain.Community;
+
+import com.ruoyi.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.hibernate.validator.constraints.Length;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import java.io.Serializable;
+
+/**
+* 
+* @TableName community_article
+*/
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@AllArgsConstructor
+public class CommunityArticle extends BaseEntity implements Serializable {
+
+    /**
+    * 文章id
+    */
+    @NotNull(message="[文章id]不能为空")
+    @ApiModelProperty("文章id")
+    private Long articleId;
+    /**
+    * 创建人id
+    */
+    @NotNull(message="[创建人id]不能为空")
+    @ApiModelProperty("创建人id")
+    private Integer userId;
+    /**
+    * 文章标题
+    */
+    @NotBlank(message="[文章标题]不能为空")
+    @Size(max= 255,message="编码长度不能超过255")
+    @Length(max= 255,message="编码长度不能超过255")
+    @ApiModelProperty("文章标题")
+    private String title;
+    /**
+    * 文章内容
+    */
+    @ApiModelProperty("文章内容")
+    private String content;
+    /**
+    * 图片URL
+    */
+    @NotBlank(message="[图片ID]不能为空")
+    @ApiModelProperty("图片ID")
+    private String imageId;
+}

+ 40 - 0
ruoyi-generator/src/main/java/com/ruoyi/generator/domain/Community/CommunityArticleImages.java

@@ -0,0 +1,40 @@
+package com.ruoyi.generator.domain.Community;
+
+import com.ruoyi.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 文章上传的图片
+ * @TableName community_article_images
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class CommunityArticleImages extends BaseEntity implements Serializable {
+    /**
+     * 图片id
+     */
+    @ApiModelProperty("图片id")
+    private Integer imageId;
+
+    /**
+     * 文章id
+     */
+    @ApiModelProperty("文章id")
+    private Integer articleId;
+
+    /**
+     * 图片地址
+     */
+    @ApiModelProperty("图片地址")
+    private String imageUrl;
+
+    private static final long serialVersionUID = 1L;
+}

+ 52 - 0
ruoyi-generator/src/main/java/com/ruoyi/generator/domain/Community/CommunityUser.java

@@ -0,0 +1,52 @@
+package com.ruoyi.generator.domain.Community;
+
+import com.ruoyi.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 用户表
+ * @TableName community_user
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@AllArgsConstructor
+public class CommunityUser extends BaseEntity implements Serializable {
+    /**
+     * 用户id
+     */
+    @ApiModelProperty("用户id")
+    private Integer userId;
+
+    /**
+     * 用户名称
+     */
+    @ApiModelProperty("用户名称")
+    private String username;
+
+    /**
+     * 用户密码
+     */
+    @ApiModelProperty("用户密码")
+    private String password;
+
+    /**
+     * 用户邮箱
+     */
+    @ApiModelProperty("用户邮箱")
+    private String email;
+
+    /**
+     * 头像地址
+     */
+    @ApiModelProperty("头像地址")
+    private String pictureUrl;
+
+    private static final long serialVersionUID = 1L;
+}

+ 25 - 0
ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/community/CommunityArticleImagesMapper.java

@@ -0,0 +1,25 @@
+package com.ruoyi.generator.mapper.community;
+
+import com.ruoyi.generator.domain.Community.CommunityArticleImages;
+
+/**
+* @author Administrator
+* @description 针对表【community_article_images(文章上传的图片)】的数据库操作Mapper
+* @createDate 2024-08-24 17:04:17
+* @Entity com.ruoyi.generator.domain.Community.CommunityArticleImages
+*/
+public interface CommunityArticleImagesMapper {
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(CommunityArticleImages record);
+
+    int insertSelective(CommunityArticleImages record);
+
+    CommunityArticleImages selectByPrimaryKey(Long id);
+
+    int updateByPrimaryKeySelective(CommunityArticleImages record);
+
+    int updateByPrimaryKey(CommunityArticleImages record);
+
+}

+ 22 - 0
ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/community/CommunityArticleMapper.java

@@ -0,0 +1,22 @@
+package com.ruoyi.generator.mapper.community;
+
+import com.ruoyi.generator.domain.Community.CommunityArticle;
+import com.ruoyi.generator.vo.CommunityArticleVo;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+* @author Administrator
+* @description 针对表【community_user(用户表)】的数据库操作Mapper
+* @createDate 2024-08-24 15:35:46
+* @Entity com.ruoyi.generator.domain.Community.CommunityUser
+*/
+@Mapper
+public interface CommunityArticleMapper {
+    List<CommunityArticleVo> selectCommunityArticleList(CommunityArticle communityArticle);
+}
+
+
+
+

+ 15 - 0
ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/community/CommunityUserMapper.java

@@ -0,0 +1,15 @@
+package com.ruoyi.generator.mapper.community;
+
+/**
+* @author Administrator
+* @description 针对表【community_user(用户表)】的数据库操作Mapper
+* @createDate 2024-08-24 15:35:46
+* @Entity com.ruoyi.generator.domain.Community.CommunityUser
+*/
+public interface CommunityUserMapper {
+
+}
+
+
+
+

+ 36 - 0
ruoyi-generator/src/main/java/com/ruoyi/generator/service/CommunityArticleServiceImpl.java

@@ -0,0 +1,36 @@
+package com.ruoyi.generator.service;
+
+import com.ruoyi.generator.domain.Community.CommunityArticle;
+import com.ruoyi.generator.mapper.community.CommunityArticleMapper;
+import com.ruoyi.generator.vo.CommunityArticleVo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 业务 服务层实现
+ * 
+ * @author ruoyi
+ */
+@Service
+public class CommunityArticleServiceImpl implements ICommunityArticleService
+{
+    private static final Logger log = LoggerFactory.getLogger(CommunityArticleServiceImpl.class);
+
+    @Autowired
+    private CommunityArticleMapper communityArticleMapper;
+
+    /**
+     * 查询文章列表
+     *
+     * @param communityArticle 文章信息
+     * @return 文章信息集合
+     */
+    @Override
+    public List<CommunityArticleVo> selectCommunityArticleList(CommunityArticle communityArticle) {
+        return communityArticleMapper.selectCommunityArticleList(communityArticle);
+    }
+}

+ 22 - 0
ruoyi-generator/src/main/java/com/ruoyi/generator/service/ICommunityArticleService.java

@@ -0,0 +1,22 @@
+package com.ruoyi.generator.service;
+
+import com.ruoyi.generator.domain.Community.CommunityArticle;
+import com.ruoyi.generator.vo.CommunityArticleVo;
+
+import java.util.List;
+
+/**
+ * 业务 服务层
+ * 
+ * @author ruoyi
+ */
+public interface ICommunityArticleService
+{
+    /**
+     * 查询文章列表
+     * 
+     * @param communityArticle 文章信息
+     * @return 文章信息集合
+     */
+    List<CommunityArticleVo> selectCommunityArticleList(CommunityArticle communityArticle);
+}

+ 69 - 0
ruoyi-generator/src/main/java/com/ruoyi/generator/vo/CommunityArticleVo.java

@@ -0,0 +1,69 @@
+package com.ruoyi.generator.vo;
+
+import com.ruoyi.common.core.domain.BaseEntity;
+import com.ruoyi.generator.domain.Community.CommunityArticleImages;
+import com.ruoyi.generator.domain.Community.CommunityUser;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.hibernate.validator.constraints.Length;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import java.io.Serializable;
+import java.util.List;
+
+/**
+* 
+* @TableName community_article
+*/
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@AllArgsConstructor
+@ApiModel(value = "ArticleEntity", description = "文章实体")
+public class CommunityArticleVo extends BaseEntity implements Serializable {
+
+    /**
+    * 文章id
+    */
+    @NotNull(message="[文章id]不能为空")
+    @ApiModelProperty("文章id")
+    private Long articleId;
+    /**
+    * 创建人id
+    */
+    @NotNull(message="[创建人id]不能为空")
+    @ApiModelProperty("创建人id")
+    private Integer userId;
+    /**
+    * 文章标题
+    */
+    @NotBlank(message="[文章标题]不能为空")
+    @Size(max= 255,message="编码长度不能超过255")
+    @Length(max= 255,message="编码长度不能超过255")
+    @ApiModelProperty("文章标题")
+    private String title;
+    /**
+    * 文章内容
+    */
+    @ApiModelProperty("文章内容")
+    private String content;
+    /**
+    * 图片URL
+    */
+    @NotBlank(message="[图片ID]不能为空")
+    @ApiModelProperty("图片ID")
+    private String imageId;
+
+    @ApiModelProperty("文章图片集合")
+    private List<CommunityArticleImages> imageList;
+
+    @ApiModelProperty("文章所属用户信息")
+    private CommunityUser communityUser;
+
+}

+ 91 - 0
ruoyi-generator/src/main/resources/mapper/community/ArticleMapper.xml

@@ -0,0 +1,91 @@
+<?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.ruoyi.generator.mapper.community.CommunityArticleMapper">
+
+    <resultMap type="com.ruoyi.generator.vo.CommunityArticleVo" id="CommunityArticleVoResult">
+        <id property="articleId" column="article_id"/>
+        <result property="userId" column="user_id"/>
+        <result property="title" column="title"/>
+        <result property="content" column="content"/>
+        <result property="imageId" column="image_id"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="remark" column="remark"/>
+        <collection property="imageList" javaType="java.util.List" resultMap="CommunityArticleImagesResult"/>
+        <collection property="communityUser" resultMap="CommunityUserResult"/>
+    </resultMap>
+
+    <resultMap type="CommunityArticleImages" id="CommunityArticleImagesResult">
+        <id property="imageId" column="image_id"/>
+        <result property="articleId" column="article_id"/>
+        <result property="imageUrl" column="image_url"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="remark" column="remark"/>
+    </resultMap>
+
+    <resultMap type="CommunityUser" id="CommunityUserResult">
+        <id property="userId" column="user_id"/>
+        <result property="username" column="username"/>
+        <result property="password" column="password"/>
+        <result property="email" column="email"/>
+        <result property="pictureUrl" column="picture_url"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="remark" column="remark"/>
+    </resultMap>
+
+    <sql id="selectCommunityArticleVo">
+        select article_id,
+               user_id,
+               title,
+               content,
+               image_id,
+               create_by,
+               create_time,
+               update_by,
+               update_time,
+               remark
+        from community_article
+    </sql>
+
+    <select id="selectCommunityArticleList" parameterType="CommunityArticle" resultMap="CommunityArticleVoResult">
+        select a.article_id,
+        a.user_id,
+        a.title,
+        a.content,
+        a.image_id,
+        a.create_by,
+        a.create_time,
+        a.update_by,
+        a.update_time,
+        a.remark,
+        b.image_id,
+        b.article_id,
+        b.image_url,
+        b.create_by,
+        b.create_time,
+        b.update_by,
+        b.update_time,
+        b.remark,
+        c.username,
+        c.email,
+        c.picture_url from
+        community_article a
+        left join community_article_images b on a.article_id = b.article_id
+        left join community_user c on a.user_id = c.user_id
+        <where>
+            <if test="title != null and title != ''">
+                AND title like concat('%', #{title}, '%')
+            </if>
+        </where>
+    </select>
+</mapper>

+ 106 - 0
ruoyi-generator/src/main/resources/mapper/community/CommunityArticleImagesMapper.xml

@@ -0,0 +1,106 @@
+<?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.ruoyi.generator.mapper.community.CommunityArticleImagesMapper">
+
+    <resultMap id="BaseResultMap" type="com.ruoyi.generator.domain.Community.CommunityArticleImages">
+            <id property="imageId" column="image_id" jdbcType="INTEGER"/>
+            <result property="articleId" column="article_id" jdbcType="INTEGER"/>
+            <result property="imageUrl" column="image_url" jdbcType="VARCHAR"/>
+            <result property="createBy" column="create_by" jdbcType="INTEGER"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+            <result property="updateBy" column="update_by" jdbcType="INTEGER"/>
+            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+            <result property="remark" column="remark" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        image_id,article_id,image_url,
+        create_by,create_time,update_by,
+        update_time,remark
+    </sql>
+
+    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List" />
+        from community_article_images
+        where  image_id = #{imageId,jdbcType=INTEGER} 
+    </select>
+
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+        delete from community_article_images
+        where  image_id = #{imageId,jdbcType=INTEGER} 
+    </delete>
+    <insert id="insert" keyColumn="image_id" keyProperty="imageId" parameterType="com.ruoyi.generator.domain.Community.CommunityArticleImages" useGeneratedKeys="true">
+        insert into community_article_images
+        ( image_id,article_id,image_url
+        ,create_by,create_time,update_by
+        ,update_time,remark)
+        values (#{imageId,jdbcType=INTEGER},#{articleId,jdbcType=INTEGER},#{imageUrl,jdbcType=VARCHAR}
+        ,#{createBy,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateBy,jdbcType=INTEGER}
+        ,#{updateTime,jdbcType=TIMESTAMP},#{remark,jdbcType=VARCHAR})
+    </insert>
+    <insert id="insertSelective" keyColumn="image_id" keyProperty="imageId" parameterType="com.ruoyi.generator.domain.Community.CommunityArticleImages" useGeneratedKeys="true">
+        insert into community_article_images
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+                <if test="imageId != null">image_id,</if>
+                <if test="articleId != null">article_id,</if>
+                <if test="imageUrl != null">image_url,</if>
+                <if test="createBy != null">create_by,</if>
+                <if test="createTime != null">create_time,</if>
+                <if test="updateBy != null">update_by,</if>
+                <if test="updateTime != null">update_time,</if>
+                <if test="remark != null">remark,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+                <if test="imageId != null">#{imageId,jdbcType=INTEGER},</if>
+                <if test="articleId != null">#{articleId,jdbcType=INTEGER},</if>
+                <if test="imageUrl != null">#{imageUrl,jdbcType=VARCHAR},</if>
+                <if test="createBy != null">#{createBy,jdbcType=INTEGER},</if>
+                <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
+                <if test="updateBy != null">#{updateBy,jdbcType=INTEGER},</if>
+                <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
+                <if test="remark != null">#{remark,jdbcType=VARCHAR},</if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.generator.domain.Community.CommunityArticleImages">
+        update community_article_images
+        <set>
+                <if test="articleId != null">
+                    article_id = #{articleId,jdbcType=INTEGER},
+                </if>
+                <if test="imageUrl != null">
+                    image_url = #{imageUrl,jdbcType=VARCHAR},
+                </if>
+                <if test="createBy != null">
+                    create_by = #{createBy,jdbcType=INTEGER},
+                </if>
+                <if test="createTime != null">
+                    create_time = #{createTime,jdbcType=TIMESTAMP},
+                </if>
+                <if test="updateBy != null">
+                    update_by = #{updateBy,jdbcType=INTEGER},
+                </if>
+                <if test="updateTime != null">
+                    update_time = #{updateTime,jdbcType=TIMESTAMP},
+                </if>
+                <if test="remark != null">
+                    remark = #{remark,jdbcType=VARCHAR},
+                </if>
+        </set>
+        where   image_id = #{imageId,jdbcType=INTEGER} 
+    </update>
+    <update id="updateByPrimaryKey" parameterType="com.ruoyi.generator.domain.Community.CommunityArticleImages">
+        update community_article_images
+        set 
+            article_id =  #{articleId,jdbcType=INTEGER},
+            image_url =  #{imageUrl,jdbcType=VARCHAR},
+            create_by =  #{createBy,jdbcType=INTEGER},
+            create_time =  #{createTime,jdbcType=TIMESTAMP},
+            update_by =  #{updateBy,jdbcType=INTEGER},
+            update_time =  #{updateTime,jdbcType=TIMESTAMP},
+            remark =  #{remark,jdbcType=VARCHAR}
+        where   image_id = #{imageId,jdbcType=INTEGER} 
+    </update>
+</mapper>

+ 19 - 0
ruoyi-generator/src/main/resources/mapper/community/CommunityUserMapper.xml

@@ -0,0 +1,19 @@
+<?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.ruoyi.generator.mapper.community.CommunityUserMapper">
+
+    <resultMap id="BaseResultMap" type="com.ruoyi.generator.domain.Community.CommunityUser">
+            <id property="userId" column="user_id" jdbcType="INTEGER"/>
+            <result property="username" column="username" jdbcType="VARCHAR"/>
+            <result property="password" column="password" jdbcType="VARCHAR"/>
+            <result property="email" column="email" jdbcType="VARCHAR"/>
+            <result property="pictureUrl" column="picture_url" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        user_id,username,password,
+        email,picture_url
+    </sql>
+</mapper>

+ 126 - 126
ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml

@@ -1,127 +1,127 @@
-<?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.ruoyi.generator.mapper.GenTableColumnMapper">
-
-    <resultMap type="GenTableColumn" id="GenTableColumnResult">
-        <id     property="columnId"       column="column_id"      />
-        <result property="tableId"        column="table_id"       />
-        <result property="columnName"     column="column_name"    />
-        <result property="columnComment"  column="column_comment" />
-        <result property="columnType"     column="column_type"    />
-        <result property="javaType"       column="java_type"      />
-        <result property="javaField"      column="java_field"     />
-        <result property="isPk"           column="is_pk"          />
-        <result property="isIncrement"    column="is_increment"   />
-        <result property="isRequired"     column="is_required"    />
-        <result property="isInsert"       column="is_insert"      />
-        <result property="isEdit"         column="is_edit"        />
-        <result property="isList"         column="is_list"        />
-        <result property="isQuery"        column="is_query"       />
-        <result property="queryType"      column="query_type"     />
-        <result property="htmlType"       column="html_type"      />
-        <result property="dictType"       column="dict_type"      />
-        <result property="sort"           column="sort"           />
-        <result property="createBy"       column="create_by"      />
-        <result property="createTime"     column="create_time"    />
-        <result property="updateBy"       column="update_by"      />
-        <result property="updateTime"     column="update_time"    />
-    </resultMap>
-
-	<sql id="selectGenTableColumnVo">
-        select column_id, table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, dict_type, sort, create_by, create_time, update_by, update_time from gen_table_column
-    </sql>
-
-    <select id="selectGenTableColumnListByTableId" parameterType="Long" resultMap="GenTableColumnResult">
-        <include refid="selectGenTableColumnVo"/>
-        where table_id = #{tableId}
-        order by sort
-    </select>
-
-    <select id="selectDbTableColumnsByName" parameterType="String" resultMap="GenTableColumnResult">
-		select column_name, (case when (is_nullable = 'no' <![CDATA[ && ]]> column_key != 'PRI') then '1' else '0' end) as is_required, (case when column_key = 'PRI' then '1' else '0' end) as is_pk, ordinal_position as sort, column_comment, (case when extra = 'auto_increment' then '1' else '0' end) as is_increment, column_type
-		from information_schema.columns where table_schema = (select database()) and table_name = (#{tableName})
-		order by ordinal_position
-	</select>
-
-    <insert id="insertGenTableColumn" parameterType="GenTableColumn" useGeneratedKeys="true" keyProperty="columnId">
-        insert into gen_table_column (
-			<if test="tableId != null and tableId != ''">table_id,</if>
-			<if test="columnName != null and columnName != ''">column_name,</if>
-			<if test="columnComment != null and columnComment != ''">column_comment,</if>
-			<if test="columnType != null and columnType != ''">column_type,</if>
-			<if test="javaType != null and javaType != ''">java_type,</if>
-			<if test="javaField != null  and javaField != ''">java_field,</if>
-			<if test="isPk != null and isPk != ''">is_pk,</if>
-			<if test="isIncrement != null and isIncrement != ''">is_increment,</if>
-			<if test="isRequired != null and isRequired != ''">is_required,</if>
-			<if test="isInsert != null and isInsert != ''">is_insert,</if>
-			<if test="isEdit != null and isEdit != ''">is_edit,</if>
-			<if test="isList != null and isList != ''">is_list,</if>
-			<if test="isQuery != null and isQuery != ''">is_query,</if>
-			<if test="queryType != null and queryType != ''">query_type,</if>
-			<if test="htmlType != null and htmlType != ''">html_type,</if>
-			<if test="dictType != null and dictType != ''">dict_type,</if>
-			<if test="sort != null">sort,</if>
-			<if test="createBy != null and createBy != ''">create_by,</if>
-			create_time
-         )values(
-			<if test="tableId != null and tableId != ''">#{tableId},</if>
-			<if test="columnName != null and columnName != ''">#{columnName},</if>
-			<if test="columnComment != null and columnComment != ''">#{columnComment},</if>
-			<if test="columnType != null and columnType != ''">#{columnType},</if>
-			<if test="javaType != null and javaType != ''">#{javaType},</if>
-			<if test="javaField != null and javaField != ''">#{javaField},</if>
-			<if test="isPk != null and isPk != ''">#{isPk},</if>
-			<if test="isIncrement != null and isIncrement != ''">#{isIncrement},</if>
-			<if test="isRequired != null and isRequired != ''">#{isRequired},</if>
-			<if test="isInsert != null and isInsert != ''">#{isInsert},</if>
-			<if test="isEdit != null and isEdit != ''">#{isEdit},</if>
-			<if test="isList != null and isList != ''">#{isList},</if>
-			<if test="isQuery != null and isQuery != ''">#{isQuery},</if>
-			<if test="queryType != null and queryType != ''">#{queryType},</if>
-			<if test="htmlType != null and htmlType != ''">#{htmlType},</if>
-			<if test="dictType != null and dictType != ''">#{dictType},</if>
-			<if test="sort != null">#{sort},</if>
-			<if test="createBy != null and createBy != ''">#{createBy},</if>
-			sysdate()
-         )
-    </insert>
-
-    <update id="updateGenTableColumn" parameterType="GenTableColumn">
-        update gen_table_column
-        <set>
-            <if test="columnComment != null">column_comment = #{columnComment},</if>
-            <if test="javaType != null">java_type = #{javaType},</if>
-            <if test="javaField != null">java_field = #{javaField},</if>
-            <if test="isInsert != null">is_insert = #{isInsert},</if>
-            <if test="isEdit != null">is_edit = #{isEdit},</if>
-            <if test="isList != null">is_list = #{isList},</if>
-            <if test="isQuery != null">is_query = #{isQuery},</if>
-            <if test="isRequired != null">is_required = #{isRequired},</if>
-            <if test="queryType != null">query_type = #{queryType},</if>
-            <if test="htmlType != null">html_type = #{htmlType},</if>
-            <if test="dictType != null">dict_type = #{dictType},</if>
-            <if test="sort != null">sort = #{sort},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            update_time = sysdate()
-        </set>
-        where column_id = #{columnId}
-    </update>
-
-    <delete id="deleteGenTableColumnByIds" parameterType="Long">
-        delete from gen_table_column where table_id in
-        <foreach collection="array" item="tableId" open="(" separator="," close=")">
-            #{tableId}
-        </foreach>
-    </delete>
-
-    <delete id="deleteGenTableColumns">
-        delete from gen_table_column where column_id in
-        <foreach collection="list" item="item" open="(" separator="," close=")">
-            #{item.columnId}
-        </foreach>
-    </delete>
-
+<?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.ruoyi.generator.mapper.GenTableColumnMapper">
+
+    <resultMap type="GenTableColumn" id="GenTableColumnResult">
+        <id     property="columnId"       column="column_id"      />
+        <result property="tableId"        column="table_id"       />
+        <result property="columnName"     column="column_name"    />
+        <result property="columnComment"  column="column_comment" />
+        <result property="columnType"     column="column_type"    />
+        <result property="javaType"       column="java_type"      />
+        <result property="javaField"      column="java_field"     />
+        <result property="isPk"           column="is_pk"          />
+        <result property="isIncrement"    column="is_increment"   />
+        <result property="isRequired"     column="is_required"    />
+        <result property="isInsert"       column="is_insert"      />
+        <result property="isEdit"         column="is_edit"        />
+        <result property="isList"         column="is_list"        />
+        <result property="isQuery"        column="is_query"       />
+        <result property="queryType"      column="query_type"     />
+        <result property="htmlType"       column="html_type"      />
+        <result property="dictType"       column="dict_type"      />
+        <result property="sort"           column="sort"           />
+        <result property="createBy"       column="create_by"      />
+        <result property="createTime"     column="create_time"    />
+        <result property="updateBy"       column="update_by"      />
+        <result property="updateTime"     column="update_time"    />
+    </resultMap>
+
+	<sql id="selectGenTableColumnVo">
+        select column_id, table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, dict_type, sort, create_by, create_time, update_by, update_time from gen_table_column
+    </sql>
+
+    <select id="selectGenTableColumnListByTableId" parameterType="Long" resultMap="GenTableColumnResult">
+        <include refid="selectGenTableColumnVo"/>
+        where table_id = #{tableId}
+        order by sort
+    </select>
+
+    <select id="selectDbTableColumnsByName" parameterType="String" resultMap="GenTableColumnResult">
+		select column_name, (case when (is_nullable = 'no' <![CDATA[ && ]]> column_key != 'PRI') then '1' else '0' end) as is_required, (case when column_key = 'PRI' then '1' else '0' end) as is_pk, ordinal_position as sort, column_comment, (case when extra = 'auto_increment' then '1' else '0' end) as is_increment, column_type
+		from information_schema.columns where table_schema = (select database()) and table_name = (#{tableName})
+		order by ordinal_position
+	</select>
+
+    <insert id="insertGenTableColumn" parameterType="GenTableColumn" useGeneratedKeys="true" keyProperty="columnId">
+        insert into gen_table_column (
+			<if test="tableId != null and tableId != ''">table_id,</if>
+			<if test="columnName != null and columnName != ''">column_name,</if>
+			<if test="columnComment != null and columnComment != ''">column_comment,</if>
+			<if test="columnType != null and columnType != ''">column_type,</if>
+			<if test="javaType != null and javaType != ''">java_type,</if>
+			<if test="javaField != null  and javaField != ''">java_field,</if>
+			<if test="isPk != null and isPk != ''">is_pk,</if>
+			<if test="isIncrement != null and isIncrement != ''">is_increment,</if>
+			<if test="isRequired != null and isRequired != ''">is_required,</if>
+			<if test="isInsert != null and isInsert != ''">is_insert,</if>
+			<if test="isEdit != null and isEdit != ''">is_edit,</if>
+			<if test="isList != null and isList != ''">is_list,</if>
+			<if test="isQuery != null and isQuery != ''">is_query,</if>
+			<if test="queryType != null and queryType != ''">query_type,</if>
+			<if test="htmlType != null and htmlType != ''">html_type,</if>
+			<if test="dictType != null and dictType != ''">dict_type,</if>
+			<if test="sort != null">sort,</if>
+			<if test="createBy != null and createBy != ''">create_by,</if>
+			create_time
+         )values(
+			<if test="tableId != null and tableId != ''">#{tableId},</if>
+			<if test="columnName != null and columnName != ''">#{columnName},</if>
+			<if test="columnComment != null and columnComment != ''">#{columnComment},</if>
+			<if test="columnType != null and columnType != ''">#{columnType},</if>
+			<if test="javaType != null and javaType != ''">#{javaType},</if>
+			<if test="javaField != null and javaField != ''">#{javaField},</if>
+			<if test="isPk != null and isPk != ''">#{isPk},</if>
+			<if test="isIncrement != null and isIncrement != ''">#{isIncrement},</if>
+			<if test="isRequired != null and isRequired != ''">#{isRequired},</if>
+			<if test="isInsert != null and isInsert != ''">#{isInsert},</if>
+			<if test="isEdit != null and isEdit != ''">#{isEdit},</if>
+			<if test="isList != null and isList != ''">#{isList},</if>
+			<if test="isQuery != null and isQuery != ''">#{isQuery},</if>
+			<if test="queryType != null and queryType != ''">#{queryType},</if>
+			<if test="htmlType != null and htmlType != ''">#{htmlType},</if>
+			<if test="dictType != null and dictType != ''">#{dictType},</if>
+			<if test="sort != null">#{sort},</if>
+			<if test="createBy != null and createBy != ''">#{createBy},</if>
+			sysdate()
+         )
+    </insert>
+
+    <update id="updateGenTableColumn" parameterType="GenTableColumn">
+        update gen_table_column
+        <set>
+            <if test="columnComment != null">column_comment = #{columnComment},</if>
+            <if test="javaType != null">java_type = #{javaType},</if>
+            <if test="javaField != null">java_field = #{javaField},</if>
+            <if test="isInsert != null">is_insert = #{isInsert},</if>
+            <if test="isEdit != null">is_edit = #{isEdit},</if>
+            <if test="isList != null">is_list = #{isList},</if>
+            <if test="isQuery != null">is_query = #{isQuery},</if>
+            <if test="isRequired != null">is_required = #{isRequired},</if>
+            <if test="queryType != null">query_type = #{queryType},</if>
+            <if test="htmlType != null">html_type = #{htmlType},</if>
+            <if test="dictType != null">dict_type = #{dictType},</if>
+            <if test="sort != null">sort = #{sort},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            update_time = sysdate()
+        </set>
+        where column_id = #{columnId}
+    </update>
+
+    <delete id="deleteGenTableColumnByIds" parameterType="Long">
+        delete from gen_table_column where table_id in
+        <foreach collection="array" item="tableId" open="(" separator="," close=")">
+            #{tableId}
+        </foreach>
+    </delete>
+
+    <delete id="deleteGenTableColumns">
+        delete from gen_table_column where column_id in
+        <foreach collection="list" item="item" open="(" separator="," close=")">
+            #{item.columnId}
+        </foreach>
+    </delete>
+
 </mapper>

+ 209 - 209
ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml

@@ -1,210 +1,210 @@
-<?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.ruoyi.generator.mapper.GenTableMapper">
-
-	<resultMap type="GenTable" id="GenTableResult">
-	    <id     property="tableId"        column="table_id"          />
-		<result property="tableName"      column="table_name"        />
-		<result property="tableComment"   column="table_comment"     />
-		<result property="subTableName"   column="sub_table_name"    />
-		<result property="subTableFkName" column="sub_table_fk_name" />
-		<result property="className"      column="class_name"        />
-		<result property="tplCategory"    column="tpl_category"      />
-		<result property="tplWebType"     column="tpl_web_type"      />
-		<result property="packageName"    column="package_name"      />
-		<result property="moduleName"     column="module_name"       />
-		<result property="businessName"   column="business_name"     />
-		<result property="functionName"   column="function_name"     />
-		<result property="functionAuthor" column="function_author"   />
-		<result property="genType"        column="gen_type"          />
-		<result property="genPath"        column="gen_path"          />
-		<result property="options"        column="options"           />
-		<result property="createBy"       column="create_by"         />
-		<result property="createTime"     column="create_time"       />
-		<result property="updateBy"       column="update_by"         />
-		<result property="updateTime"     column="update_time"       />
-		<result property="remark"         column="remark"            />
-		<collection  property="columns"   javaType="java.util.List"  resultMap="GenTableColumnResult" />
-	</resultMap>
-	
-	<resultMap type="GenTableColumn" id="GenTableColumnResult">
-        <id     property="columnId"       column="column_id"      />
-        <result property="tableId"        column="table_id"       />
-        <result property="columnName"     column="column_name"    />
-        <result property="columnComment"  column="column_comment" />
-        <result property="columnType"     column="column_type"    />
-        <result property="javaType"       column="java_type"      />
-        <result property="javaField"      column="java_field"     />
-        <result property="isPk"           column="is_pk"          />
-        <result property="isIncrement"    column="is_increment"   />
-        <result property="isRequired"     column="is_required"    />
-        <result property="isInsert"       column="is_insert"      />
-        <result property="isEdit"         column="is_edit"        />
-        <result property="isList"         column="is_list"        />
-        <result property="isQuery"        column="is_query"       />
-        <result property="queryType"      column="query_type"     />
-        <result property="htmlType"       column="html_type"      />
-        <result property="dictType"       column="dict_type"      />
-        <result property="sort"           column="sort"           />
-        <result property="createBy"       column="create_by"      />
-        <result property="createTime"     column="create_time"    />
-        <result property="updateBy"       column="update_by"      />
-        <result property="updateTime"     column="update_time"    />
-    </resultMap>
-	
-	<sql id="selectGenTableVo">
-        select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, tpl_web_type, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark from gen_table
-    </sql>
-    
-    <select id="selectGenTableList" parameterType="GenTable" resultMap="GenTableResult">
-		<include refid="selectGenTableVo"/>
-		<where>
-			<if test="tableName != null and tableName != ''">
-				AND lower(table_name) like lower(concat('%', #{tableName}, '%'))
-			</if>
-			<if test="tableComment != null and tableComment != ''">
-				AND lower(table_comment) like lower(concat('%', #{tableComment}, '%'))
-			</if>
-			<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
-				AND date_format(create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
-			</if>
-			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
-				AND date_format(create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
-			</if>
-		</where>
-	</select>
-
-	<select id="selectDbTableList" parameterType="GenTable" resultMap="GenTableResult">
-		select table_name, table_comment, create_time, update_time from information_schema.tables
-		where table_schema = (select database())
-		AND table_name NOT LIKE 'qrtz\_%' AND table_name NOT LIKE 'gen\_%'
-		AND table_name NOT IN (select table_name from gen_table)
-		<if test="tableName != null and tableName != ''">
-			AND lower(table_name) like lower(concat('%', #{tableName}, '%'))
-		</if>
-		<if test="tableComment != null and tableComment != ''">
-			AND lower(table_comment) like lower(concat('%', #{tableComment}, '%'))
-		</if>
-		<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
-			AND date_format(create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
-		</if>
-		<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
-			AND date_format(create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
-		</if>
-        order by create_time desc
-	</select>
-	
-	<select id="selectDbTableListByNames" resultMap="GenTableResult">
-		select table_name, table_comment, create_time, update_time from information_schema.tables
-		where table_name NOT LIKE 'qrtz\_%' and table_name NOT LIKE 'gen\_%' and table_schema = (select database())
-		and table_name in
-	    <foreach collection="array" item="name" open="(" separator="," close=")">
- 			#{name}
-        </foreach> 
-	</select>
-	
-	<select id="selectTableByName" parameterType="String" resultMap="GenTableResult">
-		select table_name, table_comment, create_time, update_time from information_schema.tables
-		where table_comment <![CDATA[ <> ]]> '' and table_schema = (select database())
-		and table_name = #{tableName}
-	</select>
-	
-	<select id="selectGenTableById" parameterType="Long" resultMap="GenTableResult">
-	    SELECT t.table_id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, t.class_name, t.tpl_category, t.tpl_web_type, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.gen_type, t.gen_path, t.options, t.remark,
-			   c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
-		FROM gen_table t
-			 LEFT JOIN gen_table_column c ON t.table_id = c.table_id
-		where t.table_id = #{tableId} order by c.sort
-	</select>
-	
-	<select id="selectGenTableByName" parameterType="String" resultMap="GenTableResult">
-	    SELECT t.table_id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, t.class_name, t.tpl_category, t.tpl_web_type, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.gen_type, t.gen_path, t.options, t.remark,
-			   c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
-		FROM gen_table t
-			 LEFT JOIN gen_table_column c ON t.table_id = c.table_id
-		where t.table_name = #{tableName} order by c.sort
-	</select>
-	
-	<select id="selectGenTableAll" parameterType="String" resultMap="GenTableResult">
-	    SELECT t.table_id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, t.class_name, t.tpl_category, t.tpl_web_type, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.options, t.remark,
-			   c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
-		FROM gen_table t
-			 LEFT JOIN gen_table_column c ON t.table_id = c.table_id
-		order by c.sort
-	</select>
-	
-	<insert id="insertGenTable" parameterType="GenTable" useGeneratedKeys="true" keyProperty="tableId">
-        insert into gen_table (
-			<if test="tableName != null">table_name,</if>
-			<if test="tableComment != null and tableComment != ''">table_comment,</if>
-			<if test="className != null and className != ''">class_name,</if>
-			<if test="tplCategory != null and tplCategory != ''">tpl_category,</if>
-			<if test="tplWebType != null and tplWebType != ''">tpl_web_type,</if>
-			<if test="packageName != null and packageName != ''">package_name,</if>
-			<if test="moduleName != null and moduleName != ''">module_name,</if>
-			<if test="businessName != null and businessName != ''">business_name,</if>
-			<if test="functionName != null and functionName != ''">function_name,</if>
-			<if test="functionAuthor != null and functionAuthor != ''">function_author,</if>
-			<if test="genType != null and genType != ''">gen_type,</if>
-			<if test="genPath != null and genPath != ''">gen_path,</if>
-			<if test="remark != null and remark != ''">remark,</if>
- 			<if test="createBy != null and createBy != ''">create_by,</if>
-			create_time
-         )values(
-			<if test="tableName != null">#{tableName},</if>
-			<if test="tableComment != null and tableComment != ''">#{tableComment},</if>
-			<if test="className != null and className != ''">#{className},</if>
-			<if test="tplCategory != null and tplCategory != ''">#{tplCategory},</if>
-			<if test="tplWebType != null and tplWebType != ''">#{tplWebType},</if>
-			<if test="packageName != null and packageName != ''">#{packageName},</if>
-			<if test="moduleName != null and moduleName != ''">#{moduleName},</if>
-			<if test="businessName != null and businessName != ''">#{businessName},</if>
-			<if test="functionName != null and functionName != ''">#{functionName},</if>
-			<if test="functionAuthor != null and functionAuthor != ''">#{functionAuthor},</if>
-			<if test="genType != null and genType != ''">#{genType},</if>
-			<if test="genPath != null and genPath != ''">#{genPath},</if>
-			<if test="remark != null and remark != ''">#{remark},</if>
- 			<if test="createBy != null and createBy != ''">#{createBy},</if>
-			sysdate()
-         )
-    </insert>
-    
-    <update id="createTable">
-        ${sql}
-    </update>
-    
-    <update id="updateGenTable" parameterType="GenTable">
-        update gen_table
-        <set>
-            <if test="tableName != null">table_name = #{tableName},</if>
-            <if test="tableComment != null and tableComment != ''">table_comment = #{tableComment},</if>
-            <if test="subTableName != null">sub_table_name = #{subTableName},</if>
-            <if test="subTableFkName != null">sub_table_fk_name = #{subTableFkName},</if>
-            <if test="className != null and className != ''">class_name = #{className},</if>
-            <if test="functionAuthor != null and functionAuthor != ''">function_author = #{functionAuthor},</if>
-            <if test="genType != null and genType != ''">gen_type = #{genType},</if>
-            <if test="genPath != null and genPath != ''">gen_path = #{genPath},</if>
-            <if test="tplCategory != null and tplCategory != ''">tpl_category = #{tplCategory},</if>
-            <if test="tplWebType != null and tplWebType != ''">tpl_web_type = #{tplWebType},</if>
-            <if test="packageName != null and packageName != ''">package_name = #{packageName},</if>
-            <if test="moduleName != null and moduleName != ''">module_name = #{moduleName},</if>
-            <if test="businessName != null and businessName != ''">business_name = #{businessName},</if>
-            <if test="functionName != null and functionName != ''">function_name = #{functionName},</if>
-            <if test="options != null and options != ''">options = #{options},</if>
-            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
-            <if test="remark != null">remark = #{remark},</if>
-            update_time = sysdate()
-        </set>
-        where table_id = #{tableId}
-    </update>
-    
-    <delete id="deleteGenTableByIds" parameterType="Long">
-        delete from gen_table where table_id in 
-        <foreach collection="array" item="tableId" open="(" separator="," close=")">
-            #{tableId}
-        </foreach>
-    </delete>
-
+<?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.ruoyi.generator.mapper.GenTableMapper">
+
+	<resultMap type="GenTable" id="GenTableResult">
+	    <id     property="tableId"        column="table_id"          />
+		<result property="tableName"      column="table_name"        />
+		<result property="tableComment"   column="table_comment"     />
+		<result property="subTableName"   column="sub_table_name"    />
+		<result property="subTableFkName" column="sub_table_fk_name" />
+		<result property="className"      column="class_name"        />
+		<result property="tplCategory"    column="tpl_category"      />
+		<result property="tplWebType"     column="tpl_web_type"      />
+		<result property="packageName"    column="package_name"      />
+		<result property="moduleName"     column="module_name"       />
+		<result property="businessName"   column="business_name"     />
+		<result property="functionName"   column="function_name"     />
+		<result property="functionAuthor" column="function_author"   />
+		<result property="genType"        column="gen_type"          />
+		<result property="genPath"        column="gen_path"          />
+		<result property="options"        column="options"           />
+		<result property="createBy"       column="create_by"         />
+		<result property="createTime"     column="create_time"       />
+		<result property="updateBy"       column="update_by"         />
+		<result property="updateTime"     column="update_time"       />
+		<result property="remark"         column="remark"            />
+		<collection  property="columns"   javaType="java.util.List"  resultMap="GenTableColumnResult" />
+	</resultMap>
+	
+	<resultMap type="GenTableColumn" id="GenTableColumnResult">
+        <id     property="columnId"       column="column_id"      />
+        <result property="tableId"        column="table_id"       />
+        <result property="columnName"     column="column_name"    />
+        <result property="columnComment"  column="column_comment" />
+        <result property="columnType"     column="column_type"    />
+        <result property="javaType"       column="java_type"      />
+        <result property="javaField"      column="java_field"     />
+        <result property="isPk"           column="is_pk"          />
+        <result property="isIncrement"    column="is_increment"   />
+        <result property="isRequired"     column="is_required"    />
+        <result property="isInsert"       column="is_insert"      />
+        <result property="isEdit"         column="is_edit"        />
+        <result property="isList"         column="is_list"        />
+        <result property="isQuery"        column="is_query"       />
+        <result property="queryType"      column="query_type"     />
+        <result property="htmlType"       column="html_type"      />
+        <result property="dictType"       column="dict_type"      />
+        <result property="sort"           column="sort"           />
+        <result property="createBy"       column="create_by"      />
+        <result property="createTime"     column="create_time"    />
+        <result property="updateBy"       column="update_by"      />
+        <result property="updateTime"     column="update_time"    />
+    </resultMap>
+	
+	<sql id="selectGenTableVo">
+        select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, tpl_web_type, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark from gen_table
+    </sql>
+    
+    <select id="selectGenTableList" parameterType="GenTable" resultMap="GenTableResult">
+		<include refid="selectGenTableVo"/>
+		<where>
+			<if test="tableName != null and tableName != ''">
+				AND lower(table_name) like lower(concat('%', #{tableName}, '%'))
+			</if>
+			<if test="tableComment != null and tableComment != ''">
+				AND lower(table_comment) like lower(concat('%', #{tableComment}, '%'))
+			</if>
+			<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
+				AND date_format(create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
+			</if>
+			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
+				AND date_format(create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
+			</if>
+		</where>
+	</select>
+
+	<select id="selectDbTableList" parameterType="GenTable" resultMap="GenTableResult">
+		select table_name, table_comment, create_time, update_time from information_schema.tables
+		where table_schema = (select database())
+		AND table_name NOT LIKE 'qrtz\_%' AND table_name NOT LIKE 'gen\_%'
+		AND table_name NOT IN (select table_name from gen_table)
+		<if test="tableName != null and tableName != ''">
+			AND lower(table_name) like lower(concat('%', #{tableName}, '%'))
+		</if>
+		<if test="tableComment != null and tableComment != ''">
+			AND lower(table_comment) like lower(concat('%', #{tableComment}, '%'))
+		</if>
+		<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
+			AND date_format(create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
+		</if>
+		<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
+			AND date_format(create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
+		</if>
+        order by create_time desc
+	</select>
+	
+	<select id="selectDbTableListByNames" resultMap="GenTableResult">
+		select table_name, table_comment, create_time, update_time from information_schema.tables
+		where table_name NOT LIKE 'qrtz\_%' and table_name NOT LIKE 'gen\_%' and table_schema = (select database())
+		and table_name in
+	    <foreach collection="array" item="name" open="(" separator="," close=")">
+ 			#{name}
+        </foreach> 
+	</select>
+	
+	<select id="selectTableByName" parameterType="String" resultMap="GenTableResult">
+		select table_name, table_comment, create_time, update_time from information_schema.tables
+		where table_comment <![CDATA[ <> ]]> '' and table_schema = (select database())
+		and table_name = #{tableName}
+	</select>
+	
+	<select id="selectGenTableById" parameterType="Long" resultMap="GenTableResult">
+	    SELECT t.table_id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, t.class_name, t.tpl_category, t.tpl_web_type, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.gen_type, t.gen_path, t.options, t.remark,
+			   c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
+		FROM gen_table t
+			 LEFT JOIN gen_table_column c ON t.table_id = c.table_id
+		where t.table_id = #{tableId} order by c.sort
+	</select>
+	
+	<select id="selectGenTableByName" parameterType="String" resultMap="GenTableResult">
+	    SELECT t.table_id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, t.class_name, t.tpl_category, t.tpl_web_type, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.gen_type, t.gen_path, t.options, t.remark,
+			   c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
+		FROM gen_table t
+			 LEFT JOIN gen_table_column c ON t.table_id = c.table_id
+		where t.table_name = #{tableName} order by c.sort
+	</select>
+	
+	<select id="selectGenTableAll" parameterType="String" resultMap="GenTableResult">
+	    SELECT t.table_id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, t.class_name, t.tpl_category, t.tpl_web_type, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.options, t.remark,
+			   c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
+		FROM gen_table t
+			 LEFT JOIN gen_table_column c ON t.table_id = c.table_id
+		order by c.sort
+	</select>
+	
+	<insert id="insertGenTable" parameterType="GenTable" useGeneratedKeys="true" keyProperty="tableId">
+        insert into gen_table (
+			<if test="tableName != null">table_name,</if>
+			<if test="tableComment != null and tableComment != ''">table_comment,</if>
+			<if test="className != null and className != ''">class_name,</if>
+			<if test="tplCategory != null and tplCategory != ''">tpl_category,</if>
+			<if test="tplWebType != null and tplWebType != ''">tpl_web_type,</if>
+			<if test="packageName != null and packageName != ''">package_name,</if>
+			<if test="moduleName != null and moduleName != ''">module_name,</if>
+			<if test="businessName != null and businessName != ''">business_name,</if>
+			<if test="functionName != null and functionName != ''">function_name,</if>
+			<if test="functionAuthor != null and functionAuthor != ''">function_author,</if>
+			<if test="genType != null and genType != ''">gen_type,</if>
+			<if test="genPath != null and genPath != ''">gen_path,</if>
+			<if test="remark != null and remark != ''">remark,</if>
+ 			<if test="createBy != null and createBy != ''">create_by,</if>
+			create_time
+         )values(
+			<if test="tableName != null">#{tableName},</if>
+			<if test="tableComment != null and tableComment != ''">#{tableComment},</if>
+			<if test="className != null and className != ''">#{className},</if>
+			<if test="tplCategory != null and tplCategory != ''">#{tplCategory},</if>
+			<if test="tplWebType != null and tplWebType != ''">#{tplWebType},</if>
+			<if test="packageName != null and packageName != ''">#{packageName},</if>
+			<if test="moduleName != null and moduleName != ''">#{moduleName},</if>
+			<if test="businessName != null and businessName != ''">#{businessName},</if>
+			<if test="functionName != null and functionName != ''">#{functionName},</if>
+			<if test="functionAuthor != null and functionAuthor != ''">#{functionAuthor},</if>
+			<if test="genType != null and genType != ''">#{genType},</if>
+			<if test="genPath != null and genPath != ''">#{genPath},</if>
+			<if test="remark != null and remark != ''">#{remark},</if>
+ 			<if test="createBy != null and createBy != ''">#{createBy},</if>
+			sysdate()
+         )
+    </insert>
+    
+    <update id="createTable">
+        ${sql}
+    </update>
+    
+    <update id="updateGenTable" parameterType="GenTable">
+        update gen_table
+        <set>
+            <if test="tableName != null">table_name = #{tableName},</if>
+            <if test="tableComment != null and tableComment != ''">table_comment = #{tableComment},</if>
+            <if test="subTableName != null">sub_table_name = #{subTableName},</if>
+            <if test="subTableFkName != null">sub_table_fk_name = #{subTableFkName},</if>
+            <if test="className != null and className != ''">class_name = #{className},</if>
+            <if test="functionAuthor != null and functionAuthor != ''">function_author = #{functionAuthor},</if>
+            <if test="genType != null and genType != ''">gen_type = #{genType},</if>
+            <if test="genPath != null and genPath != ''">gen_path = #{genPath},</if>
+            <if test="tplCategory != null and tplCategory != ''">tpl_category = #{tplCategory},</if>
+            <if test="tplWebType != null and tplWebType != ''">tpl_web_type = #{tplWebType},</if>
+            <if test="packageName != null and packageName != ''">package_name = #{packageName},</if>
+            <if test="moduleName != null and moduleName != ''">module_name = #{moduleName},</if>
+            <if test="businessName != null and businessName != ''">business_name = #{businessName},</if>
+            <if test="functionName != null and functionName != ''">function_name = #{functionName},</if>
+            <if test="options != null and options != ''">options = #{options},</if>
+            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            update_time = sysdate()
+        </set>
+        where table_id = #{tableId}
+    </update>
+    
+    <delete id="deleteGenTableByIds" parameterType="Long">
+        delete from gen_table where table_id in 
+        <foreach collection="array" item="tableId" open="(" separator="," close=")">
+            #{tableId}
+        </foreach>
+    </delete>
+
 </mapper>