yumeng 7 miesięcy temu
rodzic
commit
2100e659d1

+ 147 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/controller/KuaishouRewardBaseInfoController.java

@@ -0,0 +1,147 @@
+package com.ruixuan.isc.controller;
+
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.annotation.Log;
+import com.ruixuan.common.core.controller.BaseController;
+import com.ruixuan.common.core.domain.AjaxResult;
+import com.ruixuan.common.core.page.TableDataInfo;
+import com.ruixuan.common.enums.BusinessType;
+import com.ruixuan.common.utils.Check;
+import com.ruixuan.common.utils.DateUtils;
+import com.ruixuan.common.utils.poi.ExcelUtil;
+import com.ruixuan.isc.entity.KuaishouRewardBaseInfo;
+import com.ruixuan.isc.service.IKuaishouRewardBaseInfoService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ * 【请填写功能名称】Controller
+ *
+ * @author ruoyi
+ * @date 2024-10-31
+ */
+@RestController
+@RequestMapping("/finance/reward")
+public class KuaishouRewardBaseInfoController extends BaseController {
+    @Autowired
+    private IKuaishouRewardBaseInfoService kuaishouRewardBaseInfoService;
+
+    /**
+     * 查询【请填写功能名称】列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(KuaishouRewardBaseInfo kuaishouRewardBaseInfo) {
+        startPage();
+        List<KuaishouRewardBaseInfo> list = kuaishouRewardBaseInfoService.selectKuaishouRewardBaseInfoList(kuaishouRewardBaseInfo);
+        return getDataTable(list);
+    }
+
+
+    @GetMapping("/getTotal")
+    public JSONObject getTotal(KuaishouRewardBaseInfo kuaishouRewardBaseInfo) {
+
+        JSONObject json = kuaishouRewardBaseInfoService.getTotal(kuaishouRewardBaseInfo);
+        return json;
+    }
+
+    /**
+     * 导出【请填写功能名称】列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:export')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, KuaishouRewardBaseInfo kuaishouRewardBaseInfo) {
+        List<KuaishouRewardBaseInfo> list = kuaishouRewardBaseInfoService.selectKuaishouRewardBaseInfoList(kuaishouRewardBaseInfo);
+        ExcelUtil<KuaishouRewardBaseInfo> util = new ExcelUtil<KuaishouRewardBaseInfo>(KuaishouRewardBaseInfo.class);
+        util.exportExcel(response, list, "【请填写功能名称】数据");
+    }
+
+    /**
+     * 获取【请填写功能名称】详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(kuaishouRewardBaseInfoService.selectKuaishouRewardBaseInfoById(id));
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     */
+    @PostMapping("/add")
+    public AjaxResult add(@RequestBody KuaishouRewardBaseInfo kuaishouRewardBaseInfo) {
+        AjaxResult result = new AjaxResult();
+        try {
+            Long itemId = kuaishouRewardBaseInfo.getItemId();
+            if (Check.isNull(itemId)) {
+                throw new Exception("请输入商品ID");
+
+            }
+            String promoterId = kuaishouRewardBaseInfo.getPromoterId();
+            if (Check.isNull(promoterId)) {
+                throw new Exception("请输入达人ID");
+            }
+            String statDate = kuaishouRewardBaseInfo.getStatDate();
+            if (Check.isNull(statDate)) {
+                throw new Exception("请输入结算日期");
+            }
+            kuaishouRewardBaseInfo.setStatDate(statDate);
+            Integer dataCount = kuaishouRewardBaseInfoService.checkData(itemId, promoterId, statDate);
+            if (dataCount >= 1) {
+                throw new Exception("此达人下此商品所选日期已结算");
+            }
+            JSONObject getInfo = kuaishouRewardBaseInfoService.getInfo(itemId, promoterId);
+            if (!Check.isNull(getInfo)) {
+                String itemName = getInfo.getString("itemName");
+                if (!Check.isNull(itemName)) {
+                    kuaishouRewardBaseInfo.setItemTitle(itemName);
+                }
+                String promoterName = getInfo.getString("promoterName");
+                if (!Check.isNull(promoterName)) {
+                    kuaishouRewardBaseInfo.setPromoterName(promoterName);
+                }
+            }
+            return toAjax(kuaishouRewardBaseInfoService.insertKuaishouRewardBaseInfo(kuaishouRewardBaseInfo));
+        } catch (Exception e) {
+            result.put("code", 500);
+            result.put("msg", e.getMessage());
+            return result;
+        }
+
+    }
+
+    /**
+     * 修改【请填写功能名称】
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:edit')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody KuaishouRewardBaseInfo kuaishouRewardBaseInfo) {
+        return toAjax(kuaishouRewardBaseInfoService.updateKuaishouRewardBaseInfo(kuaishouRewardBaseInfo));
+    }
+
+    /**
+     * 删除【请填写功能名称】
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:remove')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(kuaishouRewardBaseInfoService.deleteKuaishouRewardBaseInfoByIds(ids));
+    }
+}
+

+ 248 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/entity/KuaishouRewardBaseInfo.java

@@ -0,0 +1,248 @@
+package com.ruixuan.isc.entity;
+
+
+import java.math.BigDecimal;
+
+import com.ruixuan.common.annotation.Excel;
+import com.ruixuan.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import org.springframework.data.annotation.Transient;
+
+
+/**
+ * 【请填写功能名称】对象 kuaishou_reward_base_info
+ *
+ * @author ruoyi
+ * @date 2024-10-31
+ */
+public class KuaishouRewardBaseInfo extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * $column.columnComment
+     */
+    private Long id;
+
+    /**
+     * 商品id
+     */
+    @Excel(name = "商品id")
+    private Long itemId;
+
+    /**
+     * 商品名称
+     */
+    @Excel(name = "商品名称")
+    private String itemTitle;
+
+    /**
+     * 达人ID
+     */
+    @Excel(name = "达人ID")
+    private String promoterId;
+
+    /**
+     * 达人名称
+     */
+    @Excel(name = "达人名称")
+    private String promoterName;
+
+
+    /**
+     * 日期
+     */
+    @Excel(name = "日期")
+    private String statDate;
+
+    /**
+     * 当前结算单量
+     */
+    @Excel(name = "当前结算单量")
+    private Long currentSettlementNum;
+
+    /**
+     * 累计结算单量
+     */
+    @Excel(name = "累计结算单量")
+    private Long totalSettlementNum;
+
+    /**
+     * 结算单价
+     */
+    @Excel(name = "结算单价")
+    private BigDecimal settlementPrice;
+
+    /**
+     * 主播奖励金额
+     */
+    @Excel(name = "主播奖励金额")
+    private BigDecimal anchorAmount;
+
+    /**
+     * 推荐人奖励金额
+     */
+    @Excel(name = "推荐人奖励金额")
+    private BigDecimal referenceAmount;
+
+    /**
+     * 累计结算金额
+     */
+    @Excel(name = "累计结算金额")
+    private BigDecimal totalAmount;
+
+
+    /**
+     * 备注
+     */
+    @Excel(name = "备注")
+    private String remarks;
+
+
+    @Transient
+    private String promoterCreateName;
+    @Transient
+    private String itemCreateName;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getItemId() {
+        return itemId;
+    }
+
+    public void setItemId(Long itemId) {
+        this.itemId = itemId;
+    }
+
+    public String getItemTitle() {
+        return itemTitle;
+    }
+
+    public void setItemTitle(String itemTitle) {
+        this.itemTitle = itemTitle;
+    }
+
+    public String getPromoterId() {
+        return promoterId;
+    }
+
+    public void setPromoterId(String promoterId) {
+        this.promoterId = promoterId;
+    }
+
+    public String getPromoterName() {
+        return promoterName;
+    }
+
+    public void setPromoterName(String promoterName) {
+        this.promoterName = promoterName;
+    }
+
+    public String getStatDate() {
+        return statDate;
+    }
+
+    public void setStatDate(String statDate) {
+        this.statDate = statDate;
+    }
+
+    public Long getCurrentSettlementNum() {
+        return currentSettlementNum;
+    }
+
+    public void setCurrentSettlementNum(Long currentSettlementNum) {
+        this.currentSettlementNum = currentSettlementNum;
+    }
+
+    public Long getTotalSettlementNum() {
+        return totalSettlementNum;
+    }
+
+    public void setTotalSettlementNum(Long totalSettlementNum) {
+        this.totalSettlementNum = totalSettlementNum;
+    }
+
+    public BigDecimal getSettlementPrice() {
+        return settlementPrice;
+    }
+
+    public void setSettlementPrice(BigDecimal settlementPrice) {
+        this.settlementPrice = settlementPrice;
+    }
+
+    public BigDecimal getAnchorAmount() {
+        return anchorAmount;
+    }
+
+    public void setAnchorAmount(BigDecimal anchorAmount) {
+        this.anchorAmount = anchorAmount;
+    }
+
+    public BigDecimal getReferenceAmount() {
+        return referenceAmount;
+    }
+
+    public void setReferenceAmount(BigDecimal referenceAmount) {
+        this.referenceAmount = referenceAmount;
+    }
+
+    public BigDecimal getTotalAmount() {
+        return totalAmount;
+    }
+
+    public void setTotalAmount(BigDecimal totalAmount) {
+        this.totalAmount = totalAmount;
+    }
+
+    public String getRemarks() {
+        return remarks;
+    }
+
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
+    }
+
+    public String getPromoterCreateName() {
+        return promoterCreateName;
+    }
+
+    public void setPromoterCreateName(String promoterCreateName) {
+        this.promoterCreateName = promoterCreateName;
+    }
+
+    public String getItemCreateName() {
+        return itemCreateName;
+    }
+
+    public void setItemCreateName(String itemCreateName) {
+        this.itemCreateName = itemCreateName;
+    }
+
+    @Override
+    public String toString() {
+        return "KuaishouRewardBaseInfo{" +
+                "id=" + id +
+                ", itemId=" + itemId +
+                ", itemTitle='" + itemTitle + '\'' +
+                ", promoterId='" + promoterId + '\'' +
+                ", promoterName='" + promoterName + '\'' +
+                ", statDate='" + statDate + '\'' +
+                ", currentSettlementNum=" + currentSettlementNum +
+                ", totalSettlementNum=" + totalSettlementNum +
+                ", settlementPrice=" + settlementPrice +
+                ", anchorAmount=" + anchorAmount +
+                ", referenceAmount=" + referenceAmount +
+                ", totalAmount=" + totalAmount +
+                ", remarks='" + remarks + '\'' +
+                ", promoterCreateName='" + promoterCreateName + '\'' +
+                ", itemCreateName='" + itemCreateName + '\'' +
+                '}';
+    }
+}
+

