Jelajahi Sumber

公众号计划修改

wangyunpeng 2 bulan lalu
induk
melakukan
6ab4888eea
18 mengubah file dengan 345 tambahan dan 35 penghapusan
  1. 3 2
      api-module/src/main/java/com/tzld/piaoquan/api/controller/contentplatform/ContentPlatformCooperateAccountController.java
  2. 3 1
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ext/ContentPlatformGzhAccountMapperExt.java
  3. 3 1
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/CooperateAccountSaveParam.java
  4. 6 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/GzhPlanListParam.java
  5. 6 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/GzhPlanSaveParam.java
  6. 11 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhAccount.java
  7. 60 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhAccountExample.java
  8. 22 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhPlan.java
  9. 120 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhPlanExample.java
  10. 3 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/CooperateAccountItemVO.java
  11. 6 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/GzhPlanItemVO.java
  12. 1 1
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/ContentPlatformCooperateAccountService.java
  13. 4 2
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformCooperateAccountServiceImpl.java
  14. 9 4
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformPlanServiceImpl.java
  15. 23 8
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformGzhAccountMapper.xml
  16. 41 11
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformGzhPlanMapper.xml
  17. 7 1
      api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformGzhAccountMapperExt.xml
  18. 17 4
      api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.xml

+ 3 - 2
api-module/src/main/java/com/tzld/piaoquan/api/controller/contentplatform/ContentPlatformCooperateAccountController.java

