浏览代码

添加 骄阳 达人列表

zhaoxian 2 年之前
父节点
当前提交
fc410f1d85

+ 43 - 2
ruixuan-live/src/main/java/com/ruixuan/isc/controller/KuaishouPromoterController.java

@@ -7,6 +7,7 @@ import com.ruixuan.common.core.page.TableDataInfo;
 import com.ruixuan.common.utils.Check;
 import com.ruixuan.common.utils.Result;
 import com.ruixuan.common.utils.spring.SpringUtils;
+import com.ruixuan.isc.entity.JYKuaishouPromoter;
 import com.ruixuan.isc.entity.KuaishouPromoter;
 import com.ruixuan.isc.service.IKuaishouPromoterService;
 import com.ruixuan.isc.utils.Tess4jClient;
@@ -64,8 +65,8 @@ public class KuaishouPromoterController extends BaseController {
 
             String ruleName = kuaishouPromoterService.getRuleName(ruleId);
 
-            int i = kuaishouPromoterService.addRule(promoterId,ruleId,ruleName);
-            if(i > 0 ){
+            int i = kuaishouPromoterService.addRule(promoterId, ruleId, ruleName);
+            if (i > 0) {
                 returnJson.put("code", 0);
                 returnJson.put("message", "修改成功");
             }
@@ -118,6 +119,29 @@ public class KuaishouPromoterController extends BaseController {
         return getDataTable(list);
     }
 
+
+    /**
+     * 查询自营、分销达人 信息列表
+     */
+    @GetMapping("/list3")
+    @ApiOperation(value = "查询骄阳达人")
+    public TableDataInfo list3(@ApiParam("创建人ID") @RequestParam(value = "userId", required = true) Long userId,
+                               @ApiParam("达人ID") @RequestParam(value = "promoterId", required = false) String promoterId,
+                               @ApiParam("达人名称") @RequestParam(value = "promoterNickName", required = false) String promoterNickName,
+                               @ApiParam("媒体") @RequestParam(value = "mediaId", required = false) String mediaId,
+                               @ApiParam("类型") @RequestParam(value = "type", required = false) String type,
+                               @ApiParam("排序参数") @RequestParam(value = "parameter", required = false) String parameter,
+                               @ApiParam("正序倒叙") @RequestParam(value = "orderBy", required = false) String orderBy
+
+    ) {
+
+        if (Check.isNotNull(promoterId)) {
+            promoterId = promoterId.trim();
+        }
+        List<JYKuaishouPromoter> list = kuaishouPromoterService.selectKuaishouPromoterList3(userId, promoterId, promoterNickName, mediaId,type, parameter, orderBy);
+        return getDataTable(list);
+    }
+
     /**
      * 获取快手达人 信息详细信息
      */
@@ -177,6 +201,23 @@ public class KuaishouPromoterController extends BaseController {
     }
 
     /**
+     * 新增骄阳达人 信息
+     */
+    @PostMapping(value = "/add3")
+    @ApiOperation(value = "新增骄阳达人")
+    public JSONObject add3(@RequestBody JYKuaishouPromoter kuaishouPromoter) {
+        try {
+            return kuaishouPromoterService.insertKuaishouPromoter3(kuaishouPromoter);
+        } catch (Exception e) {
+            e.printStackTrace();
+            JSONObject result = new JSONObject();
+            result.put("code", -1);
+            result.put("msg", "失败");
+            return result;
+        }
+    }
+
+    /**
      * 新增 设置渠道绑定达人数
      */
     @GetMapping(value = "/addPromotersCount")

+ 217 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/entity/JYKuaishouPromoter.java

@@ -0,0 +1,217 @@
+package com.ruixuan.isc.entity;
+
+import com.alibaba.fastjson.JSONObject;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.data.annotation.Transient;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 快手达人 信息对象 kuaishou_promoter
+ */
+@Data
+@ApiModel(value = "KuaishouPromoter", description = "快手达人")
+public class JYKuaishouPromoter {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 媒体:1头条,2快手
+     */
+    private String mediaId;
+
+    /**
+     * 类型:1自营、2分销
+     */
+    private String type;
+
+    /**
+     * 创建人ID
+     */
+    @ApiModelProperty(name = "创建人ID")
+    private Long userId;
+
+    /**
+     * 创建人名称
+     */
+    @ApiModelProperty(name = "创建人名称")
+    private String userName;
+
+    /**
+     * 达人id(快手lD)
+     */
+    @ApiModelProperty(name = "达人id(快手lD)")
+    private String promoterId;
+
+    /**
+     * 达人昵称
+     */
+    @ApiModelProperty(name = "达人昵称")
+    private String promoterNickName;
+
+    /**
+     * 达人状态:1-生效,0-无效
+     */
+    @ApiModelProperty(name = "达人状态:1-生效,0-无效")
+    private String state;
+
+    /**
+     * 省市
+     */
+    @ApiModelProperty(name = "省市")
+    private String province;
+
+    /**
+     * 佣金要求
+     */
+    @ApiModelProperty(name = "佣金要求")
+    private String commissionRequirement;
+
+    /**
+     * 品类要求
+     */
+    @ApiModelProperty(name = "品类要求")
+    private String categoryRequirement;
+    /**
+     * 收货人
+     */
+    @ApiModelProperty(name = "收货人")
+    private String consignee;
+
+    /**
+     * 联系电话
+     */
+    @ApiModelProperty(name = "联系电话")
+    private String phone;
+    /**
+     * 总销售额
+     */
+    @ApiModelProperty(name = "总销售额")
+    private String totalSale;
+    /**
+     * 粉丝数
+     */
+    @ApiModelProperty(name = "粉丝数")
+    private String fansNumber;
+
+    /**
+     * 发货地址
+     */
+    @ApiModelProperty(name = "发货地址")
+    private String promoterAddress;
+
+    /**
+     * 达人头像链接
+     */
+    @ApiModelProperty(name = "达人头像")
+    private String promoterUrl;
+    /**
+     * 单视频销售额
+     */
+    @ApiModelProperty(name = "单视频销售额")
+    private String avgVideoSales;
+    /**
+     * 短视频销售额
+     */
+    @ApiModelProperty(name = "短视频销售额")
+    private String videoSales;
+    /**
+     * 睿选gmv
+     */
+    @ApiModelProperty(name = "睿选gmv")
+    private String monthDayGmv;
+
+    /**
+     * 30天出单量
+     */
+    @ApiModelProperty(name = "30天出单量")
+    private String monthDayOrderNum;
+
+    /**
+     * 出单金额
+     */
+    @ApiModelProperty(name = "出单金额")
+    private String validAmount;
+
+    /**
+     * 粉丝增量
+     */
+    @ApiModelProperty(name = "粉丝增量")
+    private Long followerIncr;
+
+    /**
+     * 出单金额
+     */
+    @ApiModelProperty(name = "真播场次")
+    private Integer liveCount30;
+
+    /**
+     * 平均点赞量
+     */
+    @ApiModelProperty(name = "平均点赞量")
+    private Long awemeAvgDiggCount30;
+
+    /**
+     * 平均赞粉比
+     */
+    @ApiModelProperty(name = "平均赞粉比")
+    private String awemeDiggFollowerRation;
+
+    /**
+     * 真播平均场观
+     */
+    @ApiModelProperty(name = "真播平均场观")
+    private String liveAverageUser30;
+
+    /**
+     * 跟进记录
+     */
+    @ApiModelProperty(name = "跟进记录")
+    private String followUpRecord;
+
+    /**
+     * 标签集
+     */
+    private List<JSONObject> labels;
+
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+
+    @Transient
+    private Long ruleId;
+    @Transient
+    private String ruleName;
+
+    public JYKuaishouPromoter() {
+    }
+
+    public JYKuaishouPromoter(Long id, String promoterNickName, String province, String promoterUrl, String fansNumber, String avgVideoSales, String videoSales, String totalSale, String promoterId) {
+        this.id = id;
+        this.promoterNickName = promoterNickName;
+        this.province = province;
+        this.promoterUrl = promoterUrl;
+        this.fansNumber = fansNumber;
+        this.avgVideoSales = avgVideoSales;
+        this.videoSales = videoSales;
+        this.totalSale = totalSale;
+        this.promoterId = promoterId;
+    }
+}

+ 13 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/mapper/KuaishouPromoterMapper.java

@@ -1,6 +1,7 @@
 package com.ruixuan.isc.mapper;
 
 import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.isc.entity.JYKuaishouPromoter;
 import com.ruixuan.isc.entity.KuaishouPromoter;
 import org.apache.ibatis.annotations.Param;
 
@@ -26,6 +27,12 @@ public interface KuaishouPromoterMapper {
                                                              @Param("mediaId") String mediaId,
                                                              @Param("parameter") String parameter, @Param("orderBy") String orderBy);
 
+ public List<JYKuaishouPromoter> selectKuaishouPromoterList3(@Param("userList") List<Long> userList, @Param("promoterId") String promoterId,
+                                                             @Param("promoterNickName") String promoterNickName,
+                                                             @Param("mediaId") String mediaId,
+                                                             @Param("type") String type,
+                                                             @Param("parameter") String parameter, @Param("orderBy") String orderBy);
+
     /**
      * 新增快手达人 信息
      *
@@ -104,4 +111,10 @@ public interface KuaishouPromoterMapper {
     int addRule(@Param("promoterId") String promoterId, @Param("ruleId") Long ruleId, @Param("ruleName") String ruleName);
 
     List<String> selectPromoterIdListByTime(@Param("userList") List<Long> userList, @Param("startDate") Long startDate, @Param("endDate") Long endDate);
+
+    KuaishouPromoter getOneByIdAndPromoterId3(@Param("userId") Long userId, @Param("promoterId") String promoterId);
+
+   void insertKuaishouPromoter3(JYKuaishouPromoter promoter);
+
+   void updateKuaishouPromoterByPromoterId3(JYKuaishouPromoter kuaishouPromoter);
 }

+ 5 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/IKuaishouPromoterService.java

@@ -3,6 +3,7 @@ package com.ruixuan.isc.service;
 import com.alibaba.fastjson.JSONObject;
 import com.ruixuan.common.core.domain.AjaxResult;
 import com.ruixuan.common.utils.Result;
+import com.ruixuan.isc.entity.JYKuaishouPromoter;
 import com.ruixuan.isc.entity.KuaishouPromoter;
 
 import java.util.List;
@@ -30,6 +31,8 @@ public interface IKuaishouPromoterService {
      */
     public List<KuaishouPromoter> selectKuaishouPromoterList(Long userId, String promoterId, String promoterNickName, String mediaId, String parameter, String orderBy);
 
+    public List<JYKuaishouPromoter> selectKuaishouPromoterList3(Long userId, String promoterId, String promoterNickName, String mediaId,String type, String parameter, String orderBy);
+
     /**
      * 新增快手达人 信息
      *
@@ -83,4 +86,6 @@ public interface IKuaishouPromoterService {
     int addRule(String promoterId, Long ruleId, String ruleName);
 
     List<String> selectPromoterIdListByTime(List<Long> userList, Long startDate, Long endDate);
+
+    JSONObject insertKuaishouPromoter3(JYKuaishouPromoter kuaishouPromoter);
 }

+ 122 - 1
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouPromoterServiceImpl.java

@@ -10,6 +10,7 @@ import com.ruixuan.common.utils.PageUtils;
 import com.ruixuan.common.utils.RedisUtil;
 import com.ruixuan.common.utils.Result;
 import com.ruixuan.common.utils.http.HttpUtil;
+import com.ruixuan.isc.entity.JYKuaishouPromoter;
 import com.ruixuan.isc.entity.KuaishouItemCollectSamples;
 import com.ruixuan.isc.entity.KuaishouPromoter;
 import com.ruixuan.isc.mapper.KuaishouPromoterMapper;
@@ -121,6 +122,52 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
     }
 
     @Override
+    public List<JYKuaishouPromoter> selectKuaishouPromoterList3(Long userId, String promoterId, String promoterNickName, String mediaId, String type, String parameter, String orderBy) {
+        String roleKey = sysUserService.getRoleKeyByUserId(userId);
+        List<Long> userList = new ArrayList<>();
+        //角色:管理员和骄阳管理员可以看到所有的达人信息
+        if ("admin".equals(roleKey) || "jy_admnin".equals(roleKey)) {
+            userList = null;
+        } else if ("jy_bd_manage".equals(roleKey) || "jy_scissors_manage".equals(roleKey)) {
+            // 骄阳渠道经理、骄阳剪手经理 可以看到自己创建的以及自己部门人员的达人信息
+            Long deptId = deptService.getDeptIdByUserId(userId);
+            userList = deptService.getDeptUserListByDeptId(deptId);
+        } else if ("jy_bd".equals(roleKey) || "jy_scissors".equals(roleKey)) {
+            // 骄阳渠道、骄阳-剪手 可以看到自己创建的达人信息
+            userList = Arrays.asList(userId);
+        } else {
+            return Collections.emptyList();
+        }
+        if (Check.isNull(parameter)) {
+            parameter = "create_time";
+        } else {
+            switch (parameter) {
+                case "avg_video_sales":
+                    parameter = "avgVideoSalesOrder";
+                    break;
+                case "video_sales":
+                    parameter = "videoSalesOrder";
+                    break;
+                case "total_sale":
+                    parameter = "totalSaleOrder";
+                    break;
+            }
+        }
+        if (Check.isNull(orderBy)) {
+            orderBy = "desc";
+        }
+        PageUtils.startPage();
+        List<JYKuaishouPromoter> list = kuaishouPromoterMapper.selectKuaishouPromoterList3(userList, promoterId, promoterNickName, mediaId,type, parameter, orderBy);
+        list.forEach(ent -> {
+            JSONObject follow = kuaishouPromoterMapper.getFollowUpRecordsByUserId(ent.getPromoterId(), ent.getUserId());
+            ent.setFollowUpRecord(Check.isNull(follow) ? "-" : follow.getString("txt"));
+            List<JSONObject> promoterLabelList = kuaishouPromoterMapper.getPromoterLabel(ent.getPromoterId(), ent.getUserId());
+            ent.setLabels(promoterLabelList);
+        });
+        return list;
+    }
+
+    @Override
     public List<JSONObject> selectKuaishouPromoterList2(Long userId, String promoterId, String promoterNickName, String status, String parameter, String orderBy) {
         if (Check.isNull(parameter)) {
             parameter = "promoterId";
@@ -248,6 +295,7 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
         return result;
     }
 
+
     /**
      * 同步更新数据
      */
@@ -255,7 +303,7 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
         try {
             if (flag) {
                 /*缓存标记,每日第一次访问调用该接口,更新达人部分(昵称,省市,粉丝,总销售,头像等)数据*/
-                String key = DateUtils.getDate() + "_" + id + "_" + promoterId;
+                String key = DateUtils.getDate() + "_" + promoterId;
                 String value = (String) redisUtil.get(key);
                 if (Check.isNotNull(value) && "1".equals(value)) {
                     return;
@@ -315,6 +363,79 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
         }
     }
 
+    /**
+     * 同步更新数据
+     */
+    private void editPromoter3(Long id, String mediaId, String promoterId, boolean flag) {
+        try {
+            if (flag) {
+                /*缓存标记,每日第一次访问调用该接口,更新达人部分(昵称,省市,粉丝,总销售,头像等)数据*/
+                String key = DateUtils.getDate() + "_" + promoterId;
+                String value = (String) redisUtil.get(key);
+                if (Check.isNotNull(value) && "1".equals(value)) {
+                    return;
+                }
+                redisUtil.set(key, "1", 60 * 60 * 24);
+            }
+
+            /*更新达人数据*/
+            Map<String, Object> param = new HashMap<>();
+            param.put("promoterId", promoterId);
+            param.put("mediaId", mediaId);
+            Long startTime = System.currentTimeMillis();
+            String content = HttpUtil.httpPostRequest(startIpPath + "promoterInfo/getPromoterId", param, null);
+            Thread.sleep(3000);
+
+            JSONObject result = JSONObject.parseObject(content);
+            if (Check.isNotNull(result) && Check.isNotNull(result.getString("promoterNickName"))) {
+                String province = "";
+                if (Check.isNotNull(result.getString("province"))) {
+                    province = result.getString("province").concat("-").concat(result.getString("city"));
+                }
+                JYKuaishouPromoter kuaishouPromoter = new JYKuaishouPromoter(
+                        id,
+                        result.getString("promoterNickName"),
+                        province,
+                        result.getString("promoterHeadImgUrl"),
+                        result.getString("fanNum"),
+                        result.getString("avgVideoSales"),
+                        result.getString("videoSales"),
+                        result.getString("totalSale"),
+                        promoterId
+                );
+
+                kuaishouPromoterMapper.updateKuaishouPromoterByPromoterId3(kuaishouPromoter);
+            } else {
+                log.error("更新达人失败,达人ID:{} 【返回结果】:{}", promoterId, result);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error("更新达人信息异常", e);
+        }
+    }
+
+    @Override
+    public JSONObject insertKuaishouPromoter3(JYKuaishouPromoter promoter) {
+        JSONObject result = new JSONObject();
+        promoter.setPromoterId(promoter.getPromoterId().trim());
+        KuaishouPromoter one = kuaishouPromoterMapper.getOneByIdAndPromoterId3(null, promoter.getPromoterId());
+        if (Check.isNotNull(one)) {
+            result.put("code", 500);
+            result.put("msg", "达人已被绑定,请重新选择 (绑定人:" + one.getUserName() + ")");
+            return result;
+        }
+
+        SysUser sysUser = sysUserService.selectUserById(promoter.getUserId());
+        if (Check.isNotNull(sysUser)) {
+            promoter.setUserName(sysUser.getNickName());
+        }
+        kuaishouPromoterMapper.insertKuaishouPromoter3(promoter);
+        editPromoter3(promoter.getId(), promoter.getMediaId(), promoter.getPromoterId(), true);
+        result.put("code", 200);
+        result.put("msg", "success");
+        return result;
+    }
+
     @Override
     public Result supplementInfo() {
         List<KuaishouPromoter> list = kuaishouPromoterMapper.getFailInfo();

+ 188 - 9
ruixuan-live/src/main/resources/mapper/isc/KuaishouPromoterMapper.xml

@@ -127,6 +127,77 @@
         order by ${parameter} ${orderBy}
     </select>
 
+    <select id="selectKuaishouPromoterList3" resultType="com.ruixuan.isc.entity.JYKuaishouPromoter">
+        SELECT
+        t1.id,
+        t1.user_id,
+        t1.type,
+        t1.media_id,
+        t1.user_name,
+        t1.promoter_id,
+        t1.promoter_nick_name,
+        t1.`state`,
+        t1.province,
+        t1.commission_requirement,
+        t1.category_requirement,
+        t1.promoter_url,
+        t1.phone,
+        t1.consignee,
+        t1.promoter_address,
+        if(t1.media_id = 1, t1.total_sale,t3.total_sale ) as 'total_sale',
+        if(t1.media_id = 1, t1.fans_number,t3.fans_number ) as 'fans_number',
+        if(t1.media_id = 1, t1.avg_video_sales,t3.avg_video_sales ) as 'avg_video_sales',
+        if(t1.media_id = 1,t1.video_sales ,t3.video_sales ) as 'video_sales',
+        t1.create_time,
+        t2.30day_gmv,
+        t2.30day_order_num,
+        t1.follower_incr,
+        t1.live_count_30,
+        t1.aweme_avg_digg_count_30,
+        t1.aweme_digg_follower_ration,
+        t1.live_average_user_30,
+        case
+        WHEN t3.total_sale like '%万%'
+        then SUBSTRING_INDEX(t3.total_sale,'-',-1)+0
+        else SUBSTRING_INDEX(t3.total_sale,'-',-1)/10000 end as 'totalSaleOrder',
+        case
+        WHEN t3.video_sales like '%万%'
+        then SUBSTRING_INDEX(t3.video_sales,'-',-1)+0
+        else SUBSTRING_INDEX(t3.video_sales,'-',-1)/10000 end as 'videoSalesOrder',
+        case
+        WHEN t3.avg_video_sales like '%万%'
+        then SUBSTRING_INDEX(t3.avg_video_sales,'-',-1)+0
+        else SUBSTRING_INDEX(t3.avg_video_sales,'-',-1)/10000 end as 'avgVideoSalesOrder',
+        t4.rule_id,
+        t4.rule_name
+        FROM
+        jy_kuaishou_promoter t1
+        LEFT JOIN promoter_oerder_amount t2 on t1.promoter_id = t2.promoter_id
+        LEFT JOIN promoter_sales_info t3 ON t1.promoter_id = t3.promoter_id
+        left join promoter_bind_rule t4 on t1.promoter_id = t4.promoter_id
+        <where>
+            <if test="userList != null and userList.size() > 0  ">
+                and t1.user_id in
+                <foreach collection="userList" item="userId" open="(" separator="," close=")">
+                    #{userId}
+                </foreach>
+            </if>
+            <if test="promoterId != null ">
+                and t1.promoter_id = #{promoterId}
+            </if>
+            <if test="promoterNickName != null  and promoterNickName != ''">
+                and t1.promoter_nick_name like concat('%', #{promoterNickName}, '%')
+            </if>
+            <if test="mediaId != null  and mediaId != ''">
+                and t1.media_id = #{mediaId}
+            </if>
+            <if test="type != null  and type != ''">
+                and t1.type = #{type}
+            </if>
+        </where>
+        order by ${parameter} ${orderBy}
+    </select>
+
     <select id="selectAllPromoterList" resultType="com.alibaba.fastjson.JSONObject">
         SELECT *
         FROM (
@@ -240,14 +311,14 @@
         select promoter_id
         from promoter_bind_channel_date
         WHERE stat_date >= #{startDate}
-            AND stat_date &lt;= #{endDate}
-            <if test="userList != null ">
-                AND user_id in
-                <foreach collection="userList" item="item" separator=","
-                         open="(" close=")">
-                    #{item}
-                </foreach>
-            </if>
+        AND stat_date &lt;= #{endDate}
+        <if test="userList != null ">
+            AND user_id in
+            <foreach collection="userList" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
     </select>
 
     <select id="getOneByIdAndPromoterId" resultMap="KuaishouPromoterResult">
@@ -259,6 +330,37 @@
         limit 1
     </select>
 
+    <select id="getOneByIdAndPromoterId3" resultMap="KuaishouPromoterResult">
+        select
+        id,
+        media_id,
+        `type`,
+        user_id,
+        user_name,
+        promoter_id,
+        promoter_nick_name,
+        `state`,
+        province,
+        commission_requirement,
+        category_requirement,
+        promoter_url,
+        phone,
+        consignee,
+        promoter_address,
+        total_sale,
+        fans_number,
+        avg_video_sales,
+        video_sales,
+        create_time,
+        update_time
+        from jy_kuaishou_promoter
+        where promoter_id = #{promoterId}
+        <if test="userId != null ">
+            AND user_id = #{userId}
+        </if>
+        limit 1
+    </select>
+
 
     <select id="getgetMonthPromoterTotal" resultType="com.alibaba.fastjson.JSONObject">
         SELECT t1.count,
@@ -337,6 +439,52 @@
         </trim>
     </insert>
 
+
+    <insert id="insertKuaishouPromoter3" parameterType="com.ruixuan.isc.entity.KuaishouPromoter" useGeneratedKeys="true"
+            keyProperty="id">
+        insert into jy_kuaishou_promoter
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="userId != null">user_id,</if>
+            <if test="mediaId != null">media_id,</if>
+            <if test="type != null">type,</if>
+            <if test="userName != null">user_name,</if>
+            <if test="promoterId != null">promoter_id,</if>
+            <if test="promoterNickName != null">promoter_nick_name,</if>
+            <if test="state != null">state,</if>
+            <if test="province != null">province,</if>
+            <if test="commissionRequirement != null">commission_requirement,</if>
+            <if test="categoryRequirement != null">category_requirement,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="totalSale != null">total_sale,</if>
+            <if test="fansNumber != null">fans_number,</if>
+            <if test="promoterUrl != null">promoter_url,</if>
+            <if test="phone != null">phone,</if>
+            <if test="consignee != null">consignee,</if>
+            <if test="promoterAddress != null">promoter_address,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="userId != null">#{userId},</if>
+            <if test="mediaId != null">#{mediaId},</if>
+            <if test="type != null">#{type},</if>
+            <if test="userName != null">#{userName},</if>
+            <if test="promoterId != null">#{promoterId},</if>
+            <if test="promoterNickName != null">#{promoterNickName},</if>
+            <if test="state != null">#{state},</if>
+            <if test="province != null">#{province},</if>
+            <if test="commissionRequirement != null">#{commissionRequirement},</if>
+            <if test="categoryRequirement != null">#{categoryRequirement},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="totalSale != null">#{totalSale},</if>
+            <if test="fansNumber != null">#{fansNumber},</if>
+            <if test="promoterUrl != null">#{promoterUrl},</if>
+            <if test="phone != null">#{phone},</if>
+            <if test="consignee != null">#{consignee},</if>
+            <if test="promoterAddress != null">#{promoterAddress},</if>
+        </trim>
+    </insert>
+
     <insert id="addFollowUpRecords">
         insert into kuaishou_promoter_follow_up_record
         (promoter_id,
@@ -410,6 +558,38 @@
         where promoter_id = #{promoterId}
     </update>
 
+    <update id="updateKuaishouPromoterByPromoterId3" parameterType="com.ruixuan.isc.entity.KuaishouPromoter">
+        update jy_kuaishou_promoter
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="type != null">`type` = #{type},</if>
+            <if test="mediaId != null">media_id = #{mediaId},</if>
+            <if test="userName != null">user_name = #{userName},</if>
+            <if test="promoterId != null">promoter_id = #{promoterId},</if>
+            <if test="promoterNickName != null">promoter_nick_name = #{promoterNickName},</if>
+            <if test="totalSale != null">total_sale = #{totalSale},</if>
+            <if test="fansNumber != null">fans_number = #{fansNumber},</if>
+            <if test="promoterUrl != null">promoter_url = #{promoterUrl},</if>
+            <if test="phone != null">phone = #{phone},</if>
+            <if test="consignee != null">consignee = #{consignee},</if>
+            <if test="promoterAddress != null">promoter_address = #{promoterAddress},</if>
+            <if test="state != null">`state` = #{state},</if>
+            <if test="province != null">province = #{province},</if>
+            <if test="commissionRequirement != null">commission_requirement = #{commissionRequirement},</if>
+            <if test="categoryRequirement != null">category_requirement = #{categoryRequirement},</if>
+            <if test="avgVideoSales != null">avg_video_sales = #{avgVideoSales},</if>
+            <if test="videoSales != null">video_sales = #{videoSales},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="followerIncr != null">follower_incr = #{followerIncr},</if>
+            <if test="liveCount30 != null">live_count_30 = #{liveCount30},</if>
+            <if test="awemeAvgDiggCount30 != null">aweme_avg_digg_count_30 = #{awemeAvgDiggCount30},</if>
+            <if test="awemeDiggFollowerRation != null">aweme_digg_follower_ration = #{awemeDiggFollowerRation},</if>
+            <if test="liveAverageUser30 != null">live_average_user_30 = #{liveAverageUser30},</if>
+        </trim>
+        where promoter_id = #{promoterId}
+    </update>
+
     <delete id="deleteKuaishouPromoterById" parameterType="Long">
         delete
         from kuaishou_promoter
@@ -528,7 +708,6 @@
     </select>
     <select id="getRuleName" resultType="java.lang.String" parameterType="java.lang.Long">
         select rule_name  from  kuaishou_settlement_rules where id = #{ruleId}
-
     </select>