瀏覽代碼

修改视频id类型

xueyiming 8 月之前
父節點
當前提交
f23b92ad7d

+ 2 - 12
we-com-server/src/main/java/com/tzld/piaoquan/wecom/job/WeComHistoryDataJob.java

@@ -258,18 +258,8 @@ public class WeComHistoryDataJob {
                             Long sendAt = jsonArray.getJSONObject(i).getLong("send_at");
                             AlertMessage alertMessage = new AlertMessage();
                             alertMessage.setMessageId(messageId);
+                            alertMessage.setVideoIds(videoIds.toString());
                             alertMessage.setSendTime(DateUtil.getDateString(sendAt));
-                            for (int v = 0; v < videoIds.size(); v++) {
-                                if (v == 0) {
-                                    alertMessage.setVideoId1(videoIds.get(v));
-                                }
-                                if (v == 1) {
-                                    alertMessage.setVideoId2(videoIds.get(v));
-                                }
-                                if (v == 2) {
-                                    alertMessage.setVideoId3(videoIds.get(v));
-                                }
-                            }
                             alertMessage.setStatus(subMissionList.getJSONObject(k).getString("status"));
                             JSONArray staffIdList = jsonArray.getJSONObject(i).getJSONArray("staff_id_list");
                             for (int s = 0; s < staffIdList.size(); s++) {
@@ -289,7 +279,7 @@ public class WeComHistoryDataJob {
                     }
                 }
             }