+ 73 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/mapper/KuaishouRewardBaseInfoMapper.java

@@ -0,0 +1,73 @@
+package com.ruixuan.isc.mapper;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.isc.entity.KuaishouRewardBaseInfo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 【请填写功能名称】Mapper接口
+ *
+ * @author ruoyi
+ * @date 2024-10-31
+ */
+public interface KuaishouRewardBaseInfoMapper {
+    /**
+     * 查询【请填写功能名称】
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    public KuaishouRewardBaseInfo selectKuaishouRewardBaseInfoById(Long id);
+
+    /**
+     * 查询【请填写功能名称】列表
+     *
+     * @param kuaishouRewardBaseInfo 【请填写功能名称】
+     * @return 【请填写功能名称】集合
+     */
+    public List<KuaishouRewardBaseInfo> selectKuaishouRewardBaseInfoList(KuaishouRewardBaseInfo kuaishouRewardBaseInfo);
+
+    /**
+     * 新增【请填写功能名称】
+     *
+     * @param kuaishouRewardBaseInfo 【请填写功能名称】
+     * @return 结果
+     */
+    public int insertKuaishouRewardBaseInfo(KuaishouRewardBaseInfo kuaishouRewardBaseInfo);
+
+    /**
+     * 修改【请填写功能名称】
+     *
+     * @param kuaishouRewardBaseInfo 【请填写功能名称】
+     * @return 结果
+     */
+    public int updateKuaishouRewardBaseInfo(KuaishouRewardBaseInfo kuaishouRewardBaseInfo);
+
+    /**
+     * 删除【请填写功能名称】
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    public int deleteKuaishouRewardBaseInfoById(Long id);
+
+    /**
+     * 批量删除【请填写功能名称】
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteKuaishouRewardBaseInfoByIds(Long[] ids);
+
+    Integer checkData(@Param("itemId") Long itemId, @Param("promoterId") String promoterId, @Param("statDate") String statDate);
+
+    String getItemName(@Param("itemId") Long itemId);
+
+
+    String getPromoterName(@Param("promoterId") String promoterId);
+
+    JSONObject getTotal(KuaishouRewardBaseInfo kuaishouRewardBaseInfo);
+}

+ 69 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/IKuaishouRewardBaseInfoService.java

@@ -0,0 +1,69 @@
+package com.ruixuan.isc.service;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.isc.entity.KuaishouRewardBaseInfo;
+
+import java.util.List;
+
+/**
+ * 【请填写功能名称】Service接口
+ *
+ * @author ruoyi
+ * @date 2024-10-31
+ */
+public interface IKuaishouRewardBaseInfoService {
+    /**
+     * 查询【请填写功能名称】
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    public KuaishouRewardBaseInfo selectKuaishouRewardBaseInfoById(Long id);
+
+    /**
+     * 查询【请填写功能名称】列表
+     *
+     * @param kuaishouRewardBaseInfo 【请填写功能名称】
+     * @return 【请填写功能名称】集合
+     */
+    public List<KuaishouRewardBaseInfo> selectKuaishouRewardBaseInfoList(KuaishouRewardBaseInfo kuaishouRewardBaseInfo);
+
+    /**
+     * 新增【请填写功能名称】
+     *
+     * @param kuaishouRewardBaseInfo 【请填写功能名称】
+     * @return 结果
+     */
+    public int insertKuaishouRewardBaseInfo(KuaishouRewardBaseInfo kuaishouRewardBaseInfo);
+
+    /**
+     * 修改【请填写功能名称】
+     *
+     * @param kuaishouRewardBaseInfo 【请填写功能名称】
+     * @return 结果
+     */
+    public int updateKuaishouRewardBaseInfo(KuaishouRewardBaseInfo kuaishouRewardBaseInfo);
+
+    /**
+     * 批量删除【请填写功能名称】
+     *
+     * @param ids 需要删除的【请填写功能名称】主键集合
+     * @return 结果
+     */
+    public int deleteKuaishouRewardBaseInfoByIds(Long[] ids);
+
+    /**
+     * 删除【请填写功能名称】信息
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    public int deleteKuaishouRewardBaseInfoById(Long id);
+
+    Integer checkData(Long itemId, String promoterId, String statDate);
+
+    JSONObject getInfo(Long itemId,String promoterId);
+
+   JSONObject getTotal(KuaishouRewardBaseInfo kuaishouRewardBaseInfo);
+}

+ 113 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouRewardBaseInfoServiceImpl.java

@@ -0,0 +1,113 @@
+package com.ruixuan.isc.service.impl;
+
+
+import java.util.List;
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.utils.DateUtils;
+import com.ruixuan.isc.entity.KuaishouRewardBaseInfo;
+import com.ruixuan.isc.mapper.KuaishouRewardBaseInfoMapper;
+import com.ruixuan.isc.service.IKuaishouRewardBaseInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * 【请填写功能名称】Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2024-10-31
+ */
+@Service
+public class KuaishouRewardBaseInfoServiceImpl implements IKuaishouRewardBaseInfoService {
+    @Autowired
+    private KuaishouRewardBaseInfoMapper kuaishouRewardBaseInfoMapper;
+
+    /**
+     * 查询【请填写功能名称】
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    @Override
+    public KuaishouRewardBaseInfo selectKuaishouRewardBaseInfoById(Long id) {
+        return kuaishouRewardBaseInfoMapper.selectKuaishouRewardBaseInfoById(id);
+    }
+
+    /**
+     * 查询【请填写功能名称】列表
+     *
+     * @param kuaishouRewardBaseInfo 【请填写功能名称】
+     * @return 【请填写功能名称】
+     */
+    @Override
+    public List<KuaishouRewardBaseInfo> selectKuaishouRewardBaseInfoList(KuaishouRewardBaseInfo kuaishouRewardBaseInfo) {
+        return kuaishouRewardBaseInfoMapper.selectKuaishouRewardBaseInfoList(kuaishouRewardBaseInfo);
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     *
+     * @param kuaishouRewardBaseInfo 【请填写功能名称】
+     * @return 结果
+     */
+    @Override
+    public int insertKuaishouRewardBaseInfo(KuaishouRewardBaseInfo kuaishouRewardBaseInfo) {
+        kuaishouRewardBaseInfo.setCreateTime(DateUtils.getNowDate());
+        return kuaishouRewardBaseInfoMapper.insertKuaishouRewardBaseInfo(kuaishouRewardBaseInfo);
+    }
+
+    /**
+     * 修改【请填写功能名称】
+     *
+     * @param kuaishouRewardBaseInfo 【请填写功能名称】
+     * @return 结果
+     */
+    @Override
+    public int updateKuaishouRewardBaseInfo(KuaishouRewardBaseInfo kuaishouRewardBaseInfo) {
+        kuaishouRewardBaseInfo.setUpdateTime(DateUtils.getNowDate());
+        return kuaishouRewardBaseInfoMapper.updateKuaishouRewardBaseInfo(kuaishouRewardBaseInfo);
+    }
+
+    /**
+     * 批量删除【请填写功能名称】
+     *
+     * @param ids 需要删除的【请填写功能名称】主键
+     * @return 结果
+     */
+    @Override
+    public int deleteKuaishouRewardBaseInfoByIds(Long[] ids) {
+        return kuaishouRewardBaseInfoMapper.deleteKuaishouRewardBaseInfoByIds(ids);
+    }
+
+    /**
+     * 删除【请填写功能名称】信息
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    @Override
+    public int deleteKuaishouRewardBaseInfoById(Long id) {
+        return kuaishouRewardBaseInfoMapper.deleteKuaishouRewardBaseInfoById(id);
+    }
+
+    @Override
+    public Integer checkData(Long itemId, String promoterId, String statDate) {
+        return kuaishouRewardBaseInfoMapper.checkData(itemId, promoterId, statDate);
+    }
+
+    @Override
+    public JSONObject getInfo(Long itemId, String promoterId) {
+        JSONObject infoJson = new JSONObject();
+        String itemName = kuaishouRewardBaseInfoMapper.getItemName(itemId);
+        String promoterName = kuaishouRewardBaseInfoMapper.getPromoterName(promoterId);
+        infoJson.put("itemName",itemName);
+        infoJson.put("promoterName",promoterName);
+        return infoJson;
+    }
+
+    @Override
+    public JSONObject getTotal(KuaishouRewardBaseInfo kuaishouRewardBaseInfo) {
+        return kuaishouRewardBaseInfoMapper.getTotal(kuaishouRewardBaseInfo);
+    }
+}

+ 8 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/SupplyChainServiceImpl.java

@@ -932,6 +932,14 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
 
 
     }
     }
 
 
+    public static void main(String[] args) {
+        Long beginTime = DateUtils.getTimeStamp(DateUtils.getHourTime(-2));
+        //当前时间
+        Long endTime = DateUtils.getTimeStamp(DateUtils.getTime());
+        System.err.println(beginTime);
+        System.err.println(endTime);
+    }
+
     @Override
     @Override
     public void insertNowdayOrderList() throws Exception {
     public void insertNowdayOrderList() throws Exception {
         String url = "https://openapi.kwaixiaodian.com";
         String url = "https://openapi.kwaixiaodian.com";

+ 206 - 0
ruixuan-live/src/main/resources/mapper/isc/KuaishouRewardBaseInfoMapper.xml

@@ -0,0 +1,206 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruixuan.isc.mapper.KuaishouRewardBaseInfoMapper">
+
+    <resultMap type="com.ruixuan.isc.entity.KuaishouRewardBaseInfo" id="KuaishouRewardBaseInfoResult">
+        <result property="id" column="id"/>
+        <result property="itemId" column="item_id"/>
+        <result property="itemTitle" column="item_title"/>
+        <result property="promoterId" column="promoter_id"/>
+        <result property="promoterName" column="promoter_name"/>
+        <result property="statDate" column="stat_date"/>
+        <result property="currentSettlementNum" column="current_settlement_num"/>
+        <result property="totalSettlementNum" column="total_settlement_num"/>
+        <result property="settlementPrice" column="settlement_price"/>
+        <result property="anchorAmount" column="anchor_amount"/>
+        <result property="referenceAmount" column="reference_amount"/>
+        <result property="totalAmount" column="total_amount"/>
+        <result property="remarks" column="remarks"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+
+    <sql id="selectKuaishouRewardBaseInfoVo">
+        SELECT id,
+               item_id,
+               item_title,
+               promoter_id,
+               promoter_name,
+               stat_date,
+               current_settlement_num,
+               total_settlement_num,
+               settlement_price,
+               anchor_amount,
+               reference_amount,
+               total_amount,
+               remarks,
+               create_time,
+               update_time
+        FROM kuaishou_reward_base_info
+    </sql>
+
+    <select id="selectKuaishouRewardBaseInfoList" parameterType="com.ruixuan.isc.entity.KuaishouRewardBaseInfo"
+            resultMap="KuaishouRewardBaseInfoResult">
+        SELECT t1.id,
+        t1.item_id,
+        t1.item_title,
+        t1.promoter_id,
+        t1.promoter_name,
+        t1.stat_date,
+        t1.current_settlement_num,
+        t1.total_settlement_num,
+        t1.settlement_price,
+        t1.anchor_amount,
+        t1.reference_amount,
+        t1.total_amount,
+        t1.remarks,
+        t2.user_name as 'itemCreateName',
+        t3.user_name as 'promoterCreateName',
+        t1.create_time,
+        t1.update_time
+        FROM kuaishou_reward_base_info t1 LEFT JOIN kuaishou_item_list t2
+        on t1.item_id = t2.item_id
+        LEFT JOIN (
+        SELECT promoter_id as 'promoter_id',
+        group_concat(user_name) as 'user_name'
+        from kuaishou_promoter WHERE media_id = '2'
+        GROUP BY promoter_id
+        ) t3 on t1.promoter_id = t3.promoter_id
+        <where>
+            <if test="itemId != null ">and t1.item_id = #{itemId}</if>
+            <if test="itemTitle != null  and itemTitle != ''">and t1.item_title = #{itemTitle}</if>
+            <if test="promoterId != null ">and t1.promoter_id = #{promoterId}</if>
+            <if test="promoterName != null  and promoterName != ''">and t1.promoter_name like concat('%',
+                #{promoterName},
+                '%')
+            </if>
+            <if test="statDate != null ">and t1.stat_date = #{statDate}</if>
+
+        </where>
+        order by t1.create_time desc
+    </select>
+
+    <select id="selectKuaishouRewardBaseInfoById" parameterType="java.lang.Long"
+            resultMap="KuaishouRewardBaseInfoResult">
+        <include refid="selectKuaishouRewardBaseInfoVo"/>
+        where id = #{id}
+    </select>
+    <select id="checkData" resultType="java.lang.Integer">
+        SELECT COUNT(1)
+        FROM kuaishou_reward_base_info
+        WHERE item_id = #{itemId}
+          AND promoter_id = #{promoterId}
+          AND stat_date = #{statDate}
+    </select>
+    <select id="getItemName" resultType="java.lang.String" parameterType="java.lang.Long">
+        SELECT item_title
+        FROM kuaishou_supply_chain
+        WHERE item_id = #{itemId} limit 1
+    </select>
+    <select id="getPromoterName" resultType="java.lang.String" parameterType="java.lang.String">
+        SELECT promoter_nick_name
+        FROM kuaishou_supply_chain
+        WHERE promoter_id = #{promoterId} limit 1
+    </select>
+    <select id="getTotal" resultType="com.alibaba.fastjson.JSONObject"
+            parameterType="com.ruixuan.isc.entity.KuaishouRewardBaseInfo">
+        SELECT
+        '-' as 'itemCreateName',
+        '-' as 'statDate',
+        '-' as 'settlementPrice',
+        '-' as 'totalSettlementNum',
+        '-' as 'itemId',
+        sum(current_settlement_num) as 'currentSettlementNum',
+        sum(anchor_amount) as 'anchorAmount',
+        sum(reference_amount) as 'referenceAmount',
+        sum(total_amount) as 'totalAmount'
+        FROM kuaishou_reward_base_info
+        <where>
+            <if test="itemId != null ">and item_id = #{itemId}</if>
+            <if test="itemTitle != null  and itemTitle != ''">and item_title = #{itemTitle}</if>
+            <if test="promoterId != null ">and promoter_id = #{promoterId}</if>
+            <if test="promoterName != null  and promoterName != ''">and promoter_name like concat('%',
+                #{promoterName},
+                '%')
+            </if>
+            <if test="statDate != null ">and stat_date = #{statDate}</if>
+        </where>
+
+    </select>
+
+
+    <insert id="insertKuaishouRewardBaseInfo" parameterType="com.ruixuan.isc.entity.KuaishouRewardBaseInfo"
+            useGeneratedKeys="true" keyProperty="id">
+        insert into kuaishou_reward_base_info
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="itemId != null">item_id,</if>
+            <if test="itemTitle != null">item_title,</if>
+            <if test="promoterId != null">promoter_id,</if>
+            <if test="promoterName != null">promoter_name,</if>
+
+            <if test="statDate != null">stat_date,</if>
+            <if test="currentSettlementNum != null">current_settlement_num,</if>
+            <if test="totalSettlementNum != null">total_settlement_num,</if>
+            <if test="settlementPrice != null">settlement_price,</if>
+            <if test="anchorAmount != null">anchor_amount,</if>
+            <if test="referenceAmount != null">reference_amount,</if>
+            <if test="totalAmount != null">total_amount,</if>
+            <if test="remarks != null">remarks,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="itemId != null">#{itemId},</if>
+            <if test="itemTitle != null">#{itemTitle},</if>
+            <if test="promoterId != null">#{promoterId},</if>
+            <if test="promoterName != null">#{promoterName},</if>
+
+            <if test="statDate != null">#{statDate},</if>
+            <if test="currentSettlementNum != null">#{currentSettlementNum},</if>
+            <if test="totalSettlementNum != null">#{totalSettlementNum},</if>
+            <if test="settlementPrice != null">#{settlementPrice},</if>
+            <if test="anchorAmount != null">#{anchorAmount},</if>
+            <if test="referenceAmount != null">#{referenceAmount},</if>
+            <if test="totalAmount != null">#{totalAmount},</if>
+            <if test="remarks != null">#{remarks},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+        </trim>
+    </insert>
+
+    <update id="updateKuaishouRewardBaseInfo" parameterType="com.ruixuan.isc.entity.KuaishouRewardBaseInfo">
+        update kuaishou_reward_base_info
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="itemId != null">item_id = #{itemId},</if>
+            <if test="itemTitle != null">item_title = #{itemTitle},</if>
+            <if test="promoterId != null">promoter_id = #{promoterId},</if>
+            <if test="promoterName != null">promoter_name = #{promoterName},</if>
+            <if test="statDate != null">stat_date = #{statDate},</if>
+            <if test="currentSettlementNum != null">current_settlement_num = #{currentSettlementNum},</if>
+            <if test="totalSettlementNum != null">total_settlement_num = #{totalSettlementNum},</if>
+            <if test="settlementPrice != null">settlement_price = #{settlementPrice},</if>
+            <if test="anchorAmount != null">anchor_amount = #{anchorAmount},</if>
+            <if test="referenceAmount != null">reference_amount = #{referenceAmount},</if>
+            <if test="totalAmount != null">total_amount = #{totalAmount},</if>
+            <if test="remarks != null">remarks = #{remarks},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteKuaishouRewardBaseInfoById" parameterType="java.lang.Long">
+        DELETE
+        FROM kuaishou_reward_base_info
+        WHERE id = #{id}
+    </delete>
+
+    <delete id="deleteKuaishouRewardBaseInfoByIds" parameterType="java.lang.String">
+        delete from kuaishou_reward_base_info where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>