Browse Source

修改数据库字段

xueyiming 1 month ago
parent
commit
c79327d0f7

+ 6 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/dao/mapper/longarticle/GroupSendResultMapper.java

@@ -16,15 +16,21 @@ public interface GroupSendResultMapper {
 
     int insertSelective(GroupSendResult record);
 
+    List<GroupSendResult> selectByExampleWithBLOBs(GroupSendResultExample example);
+
     List<GroupSendResult> selectByExample(GroupSendResultExample example);
 
     GroupSendResult selectByPrimaryKey(Long id);
 
     int updateByExampleSelective(@Param("record") GroupSendResult record, @Param("example") GroupSendResultExample example);
 
+    int updateByExampleWithBLOBs(@Param("record") GroupSendResult record, @Param("example") GroupSendResultExample example);
+
     int updateByExample(@Param("record") GroupSendResult record, @Param("example") GroupSendResultExample example);
 
     int updateByPrimaryKeySelective(GroupSendResult record);
 
+    int updateByPrimaryKeyWithBLOBs(GroupSendResult record);
+
     int updateByPrimaryKey(GroupSendResult record);
 }

+ 17 - 6
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/po/longarticle/GroupSendResult.java

@@ -13,7 +13,7 @@ public class GroupSendResult {
 
     private Integer userGroupId;
 
-    private String contentIds;
+    private String contentId;
 
     private String pushId;
 
@@ -23,6 +23,8 @@ public class GroupSendResult {
 
     private Date updateTime;
 
+    private String url;
+
     public Long getId() {
         return id;
     }
@@ -63,12 +65,12 @@ public class GroupSendResult {
         this.userGroupId = userGroupId;
     }
 
-    public String getContentIds() {
-        return contentIds;
+    public String getContentId() {
+        return contentId;
     }
 
-    public void setContentIds(String contentIds) {
-        this.contentIds = contentIds;
+    public void setContentId(String contentId) {
+        this.contentId = contentId;
     }
 
     public String getPushId() {
@@ -103,6 +105,14 @@ public class GroupSendResult {
         this.updateTime = updateTime;
     }
 
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -114,11 +124,12 @@ public class GroupSendResult {
         sb.append(", ghId=").append(ghId);
         sb.append(", publishDate=").append(publishDate);
         sb.append(", userGroupId=").append(userGroupId);
-        sb.append(", contentIds=").append(contentIds);
+        sb.append(", contentId=").append(contentId);
         sb.append(", pushId=").append(pushId);
         sb.append(", status=").append(status);
         sb.append(", createTime=").append(createTime);
         sb.append(", updateTime=").append(updateTime);
+        sb.append(", url=").append(url);
         sb.append("]");
         return sb.toString();
     }

+ 28 - 28
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/po/longarticle/GroupSendResultExample.java

@@ -446,73 +446,73 @@ public class GroupSendResultExample {
             return (Criteria) this;
         }
 
-        public Criteria andContentIdsIsNull() {
-            addCriterion("content_ids is null");
+        public Criteria andContentIdIsNull() {
+            addCriterion("content_id is null");
             return (Criteria) this;
         }
 
-        public Criteria andContentIdsIsNotNull() {
-            addCriterion("content_ids is not null");
+        public Criteria andContentIdIsNotNull() {
+            addCriterion("content_id is not null");
             return (Criteria) this;
         }
 
-        public Criteria andContentIdsEqualTo(String value) {
-            addCriterion("content_ids =", value, "contentIds");
+        public Criteria andContentIdEqualTo(String value) {
+            addCriterion("content_id =", value, "contentId");
             return (Criteria) this;
         }
 
-        public Criteria andContentIdsNotEqualTo(String value) {
-            addCriterion("content_ids <>", value, "contentIds");
+        public Criteria andContentIdNotEqualTo(String value) {
+            addCriterion("content_id <>", value, "contentId");
             return (Criteria) this;
         }
 
-        public Criteria andContentIdsGreaterThan(String value) {
-            addCriterion("content_ids >", value, "contentIds");
+        public Criteria andContentIdGreaterThan(String value) {
+            addCriterion("content_id >", value, "contentId");
             return (Criteria) this;
         }
 
-        public Criteria andContentIdsGreaterThanOrEqualTo(String value) {
-            addCriterion("content_ids >=", value, "contentIds");
+        public Criteria andContentIdGreaterThanOrEqualTo(String value) {
+            addCriterion("content_id >=", value, "contentId");
             return (Criteria) this;
         }
 
-        public Criteria andContentIdsLessThan(String value) {
-            addCriterion("content_ids <", value, "contentIds");
+        public Criteria andContentIdLessThan(String value) {
+            addCriterion("content_id <", value, "contentId");
             return (Criteria) this;
         }
 
-        public Criteria andContentIdsLessThanOrEqualTo(String value) {
-            addCriterion("content_ids <=", value, "contentIds");
+        public Criteria andContentIdLessThanOrEqualTo(String value) {
+            addCriterion("content_id <=", value, "contentId");
             return (Criteria) this;
         }
 
-        public Criteria andContentIdsLike(String value) {
-            addCriterion("content_ids like", value, "contentIds");
+        public Criteria andContentIdLike(String value) {
+            addCriterion("content_id like", value, "contentId");
             return (Criteria) this;
         }
 
-        public Criteria andContentIdsNotLike(String value) {
-            addCriterion("content_ids not like", value, "contentIds");
+        public Criteria andContentIdNotLike(String value) {
+            addCriterion("content_id not like", value, "contentId");
             return (Criteria) this;
         }
 
-        public Criteria andContentIdsIn(List<String> values) {
-            addCriterion("content_ids in", values, "contentIds");
+        public Criteria andContentIdIn(List<String> values) {
+            addCriterion("content_id in", values, "contentId");
             return (Criteria) this;
         }
 
-        public Criteria andContentIdsNotIn(List<String> values) {
-            addCriterion("content_ids not in", values, "contentIds");
+        public Criteria andContentIdNotIn(List<String> values) {
+            addCriterion("content_id not in", values, "contentId");
             return (Criteria) this;
         }
 
-        public Criteria andContentIdsBetween(String value1, String value2) {
-            addCriterion("content_ids between", value1, value2, "contentIds");
+        public Criteria andContentIdBetween(String value1, String value2) {
+            addCriterion("content_id between", value1, value2, "contentId");
             return (Criteria) this;
         }
 
-        public Criteria andContentIdsNotBetween(String value1, String value2) {
-            addCriterion("content_ids not between", value1, value2, "contentIds");
+        public Criteria andContentIdNotBetween(String value1, String value2) {
+            addCriterion("content_id not between", value1, value2, "contentId");
             return (Criteria) this;
         }
 

+ 10 - 11
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/CoreServiceImpl.java

@@ -809,7 +809,6 @@ public class CoreServiceImpl implements CoreService {
             log.info("gzhPushParam={}", gzhPushParam);
             String pushId = aigcService.createBatchGroupPushTask(gzhPushParam);
             log.info("pushId = {}", pushId);
-            List<String> contentIds = new ArrayList<>();
             for (PublishContent publishContent : publishContentList) {
                 PublishContent publishContent1 = new PublishContent();
                 BeanUtils.copyProperties(publishContent, publishContent1);
@@ -820,16 +819,16 @@ public class CoreServiceImpl implements CoreService {
                 publishContent1.setCreateTime(null);
                 publishContent1.setUpdateTime(null);
                 publishContentMapper.insertSelective(publishContent1);
-                contentIds.add(publishContent.getSourceId());
-            }
-            GroupSendResult groupSendResult = new GroupSendResult();
-            groupSendResult.setAccountName(planAccount.getAccountName());
-            groupSendResult.setGhId(planAccount.getGhId());
-            groupSendResult.setUserGroupId(entry.getKey());
-            groupSendResult.setContentIds(JSON.toJSONString(contentIds));
-            groupSendResult.setPushId(pushId);
-            groupSendResult.setPublishDate(DateUtil.getThatDayDateString());
-            groupSendResultMapper.insertSelective(groupSendResult);
+                GroupSendResult groupSendResult = new GroupSendResult();
+                groupSendResult.setAccountName(planAccount.getAccountName());
+                groupSendResult.setGhId(planAccount.getGhId());
+                groupSendResult.setUserGroupId(entry.getKey());
+                groupSendResult.setContentId(publishContent.getSourceId());
+                groupSendResult.setPushId(pushId);
+                groupSendResult.setPublishDate(DateUtil.getThatDayDateString());
+                groupSendResultMapper.insertSelective(groupSendResult);
+            }
+
         }
     }
 

+ 87 - 17
long-article-server/src/main/resources/mapper/longarticle/GroupSendResultMapper.xml

@@ -7,12 +7,15 @@
     <result column="gh_id" jdbcType="VARCHAR" property="ghId" />
     <result column="publish_date" jdbcType="VARCHAR" property="publishDate" />
     <result column="user_group_id" jdbcType="INTEGER" property="userGroupId" />
-    <result column="content_ids" jdbcType="CHAR" property="contentIds" />
+    <result column="content_id" jdbcType="VARCHAR" property="contentId" />
     <result column="push_id" jdbcType="VARCHAR" property="pushId" />
     <result column="status" jdbcType="INTEGER" property="status" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
   </resultMap>
+  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.tzld.piaoquan.longarticle.model.po.longarticle.GroupSendResult">
+    <result column="url" jdbcType="LONGVARCHAR" property="url" />
+  </resultMap>
   <sql id="Example_Where_Clause">
     <where>
       <foreach collection="oredCriteria" item="criteria" separator="or">
@@ -72,9 +75,31 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, account_name, gh_id, publish_date, user_group_id, content_ids, push_id, `status`, 
+    id, account_name, gh_id, publish_date, user_group_id, content_id, push_id, `status`, 
     create_time, update_time
   </sql>
+  <sql id="Blob_Column_List">
+    url
+  </sql>
+  <select id="selectByExampleWithBLOBs" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.GroupSendResultExample" resultMap="ResultMapWithBLOBs">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from long_articles_group_send_result
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+    <if test="page != null">
+      limit #{page.offset} , #{page.pageSize}
+    </if>
+  </select>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.GroupSendResultExample" resultMap="BaseResultMap">
     select
     <if test="distinct">
@@ -92,9 +117,11 @@
       limit #{page.offset} , #{page.pageSize}
     </if>
   </select>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
     select 
     <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
     from long_articles_group_send_result
     where id = #{id,jdbcType=BIGINT}
   </select>
@@ -110,13 +137,13 @@
   </delete>
   <insert id="insert" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.GroupSendResult">
     insert into long_articles_group_send_result (id, account_name, gh_id, 
-      publish_date, user_group_id, content_ids, 
+      publish_date, user_group_id, content_id, 
       push_id, `status`, create_time, 
-      update_time)
+      update_time, url)
     values (#{id,jdbcType=BIGINT}, #{accountName,jdbcType=VARCHAR}, #{ghId,jdbcType=VARCHAR}, 
-      #{publishDate,jdbcType=VARCHAR}, #{userGroupId,jdbcType=INTEGER}, #{contentIds,jdbcType=CHAR}, 
+      #{publishDate,jdbcType=VARCHAR}, #{userGroupId,jdbcType=INTEGER}, #{contentId,jdbcType=VARCHAR}, 
       #{pushId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
-      #{updateTime,jdbcType=TIMESTAMP})
+      #{updateTime,jdbcType=TIMESTAMP}, #{url,jdbcType=LONGVARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.GroupSendResult">
     insert into long_articles_group_send_result
@@ -136,8 +163,8 @@
       <if test="userGroupId != null">
         user_group_id,
       </if>
-      <if test="contentIds != null">
-        content_ids,
+      <if test="contentId != null">
+        content_id,
       </if>
       <if test="pushId != null">
         push_id,
@@ -151,6 +178,9 @@
       <if test="updateTime != null">
         update_time,
       </if>
+      <if test="url != null">
+        url,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -168,8 +198,8 @@
       <if test="userGroupId != null">
         #{userGroupId,jdbcType=INTEGER},
       </if>
-      <if test="contentIds != null">
-        #{contentIds,jdbcType=CHAR},
+      <if test="contentId != null">
+        #{contentId,jdbcType=VARCHAR},
       </if>
       <if test="pushId != null">
         #{pushId,jdbcType=VARCHAR},
@@ -183,6 +213,9 @@
       <if test="updateTime != null">
         #{updateTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="url != null">
+        #{url,jdbcType=LONGVARCHAR},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.GroupSendResultExample" resultType="java.lang.Long">
@@ -209,8 +242,8 @@
       <if test="record.userGroupId != null">
         user_group_id = #{record.userGroupId,jdbcType=INTEGER},
       </if>
-      <if test="record.contentIds != null">
-        content_ids = #{record.contentIds,jdbcType=CHAR},
+      <if test="record.contentId != null">
+        content_id = #{record.contentId,jdbcType=VARCHAR},
       </if>
       <if test="record.pushId != null">
         push_id = #{record.pushId,jdbcType=VARCHAR},
@@ -224,11 +257,31 @@
       <if test="record.updateTime != null">
         update_time = #{record.updateTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="record.url != null">
+        url = #{record.url,jdbcType=LONGVARCHAR},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
+  <update id="updateByExampleWithBLOBs" parameterType="map">
+    update long_articles_group_send_result
+    set id = #{record.id,jdbcType=BIGINT},
+      account_name = #{record.accountName,jdbcType=VARCHAR},
+      gh_id = #{record.ghId,jdbcType=VARCHAR},
+      publish_date = #{record.publishDate,jdbcType=VARCHAR},
+      user_group_id = #{record.userGroupId,jdbcType=INTEGER},
+      content_id = #{record.contentId,jdbcType=VARCHAR},
+      push_id = #{record.pushId,jdbcType=VARCHAR},
+      `status` = #{record.status,jdbcType=INTEGER},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      url = #{record.url,jdbcType=LONGVARCHAR}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
   <update id="updateByExample" parameterType="map">
     update long_articles_group_send_result
     set id = #{record.id,jdbcType=BIGINT},
@@ -236,7 +289,7 @@
       gh_id = #{record.ghId,jdbcType=VARCHAR},
       publish_date = #{record.publishDate,jdbcType=VARCHAR},
       user_group_id = #{record.userGroupId,jdbcType=INTEGER},
-      content_ids = #{record.contentIds,jdbcType=CHAR},
+      content_id = #{record.contentId,jdbcType=VARCHAR},
       push_id = #{record.pushId,jdbcType=VARCHAR},
       `status` = #{record.status,jdbcType=INTEGER},
       create_time = #{record.createTime,jdbcType=TIMESTAMP},
@@ -260,8 +313,8 @@
       <if test="userGroupId != null">
         user_group_id = #{userGroupId,jdbcType=INTEGER},
       </if>
-      <if test="contentIds != null">
-        content_ids = #{contentIds,jdbcType=CHAR},
+      <if test="contentId != null">
+        content_id = #{contentId,jdbcType=VARCHAR},
       </if>
       <if test="pushId != null">
         push_id = #{pushId,jdbcType=VARCHAR},
@@ -275,16 +328,33 @@
       <if test="updateTime != null">
         update_time = #{updateTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="url != null">
+        url = #{url,jdbcType=LONGVARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=BIGINT}
   </update>
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.GroupSendResult">
+    update long_articles_group_send_result
+    set account_name = #{accountName,jdbcType=VARCHAR},
+      gh_id = #{ghId,jdbcType=VARCHAR},
+      publish_date = #{publishDate,jdbcType=VARCHAR},
+      user_group_id = #{userGroupId,jdbcType=INTEGER},
+      content_id = #{contentId,jdbcType=VARCHAR},
+      push_id = #{pushId,jdbcType=VARCHAR},
+      `status` = #{status,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP},
+      url = #{url,jdbcType=LONGVARCHAR}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
   <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.GroupSendResult">
     update long_articles_group_send_result
     set account_name = #{accountName,jdbcType=VARCHAR},
       gh_id = #{ghId,jdbcType=VARCHAR},
       publish_date = #{publishDate,jdbcType=VARCHAR},
       user_group_id = #{userGroupId,jdbcType=INTEGER},
-      content_ids = #{contentIds,jdbcType=CHAR},
+      content_id = #{contentId,jdbcType=VARCHAR},
       push_id = #{pushId,jdbcType=VARCHAR},
       `status` = #{status,jdbcType=INTEGER},
       create_time = #{createTime,jdbcType=TIMESTAMP},