-            if(!CollectionUtils.isEmpty(alertMessageList)){
+            if (!CollectionUtils.isEmpty(alertMessageList)) {
                 LarkRobotUtil.sendMessage(JSONArray.toJSONString(alertMessageList));
             }
         } catch (IOException e) {

+ 6 - 28
we-com-server/src/main/java/com/tzld/piaoquan/wecom/model/po/AlertMessage.java

@@ -9,11 +9,7 @@ public class AlertMessage {
 
     private String staffName;
 
-    private Long videoId1;
-
-    private Long videoId2;
-
-    private Long videoId3;
+    private String videoIds;
 
     private String status;
 
@@ -45,28 +41,12 @@ public class AlertMessage {
         this.staffName = staffName;
     }
 
-    public Long getVideoId1() {
-        return videoId1;
-    }
-
-    public void setVideoId1(Long videoId1) {
-        this.videoId1 = videoId1;
-    }
-
-    public Long getVideoId2() {
-        return videoId2;
-    }
-
-    public void setVideoId2(Long videoId2) {
-        this.videoId2 = videoId2;
-    }
-
-    public Long getVideoId3() {
-        return videoId3;
+    public String getVideoIds() {
+        return videoIds;
     }
 
-    public void setVideoId3(Long videoId3) {
-        this.videoId3 = videoId3;
+    public void setVideoIds(String videoIds) {
+        this.videoIds = videoIds;
     }
 
     public String getStatus() {
@@ -102,9 +82,7 @@ public class AlertMessage {
         sb.append(", id=").append(id);
         sb.append(", messageId=").append(messageId);
         sb.append(", staffName=").append(staffName);
-        sb.append(", videoId1=").append(videoId1);
-        sb.append(", videoId2=").append(videoId2);
-        sb.append(", videoId3=").append(videoId3);
+        sb.append(", videoIds=").append(videoIds);
         sb.append(", status=").append(status);
         sb.append(", sendTime=").append(sendTime);
         sb.append(", createTime=").append(createTime);

+ 28 - 138
we-com-server/src/main/java/com/tzld/piaoquan/wecom/model/po/AlertMessageExample.java

@@ -306,183 +306,73 @@ public class AlertMessageExample {
             return (Criteria) this;
         }
 
-        public Criteria andVideoId1IsNull() {
-            addCriterion("video_id_1 is null");
+        public Criteria andVideoIdsIsNull() {
+            addCriterion("video_ids is null");
             return (Criteria) this;
         }
 
-        public Criteria andVideoId1IsNotNull() {
-            addCriterion("video_id_1 is not null");
+        public Criteria andVideoIdsIsNotNull() {
+            addCriterion("video_ids is not null");
             return (Criteria) this;
         }
 
-        public Criteria andVideoId1EqualTo(Long value) {
-            addCriterion("video_id_1 =", value, "videoId1");
+        public Criteria andVideoIdsEqualTo(String value) {
+            addCriterion("video_ids =", value, "videoIds");
             return (Criteria) this;
         }
 
-        public Criteria andVideoId1NotEqualTo(Long value) {
-            addCriterion("video_id_1 <>", value, "videoId1");
+        public Criteria andVideoIdsNotEqualTo(String value) {
+            addCriterion("video_ids <>", value, "videoIds");
             return (Criteria) this;
         }
 
-        public Criteria andVideoId1GreaterThan(Long value) {
-            addCriterion("video_id_1 >", value, "videoId1");
+        public Criteria andVideoIdsGreaterThan(String value) {
+            addCriterion("video_ids >", value, "videoIds");
             return (Criteria) this;
         }
 
-        public Criteria andVideoId1GreaterThanOrEqualTo(Long value) {
-            addCriterion("video_id_1 >=", value, "videoId1");
+        public Criteria andVideoIdsGreaterThanOrEqualTo(String value) {
+            addCriterion("video_ids >=", value, "videoIds");
             return (Criteria) this;
         }
 
-        public Criteria andVideoId1LessThan(Long value) {
-            addCriterion("video_id_1 <", value, "videoId1");
+        public Criteria andVideoIdsLessThan(String value) {
+            addCriterion("video_ids <", value, "videoIds");
             return (Criteria) this;
         }
 
-        public Criteria andVideoId1LessThanOrEqualTo(Long value) {
-            addCriterion("video_id_1 <=", value, "videoId1");
+        public Criteria andVideoIdsLessThanOrEqualTo(String value) {
+            addCriterion("video_ids <=", value, "videoIds");
             return (Criteria) this;
         }
 
-        public Criteria andVideoId1In(List<Long> values) {
-            addCriterion("video_id_1 in", values, "videoId1");
+        public Criteria andVideoIdsLike(String value) {
+            addCriterion("video_ids like", value, "videoIds");
             return (Criteria) this;
         }
 
-        public Criteria andVideoId1NotIn(List<Long> values) {
-            addCriterion("video_id_1 not in", values, "videoId1");
+        public Criteria andVideoIdsNotLike(String value) {
+            addCriterion("video_ids not like", value, "videoIds");
             return (Criteria) this;
         }
 
-        public Criteria andVideoId1Between(Long value1, Long value2) {
-            addCriterion("video_id_1 between", value1, value2, "videoId1");
+        public Criteria andVideoIdsIn(List<String> values) {
+            addCriterion("video_ids in", values, "videoIds");
             return (Criteria) this;
         }
 
-        public Criteria andVideoId1NotBetween(Long value1, Long value2) {
-            addCriterion("video_id_1 not between", value1, value2, "videoId1");
+        public Criteria andVideoIdsNotIn(List<String> values) {
+            addCriterion("video_ids not in", values, "videoIds");
             return (Criteria) this;
         }
 
-        public Criteria andVideoId2IsNull() {
-            addCriterion("video_id_2 is null");
+        public Criteria andVideoIdsBetween(String value1, String value2) {
+            addCriterion("video_ids between", value1, value2, "videoIds");
             return (Criteria) this;
         }
 
-        public Criteria andVideoId2IsNotNull() {
-            addCriterion("video_id_2 is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoId2EqualTo(Long value) {
-            addCriterion("video_id_2 =", value, "videoId2");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoId2NotEqualTo(Long value) {
-            addCriterion("video_id_2 <>", value, "videoId2");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoId2GreaterThan(Long value) {
-            addCriterion("video_id_2 >", value, "videoId2");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoId2GreaterThanOrEqualTo(Long value) {
-            addCriterion("video_id_2 >=", value, "videoId2");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoId2LessThan(Long value) {
-            addCriterion("video_id_2 <", value, "videoId2");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoId2LessThanOrEqualTo(Long value) {
-            addCriterion("video_id_2 <=", value, "videoId2");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoId2In(List<Long> values) {
-            addCriterion("video_id_2 in", values, "videoId2");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoId2NotIn(List<Long> values) {
-            addCriterion("video_id_2 not in", values, "videoId2");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoId2Between(Long value1, Long value2) {
-            addCriterion("video_id_2 between", value1, value2, "videoId2");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoId2NotBetween(Long value1, Long value2) {
-            addCriterion("video_id_2 not between", value1, value2, "videoId2");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoId3IsNull() {
-            addCriterion("video_id_3 is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoId3IsNotNull() {
-            addCriterion("video_id_3 is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoId3EqualTo(Long value) {
-            addCriterion("video_id_3 =", value, "videoId3");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoId3NotEqualTo(Long value) {
-            addCriterion("video_id_3 <>", value, "videoId3");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoId3GreaterThan(Long value) {
-            addCriterion("video_id_3 >", value, "videoId3");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoId3GreaterThanOrEqualTo(Long value) {
-            addCriterion("video_id_3 >=", value, "videoId3");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoId3LessThan(Long value) {
-            addCriterion("video_id_3 <", value, "videoId3");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoId3LessThanOrEqualTo(Long value) {
-            addCriterion("video_id_3 <=", value, "videoId3");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoId3In(List<Long> values) {
-            addCriterion("video_id_3 in", values, "videoId3");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoId3NotIn(List<Long> values) {
-            addCriterion("video_id_3 not in", values, "videoId3");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoId3Between(Long value1, Long value2) {
-            addCriterion("video_id_3 between", value1, value2, "videoId3");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoId3NotBetween(Long value1, Long value2) {
-            addCriterion("video_id_3 not between", value1, value2, "videoId3");
+        public Criteria andVideoIdsNotBetween(String value1, String value2) {
+            addCriterion("video_ids not between", value1, value2, "videoIds");
             return (Criteria) this;
         }
 

+ 16 - 49
we-com-server/src/main/resources/mapper/AlertMessageMapper.xml

@@ -5,9 +5,7 @@
     <id column="id" jdbcType="BIGINT" property="id" />
     <result column="message_id" jdbcType="BIGINT" property="messageId" />
     <result column="staff_name" jdbcType="VARCHAR" property="staffName" />
-    <result column="video_id_1" jdbcType="BIGINT" property="videoId1" />
-    <result column="video_id_2" jdbcType="BIGINT" property="videoId2" />
-    <result column="video_id_3" jdbcType="BIGINT" property="videoId3" />
+    <result column="video_ids" jdbcType="VARCHAR" property="videoIds" />
     <result column="status" jdbcType="VARCHAR" property="status" />
     <result column="send_time" jdbcType="TIMESTAMP" property="sendTime" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
@@ -71,8 +69,7 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, message_id, staff_name, video_id_1, video_id_2, video_id_3, `status`, send_time, 
-    create_time
+    id, message_id, staff_name, video_ids, `status`, send_time, create_time
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.wecom.model.po.AlertMessageExample" resultMap="BaseResultMap">
     select
@@ -109,13 +106,11 @@
   </delete>
   <insert id="insert" parameterType="com.tzld.piaoquan.wecom.model.po.AlertMessage">
     insert into we_com_alert_message (id, message_id, staff_name, 
-      video_id_1, video_id_2, video_id_3, 
-      `status`, send_time, create_time
-      )
+      video_ids, `status`, send_time, 
+      create_time)
     values (#{id,jdbcType=BIGINT}, #{messageId,jdbcType=BIGINT}, #{staffName,jdbcType=VARCHAR}, 
-      #{videoId1,jdbcType=BIGINT}, #{videoId2,jdbcType=BIGINT}, #{videoId3,jdbcType=BIGINT}, 
-      #{status,jdbcType=VARCHAR}, #{sendTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}
-      )
+      #{videoIds,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{sendTime,jdbcType=TIMESTAMP}, 
+      #{createTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.wecom.model.po.AlertMessage">
     insert into we_com_alert_message
@@ -129,14 +124,8 @@
       <if test="staffName != null">
         staff_name,
       </if>
-      <if test="videoId1 != null">
-        video_id_1,
-      </if>
-      <if test="videoId2 != null">
-        video_id_2,
-      </if>
-      <if test="videoId3 != null">
-        video_id_3,
+      <if test="videoIds != null">
+        video_ids,
       </if>
       <if test="status != null">
         `status`,
@@ -158,14 +147,8 @@
       <if test="staffName != null">
         #{staffName,jdbcType=VARCHAR},
       </if>
-      <if test="videoId1 != null">
-        #{videoId1,jdbcType=BIGINT},
-      </if>
-      <if test="videoId2 != null">
-        #{videoId2,jdbcType=BIGINT},
-      </if>
-      <if test="videoId3 != null">
-        #{videoId3,jdbcType=BIGINT},
+      <if test="videoIds != null">
+        #{videoIds,jdbcType=VARCHAR},
       </if>
       <if test="status != null">
         #{status,jdbcType=VARCHAR},
@@ -196,14 +179,8 @@
       <if test="record.staffName != null">
         staff_name = #{record.staffName,jdbcType=VARCHAR},
       </if>
-      <if test="record.videoId1 != null">
-        video_id_1 = #{record.videoId1,jdbcType=BIGINT},
-      </if>
-      <if test="record.videoId2 != null">
-        video_id_2 = #{record.videoId2,jdbcType=BIGINT},
-      </if>
-      <if test="record.videoId3 != null">
-        video_id_3 = #{record.videoId3,jdbcType=BIGINT},
+      <if test="record.videoIds != null">
+        video_ids = #{record.videoIds,jdbcType=VARCHAR},
       </if>
       <if test="record.status != null">
         `status` = #{record.status,jdbcType=VARCHAR},
@@ -224,9 +201,7 @@
     set id = #{record.id,jdbcType=BIGINT},
       message_id = #{record.messageId,jdbcType=BIGINT},
       staff_name = #{record.staffName,jdbcType=VARCHAR},
-      video_id_1 = #{record.videoId1,jdbcType=BIGINT},
-      video_id_2 = #{record.videoId2,jdbcType=BIGINT},
-      video_id_3 = #{record.videoId3,jdbcType=BIGINT},
+      video_ids = #{record.videoIds,jdbcType=VARCHAR},
       `status` = #{record.status,jdbcType=VARCHAR},
       send_time = #{record.sendTime,jdbcType=TIMESTAMP},
       create_time = #{record.createTime,jdbcType=TIMESTAMP}
@@ -243,14 +218,8 @@
       <if test="staffName != null">
         staff_name = #{staffName,jdbcType=VARCHAR},
       </if>
-      <if test="videoId1 != null">
-        video_id_1 = #{videoId1,jdbcType=BIGINT},
-      </if>
-      <if test="videoId2 != null">
-        video_id_2 = #{videoId2,jdbcType=BIGINT},
-      </if>
-      <if test="videoId3 != null">
-        video_id_3 = #{videoId3,jdbcType=BIGINT},
+      <if test="videoIds != null">
+        video_ids = #{videoIds,jdbcType=VARCHAR},
       </if>
       <if test="status != null">
         `status` = #{status,jdbcType=VARCHAR},
@@ -268,9 +237,7 @@
     update we_com_alert_message
     set message_id = #{messageId,jdbcType=BIGINT},
       staff_name = #{staffName,jdbcType=VARCHAR},
-      video_id_1 = #{videoId1,jdbcType=BIGINT},
-      video_id_2 = #{videoId2,jdbcType=BIGINT},
-      video_id_3 = #{videoId3,jdbcType=BIGINT},
+      video_ids = #{videoIds,jdbcType=VARCHAR},
       `status` = #{status,jdbcType=VARCHAR},
       send_time = #{sendTime,jdbcType=TIMESTAMP},
       create_time = #{createTime,jdbcType=TIMESTAMP}