@@ -58,8 +58,9 @@ public class ContentPlatformCooperateAccountController {
 
     @ApiOperation(value = "公众号下拉框")
     @GetMapping("/gzh/accountList")
-    public CommonResponse<List<GzhAccountItem>> getGzhAccountList() {
-        return CommonResponse.success(cooperateAccountService.getGzhAccountList());
+    public CommonResponse<List<GzhAccountItem>> getGzhAccountList(@RequestParam Integer accountType,
+                                                                  @RequestParam String name) {
+        return CommonResponse.success(cooperateAccountService.getGzhAccountList(accountType, name));
     }
 
     @ApiOperation(value = "公众号删除")

+ 3 - 1
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ext/ContentPlatformGzhAccountMapperExt.java

@@ -20,5 +20,7 @@ public interface ContentPlatformGzhAccountMapperExt {
                                                             @Param("offset") int offset,
                                                             @Param("pageSize") Integer pageSize);
 
-    List<GzhAccountItem> getGzhAccountList(@Param("createAccountId") Long createAccountId);
+    List<GzhAccountItem> getGzhAccountList(@Param("createAccountId") Long createAccountId,
+                                           @Param("accountType") Integer accountType,
+                                           @Param("name") String name);
 }

+ 3 - 1
api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/CooperateAccountSaveParam.java

@@ -1,6 +1,5 @@
 package com.tzld.piaoquan.api.model.param.contentplatform;
 
-import com.tzld.piaoquan.api.model.param.PageParam;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -17,6 +16,9 @@ public class CooperateAccountSaveParam {
     @ApiModelProperty(value = "ghId")
     private String ghId;
 
+    @ApiModelProperty(value = "账号类型 0-公众号 1-服务号")
+    private Integer type;
+
     @ApiModelProperty(value = "内容类别")
     private String contentType;
 

+ 6 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/GzhPlanListParam.java

@@ -13,9 +13,15 @@ public class GzhPlanListParam extends PageParam {
     @ApiModelProperty(value = "标题")
     private String title;
 
+    @ApiModelProperty(value = "发布计划类型 0-自动回复、1-服务号推送")
+    private Integer type;
+
     @ApiModelProperty(value = "发布方:0-平台发布 1-用户发布")
     private Integer publishStage;
 
+    @ApiModelProperty(value = "视频选取方式 0-手动选取 1-自动选取")
+    private Integer selectVideoType;
+
     @ApiModelProperty(value = "创建时间开始")
     private Long createTimestampStart;
 

+ 6 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/GzhPlanSaveParam.java

@@ -15,12 +15,18 @@ public class GzhPlanSaveParam {
     @ApiModelProperty(value = "公众号id")
     private Long accountId;
 
+    @ApiModelProperty(value = "发布计划类型 0-自动回复、1-服务号推送")
+    private Integer type;
+
     @ApiModelProperty(value = "发布场景 0-关注回复")
     private Integer scene;
 
     @ApiModelProperty(value = "发布方:0-平台发布 1-用户发布")
     private Integer publishStage;
 
+    @ApiModelProperty(value = "视频选取方式 0-手动选取 1-自动选取")
+    private Integer selectVideoType;
+
     @ApiModelProperty(value = "视频列表")
     private List<GzhPlanVideoContentItemVO> videoList;
 }

+ 11 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhAccount.java

@@ -9,6 +9,8 @@ public class ContentPlatformGzhAccount {
 
     private String externalId;
 
+    private Integer type;
+
     private String contentType;
 
     private Integer status;
@@ -51,6 +53,14 @@ public class ContentPlatformGzhAccount {
         this.externalId = externalId;
     }
 
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
     public String getContentType() {
         return contentType;
     }
@@ -101,6 +111,7 @@ public class ContentPlatformGzhAccount {
         sb.append(", name=").append(name);
         sb.append(", ghId=").append(ghId);
         sb.append(", externalId=").append(externalId);
+        sb.append(", type=").append(type);
         sb.append(", contentType=").append(contentType);
         sb.append(", status=").append(status);
         sb.append(", createAccountId=").append(createAccountId);

+ 60 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhAccountExample.java

@@ -385,6 +385,66 @@ public class ContentPlatformGzhAccountExample {
             return (Criteria) this;
         }
 
+        public Criteria andTypeIsNull() {
+            addCriterion("`type` is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeIsNotNull() {
+            addCriterion("`type` is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeEqualTo(Integer value) {
+            addCriterion("`type` =", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotEqualTo(Integer value) {
+            addCriterion("`type` <>", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeGreaterThan(Integer value) {
+            addCriterion("`type` >", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
+            addCriterion("`type` >=", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeLessThan(Integer value) {
+            addCriterion("`type` <", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeLessThanOrEqualTo(Integer value) {
+            addCriterion("`type` <=", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeIn(List<Integer> values) {
+            addCriterion("`type` in", values, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotIn(List<Integer> values) {
+            addCriterion("`type` not in", values, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeBetween(Integer value1, Integer value2) {
+            addCriterion("`type` between", value1, value2, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotBetween(Integer value1, Integer value2) {
+            addCriterion("`type` not between", value1, value2, "type");
+            return (Criteria) this;
+        }
+
         public Criteria andContentTypeIsNull() {
             addCriterion("content_type is null");
             return (Criteria) this;

+ 22 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhPlan.java

@@ -3,6 +3,8 @@ package com.tzld.piaoquan.api.model.po.contentplatform;
 public class ContentPlatformGzhPlan {
     private Long id;
 
+    private Integer type;
+
     private Integer publishStage;
 
     private Long accountId;
@@ -11,6 +13,8 @@ public class ContentPlatformGzhPlan {
 
     private String externalId;
 
+    private Integer selectVideoType;
+
     private Integer status;
 
     private Long createAccountId;
@@ -27,6 +31,14 @@ public class ContentPlatformGzhPlan {
         this.id = id;
     }
 
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
     public Integer getPublishStage() {
         return publishStage;
     }
@@ -59,6 +71,14 @@ public class ContentPlatformGzhPlan {
         this.externalId = externalId;
     }
 
+    public Integer getSelectVideoType() {
+        return selectVideoType;
+    }
+
+    public void setSelectVideoType(Integer selectVideoType) {
+        this.selectVideoType = selectVideoType;
+    }
+
     public Integer getStatus() {
         return status;
     }
@@ -98,10 +118,12 @@ public class ContentPlatformGzhPlan {
         sb.append(" [");
         sb.append("Hash = ").append(hashCode());
         sb.append(", id=").append(id);
+        sb.append(", type=").append(type);
         sb.append(", publishStage=").append(publishStage);
         sb.append(", accountId=").append(accountId);
         sb.append(", scene=").append(scene);
         sb.append(", externalId=").append(externalId);
+        sb.append(", selectVideoType=").append(selectVideoType);
         sb.append(", status=").append(status);
         sb.append(", createAccountId=").append(createAccountId);
         sb.append(", createTimestamp=").append(createTimestamp);

+ 120 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhPlanExample.java

@@ -175,6 +175,66 @@ public class ContentPlatformGzhPlanExample {
             return (Criteria) this;
         }
 
+        public Criteria andTypeIsNull() {
+            addCriterion("`type` is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeIsNotNull() {
+            addCriterion("`type` is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeEqualTo(Integer value) {
+            addCriterion("`type` =", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotEqualTo(Integer value) {
+            addCriterion("`type` <>", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeGreaterThan(Integer value) {
+            addCriterion("`type` >", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
+            addCriterion("`type` >=", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeLessThan(Integer value) {
+            addCriterion("`type` <", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeLessThanOrEqualTo(Integer value) {
+            addCriterion("`type` <=", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeIn(List<Integer> values) {
+            addCriterion("`type` in", values, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotIn(List<Integer> values) {
+            addCriterion("`type` not in", values, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeBetween(Integer value1, Integer value2) {
+            addCriterion("`type` between", value1, value2, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotBetween(Integer value1, Integer value2) {
+            addCriterion("`type` not between", value1, value2, "type");
+            return (Criteria) this;
+        }
+
         public Criteria andPublishStageIsNull() {
             addCriterion("publish_stage is null");
             return (Criteria) this;
@@ -425,6 +485,66 @@ public class ContentPlatformGzhPlanExample {
             return (Criteria) this;
         }
 
+        public Criteria andSelectVideoTypeIsNull() {
+            addCriterion("select_video_type is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectVideoTypeIsNotNull() {
+            addCriterion("select_video_type is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectVideoTypeEqualTo(Integer value) {
+            addCriterion("select_video_type =", value, "selectVideoType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectVideoTypeNotEqualTo(Integer value) {
+            addCriterion("select_video_type <>", value, "selectVideoType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectVideoTypeGreaterThan(Integer value) {
+            addCriterion("select_video_type >", value, "selectVideoType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectVideoTypeGreaterThanOrEqualTo(Integer value) {
+            addCriterion("select_video_type >=", value, "selectVideoType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectVideoTypeLessThan(Integer value) {
+            addCriterion("select_video_type <", value, "selectVideoType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectVideoTypeLessThanOrEqualTo(Integer value) {
+            addCriterion("select_video_type <=", value, "selectVideoType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectVideoTypeIn(List<Integer> values) {
+            addCriterion("select_video_type in", values, "selectVideoType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectVideoTypeNotIn(List<Integer> values) {
+            addCriterion("select_video_type not in", values, "selectVideoType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectVideoTypeBetween(Integer value1, Integer value2) {
+            addCriterion("select_video_type between", value1, value2, "selectVideoType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectVideoTypeNotBetween(Integer value1, Integer value2) {
+            addCriterion("select_video_type not between", value1, value2, "selectVideoType");
+            return (Criteria) this;
+        }
+
         public Criteria andStatusIsNull() {
             addCriterion("`status` is null");
             return (Criteria) this;

+ 3 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/CooperateAccountItemVO.java

@@ -15,6 +15,9 @@ public class CooperateAccountItemVO {
     @ApiModelProperty(value = "ghId")
     private String ghId;
 
+    @ApiModelProperty(value = "账号类型 0-公众号 1-服务号")
+    private Integer type;
+
     @ApiModelProperty(value = "内容类别")
     private String contentType;
 

+ 6 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/GzhPlanItemVO.java

@@ -17,6 +17,9 @@ public class GzhPlanItemVO {
     @ApiModelProperty(value = "公众号名称")
     private String accountName;
 
+    @ApiModelProperty(value = "发布计划类型 0-自动回复、1-服务号推送")
+    private Integer type;
+
     @ApiModelProperty(value = "发布场景 0-关注回复")
     private Integer scene;
 
@@ -34,4 +37,7 @@ public class GzhPlanItemVO {
 
     @ApiModelProperty(value = "发布方:0-平台发布 1-用户发布")
     private Integer publishStage;
+
+    @ApiModelProperty(value = "视频选取方式 0-手动选取 1-自动选取")
+    private Integer selectVideoType;
 }

+ 1 - 1
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/ContentPlatformCooperateAccountService.java

@@ -25,7 +25,7 @@ public interface ContentPlatformCooperateAccountService {
 
     void gzhDelete(Long id);
 
-    List<GzhAccountItem> getGzhAccountList();
+    List<GzhAccountItem> getGzhAccountList(Integer accountType, String name);
 
     List<ContentPlatformGzhAccount> getAccountListByIds(List<Long> ids);
 

+ 4 - 2
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformCooperateAccountServiceImpl.java

@@ -78,6 +78,7 @@ public class ContentPlatformCooperateAccountServiceImpl implements ContentPlatfo
             accountVO.setId(account.getId());
             accountVO.setName(account.getName());
             accountVO.setGhId(account.getGhId());
+            accountVO.setType(account.getType());
             accountVO.setContentType(account.getContentType());
             accountVO.setCreateTimestamp(account.getCreateTimestamp());
             result.add(accountVO);
@@ -108,6 +109,7 @@ public class ContentPlatformCooperateAccountServiceImpl implements ContentPlatfo
             if (StringUtils.hasText(externalId)) {
                 account.setExternalId(externalId);
             }
+            account.setType(param.getType());
             account.setCreateAccountId(loginAccount.getId());
             account.setCreateTimestamp(now);
             gzhAccountMapper.insertSelective(account);
@@ -153,9 +155,9 @@ public class ContentPlatformCooperateAccountServiceImpl implements ContentPlatfo
     }
 
     @Override
-    public List<GzhAccountItem> getGzhAccountList() {
+    public List<GzhAccountItem> getGzhAccountList(Integer accountType, String name) {
         ContentPlatformAccount loginAccount = LoginUserContext.getUser();
-        return gzhAccountMapperExt.getGzhAccountList(loginAccount.getId());
+        return gzhAccountMapperExt.getGzhAccountList(loginAccount.getId(), accountType, name);
     }
 
     @Override

+ 9 - 4
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformPlanServiceImpl.java

@@ -126,8 +126,10 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
             planItemVO.setId(gzhPlan.getId());
             planItemVO.setAccountId(gzhPlan.getAccountId());
             planItemVO.setAccountName(accountMap.get(gzhPlan.getAccountId()));
+            planItemVO.setType(gzhPlan.getType());
             planItemVO.setScene(gzhPlan.getScene());
             planItemVO.setPublishStage(gzhPlan.getPublishStage());
+            planItemVO.setSelectVideoType(gzhPlan.getSelectVideoType());
             List<ContentPlatformGzhPlanVideo> videoListByPlanId = videoMap.get(gzhPlan.getId());
             if (CollectionUtils.isNotEmpty(videoListByPlanId)) {
                 planItemVO.setVideoCount(videoListByPlanId.size());
@@ -207,12 +209,14 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         Long now = System.currentTimeMillis();
         ContentPlatformGzhPlan gzhPlan = new ContentPlatformGzhPlan();
         gzhPlan.setAccountId(param.getAccountId());
+        gzhPlan.setType(param.getType());
         gzhPlan.setScene(param.getScene());
         gzhPlan.setPublishStage(param.getPublishStage());
+        gzhPlan.setSelectVideoType(param.getSelectVideoType());
         gzhPlan.setUpdateTimestamp(now);
         // 更新gh_detail
         List<Long> videoIds = param.getVideoList().stream().map(GzhPlanVideoContentItemVO::getVideoId).collect(Collectors.toList());
-        updateGhDetail(account, videoIds);
+        updateGhDetail(account, param.getSelectVideoType(), videoIds);
         // 更新cgi_reply_bucket_data
         updateCgiReplyBucketData(account.getGhId(), param.getVideoList());
         if (Objects.isNull(param.getId())) {
@@ -308,13 +312,14 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         return gzhPlanVideoMapper.selectByExample(example);
     }
 
-    private void updateGhDetail(ContentPlatformGzhAccount account, List<Long> videoIds) {
+    private void updateGhDetail(ContentPlatformGzhAccount account, Integer selectVideoType, List<Long> videoIds) {
         GhDetail ghDetail = ghDetailService.getGhDetailByGhIdType(account.getGhId(), GhTypeEnum.THIRD_PARTY_GH.type);
         GhDetailVo detailVo = new GhDetailVo();
+        Integer strategyStatus = selectVideoType == 0 ? StrategyStatusEnum.DEFAULT.status : StrategyStatusEnum.STRATEGY.status;
         if (Objects.nonNull(ghDetail)) {
             BeanUtils.copyProperties(ghDetail, detailVo);
             detailVo.setVideoIds(videoIds);
-            detailVo.setStrategyStatus(StrategyStatusEnum.DEFAULT.status);
+            detailVo.setStrategyStatus(strategyStatus);
             detailVo.setAutoreplySendMinigramNum(videoIds.size());
             detailVo.setCategory1(account.getContentType());
             ghDetailService.updateDetail(detailVo);
@@ -325,7 +330,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
             detailVo.setType(GhTypeEnum.THIRD_PARTY_GH.type);
             detailVo.setChannel(loginUser.getChannel());
             detailVo.setCategory1(account.getContentType());
-            detailVo.setStrategyStatus(StrategyStatusEnum.DEFAULT.status);
+            detailVo.setStrategyStatus(strategyStatus);
             detailVo.setVideoIds(videoIds);
             detailVo.setAutoreplySendMinigramNum(videoIds.size());
             ghDetailService.addGhDetail(detailVo);

+ 23 - 8
api-module/src/main/resources/mapper/contentplatform/ContentPlatformGzhAccountMapper.xml

@@ -6,6 +6,7 @@
     <result column="name" jdbcType="VARCHAR" property="name" />
     <result column="gh_id" jdbcType="VARCHAR" property="ghId" />
     <result column="external_id" jdbcType="VARCHAR" property="externalId" />
+    <result column="type" jdbcType="INTEGER" property="type" />
     <result column="content_type" jdbcType="VARCHAR" property="contentType" />
     <result column="status" jdbcType="INTEGER" property="status" />
     <result column="create_account_id" jdbcType="BIGINT" property="createAccountId" />
@@ -71,8 +72,8 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, `name`, gh_id, external_id, content_type, `status`, create_account_id, create_timestamp, 
-    update_timestamp
+    id, `name`, gh_id, external_id, `type`, content_type, `status`, create_account_id, 
+    create_timestamp, update_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhAccountExample" resultMap="BaseResultMap">
     select
@@ -109,13 +110,13 @@
   </delete>
   <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhAccount">
     insert into content_platform_gzh_account (id, `name`, gh_id, 
-      external_id, content_type, `status`, 
-      create_account_id, create_timestamp, update_timestamp
-      )
+      external_id, `type`, content_type, 
+      `status`, create_account_id, create_timestamp, 
+      update_timestamp)
     values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{ghId,jdbcType=VARCHAR}, 
-      #{externalId,jdbcType=VARCHAR}, #{contentType,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
-      #{createAccountId,jdbcType=BIGINT}, #{createTimestamp,jdbcType=BIGINT}, #{updateTimestamp,jdbcType=BIGINT}
-      )
+      #{externalId,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{contentType,jdbcType=VARCHAR}, 
+      #{status,jdbcType=INTEGER}, #{createAccountId,jdbcType=BIGINT}, #{createTimestamp,jdbcType=BIGINT}, 
+      #{updateTimestamp,jdbcType=BIGINT})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhAccount">
     insert into content_platform_gzh_account
@@ -132,6 +133,9 @@
       <if test="externalId != null">
         external_id,
       </if>
+      <if test="type != null">
+        `type`,
+      </if>
       <if test="contentType != null">
         content_type,
       </if>
@@ -161,6 +165,9 @@
       <if test="externalId != null">
         #{externalId,jdbcType=VARCHAR},
       </if>
+      <if test="type != null">
+        #{type,jdbcType=INTEGER},
+      </if>
       <if test="contentType != null">
         #{contentType,jdbcType=VARCHAR},
       </if>
@@ -199,6 +206,9 @@
       <if test="record.externalId != null">
         external_id = #{record.externalId,jdbcType=VARCHAR},
       </if>
+      <if test="record.type != null">
+        `type` = #{record.type,jdbcType=INTEGER},
+      </if>
       <if test="record.contentType != null">
         content_type = #{record.contentType,jdbcType=VARCHAR},
       </if>
@@ -225,6 +235,7 @@
       `name` = #{record.name,jdbcType=VARCHAR},
       gh_id = #{record.ghId,jdbcType=VARCHAR},
       external_id = #{record.externalId,jdbcType=VARCHAR},
+      `type` = #{record.type,jdbcType=INTEGER},
       content_type = #{record.contentType,jdbcType=VARCHAR},
       `status` = #{record.status,jdbcType=INTEGER},
       create_account_id = #{record.createAccountId,jdbcType=BIGINT},
@@ -246,6 +257,9 @@
       <if test="externalId != null">
         external_id = #{externalId,jdbcType=VARCHAR},
       </if>
+      <if test="type != null">
+        `type` = #{type,jdbcType=INTEGER},
+      </if>
       <if test="contentType != null">
         content_type = #{contentType,jdbcType=VARCHAR},
       </if>
@@ -269,6 +283,7 @@
     set `name` = #{name,jdbcType=VARCHAR},
       gh_id = #{ghId,jdbcType=VARCHAR},
       external_id = #{externalId,jdbcType=VARCHAR},
+      `type` = #{type,jdbcType=INTEGER},
       content_type = #{contentType,jdbcType=VARCHAR},
       `status` = #{status,jdbcType=INTEGER},
       create_account_id = #{createAccountId,jdbcType=BIGINT},

+ 41 - 11
api-module/src/main/resources/mapper/contentplatform/ContentPlatformGzhPlanMapper.xml

@@ -3,10 +3,12 @@
 <mapper namespace="com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformGzhPlanMapper">
   <resultMap id="BaseResultMap" type="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlan">
     <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="type" jdbcType="INTEGER" property="type" />
     <result column="publish_stage" jdbcType="INTEGER" property="publishStage" />
     <result column="account_id" jdbcType="BIGINT" property="accountId" />
     <result column="scene" jdbcType="INTEGER" property="scene" />
     <result column="external_id" jdbcType="VARCHAR" property="externalId" />
+    <result column="select_video_type" jdbcType="INTEGER" property="selectVideoType" />
     <result column="status" jdbcType="INTEGER" property="status" />
     <result column="create_account_id" jdbcType="BIGINT" property="createAccountId" />
     <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
@@ -71,8 +73,8 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, publish_stage, account_id, scene, external_id, `status`, create_account_id, create_timestamp, 
-    update_timestamp
+    id, `type`, publish_stage, account_id, scene, external_id, select_video_type, `status`, 
+    create_account_id, create_timestamp, update_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlanExample" resultMap="BaseResultMap">
     select
@@ -108,14 +110,14 @@
     </if>
   </delete>
   <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlan">
-    insert into content_platform_gzh_plan (id, publish_stage, account_id, 
-      scene, external_id, `status`, 
-      create_account_id, create_timestamp, update_timestamp
-      )
-    values (#{id,jdbcType=BIGINT}, #{publishStage,jdbcType=INTEGER}, #{accountId,jdbcType=BIGINT}, 
-      #{scene,jdbcType=INTEGER}, #{externalId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
-      #{createAccountId,jdbcType=BIGINT}, #{createTimestamp,jdbcType=BIGINT}, #{updateTimestamp,jdbcType=BIGINT}
-      )
+    insert into content_platform_gzh_plan (id, `type`, publish_stage, 
+      account_id, scene, external_id, 
+      select_video_type, `status`, create_account_id, 
+      create_timestamp, update_timestamp)
+    values (#{id,jdbcType=BIGINT}, #{type,jdbcType=INTEGER}, #{publishStage,jdbcType=INTEGER}, 
+      #{accountId,jdbcType=BIGINT}, #{scene,jdbcType=INTEGER}, #{externalId,jdbcType=VARCHAR}, 
+      #{selectVideoType,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createAccountId,jdbcType=BIGINT}, 
+      #{createTimestamp,jdbcType=BIGINT}, #{updateTimestamp,jdbcType=BIGINT})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlan">
     insert into content_platform_gzh_plan
@@ -123,6 +125,9 @@
       <if test="id != null">
         id,
       </if>
+      <if test="type != null">
+        `type`,
+      </if>
       <if test="publishStage != null">
         publish_stage,
       </if>
@@ -135,6 +140,9 @@
       <if test="externalId != null">
         external_id,
       </if>
+      <if test="selectVideoType != null">
+        select_video_type,
+      </if>
       <if test="status != null">
         `status`,
       </if>
@@ -152,6 +160,9 @@
       <if test="id != null">
         #{id,jdbcType=BIGINT},
       </if>
+      <if test="type != null">
+        #{type,jdbcType=INTEGER},
+      </if>
       <if test="publishStage != null">
         #{publishStage,jdbcType=INTEGER},
       </if>
@@ -164,6 +175,9 @@
       <if test="externalId != null">
         #{externalId,jdbcType=VARCHAR},
       </if>
+      <if test="selectVideoType != null">
+        #{selectVideoType,jdbcType=INTEGER},
+      </if>
       <if test="status != null">
         #{status,jdbcType=INTEGER},
       </if>
@@ -190,6 +204,9 @@
       <if test="record.id != null">
         id = #{record.id,jdbcType=BIGINT},
       </if>
+      <if test="record.type != null">
+        `type` = #{record.type,jdbcType=INTEGER},
+      </if>
       <if test="record.publishStage != null">
         publish_stage = #{record.publishStage,jdbcType=INTEGER},
       </if>
@@ -202,6 +219,9 @@
       <if test="record.externalId != null">
         external_id = #{record.externalId,jdbcType=VARCHAR},
       </if>
+      <if test="record.selectVideoType != null">
+        select_video_type = #{record.selectVideoType,jdbcType=INTEGER},
+      </if>
       <if test="record.status != null">
         `status` = #{record.status,jdbcType=INTEGER},
       </if>
@@ -222,10 +242,12 @@
   <update id="updateByExample" parameterType="map">
     update content_platform_gzh_plan
     set id = #{record.id,jdbcType=BIGINT},
+      `type` = #{record.type,jdbcType=INTEGER},
       publish_stage = #{record.publishStage,jdbcType=INTEGER},
       account_id = #{record.accountId,jdbcType=BIGINT},
       scene = #{record.scene,jdbcType=INTEGER},
       external_id = #{record.externalId,jdbcType=VARCHAR},
+      select_video_type = #{record.selectVideoType,jdbcType=INTEGER},
       `status` = #{record.status,jdbcType=INTEGER},
       create_account_id = #{record.createAccountId,jdbcType=BIGINT},
       create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
@@ -237,6 +259,9 @@
   <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlan">
     update content_platform_gzh_plan
     <set>
+      <if test="type != null">
+        `type` = #{type,jdbcType=INTEGER},
+      </if>
       <if test="publishStage != null">
         publish_stage = #{publishStage,jdbcType=INTEGER},
       </if>
@@ -249,6 +274,9 @@
       <if test="externalId != null">
         external_id = #{externalId,jdbcType=VARCHAR},
       </if>
+      <if test="selectVideoType != null">
+        select_video_type = #{selectVideoType,jdbcType=INTEGER},
+      </if>
       <if test="status != null">
         `status` = #{status,jdbcType=INTEGER},
       </if>
@@ -266,10 +294,12 @@
   </update>
   <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlan">
     update content_platform_gzh_plan
-    set publish_stage = #{publishStage,jdbcType=INTEGER},
+    set `type` = #{type,jdbcType=INTEGER},
+      publish_stage = #{publishStage,jdbcType=INTEGER},
       account_id = #{accountId,jdbcType=BIGINT},
       scene = #{scene,jdbcType=INTEGER},
       external_id = #{externalId,jdbcType=VARCHAR},
+      select_video_type = #{selectVideoType,jdbcType=INTEGER},
       `status` = #{status,jdbcType=INTEGER},
       create_account_id = #{createAccountId,jdbcType=BIGINT},
       create_timestamp = #{createTimestamp,jdbcType=BIGINT},

+ 7 - 1
api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformGzhAccountMapperExt.xml

@@ -33,7 +33,13 @@
     select id, name
     from content_platform_gzh_account
     where create_account_id = #{createAccountId}
-      and status = 1
+    and status = 1
+    <if test="name != null and name != ''">
+      and name like concat('%', #{name}, '%')
+    </if>
+    <if test="accountType!= null">
+      and type = #{accountType}
+    </if>
     order by create_timestamp desc
   </select>
 

+ 17 - 4
api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.xml

@@ -3,23 +3,30 @@
 <mapper namespace="com.tzld.piaoquan.api.dao.mapper.contentplatform.ext.ContentPlatformPlanMapperExt">
 
     <insert id="insertGzhPlanReturnId" useGeneratedKeys="true" keyProperty="id">
-        insert into content_platform_gzh_plan (publish_stage, account_id,
-                                               scene, external_id, create_account_id,
+        insert into content_platform_gzh_plan (`type`, publish_stage, account_id, scene, external_id,
+                                               select_video_type, `status`, create_account_id,
                                                create_timestamp, update_timestamp)
-        values (#{record.publishStage}, #{record.accountId}, #{record.scene}, #{record.externalId},
-                #{record.createAccountId}, #{record.createTimestamp}, #{record.updateTimestamp})
+        values (#{record.type}, #{record.publishStage}, #{record.accountId}, #{record.scene}, #{erecord.xternalId},
+                #{record.selectVideoType}, #{record.status}, #{record.createAccountId}, #{record.createTimestamp},
+                #{record.record.updateTimestamp})
     </insert>
 
     <select id="getGzhPlanCount" resultType="java.lang.Integer">
         select count(*)
         from content_platform_gzh_plan
         where create_account_id = #{createAccountId} and status = 1
+        <if test="param.type != null">
+            and type = #{param.type}
+        </if>
         <if test="param.accountId != null">
             and account_id = #{param.accountId}
         </if>
         <if test="param.publishStage != null">
             and publish_stage = #{param.publishStage}
         </if>
+        <if test="param.selectVideoType != null">
+            and select_video_type = #{param.selectVideoType}
+        </if>
         <if test="param.createTimestampStart != null">
             and create_timestamp > #{param.createTimestampStart}
         </if>
@@ -39,12 +46,18 @@
         select *
         from content_platform_gzh_plan
         where create_account_id = #{createAccountId} and status = 1
+        <if test="param.type != null">
+            and type = #{param.type}
+        </if>
         <if test="param.accountId != null">
             and account_id = #{param.accountId}
         </if>
         <if test="param.publishStage != null">
             and publish_stage = #{param.publishStage}
         </if>
+        <if test="param.selectVideoType != null">
+            and select_video_type = #{param.selectVideoType}
+        </if>
         <if test="param.createTimestampStart != null">
             and create_timestamp > #{param.createTimestampStart}
         </if>