Browse Source

分销系统V.1.0.0

kaick 1 year ago
parent
commit
0f77e39371
23 changed files with 4652 additions and 1 deletions
  1. 102 0
      src/main/java/com/caimei365/commodity/controller/ReportingClubApi.java
  2. 113 0
      src/main/java/com/caimei365/commodity/mapper/CmDistributionMapper.java
  3. 169 0
      src/main/java/com/caimei365/commodity/mapper/CmDistributionProductMapper.java
  4. 111 0
      src/main/java/com/caimei365/commodity/mapper/CmDistributionSkuMapper.java
  5. 113 0
      src/main/java/com/caimei365/commodity/mapper/CmRelatedImageMapper.java
  6. 113 0
      src/main/java/com/caimei365/commodity/mapper/CmReportingClubMapper.java
  7. 121 0
      src/main/java/com/caimei365/commodity/mapper/CmReportingMemberMapper.java
  8. 211 0
      src/main/java/com/caimei365/commodity/model/po/CmDistribution.java
  9. 213 0
      src/main/java/com/caimei365/commodity/model/po/CmDistributionProduct.java
  10. 140 0
      src/main/java/com/caimei365/commodity/model/po/CmDistributionSku.java
  11. 109 0
      src/main/java/com/caimei365/commodity/model/po/CmDistributionTeamProduct.java
  12. 103 0
      src/main/java/com/caimei365/commodity/model/po/CmRelatedImage.java
  13. 277 0
      src/main/java/com/caimei365/commodity/model/po/CmReportingClub.java
  14. 224 0
      src/main/java/com/caimei365/commodity/model/po/CmReportingMember.java
  15. 59 0
      src/main/java/com/caimei365/commodity/service/CmReportingClubService.java
  16. 132 0
      src/main/java/com/caimei365/commodity/service/impl/CmReportingClubServiceImpl.java
  17. 19 1
      src/main/java/com/caimei365/commodity/service/impl/PageServiceImpl.java
  18. 367 0
      src/main/resources/mapper/CmDistributionMapper.xml
  19. 620 0
      src/main/resources/mapper/CmDistributionProductMapper.xml
  20. 289 0
      src/main/resources/mapper/CmDistributionSkuMapper.xml
  21. 320 0
      src/main/resources/mapper/CmRelatedImageMapper.xml
  22. 359 0
      src/main/resources/mapper/CmReportingClubMapper.xml
  23. 368 0
      src/main/resources/mapper/CmReportingMemberMapper.xml

+ 102 - 0
src/main/java/com/caimei365/commodity/controller/ReportingClubApi.java

@@ -0,0 +1,102 @@
+package com.caimei365.commodity.controller;
+
+import com.caimei365.commodity.model.ResponseJson;
+import com.caimei365.commodity.model.po.CmDistribution;
+import com.caimei365.commodity.model.po.CmDistributionTeamProduct;
+import com.caimei365.commodity.model.po.CmReportingClub;
+import com.caimei365.commodity.model.po.CmReportingMember;
+import com.caimei365.commodity.model.vo.ArchiveVo;
+import com.caimei365.commodity.model.vo.PaginationVo;
+import com.caimei365.commodity.service.CmReportingClubService;
+import com.github.pagehelper.PageHelper;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * @创建人 hzg
+ * @创建时间 2022/8/30
+ * @描述
+ */
+@RequestMapping("/commodity/reportingClub")
+@RequiredArgsConstructor
+@RestController
+public class ReportingClubApi {
+
+    private final CmReportingClubService cmReportingClubService;
+
+
+    @ApiOperation("机构意向订单报备列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(readOnly = true, name = "pageNo", value = "页面页数"),
+            @ApiImplicitParam(readOnly = true, name = "pageSize", value = "页面数据量"),
+            @ApiImplicitParam(readOnly = true, name = "id", value = "用户Id"),
+            @ApiImplicitParam(readOnly = true, name = "parentId", value = "父级Id"),
+            @ApiImplicitParam(readOnly = true, name = "clubName", value = "机构名称"),
+    })
+    @GetMapping("/list")
+    public ResponseJson list(CmDistribution cmDistribution,String clubName,
+                             @RequestParam(value = "pageNum", defaultValue = "1") int pageNum, @RequestParam(value = "pageSize", defaultValue = "20") int pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        List<CmReportingMember> cmReportingClubList = cmReportingClubService.getCmReportingClubList(cmDistribution,clubName);
+        PaginationVo<CmReportingMember> paginationVo = new PaginationVo(cmReportingClubList);
+        return ResponseJson.success(paginationVo);
+    }
+
+    @ApiOperation("分销团队商品列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(readOnly = true, name = "pageNo", value = "页面页数"),
+            @ApiImplicitParam(readOnly = true, name = "pageSize", value = "页面数据量"),
+            @ApiImplicitParam(readOnly = true, name = "id", value = "父级Id"),
+            @ApiImplicitParam(readOnly = true, name = "name", value = "商品名称"),
+    })
+    @GetMapping("/productList")
+    public ResponseJson productList(CmDistribution cmDistribution,
+                             @RequestParam(value = "pageNum", defaultValue = "1") int pageNum, @RequestParam(value = "pageSize", defaultValue = "20") int pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        List<CmDistributionTeamProduct> cmDistributionTeamProducts = cmReportingClubService.getCmDistributionTeamProductList(cmDistribution);
+        PaginationVo<CmDistributionTeamProduct> paginationVo = new PaginationVo(cmDistributionTeamProducts);
+        return ResponseJson.success(paginationVo);
+    }
+
+    @ApiOperation("分销团队商品资料列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(readOnly = true, name = "pageNo", value = "页面页数"),
+            @ApiImplicitParam(readOnly = true, name = "pageSize", value = "页面数据量"),
+            @ApiImplicitParam(readOnly = true, name = "productName", value = "商品名称"),
+    })
+    @GetMapping("/archiveList")
+    public ResponseJson getProductArchiveList(String productName,
+                             @RequestParam(value = "pageNum", defaultValue = "1") int pageNum, @RequestParam(value = "pageSize", defaultValue = "20") int pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        List<ArchiveVo> archiveList = cmReportingClubService.getProductArchiveList(productName);
+        PaginationVo<ArchiveVo> paginationVo = new PaginationVo(archiveList);
+        return ResponseJson.success(paginationVo);
+    }
+
+
+    @ApiOperation("机构意向订单报备成员记录详情")
+    @ApiImplicitParams({
+            @ApiImplicitParam(readOnly = true, name = "id", value = "机构意向订单报备成员记录Id"),
+    })
+    @GetMapping("/details")
+    public ResponseJson list(String id) {
+        CmReportingMember cmReportingMember = cmReportingClubService.getCmReportingMemberById(id);
+        return ResponseJson.success(cmReportingMember);
+    }
+
+    @ApiOperation("新增机构意向订单")
+    @ApiImplicitParams({
+            @ApiImplicitParam(readOnly = true, name = "id", value = "机构意向订单报备成员记录Id"),
+    })
+    @PostMapping("/add")
+    public ResponseJson add(CmReportingClub cmReportingClub) {
+        return cmReportingClubService.addCmReportingClub(cmReportingClub);
+    }
+
+
+}

+ 113 - 0
src/main/java/com/caimei365/commodity/mapper/CmDistributionMapper.java

@@ -0,0 +1,113 @@
+package com.caimei365.commodity.mapper;
+
+import com.caimei365.commodity.model.po.CmDistribution;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * Mapper接口
+ *
+ * @author Kaick
+ * @date 2023-09-15
+ */
+@Mapper
+public interface CmDistributionMapper
+{
+    /**
+     * 通过对象查询列表
+     *
+     * @param cmDistribution
+     * @return 集合
+     */
+    public List<CmDistribution> getCmDistributionList(CmDistribution cmDistribution);
+
+    /**
+     * 通过Id查询对象
+     *
+     * @param id 主键
+     * @return
+     */
+    public CmDistribution getCmDistributionById(String id);
+
+    /**
+     * 通过对象查询对象
+     *
+     * @param cmDistribution
+     * @return
+     */
+    public CmDistribution getByCmDistribution(CmDistribution cmDistribution);
+
+    /**
+     * 通过对象查询Id
+     *
+     * @param cmDistribution
+     * @return String
+     */
+    public String getById(CmDistribution cmDistribution);
+
+    /**
+     * 通过对象查询Ids
+     *
+     * @param cmDistribution
+     * @return List<String>
+     */
+    public List<String> getByIds(CmDistribution cmDistribution);
+
+    /**
+     * 通过对象查询记录总数
+     *
+     * @param cmDistribution
+     * @return Integer
+     */
+    public int getCmDistributionCount(CmDistribution cmDistribution);
+
+    /**
+     * 新增
+     *
+     * @param cmDistribution
+     * @return 结果
+     */
+    public int addCmDistribution(CmDistribution cmDistribution);
+
+    /**
+     * 修改
+     *
+     * @param cmDistribution
+     * @return 结果
+     */
+    public int updateCmDistribution(CmDistribution cmDistribution);
+
+    /**
+     * 删除
+     *
+     * @param id 主键
+     * @return 结果
+     */
+    public int delCmDistributionById(String id);
+
+    /**
+     * 批量删除
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int delCmDistribution(CmDistribution cmDistribution);
+
+    /**
+     * 批量删除
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int delCmDistributionByIds(@Param("ids") String[] ids);
+
+    /**
+     * 修改批量删除
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int updateDelCmDistributionByIds(@Param("ids") String[] ids,@Param("delFlag") Integer delFlag);
+}

+ 169 - 0
src/main/java/com/caimei365/commodity/mapper/CmDistributionProductMapper.java

@@ -0,0 +1,169 @@
+package com.caimei365.commodity.mapper;
+
+import com.caimei365.commodity.model.po.CmDistributionProduct;
+import com.caimei365.commodity.model.po.CmDistributionTeamProduct;
+import com.caimei365.commodity.model.vo.ArchiveVo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * Mapper接口
+ *
+ * @author Kaick
+ * @date 2023-09-18
+ */
+@Mapper
+public interface CmDistributionProductMapper
+{
+    /**
+     * 通过对象查询列表
+     *
+     * @param cmDistributionProduct
+     * @return 集合
+     */
+    public List<CmDistributionProduct> getCmDistributionProductList(CmDistributionProduct cmDistributionProduct);
+    /**
+     * 通过对象查询列表
+     *
+     * @param cmDistributionTeamProduct
+     * @return 集合
+     */
+    public List<CmDistributionTeamProduct> getCmDistributionTeamProductList(CmDistributionTeamProduct cmDistributionTeamProduct);
+
+    /**
+     * 查询分销商品资料列表
+     *
+     * @param productName     搜索关键词
+     * @return
+     */
+    List<ArchiveVo> getProductArchiveList( @Param("productName") String productName);
+
+    /**
+     * 通过对象查询分销团队商品列表
+     *
+     * @param cmDistributionProduct
+     * @return 集合
+     */
+    public List<CmDistributionProduct> findTeamProductPage(CmDistributionProduct cmDistributionProduct);
+
+    /**
+     * 通过Id查询对象
+     *
+     * @param id 主键
+     * @return
+     */
+    public CmDistributionProduct getCmDistributionProductById(String id);
+
+    /**
+     * 通过对象查询对象
+     *
+     * @param cmDistributionProduct
+     * @return
+     */
+    public CmDistributionProduct getByCmDistributionProduct(CmDistributionProduct cmDistributionProduct);
+
+    /**
+     * 通过对象查询Id
+     *
+     * @param cmDistributionProduct
+     * @return String
+     */
+    public String getById(CmDistributionProduct cmDistributionProduct);
+
+    /**
+     * 通过对象查询Ids
+     *
+     * @param cmDistributionProduct
+     * @return List<String>
+     */
+    public List<String> getByIds(CmDistributionProduct cmDistributionProduct);
+    /**
+     * 通过对象查询商品Ids
+     *
+     * @param cmDistributionProduct
+     * @return List<String>
+     */
+    public List<Integer> getByProductIds(CmDistributionProduct cmDistributionProduct);
+
+    /**
+     * 通过对象查询分销团队商品Ids
+     *
+     * @param cmDistributionProduct
+     * @return List<String>
+     */
+    public List<Integer> getByTeamProductIds(CmDistributionProduct cmDistributionProduct);
+
+    /**
+     * 通过对象查询记录总数
+     *
+     * @param cmDistributionProduct
+     * @return Integer
+     */
+    public int getCmDistributionProductCount(CmDistributionProduct cmDistributionProduct);
+
+    /**
+     * 通过对象查询记录总数
+     *
+     * @param cmDistributionTeamProduct
+     * @return Integer
+     */
+    public int getCmDistributionTeamProductCount(CmDistributionTeamProduct cmDistributionTeamProduct);
+    /**
+     * 新增
+     *
+     * @param cmDistributionProduct
+     * @return 结果
+     */
+    public int addCmDistributionProduct(CmDistributionProduct cmDistributionProduct);
+    /**
+     * 新增
+     *
+     * @param cmDistributionTeamProduct
+     * @return 结果
+     */
+    public int addCmDistributionTeamProduct(CmDistributionTeamProduct cmDistributionTeamProduct);
+    /**
+     * 修改
+     *
+     * @param cmDistributionProduct
+     * @return 结果
+     */
+    public int updateCmDistributionProduct(CmDistributionProduct cmDistributionProduct);
+
+
+
+    /**
+     * 批量删除
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int delCmDistributionProduct(CmDistributionProduct cmDistributionProduct);
+
+    /**
+     * 批量删除
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int delCmDistributionProductByIds(@Param("ids") String[] ids);
+
+
+
+    /**
+     * 修改
+     *
+     * @param cmDistributionTeamProduct
+     * @return 结果
+     */
+    public int updateCmDistributionTeamProduct(CmDistributionTeamProduct cmDistributionTeamProduct);
+
+
+    /**
+     * 批量删除
+     * @return 结果
+     */
+    public int delCmDistributionTeamProduct(CmDistributionTeamProduct cmDistributionTeamProduct);
+}

+ 111 - 0
src/main/java/com/caimei365/commodity/mapper/CmDistributionSkuMapper.java

@@ -0,0 +1,111 @@
+package com.caimei365.commodity.mapper;
+
+import com.caimei.modules.product.entity.CmDistributionSku;
+import com.caimei.modules.product.entity.CmSku;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * Mapper接口
+ *
+ * @author Kaick
+ * @date 2023-09-18
+ */
+@Mapper
+public interface CmDistributionSkuMapper
+{
+    /**
+     * 通过对象查询列表
+     *
+     * @param cmDistributionSku
+     * @return 集合
+     */
+    public List<CmDistributionSku> getCmDistributionSkuList(CmDistributionSku cmDistributionSku);
+
+    /**
+     * 通过Id查询对象
+     *
+     * @param skuId 主键
+     * @return
+     */
+    public CmDistributionSku getCmDistributionSkuBySkuId(String skuId);
+
+    /**
+     * 通过对象查询对象
+     *
+     * @param cmDistributionSku
+     * @return
+     */
+    public CmDistributionSku getByCmDistributionSku(CmDistributionSku cmDistributionSku);
+
+    /**
+     * 通过对象查询Id
+     *
+     * @param cmDistributionSku
+     * @return String
+     */
+    public String getById(CmDistributionSku cmDistributionSku);
+
+    /**
+     * 通过对象查询Ids
+     *
+     * @param cmDistributionSku
+     * @return List<String>
+     */
+    public List<String> getByIds(CmDistributionSku cmDistributionSku);
+
+    public List<CmSku> findDistributionSku(Integer productId);
+    /**
+     * 通过对象查询记录总数
+     *
+     * @param cmDistributionSku
+     * @return Integer
+     */
+    public int getCmDistributionSkuCount(CmDistributionSku cmDistributionSku);
+
+    /**
+     * 新增
+     *
+     * @param cmDistributionSku
+     * @return 结果
+     */
+    public int addCmDistributionSku(CmDistributionSku cmDistributionSku);
+
+
+
+    /**
+     * 修改
+     *
+     * @param cmDistributionSku
+     * @return 结果
+     */
+    public int updateCmDistributionSku(CmDistributionSku cmDistributionSku);
+
+    /**
+     * 删除
+     *
+     * @param skuId 主键
+     * @return 结果
+     */
+    public int delCmDistributionSkuBySkuId(String skuId);
+
+    /**
+     * 批量删除
+     *
+     * @param skuIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int delCmDistributionSku(CmDistributionSku cmDistributionSku);
+
+    /**
+     * 批量删除
+     *
+     * @param skuIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int delCmDistributionSkuBySkuIds(@Param("skuIds") String[] skuIds);
+
+}

+ 113 - 0
src/main/java/com/caimei365/commodity/mapper/CmRelatedImageMapper.java

@@ -0,0 +1,113 @@
+package com.caimei365.commodity.mapper;
+
+import com.caimei365.commodity.model.po.CmRelatedImage;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 相关图片Mapper接口
+ *
+ * @author Kaick
+ * @date 2023-09-20
+ */
+@Mapper
+public interface CmRelatedImageMapper
+{
+    /**
+     * 通过对象查询相关图片列表
+     *
+     * @param cmRelatedImage 相关图片
+     * @return 相关图片集合
+     */
+    public List<CmRelatedImage> getCmRelatedImageList(CmRelatedImage cmRelatedImage);
+
+    /**
+     * 通过Id查询相关图片对象
+     *
+     * @param id 相关图片主键
+     * @return 相关图片
+     */
+    public CmRelatedImage getCmRelatedImageById(String id);
+
+    /**
+     * 通过对象查询相关图片对象
+     *
+     * @param cmRelatedImage 相关图片
+     * @return 相关图片
+     */
+    public CmRelatedImage getByCmRelatedImage(CmRelatedImage cmRelatedImage);
+
+    /**
+     * 通过对象查询相关图片Id
+     *
+     * @param cmRelatedImage 相关图片
+     * @return String
+     */
+    public String getById(CmRelatedImage cmRelatedImage);
+
+    /**
+     * 通过对象查询相关图片Ids
+     *
+     * @param cmRelatedImage 相关图片
+     * @return List<String>
+     */
+    public List<String> getByIds(CmRelatedImage cmRelatedImage);
+
+    /**
+     * 通过对象查询相关图片记录总数
+     *
+     * @param cmRelatedImage 相关图片
+     * @return 相关图片Integer
+     */
+    public int getCmRelatedImageCount(CmRelatedImage cmRelatedImage);
+
+    /**
+     * 新增相关图片
+     *
+     * @param cmRelatedImage 相关图片
+     * @return 结果
+     */
+    public int addCmRelatedImage(CmRelatedImage cmRelatedImage);
+
+    /**
+     * 修改相关图片
+     *
+     * @param cmRelatedImage 相关图片
+     * @return 结果
+     */
+    public int updateCmRelatedImage(CmRelatedImage cmRelatedImage);
+
+    /**
+     * 删除相关图片
+     *
+     * @param id 相关图片主键
+     * @return 结果
+     */
+    public int delCmRelatedImageById(String id);
+
+    /**
+     * 批量删除相关图片
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int delCmRelatedImage(CmRelatedImage cmRelatedImage);
+
+    /**
+     * 批量删除相关图片
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int delCmRelatedImageByIds(@Param("ids") String[] ids);
+
+    /**
+     * 修改批量删除相关图片
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int updateDelCmRelatedImageByIds(@Param("ids") String[] ids,@Param("delFlag") Integer delFlag);
+}

+ 113 - 0
src/main/java/com/caimei365/commodity/mapper/CmReportingClubMapper.java

@@ -0,0 +1,113 @@
+package com.caimei365.commodity.mapper;
+
+import com.caimei365.commodity.model.po.CmReportingClub;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 机构报备Mapper接口
+ *
+ * @author Kaick
+ * @date 2023-09-20
+ */
+@Mapper
+public interface CmReportingClubMapper
+{
+    /**
+     * 通过对象查询机构报备列表
+     *
+     * @param cmReportingClub 机构报备
+     * @return 机构报备集合
+     */
+    public List<CmReportingClub> getCmReportingClubList(CmReportingClub cmReportingClub);
+
+    /**
+     * 通过Id查询机构报备对象
+     *
+     * @param id 机构报备主键
+     * @return 机构报备
+     */
+    public CmReportingClub getCmReportingClubById(String id);
+
+    /**
+     * 通过对象查询机构报备对象
+     *
+     * @param cmReportingClub 机构报备
+     * @return 机构报备
+     */
+    public CmReportingClub getByCmReportingClub(CmReportingClub cmReportingClub);
+
+    /**
+     * 通过对象查询机构报备Id
+     *
+     * @param cmReportingClub 机构报备
+     * @return String
+     */
+    public String getById(CmReportingClub cmReportingClub);
+
+    /**
+     * 通过对象查询机构报备Ids
+     *
+     * @param cmReportingClub 机构报备
+     * @return List<String>
+     */
+    public List<String> getByIds(CmReportingClub cmReportingClub);
+
+    /**
+     * 通过对象查询机构报备记录总数
+     *
+     * @param cmReportingClub 机构报备
+     * @return 机构报备Integer
+     */
+    public int getCmReportingClubCount(CmReportingClub cmReportingClub);
+
+    /**
+     * 新增机构报备
+     *
+     * @param cmReportingClub 机构报备
+     * @return 结果
+     */
+    public int addCmReportingClub(CmReportingClub cmReportingClub);
+
+    /**
+     * 修改机构报备
+     *
+     * @param cmReportingClub 机构报备
+     * @return 结果
+     */
+    public int updateCmReportingClub(CmReportingClub cmReportingClub);
+
+    /**
+     * 删除机构报备
+     *
+     * @param id 机构报备主键
+     * @return 结果
+     */
+    public int delCmReportingClubById(String id);
+
+    /**
+     * 批量删除机构报备
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int delCmReportingClub(CmReportingClub cmReportingClub);
+
+    /**
+     * 批量删除机构报备
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int delCmReportingClubByIds(@Param("ids") String[] ids);
+
+    /**
+     * 修改批量删除机构报备
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int updateDelCmReportingClubByIds(@Param("ids") String[] ids,@Param("delFlag") Integer delFlag);
+}

+ 121 - 0
src/main/java/com/caimei365/commodity/mapper/CmReportingMemberMapper.java

@@ -0,0 +1,121 @@
+package com.caimei365.commodity.mapper;
+
+import com.caimei365.commodity.model.po.CmDistribution;
+import com.caimei365.commodity.model.po.CmReportingMember;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 分销报备成员Mapper接口
+ *
+ * @author Kaick
+ * @date 2023-09-20
+ */
+@Mapper
+public interface CmReportingMemberMapper
+{
+    /**
+     * 通过对象查询分销报备成员列表
+     *
+     * @param cmReportingMember 分销报备成员
+     * @return 分销报备成员集合
+     */
+    public List<CmReportingMember> getCmReportingMemberList(CmReportingMember cmReportingMember);
+    /**
+     * 通过对象查询分销报备成员列表
+     *
+     * @param cmDistribution 分销报备成员
+     * @return 分销报备成员集合
+     */
+    public List<CmReportingMember> getCmDistributionMemberList(@Param("cmDistribution")CmDistribution cmDistribution,@Param("clubName") String clubName);
+
+    /**
+     * 通过Id查询分销报备成员对象
+     *
+     * @param id 分销报备成员主键
+     * @return 分销报备成员
+     */
+    public CmReportingMember getCmReportingMemberById(String id);
+
+    /**
+     * 通过对象查询分销报备成员对象
+     *
+     * @param cmReportingMember 分销报备成员
+     * @return 分销报备成员
+     */
+    public CmReportingMember getByCmReportingMember(CmReportingMember cmReportingMember);
+
+    /**
+     * 通过对象查询分销报备成员Id
+     *
+     * @param cmReportingMember 分销报备成员
+     * @return String
+     */
+    public String getById(CmReportingMember cmReportingMember);
+
+    /**
+     * 通过对象查询分销报备成员Ids
+     *
+     * @param cmReportingMember 分销报备成员
+     * @return List<String>
+     */
+    public List<String> getByIds(CmReportingMember cmReportingMember);
+
+    /**
+     * 通过对象查询分销报备成员记录总数
+     *
+     * @param cmReportingMember 分销报备成员
+     * @return 分销报备成员Integer
+     */
+    public Integer getCmReportingMemberCount(CmReportingMember cmReportingMember);
+
+    /**
+     * 新增分销报备成员
+     *
+     * @param cmReportingMember 分销报备成员
+     * @return 结果
+     */
+    public int addCmReportingMember(CmReportingMember cmReportingMember);
+
+    /**
+     * 修改分销报备成员
+     *
+     * @param cmReportingMember 分销报备成员
+     * @return 结果
+     */
+    public int updateCmReportingMember(CmReportingMember cmReportingMember);
+
+    /**
+     * 删除分销报备成员
+     *
+     * @param id 分销报备成员主键
+     * @return 结果
+     */
+    public int delCmReportingMemberById(String id);
+
+    /**
+     * 批量删除分销报备成员
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int delCmReportingMember(CmReportingMember cmReportingMember);
+
+    /**
+     * 批量删除分销报备成员
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int delCmReportingMemberByIds(@Param("ids") String[] ids);
+
+    /**
+     * 修改批量删除分销报备成员
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int updateDelCmReportingMemberByIds(@Param("ids") String[] ids,@Param("delFlag") Integer delFlag);
+}

+ 211 - 0
src/main/java/com/caimei365/commodity/model/po/CmDistribution.java

@@ -0,0 +1,211 @@
+package com.caimei365.commodity.model.po;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.experimental.Accessors;
+import org.apache.ibatis.type.Alias;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 对象 cm_distribution
+ *
+ * @author Kaick
+ * @date 2023-09-15
+ */
+@Accessors(fluent  = true )
+@Data
+@Alias("CmDistribution")
+public class CmDistribution  implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private String id;
+
+    /** 用户id */
+    private Integer userId;
+
+    /** 名称 */
+    private String name;
+
+    /** 联系人 */
+    private String linkMan;
+    /** 手机号 */
+    private String mobile;
+    /** 密码 */
+    private String password;
+
+    /** 公司名称 */
+    private String corporateName;
+
+    /** 分账号 */
+    private String splitCode;
+
+    /** 所属银行 */
+    private String bankName;
+
+    /** 银行卡号 */
+    private String bankAccount;
+
+    /** 状态:90上线,91下线 */
+    private Integer status;
+
+    /** 分销二维码 */
+    private String qrCode;
+
+    /** 父级团队Id:0表示团队 */
+    private Integer parentId;
+
+    /** 父级团队Id集合 */
+    private String parentIds;
+
+    /** 修改时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /** 添加时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date addTime;
+
+    /** 删除状态 0正常,其他删除 */
+    private String delFlag;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getLinkMan() {
+        return linkMan;
+    }
+
+    public void setLinkMan(String linkMan) {
+        this.linkMan = linkMan;
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getCorporateName() {
+        return corporateName;
+    }
+
+    public void setCorporateName(String corporateName) {
+        this.corporateName = corporateName;
+    }
+
+    public String getSplitCode() {
+        return splitCode;
+    }
+
+    public void setSplitCode(String splitCode) {
+        this.splitCode = splitCode;
+    }
+
+    public String getBankName() {
+        return bankName;
+    }
+
+    public void setBankName(String bankName) {
+        this.bankName = bankName;
+    }
+
+    public String getBankAccount() {
+        return bankAccount;
+    }
+
+    public void setBankAccount(String bankAccount) {
+        this.bankAccount = bankAccount;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public String getQrCode() {
+        return qrCode;
+    }
+
+    public void setQrCode(String qrCode) {
+        this.qrCode = qrCode;
+    }
+
+    public Integer getParentId() {
+        return parentId;
+    }
+
+    public void setParentId(Integer parentId) {
+        this.parentId = parentId;
+    }
+
+    public String getParentIds() {
+        return parentIds;
+    }
+
+    public void setParentIds(String parentIds) {
+        this.parentIds = parentIds;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public Date getAddTime() {
+        return addTime;
+    }
+
+    public void setAddTime(Date addTime) {
+        this.addTime = addTime;
+    }
+
+    public String getDelFlag() {
+        return delFlag;
+    }
+
+    public void setDelFlag(String delFlag) {
+        this.delFlag = delFlag;
+    }
+}
+

+ 213 - 0
src/main/java/com/caimei365/commodity/model/po/CmDistributionProduct.java

@@ -0,0 +1,213 @@
+package com.caimei365.commodity.model.po;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.experimental.Accessors;
+import org.apache.ibatis.type.Alias;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 对象 cm_distribution_product
+ *
+ * @author Kaick
+ * @date 2023-09-18
+ */
+@Accessors(fluent  = true )
+@Data
+@Alias("CmDistributionProduct")
+public class CmDistributionProduct  implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private String id;
+
+    /** 对应采美商品id */
+    private Integer productId;
+
+    /** 上架状态:1上架,2下架 */
+    private String validFlag;
+
+    /** 是否含税 0不含税,1含税 */
+    private String includedTax;
+
+    /** 发票类型(基于是否含税基础) 1增值税专用发票,2增值税普通发票, 3不能开票 */
+    private String invoiceType;
+
+    /** 机构税率 :增值税默认13%,普通票6%取值范围[0-100] */
+    private BigDecimal clubTaxPoint;
+
+    /** 供应商税率:增值专用发票默认13%,增值税普通发票6%取值范围[0-100] */
+    private BigDecimal shopTaxPoint;
+
+    /** 报备佣金 */
+    private BigDecimal commission;
+
+    /** 添加时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date addTime;
+
+
+
+    /** 团队Id */
+    private Integer distributionId;
+
+    /** 商品名称 */
+    private String name;
+    /** 供应商Id */
+    private String shopID;
+    /** 供应商名称 */
+    private String shopName;
+    /** mainImage */
+    private String mainImage;
+
+
+
+    /** skuId */
+    private String skuId;
+    /** 机构价格(同为二手商品的交易价) */
+    private BigDecimal price;
+
+    /** 机构价格(同为二手商品的交易价) */
+    private List<CmDistributionSku> skus;
+
+    public Integer getDistributionId() {
+        return distributionId;
+    }
+
+    public void setDistributionId(Integer distributionId) {
+        this.distributionId = distributionId;
+    }
+
+    public List<CmDistributionSku> getSkus() {
+        return skus;
+    }
+
+    public void setSkus(List<CmDistributionSku> skus) {
+        this.skus = skus;
+    }
+
+    public String getSkuId() {
+        return skuId;
+    }
+
+    public void setSkuId(String skuId) {
+        this.skuId = skuId;
+    }
+
+    public BigDecimal getPrice() {
+        return price;
+    }
+
+    public void setPrice(BigDecimal price) {
+        this.price = price;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getShopID() {
+        return shopID;
+    }
+
+    public void setShopID(String shopID) {
+        this.shopID = shopID;
+    }
+
+    public String getShopName() {
+        return shopName;
+    }
+
+    public void setShopName(String shopName) {
+        this.shopName = shopName;
+    }
+
+    public String getMainImage() {
+        return mainImage;
+    }
+
+    public void setMainImage(String mainImage) {
+        this.mainImage = mainImage;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public Integer getProductId() {
+        return productId;
+    }
+
+    public void setProductId(Integer productId) {
+        this.productId = productId;
+    }
+
+    public String getValidFlag() {
+        return validFlag;
+    }
+
+    public void setValidFlag(String validFlag) {
+        this.validFlag = validFlag;
+    }
+
+    public String getIncludedTax() {
+        return includedTax;
+    }
+
+    public void setIncludedTax(String includedTax) {
+        this.includedTax = includedTax;
+    }
+
+    public String getInvoiceType() {
+        return invoiceType;
+    }
+
+    public void setInvoiceType(String invoiceType) {
+        this.invoiceType = invoiceType;
+    }
+
+    public BigDecimal getClubTaxPoint() {
+        return clubTaxPoint;
+    }
+
+    public void setClubTaxPoint(BigDecimal clubTaxPoint) {
+        this.clubTaxPoint = clubTaxPoint;
+    }
+
+    public BigDecimal getShopTaxPoint() {
+        return shopTaxPoint;
+    }
+
+    public void setShopTaxPoint(BigDecimal shopTaxPoint) {
+        this.shopTaxPoint = shopTaxPoint;
+    }
+
+    public BigDecimal getCommission() {
+        return commission;
+    }
+
+    public void setCommission(BigDecimal commission) {
+        this.commission = commission;
+    }
+
+    public Date getAddTime() {
+        return addTime;
+    }
+
+    public void setAddTime(Date addTime) {
+        this.addTime = addTime;
+    }
+}

+ 140 - 0
src/main/java/com/caimei365/commodity/model/po/CmDistributionSku.java

@@ -0,0 +1,140 @@
+package com.caimei365.commodity.model.po;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+import org.apache.ibatis.type.Alias;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * 对象 cm_distribution_sku
+ *
+ * @author Kaick
+ * @date 2023-09-18
+ */
+@Accessors(fluent  = true )
+@Data
+@Alias("CmDistributionSku")
+public class CmDistributionSku  implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** skuId */
+    private String skuId;
+
+    /** 商品Id */
+    private Integer productId;
+
+    /** 机构价格(同为二手商品的交易价) */
+    private BigDecimal price;
+
+    /** 分账供应商成本比例 */
+    private Integer shopPercent;
+
+    /** 分账组织佣金比例 */
+    private Integer organizePercent;
+
+    /** 分账采美佣金比例 */
+    private Integer cmPercent;
+
+    /** 成本类型:1固定成本 2比例成本 */
+    private String costCheckFlag;
+    /** 规格 */
+    private String unit;
+
+    /** 成本价 */
+    private BigDecimal costPrice;
+    /** 采美成本 */
+    private BigDecimal cmCostPrice;
+    /** 集团成本 */
+    private BigDecimal organizeCostPrice;
+
+    public BigDecimal getCostPrice() {
+        return costPrice;
+    }
+
+    public void setCostPrice(BigDecimal costPrice) {
+        this.costPrice = costPrice;
+    }
+
+    public BigDecimal getCmCostPrice() {
+        return cmCostPrice;
+    }
+
+    public void setCmCostPrice(BigDecimal cmCostPrice) {
+        this.cmCostPrice = cmCostPrice;
+    }
+
+    public BigDecimal getOrganizeCostPrice() {
+        return organizeCostPrice;
+    }
+
+    public void setOrganizeCostPrice(BigDecimal organizeCostPrice) {
+        this.organizeCostPrice = organizeCostPrice;
+    }
+
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+    public String getSkuId() {
+        return skuId;
+    }
+
+    public void setSkuId(String skuId) {
+        this.skuId = skuId;
+    }
+
+    public Integer getProductId() {
+        return productId;
+    }
+
+    public void setProductId(Integer productId) {
+        this.productId = productId;
+    }
+
+    public BigDecimal getPrice() {
+        return price;
+    }
+
+    public void setPrice(BigDecimal price) {
+        this.price = price;
+    }
+
+    public Integer getShopPercent() {
+        return shopPercent;
+    }
+
+    public void setShopPercent(Integer shopPercent) {
+        this.shopPercent = shopPercent;
+    }
+
+    public Integer getOrganizePercent() {
+        return organizePercent;
+    }
+
+    public void setOrganizePercent(Integer organizePercent) {
+        this.organizePercent = organizePercent;
+    }
+
+    public Integer getCmPercent() {
+        return cmPercent;
+    }
+
+    public void setCmPercent(Integer cmPercent) {
+        this.cmPercent = cmPercent;
+    }
+
+    public String getCostCheckFlag() {
+        return costCheckFlag;
+    }
+
+    public void setCostCheckFlag(String costCheckFlag) {
+        this.costCheckFlag = costCheckFlag;
+    }
+}

+ 109 - 0
src/main/java/com/caimei365/commodity/model/po/CmDistributionTeamProduct.java

@@ -0,0 +1,109 @@
+package com.caimei365.commodity.model.po;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+import org.apache.ibatis.type.Alias;
+
+import java.io.Serializable;
+
+/**
+ * 对象 cm_distribution_team_product
+ *
+ * @author Kaick
+ * @date 2023-09-20
+ */
+@Accessors(fluent  = true )
+@Data
+@Alias("CmDistributionTeamProduct")
+public class CmDistributionTeamProduct  implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private String id;
+
+    /** cm_distribution表id */
+    private Integer distributionId;
+
+    /** cm_distribution_product表商品id */
+    private Integer productId;
+
+    /** 上架状态:1上架,2下架 */
+    private String validFlag;
+
+
+
+    /** 商品名称 */
+    private String name;
+    /** 供应商Id */
+    private String shopID;
+    /** 供应商名称 */
+    private String shopName;
+    /** mainImage */
+    private String mainImage;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getShopID() {
+        return shopID;
+    }
+
+    public void setShopID(String shopID) {
+        this.shopID = shopID;
+    }
+
+    public String getShopName() {
+        return shopName;
+    }
+
+    public void setShopName(String shopName) {
+        this.shopName = shopName;
+    }
+
+    public String getMainImage() {
+        return mainImage;
+    }
+
+    public void setMainImage(String mainImage) {
+        this.mainImage = mainImage;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public Integer getDistributionId() {
+        return distributionId;
+    }
+
+    public void setDistributionId(Integer distributionId) {
+        this.distributionId = distributionId;
+    }
+
+    public Integer getProductId() {
+        return productId;
+    }
+
+    public void setProductId(Integer productId) {
+        this.productId = productId;
+    }
+
+    public String getValidFlag() {
+        return validFlag;
+    }
+
+    public void setValidFlag(String validFlag) {
+        this.validFlag = validFlag;
+    }
+}
+

+ 103 - 0
src/main/java/com/caimei365/commodity/model/po/CmRelatedImage.java

@@ -0,0 +1,103 @@
+package com.caimei365.commodity.model.po;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.experimental.Accessors;
+import org.apache.ibatis.type.Alias;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 相关图片对象 cm_related_image
+ *
+ * @author Kaick
+ * @date 2023-09-20
+ */
+@Accessors(fluent  = true )
+@Data
+@Alias("CmRelatedImage")
+public class CmRelatedImage implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private String id;
+
+    /** 分类:1分销报备凭证图片(cm_reporting_member) */
+    private String type;
+
+    /** 归属者Id(type字段表Id) */
+    private String authorId;
+
+    /** 图片 */
+    private String image;
+
+    /** 删除状态 0正常,其他删除 */
+    private Integer delFlag;
+
+    /** 修改时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /** 添加时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getAuthorId() {
+        return authorId;
+    }
+
+    public void setAuthorId(String authorId) {
+        this.authorId = authorId;
+    }
+
+    public String getImage() {
+        return image;
+    }
+
+    public void setImage(String image) {
+        this.image = image;
+    }
+
+    public Integer getDelFlag() {
+        return delFlag;
+    }
+
+    public void setDelFlag(Integer delFlag) {
+        this.delFlag = delFlag;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+}
+

+ 277 - 0
src/main/java/com/caimei365/commodity/model/po/CmReportingClub.java

@@ -0,0 +1,277 @@
+package com.caimei365.commodity.model.po;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.experimental.Accessors;
+import org.apache.ibatis.type.Alias;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 机构报备对象 cm_reporting_club
+ *
+ * @author Kaick
+ * @date 2023-09-20
+ */
+@Accessors(fluent  = true )
+@Data
+@Alias("CmReportingClub")
+public class CmReportingClub implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private String id;
+
+    /** 机构名称 */
+    private String clubName;
+
+    /** 联系人 */
+    private String linkMan;
+
+    /** 手机号 */
+    private String mobile;
+
+    /** 商品id */
+    private Integer productId;
+
+    /** 商品名称 */
+    private String productName;
+
+    /** 商品图片 */
+    private String productImage;
+
+    /** 备注 */
+    private String remarks;
+    /** 订单id */
+    private Integer orderId;
+    /** 订单状态 :1已成交,0未成交 */
+    private Integer orderStatus;
+
+    /** 锁定状态 :1锁定,0未锁定 */
+    private Integer lockStatus;
+
+    /** 锁定时间 */
+    private Integer lockTime;
+
+    /** 分销报备人数量 */
+    private Integer distributionCount;
+
+    /** 分销报备锁定人id */
+    private Integer distributionId;
+
+    /** 分销报备锁定人id */
+    private String distributionName;
+
+    /** 删除状态 0正常,其他删除 */
+    private String delFlag;
+
+    /** 修改时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /** 添加时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+    /** 商品总佣金 */
+    private BigDecimal commission;
+
+    /** 结算状态: 1已完结 ,0未完结 */
+    private Integer settleStatus;
+
+    /** 结算时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date settleTime;
+    /** 报备成员 */
+    private CmReportingMember cmReportingMember;
+    /** 报备成员集合 */
+    private List<CmReportingMember> cmReportingMemberList;
+
+    public Integer getOrderId() {
+        return orderId;
+    }
+
+    public void setOrderId(Integer orderId) {
+        this.orderId = orderId;
+    }
+
+    public BigDecimal getCommission() {
+        return commission;
+    }
+
+    public void setCommission(BigDecimal commission) {
+        this.commission = commission;
+    }
+
+    public Integer getSettleStatus() {
+        return settleStatus;
+    }
+
+    public void setSettleStatus(Integer settleStatus) {
+        this.settleStatus = settleStatus;
+    }
+
+    public Date getSettleTime() {
+        return settleTime;
+    }
+
+    public void setSettleTime(Date settleTime) {
+        this.settleTime = settleTime;
+    }
+
+    public String getProductName() {
+        return productName;
+    }
+
+    public void setProductName(String productName) {
+        this.productName = productName;
+    }
+
+    public String getProductImage() {
+        return productImage;
+    }
+
+    public void setProductImage(String productImage) {
+        this.productImage = productImage;
+    }
+
+    public Integer getLockTime() {
+        return lockTime;
+    }
+
+    public void setLockTime(Integer lockTime) {
+        this.lockTime = lockTime;
+    }
+
+    public Integer getDistributionCount() {
+        return distributionCount;
+    }
+
+    public void setDistributionCount(Integer distributionCount) {
+        this.distributionCount = distributionCount;
+    }
+
+    public String getDistributionName() {
+        return distributionName;
+    }
+
+    public void setDistributionName(String distributionName) {
+        this.distributionName = distributionName;
+    }
+
+    public CmReportingMember getCmReportingMember() {
+        return cmReportingMember;
+    }
+
+    public void setCmReportingMember(CmReportingMember cmReportingMember) {
+        this.cmReportingMember = cmReportingMember;
+    }
+
+    public List<CmReportingMember> getCmReportingMemberList() {
+        return cmReportingMemberList;
+    }
+
+    public void setCmReportingMemberList(List<CmReportingMember> cmReportingMemberList) {
+        this.cmReportingMemberList = cmReportingMemberList;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getClubName() {
+        return clubName;
+    }
+
+    public void setClubName(String clubName) {
+        this.clubName = clubName;
+    }
+
+    public String getLinkMan() {
+        return linkMan;
+    }
+
+    public void setLinkMan(String linkMan) {
+        this.linkMan = linkMan;
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public Integer getProductId() {
+        return productId;
+    }
+
+    public void setProductId(Integer productId) {
+        this.productId = productId;
+    }
+
+    public String getRemarks() {
+        return remarks;
+    }
+
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
+    }
+
+    public Integer getOrderStatus() {
+        return orderStatus;
+    }
+
+    public void setOrderStatus(Integer orderStatus) {
+        this.orderStatus = orderStatus;
+    }
+
+    public Integer getLockStatus() {
+        return lockStatus;
+    }
+
+    public void setLockStatus(Integer lockStatus) {
+        this.lockStatus = lockStatus;
+    }
+
+    public Integer getDistributionId() {
+        return distributionId;
+    }
+
+    public void setDistributionId(Integer distributionId) {
+        this.distributionId = distributionId;
+    }
+
+    public String getDelFlag() {
+        return delFlag;
+    }
+
+    public void setDelFlag(String delFlag) {
+        this.delFlag = delFlag;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+}
+

+ 224 - 0
src/main/java/com/caimei365/commodity/model/po/CmReportingMember.java

@@ -0,0 +1,224 @@
+package com.caimei365.commodity.model.po;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.experimental.Accessors;
+import org.apache.ibatis.type.Alias;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 分销报备成员对象 cm_reporting_member
+ *
+ * @author Kaick
+ * @date 2023-09-20
+ */
+@Accessors(fluent  = true )
+@Data
+@Alias("CmReportingMember")
+public class CmReportingMember implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private String id;
+
+    /** 分销报备人id */
+    private Integer distributionId;
+
+    /** 报备机构id */
+    private Integer clubReportingId;
+
+    /** 审核人用户id */
+    private Integer auditBy;
+
+    /** 审核人用户名称 */
+    private Integer auditName;
+
+    /** 审核状态:1待审核,2审核通过,3审核失败 */
+    private String auditStatus;
+
+    /** 审核备注 */
+    private String auditText;
+
+    /** 审核时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date auditTime;
+
+    /**备注 */
+    private String remarks;
+
+    /** 删除状态 0正常,其他删除 */
+    private String delFlag;
+
+    /** 修改时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /** 添加时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+
+    /** 商品佣金 */
+    private BigDecimal commission;
+
+    /** 结算状态: 1已完结 ,0未完结 */
+    private Integer settleStatus;
+
+    /** 结算时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date settleTime;
+    /** 报备人详情 */
+    private CmDistribution cmDistribution;
+    /** 报备机构详情 */
+    private CmReportingClub cmReportingClub;
+    /** 凭证图片集合 */
+    private List<CmRelatedImage> cmRelatedImageList;
+
+    public CmReportingClub getCmReportingClub() {
+        return cmReportingClub;
+    }
+
+    public void setCmReportingClub(CmReportingClub cmReportingClub) {
+        this.cmReportingClub = cmReportingClub;
+    }
+
+    public String getRemarks() {
+        return remarks;
+    }
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
+    }
+
+    public BigDecimal getCommission() {
+        return commission;
+    }
+
+    public void setCommission(BigDecimal commission) {
+        this.commission = commission;
+    }
+
+    public Integer getSettleStatus() {
+        return settleStatus;
+    }
+
+    public void setSettleStatus(Integer settleStatus) {
+        this.settleStatus = settleStatus;
+    }
+
+    public Date getSettleTime() {
+        return settleTime;
+    }
+
+    public void setSettleTime(Date settleTime) {
+        this.settleTime = settleTime;
+    }
+
+    public Integer getAuditBy() {
+        return auditBy;
+    }
+
+    public void setAuditBy(Integer auditBy) {
+        this.auditBy = auditBy;
+    }
+
+    public Integer getAuditName() {
+        return auditName;
+    }
+
+    public void setAuditName(Integer auditName) {
+        this.auditName = auditName;
+    }
+
+    public CmDistribution getCmDistribution() {
+        return cmDistribution;
+    }
+
+    public void setCmDistribution(CmDistribution cmDistribution) {
+        this.cmDistribution = cmDistribution;
+    }
+
+    public List<CmRelatedImage> getCmRelatedImageList() {
+        return cmRelatedImageList;
+    }
+
+    public void setCmRelatedImageList(List<CmRelatedImage> cmRelatedImageList) {
+        this.cmRelatedImageList = cmRelatedImageList;
+    }
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public Integer getDistributionId() {
+        return distributionId;
+    }
+
+    public void setDistributionId(Integer distributionId) {
+        this.distributionId = distributionId;
+    }
+
+    public Integer getClubReportingId() {
+        return clubReportingId;
+    }
+
+    public void setClubReportingId(Integer clubReportingId) {
+        this.clubReportingId = clubReportingId;
+    }
+
+    public String getAuditStatus() {
+        return auditStatus;
+    }
+
+    public void setAuditStatus(String auditStatus) {
+        this.auditStatus = auditStatus;
+    }
+
+    public String getAuditText() {
+        return auditText;
+    }
+
+    public void setAuditText(String auditText) {
+        this.auditText = auditText;
+    }
+
+    public Date getAuditTime() {
+        return auditTime;
+    }
+
+    public void setAuditTime(Date auditTime) {
+        this.auditTime = auditTime;
+    }
+
+    public String getDelFlag() {
+        return delFlag;
+    }
+
+    public void setDelFlag(String delFlag) {
+        this.delFlag = delFlag;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+}
+

+ 59 - 0
src/main/java/com/caimei365/commodity/service/CmReportingClubService.java

@@ -0,0 +1,59 @@
+package com.caimei365.commodity.service;
+
+import com.caimei365.commodity.model.ResponseJson;
+import com.caimei365.commodity.model.po.CmDistribution;
+import com.caimei365.commodity.model.po.CmDistributionTeamProduct;
+import com.caimei365.commodity.model.po.CmReportingClub;
+import com.caimei365.commodity.model.po.CmReportingMember;
+import com.caimei365.commodity.model.vo.ArchiveVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 机构报备Service接口
+ *
+ * @author Kaick
+ * @date 2023-09-26
+ */
+public interface CmReportingClubService
+{
+    /**
+     * 通过对象查询机构报备列表
+     *
+     * @param cmReportingClub 机构报备
+     * @return 机构报备集合
+     */
+    public List<CmReportingMember> getCmReportingClubList(CmDistribution cmDistribution,String clubName);
+    /**
+     * 功能描述: 分销团队商品列表
+     * @auther: Kaick
+     * @date: 2023/9/26 13:39
+     * @param cmDistribution
+     * @return [cmDistribution]
+     */
+
+    public List<CmDistributionTeamProduct> getCmDistributionTeamProductList(CmDistribution cmDistribution);
+
+    /**
+     * 查询分销商品资料列表
+     *
+     * @param productName     搜索关键词
+     * @return
+     */
+    List<ArchiveVo> getProductArchiveList( String productName);
+    /**
+     * 通过Id查询机构报备
+     *
+     * @param id 机构报备主键
+     * @return 机构报备
+     */
+    public CmReportingMember getCmReportingMemberById(String id);
+    /**
+     * 新增机构报备
+     */
+    public ResponseJson addCmReportingClub(CmReportingClub cmReportingClub);
+
+}
+
+

+ 132 - 0
src/main/java/com/caimei365/commodity/service/impl/CmReportingClubServiceImpl.java

@@ -0,0 +1,132 @@
+package com.caimei365.commodity.service.impl;
+
+import com.caimei365.commodity.mapper.CmDistributionProductMapper;
+import com.caimei365.commodity.mapper.CmRelatedImageMapper;
+import com.caimei365.commodity.mapper.CmReportingClubMapper;
+import com.caimei365.commodity.mapper.CmReportingMemberMapper;
+import com.caimei365.commodity.model.ResponseJson;
+import com.caimei365.commodity.model.po.*;
+import com.caimei365.commodity.model.vo.ArchiveVo;
+import com.caimei365.commodity.service.CmReportingClubService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 机构报备Service业务层处理
+ *
+ * @author Kaick
+ * @date 2023-09-26
+ */
+@Service
+public class CmReportingClubServiceImpl implements CmReportingClubService {
+    @Resource
+    private CmReportingClubMapper cmReportingClubMapper;
+    @Resource
+    private CmReportingMemberMapper cmReportingMemberMapper;
+    @Resource
+    private CmRelatedImageMapper cmRelatedImageMapper;
+    @Resource
+    private CmDistributionProductMapper cmDistributionProductMapper;
+
+    /**
+     * 通过对象查询机构报备列表
+     *
+     * @param cmDistribution 机构报备
+     * @return 机构报备
+     */
+    @Override
+    public List<CmReportingMember> getCmReportingClubList(CmDistribution cmDistribution, String clubName) {
+        List<CmReportingMember> cmReportingMemberList = new ArrayList<>();
+        if (null != cmDistribution.parentId()) {
+            cmReportingMemberList = cmReportingMemberMapper.getCmDistributionMemberList(new CmDistribution().parentId(cmDistribution.parentId()), clubName);
+            cmReportingMemberList.forEach(s -> {
+                s.cmReportingClub(cmReportingClubMapper.getCmReportingClubById(String.valueOf(s.clubReportingId())));
+            });
+        } else if (StringUtils.isNotBlank(cmDistribution.id())) {
+            cmReportingMemberList = cmReportingMemberMapper.getCmDistributionMemberList(new CmDistribution().id(cmDistribution.id()), clubName);
+            cmReportingMemberList.forEach(s -> {
+                s.cmReportingClub(cmReportingClubMapper.getCmReportingClubById(String.valueOf(s.clubReportingId())));
+            });
+        }
+        return cmReportingMemberList;
+    }
+
+    /**
+     * 通过对象查询分销团队商品列表
+     *
+     * @param cmDistribution 机构报备
+     * @return 机构报备
+     */
+    @Override
+    public List<CmDistributionTeamProduct> getCmDistributionTeamProductList(CmDistribution cmDistribution) {
+        List<CmDistributionTeamProduct> cmDistributionTeamProductList = cmDistributionProductMapper.getCmDistributionTeamProductList(new CmDistributionTeamProduct().distributionId(Integer.valueOf(cmDistribution.id())));
+        return cmDistributionTeamProductList;
+    }
+
+    @Override
+    public List<ArchiveVo> getProductArchiveList(String productName){
+        return cmDistributionProductMapper.getProductArchiveList(productName);
+    }
+
+    /**
+     * 通过Id查询机构报备
+     *
+     * @param id 机构报备主键
+     * @return 机构报备
+     */
+    @Override
+    public CmReportingMember getCmReportingMemberById(String id) {
+        CmReportingMember cmReportingMemberById = cmReportingMemberMapper.getCmReportingMemberById(id);
+        if (null != cmReportingMemberById) {
+            cmReportingMemberById.cmReportingClub(cmReportingClubMapper.getCmReportingClubById(String.valueOf(cmReportingMemberById.clubReportingId())));
+            cmReportingMemberById.cmRelatedImageList(cmRelatedImageMapper.getCmRelatedImageList(new CmRelatedImage().type("1").authorId(cmReportingMemberById.id())));
+        }
+        return cmReportingMemberById;
+    }
+
+    /**
+     * 新增机构报备
+     */
+    @Override
+    public ResponseJson addCmReportingClub(CmReportingClub cmReportingClub) {
+        CmReportingClub byCmReportingClub = cmReportingClubMapper.getByCmReportingClub(new CmReportingClub()
+                .mobile(cmReportingClub.mobile())
+                .productId(cmReportingClub.productId())
+                .orderStatus(0)
+                .lockStatus(1)
+        );
+        if (null == byCmReportingClub) {
+            byCmReportingClub = cmReportingClubMapper.getByCmReportingClub(new CmReportingClub()
+                    .mobile(cmReportingClub.mobile())
+                    .productId(cmReportingClub.productId())
+                    .lockStatus(0)
+            );
+            if (null == byCmReportingClub) {
+                cmReportingClubMapper.addCmReportingClub(cmReportingClub);
+            }
+            CmReportingMember cmReportingMember = cmReportingClub.cmReportingMember()
+                    .clubReportingId(Integer.valueOf(cmReportingClub.id()))
+                    .distributionId(cmReportingClub.distributionId())
+                    .auditStatus("1")
+                    .createTime(new Date());
+            cmReportingMemberMapper.addCmReportingMember(cmReportingMember);
+            cmReportingMember.cmRelatedImageList().forEach(s -> {
+                s.type("1");
+                s.authorId(String.valueOf(cmReportingMember.distributionId()))
+                        .createTime(new Date());
+                cmRelatedImageMapper.addCmRelatedImage(s);
+            });
+            return ResponseJson.success("报备成功!",null);
+        } else {
+            return ResponseJson.error("抱歉,该机构/商品采购意向订单报备已被其他人锁定,目前暂无法进行报备!");
+        }
+    }
+
+}
+
+

+ 19 - 1
src/main/java/com/caimei365/commodity/service/impl/PageServiceImpl.java

@@ -57,6 +57,10 @@ public class PageServiceImpl implements PageService {
     private PageService pageService;
     @Resource
     private CouponMapper couponMapper;
+    @Resource
+    private CmDistributionMapper cmDistributionMapper;
+    @Resource
+    private CmDistributionProductMapper cmDistributionProductMapper;
     @Value("${spring.cloud.config.profile}")
     private String active;
 
@@ -1322,7 +1326,21 @@ public class PageServiceImpl implements PageService {
         if (null == identity) {
             // 未登录
             permission = 1;
-        } else if (1 == identity) {
+        } else if (1 == identity || 7 == identity) {
+            if(7 == identity){
+                //分销人员可查看团队所有资料
+                CmDistribution byCmDistribution = cmDistributionMapper.getByCmDistribution(new CmDistribution().userId(userId));
+                if(!byCmDistribution.parentId().equals("0")){
+                    byCmDistribution.id(String.valueOf(byCmDistribution.parentId()));
+                }
+                int productCount = cmDistributionProductMapper.getCmDistributionTeamProductCount(new CmDistributionTeamProduct()
+                        .distributionId(Integer.valueOf(byCmDistribution.id()))
+                        .productId(archive.getProductId())
+                );
+                if(productCount==0){
+                    permission = 5;
+                }
+            }
             //协销可查看所有资料
             permission = 0;
         } else if (4 == identity) {

+ 367 - 0
src/main/resources/mapper/CmDistributionMapper.xml

@@ -0,0 +1,367 @@
+<?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.caimei365.commodity.mapper.CmDistributionMapper">
+
+	<resultMap type="com.caimei365.commodity.model.po.CmDistribution" id="CmDistributionResult">
+		<result property="id"    column="id"    />
+		<result property="userId"    column="userId"    />
+		<result property="name"    column="name"    />
+		<result property="linkMan"    column="linkMan"    />
+		<result property="mobile"    column="mobile"    />
+		<result property="password"    column="password"    />
+		<result property="corporateName"    column="corporateName"    />
+		<result property="splitCode"    column="splitCode"    />
+		<result property="bankName"    column="bankName"    />
+		<result property="bankAccount"    column="bankAccount"    />
+		<result property="status"    column="status"    />
+		<result property="qrCode"    column="qrCode"    />
+		<result property="parentId"    column="parentId"    />
+		<result property="parentIds"    column="parentIds"    />
+		<result property="updateTime"    column="updateTime"    />
+		<result property="addTime"    column="addTime"    />
+		<result property="delFlag"    column="delFlag"    />
+	</resultMap>
+
+	<sql id="selectCmDistributionVo">
+		select
+			cm_distribution.id,
+			cm_distribution.userId,
+			cm_distribution.name,
+			cm_distribution.linkMan,
+			cm_distribution.mobile,
+			cm_distribution.password,
+			cm_distribution.corporateName,
+			cm_distribution.splitCode,
+			cm_distribution.bankName,
+			cm_distribution.bankAccount,
+			cm_distribution.status,
+			cm_distribution.qrCode,
+			cm_distribution.parentId,
+			cm_distribution.parentIds,
+			cm_distribution.updateTime,
+			cm_distribution.addTime,
+			cm_distribution.delFlag
+	</sql>
+
+
+
+
+	<select id="getByCmDistribution" parameterType="com.caimei365.commodity.model.po.CmDistribution" resultMap="CmDistributionResult">
+		<include refid="selectCmDistributionVo"/>
+		from cm_distribution AS cm_distribution
+		<where>  cm_distribution.delFlag = 0
+			<if test="id != null  and id != ''">
+				and cm_distribution.id
+				<if test="id.toUpperCase().indexOf('=')==-1">
+					= #{id}
+				</if>
+				<if test="id.toUpperCase().indexOf('=')!=-1">
+					<if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="userId != null "> and cm_distribution.userId = #{userId}</if>
+			<if test="name != null  and name != ''"> and cm_distribution.name like concat('%', #{name}, '%')</if>
+			<if test="linkMan != null  and linkMan != ''"> and cm_distribution.linkMan = #{linkMan}</if>
+            <if test="mobile != null  and mobile != ''"> and cm_distribution.mobile = #{mobile}</if>
+			<if test="password != null  and password != ''"> and cm_distribution.password = #{password}</if>
+			<if test="corporateName != null  and corporateName != ''"> and cm_distribution.corporateName like concat('%', #{corporateName}, '%')</if>
+			<if test="splitCode != null  and splitCode != ''"> and cm_distribution.splitCode = #{splitCode}</if>
+			<if test="bankName != null  and bankName != ''"> and cm_distribution.bankName like concat('%', #{bankName}, '%')</if>
+			<if test="bankAccount != null  and bankAccount != ''"> and cm_distribution.bankAccount = #{bankAccount}</if>
+			<if test="status != null "> and cm_distribution.status = #{status}</if>
+			<if test="qrCode != null  and qrCode != ''"> and cm_distribution.qrCode = #{qrCode}</if>
+			<if test="parentId != null "> and cm_distribution.parentId = #{parentId}</if>
+			<if test="parentIds != null  and parentIds != ''"> and cm_distribution.parentIds = #{parentIds}</if>
+			<if test="updateTime != null "> and cm_distribution.updateTime = #{updateTime}</if>
+			<if test="addTime != null "> and cm_distribution.addTime = #{addTime}</if>
+		</where>
+		group by cm_distribution.id
+		order by cm_distribution.addTime desc
+		limit 0,1
+	</select>
+
+	<select id="getCmDistributionList" parameterType="com.caimei365.commodity.model.po.CmDistribution" resultMap="CmDistributionResult">
+		<include refid="selectCmDistributionVo"/>
+		from cm_distribution AS cm_distribution
+		<where>  cm_distribution.delFlag = 0
+			<if test="id != null  and id != ''">
+				and cm_distribution.id
+				<if test="id.toUpperCase().indexOf('=')==-1">
+					= #{id}
+				</if>
+				<if test="id.toUpperCase().indexOf('=')!=-1">
+					<if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="userId != null "> and cm_distribution.userId = #{userId}</if>
+			<if test="name != null  and name != ''"> and cm_distribution.name like concat('%', #{name}, '%')</if>
+			<if test="linkMan != null  and linkMan != ''"> and cm_distribution.linkMan = #{linkMan}</if>
+            <if test="mobile != null  and mobile != ''"> and cm_distribution.mobile = #{mobile}</if>
+			<if test="password != null  and password != ''"> and cm_distribution.password = #{password}</if>
+			<if test="corporateName != null  and corporateName != ''"> and cm_distribution.corporateName like concat('%', #{corporateName}, '%')</if>
+			<if test="splitCode != null  and splitCode != ''"> and cm_distribution.splitCode = #{splitCode}</if>
+			<if test="bankName != null  and bankName != ''"> and cm_distribution.bankName like concat('%', #{bankName}, '%')</if>
+			<if test="bankAccount != null  and bankAccount != ''"> and cm_distribution.bankAccount = #{bankAccount}</if>
+			<if test="status != null "> and cm_distribution.status = #{status}</if>
+			<if test="qrCode != null  and qrCode != ''"> and cm_distribution.qrCode = #{qrCode}</if>
+			<if test="parentId != null "> and cm_distribution.parentId = #{parentId}</if>
+			<if test="parentIds != null  and parentIds != ''"> and cm_distribution.parentIds = #{parentIds}</if>
+			<if test="updateTime != null "> and cm_distribution.updateTime = #{updateTime}</if>
+			<if test="addTime != null "> and cm_distribution.addTime = #{addTime}</if>
+		</where>
+		group by cm_distribution.id
+		order by cm_distribution.addTime desc
+	</select>
+
+
+	<select id="getCmDistributionCount" parameterType="com.caimei365.commodity.model.po.CmDistribution" resultType="String">
+		select count(1)
+		from cm_distribution AS cm_distribution
+		<where>  cm_distribution.delFlag = 0
+			<if test="id != null  and  id != ''">
+				and cm_distribution.id
+				<if test="id.toUpperCase().indexOf('=')==-1">
+					= #{id}
+				</if>
+				<if test="id.toUpperCase().indexOf('=')!=-1">
+					<if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="userId != null "> and cm_distribution.userId = #{userId}</if>
+			<if test="name != null  and name != ''"> and cm_distribution.name like concat('%', #{name}, '%')</if>
+			<if test="linkMan != null  and linkMan != ''"> and cm_distribution.linkMan = #{linkMan}</if>
+            <if test="mobile != null  and mobile != ''"> and cm_distribution.mobile = #{mobile}</if>
+			<if test="password != null  and password != ''"> and cm_distribution.password = #{password}</if>
+			<if test="corporateName != null  and corporateName != ''"> and cm_distribution.corporateName like concat('%', #{corporateName}, '%')</if>
+			<if test="splitCode != null  and splitCode != ''"> and cm_distribution.splitCode = #{splitCode}</if>
+			<if test="bankName != null  and bankName != ''"> and cm_distribution.bankName like concat('%', #{bankName}, '%')</if>
+			<if test="bankAccount != null  and bankAccount != ''"> and cm_distribution.bankAccount = #{bankAccount}</if>
+			<if test="status != null "> and cm_distribution.status = #{status}</if>
+			<if test="qrCode != null  and qrCode != ''"> and cm_distribution.qrCode = #{qrCode}</if>
+			<if test="parentId != null "> and cm_distribution.parentId = #{parentId}</if>
+			<if test="parentIds != null  and parentIds != ''"> and cm_distribution.parentIds = #{parentIds}</if>
+			<if test="updateTime != null "> and cm_distribution.updateTime = #{updateTime}</if>
+			<if test="addTime != null "> and cm_distribution.addTime = #{addTime}</if>
+		</where>
+		group by cm_distribution.id
+	</select>
+
+	<select id="getCmDistributionById" parameterType="String" resultMap="CmDistributionResult">
+		<include refid="selectCmDistributionVo"/>
+		from cm_distribution AS cm_distribution
+		where  cm_distribution.delFlag = 0 and cm_distribution.id = #{id}
+	</select>
+
+
+
+	<select id="getByIds" parameterType="com.caimei365.commodity.model.po.CmDistribution" resultType="String">
+		select id
+		from cm_distribution AS cm_distribution
+		<where>  cm_distribution.delFlag = 0
+			<if test="id != null  and id != ''">
+				and cm_distribution.id
+				<if test="id.toUpperCase().indexOf('=')==-1">
+					= #{id}
+				</if>
+				<if test="id.toUpperCase().indexOf('=')!=-1">
+					<if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="userId != null "> and cm_distribution.userId = #{userId}</if>
+			<if test="name != null  and name != ''"> and cm_distribution.name like concat('%', #{name}, '%')</if>
+			<if test="linkMan != null  and linkMan != ''"> and cm_distribution.linkMan = #{linkMan}</if>
+            <if test="mobile != null  and mobile != ''"> and cm_distribution.mobile = #{mobile}</if>
+			<if test="password != null  and password != ''"> and cm_distribution.password = #{password}</if>
+			<if test="corporateName != null  and corporateName != ''"> and cm_distribution.corporateName like concat('%', #{corporateName}, '%')</if>
+			<if test="splitCode != null  and splitCode != ''"> and cm_distribution.splitCode = #{splitCode}</if>
+			<if test="bankName != null  and bankName != ''"> and cm_distribution.bankName like concat('%', #{bankName}, '%')</if>
+			<if test="bankAccount != null  and bankAccount != ''"> and cm_distribution.bankAccount = #{bankAccount}</if>
+			<if test="status != null "> and cm_distribution.status = #{status}</if>
+			<if test="qrCode != null  and qrCode != ''"> and cm_distribution.qrCode = #{qrCode}</if>
+			<if test="parentId != null "> and cm_distribution.parentId = #{parentId}</if>
+			<if test="parentIds != null  and parentIds != ''"> and cm_distribution.parentIds = #{parentIds}</if>
+			<if test="updateTime != null "> and cm_distribution.updateTime = #{updateTime}</if>
+			<if test="addTime != null "> and cm_distribution.addTime = #{addTime}</if>
+		</where>
+		group by cm_distribution.id
+	</select>
+
+	<select id="getById" parameterType="com.caimei365.commodity.model.po.CmDistribution" resultType="String">
+		select id
+		from cm_distribution AS cm_distribution
+		<where>  cm_distribution.delFlag = 0
+			<if test="id != null  and id != ''">
+				and cm_distribution.id
+				<if test="id.toString().toUpperCase().indexOf('=')==-1">
+					= #{id}
+				</if>
+				<if test="id.toString().toUpperCase().indexOf('=')!=-1">
+					<if test="id.toString().toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="id.toString().toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="id.toString().substring(id.toString().toUpperCase().indexOf('=')+1,id.toString().length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="userId != null "> and cm_distribution.userId = #{userId}</if>
+			<if test="name != null  and name != ''"> and cm_distribution.name like concat('%', #{name}, '%')</if>
+			<if test="linkMan != null  and linkMan != ''"> and cm_distribution.linkMan = #{linkMan}</if>
+            <if test="mobile != null  and mobile != ''"> and cm_distribution.mobile = #{mobile}</if>
+			<if test="password != null  and password != ''"> and cm_distribution.password = #{password}</if>
+			<if test="corporateName != null  and corporateName != ''"> and cm_distribution.corporateName like concat('%', #{corporateName}, '%')</if>
+			<if test="splitCode != null  and splitCode != ''"> and cm_distribution.splitCode = #{splitCode}</if>
+			<if test="bankName != null  and bankName != ''"> and cm_distribution.bankName like concat('%', #{bankName}, '%')</if>
+			<if test="bankAccount != null  and bankAccount != ''"> and cm_distribution.bankAccount = #{bankAccount}</if>
+			<if test="status != null "> and cm_distribution.status = #{status}</if>
+			<if test="qrCode != null  and qrCode != ''"> and cm_distribution.qrCode = #{qrCode}</if>
+			<if test="parentId != null "> and cm_distribution.parentId = #{parentId}</if>
+			<if test="parentIds != null  and parentIds != ''"> and cm_distribution.parentIds = #{parentIds}</if>
+			<if test="updateTime != null "> and cm_distribution.updateTime = #{updateTime}</if>
+			<if test="addTime != null "> and cm_distribution.addTime = #{addTime}</if>
+		</where>
+		group by cm_distribution.id
+		limit 0,1
+	</select>
+
+	<insert id="addCmDistribution" parameterType="com.caimei365.commodity.model.po.CmDistribution" useGeneratedKeys="true" keyProperty="id">
+		insert into cm_distribution
+		<trim prefix="(" suffix=")" suffixOverrides=",">
+			<if test="id != null and id != ''">id,</if>
+			<if test="userId != null">userId,</if>
+			<if test="name != null and name != ''">name,</if>
+			<if test="linkMan != null and linkMan != ''">linkMan,</if>
+			<if test="mobile != null and mobile != ''">mobile,</if>
+			<if test="password != null and password != ''">password,</if>
+			<if test="corporateName != null and corporateName != ''">corporateName,</if>
+			<if test="splitCode != null and splitCode != ''">splitCode,</if>
+			<if test="bankName != null and bankName != ''">bankName,</if>
+			<if test="bankAccount != null and bankAccount != ''">bankAccount,</if>
+			<if test="status != null">status,</if>
+			<if test="qrCode != null and qrCode != ''">qrCode,</if>
+			<if test="parentId != null">parentId,</if>
+			<if test="parentIds != null and parentIds != ''">parentIds,</if>
+			<if test="updateTime != null">updateTime,</if>
+			<if test="addTime != null">addTime,</if>
+			<if test="delFlag != null">delFlag,</if>
+		</trim>
+		<trim prefix="values (" suffix=")" suffixOverrides=",">
+			<if test="id != null and id != ''">#{id},</if>
+			<if test="userId != null">#{userId},</if>
+			<if test="name != null and name != ''">#{name},</if>
+			<if test="linkMan != null and linkMan != ''">#{linkMan},</if>
+			<if test="mobile != null and mobile != ''">#{mobile},</if>
+			<if test="password != null and password != ''">#{password},</if>
+			<if test="corporateName != null and corporateName != ''">#{corporateName},</if>
+			<if test="splitCode != null and splitCode != ''">#{splitCode},</if>
+			<if test="bankName != null and bankName != ''">#{bankName},</if>
+			<if test="bankAccount != null and bankAccount != ''">#{bankAccount},</if>
+			<if test="status != null">#{status},</if>
+			<if test="qrCode != null and qrCode != ''">#{qrCode},</if>
+			<if test="parentId != null">#{parentId},</if>
+			<if test="parentIds != null and parentIds != ''">#{parentIds},</if>
+			<if test="updateTime != null">#{updateTime},</if>
+			<if test="addTime != null">#{addTime},</if>
+			<if test="delFlag != null">#{delFlag},</if>
+		</trim>
+	</insert>
+
+	<update id="updateCmDistribution" parameterType="com.caimei365.commodity.model.po.CmDistribution">
+		update cm_distribution
+		<trim prefix="SET" suffixOverrides=",">
+			<if test="userId != null">userId = #{userId},</if>
+			<if test="name != null and name != ''">name = #{name},</if>
+			<if test="linkMan != null and linkMan != ''">linkMan = #{linkMan},</if>
+			<if test="mobile != null and mobile != ''">mobile = #{mobile},</if>
+			<if test="password != null and password != ''">password = #{password},</if>
+			<if test="corporateName != null and corporateName != ''">corporateName = #{corporateName},</if>
+			<if test="splitCode != null and splitCode != ''">splitCode = #{splitCode},</if>
+			<if test="bankName != null and bankName != ''">bankName = #{bankName},</if>
+			<if test="bankAccount != null and bankAccount != ''">bankAccount = #{bankAccount},</if>
+			<if test="status != null">status = #{status},</if>
+			<if test="qrCode != null and qrCode != ''">qrCode = #{qrCode},</if>
+			<if test="parentId != null">parentId = #{parentId},</if>
+			<if test="parentIds != null and parentIds != ''">parentIds = #{parentIds},</if>
+			<if test="updateTime != null">updateTime = #{updateTime},</if>
+			<if test="addTime != null">addTime = #{addTime},</if>
+			<if test="delFlag != null">delFlag = #{delFlag},</if>
+		</trim>
+		<where>
+			<if test="id != null  and id != ''"> and cm_distribution.id = #{id}</if>
+			<if test="userId != null "> and cm_distribution.userId = #{userId}</if>
+		</where>
+
+	</update>
+
+	<update id="updateDelCmDistributionByIds" parameterType="String">
+		update cm_distribution set delFlag=#{delFlag} where id in
+		<foreach item="id" collection="ids" open="(" separator="," close=")">
+			#{id}
+		</foreach>
+	</update>
+
+	<delete id="delCmDistributionById" parameterType="String">
+		delete
+		from cm_distribution where id = #{id}
+	</delete>
+
+	<delete id="delCmDistribution" parameterType="com.caimei365.commodity.model.po.CmDistribution">
+		delete
+		from cm_distribution AS cm_distribution
+		<where>
+			<if test="id != null  and id != ''">
+				and cm_distribution.id
+				<if test="id.toUpperCase().indexOf('=')==-1">
+					= #{id}
+				</if>
+				<if test="id.toUpperCase().indexOf('=')!=-1">
+					<if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="userId != null "> and cm_distribution.userId = #{userId}</if>
+			<if test="name != null  and name != ''"> and cm_distribution.name like concat('%', #{name}, '%')</if>
+			<if test="linkMan != null  and linkMan != ''"> and cm_distribution.linkMan = #{linkMan}</if>
+            <if test="mobile != null  and mobile != ''"> and cm_distribution.mobile = #{mobile}</if>
+			<if test="password != null  and password != ''"> and cm_distribution.password = #{password}</if>
+			<if test="corporateName != null  and corporateName != ''"> and cm_distribution.corporateName like concat('%', #{corporateName}, '%')</if>
+			<if test="splitCode != null  and splitCode != ''"> and cm_distribution.splitCode = #{splitCode}</if>
+			<if test="bankName != null  and bankName != ''"> and cm_distribution.bankName like concat('%', #{bankName}, '%')</if>
+			<if test="bankAccount != null  and bankAccount != ''"> and cm_distribution.bankAccount = #{bankAccount}</if>
+			<if test="status != null "> and cm_distribution.status = #{status}</if>
+			<if test="qrCode != null  and qrCode != ''"> and cm_distribution.qrCode = #{qrCode}</if>
+			<if test="parentId != null "> and cm_distribution.parentId = #{parentId}</if>
+			<if test="parentIds != null  and parentIds != ''"> and cm_distribution.parentIds = #{parentIds}</if>
+			<if test="updateTime != null "> and cm_distribution.updateTime = #{updateTime}</if>
+			<if test="addTime != null "> and cm_distribution.addTime = #{addTime}</if>
+		</where>
+	</delete>
+
+	<delete id="delCmDistributionByIds" parameterType="String">
+		delete from cm_distribution where id in
+		<foreach item="id" collection="ids" open="(" separator="," close=")">
+			#{id}
+		</foreach>
+	</delete>
+
+</mapper>

+ 620 - 0
src/main/resources/mapper/CmDistributionProductMapper.xml

@@ -0,0 +1,620 @@
+<?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.caimei365.commodity.mapper.CmDistributionProductMapper">
+
+    <resultMap type="com.caimei365.commodity.model.po.CmDistributionProduct" id="CmDistributionProductResult">
+        <result property="id"    column="id"    />
+        <result property="productId"    column="productId"    />
+        <result property="validFlag"    column="validFlag"    />
+        <result property="includedTax"    column="includedTax"    />
+        <result property="invoiceType"    column="invoiceType"    />
+        <result property="clubTaxPoint"    column="clubTaxPoint"    />
+        <result property="shopTaxPoint"    column="shopTaxPoint"    />
+        <result property="commission"    column="commission"    />
+        <result property="addTime"    column="addTime"    />
+        <result property="name"    column="name"    />
+        <result property="mainImage"    column="mainImage"    />
+        <result property="shopID"    column="shopID"    />
+        <result property="shopName"    column="shopName"    />
+        <result property="skuId"    column="skuId"    />
+        <result property="price"    column="price"    />
+    </resultMap>
+
+    <sql id="selectCmDistributionProductVo">
+        select
+            cm_distribution_product.id,
+            cm_distribution_product.productId,
+            cm_distribution_product.validFlag,
+            cm_distribution_product.includedTax,
+            cm_distribution_product.invoiceType,
+            ifnull(cm_distribution_product.clubTaxPoint,0) AS clubTaxPoint,
+            ifnull(cm_distribution_product.shopTaxPoint,0) AS shopTaxPoint,
+            ifnull(cm_distribution_product.commission,0) AS commission,
+            p.name,
+            p.mainImage,
+            p.shopID,
+            s.name AS shopName,
+            cm_distribution_product.addTime,
+            cm_distribution_sku.skuId,
+            ifnull(cm_distribution_sku.price,0) AS price
+    </sql>
+
+    <select id="getByCmDistributionProduct" parameterType="com.caimei365.commodity.model.po.CmDistributionProduct" resultMap="CmDistributionProductResult">
+        <include refid="selectCmDistributionProductVo"/>
+        from cm_distribution_product AS cm_distribution_product
+        LEFT JOIN product p ON  cm_distribution_product.productId = p.productID
+        LEFT JOIN shop s on p.shopID = s.shopID
+        LEFT JOIN cm_distribution_sku cm_distribution_sku ON  cm_distribution_sku.productId = p.productID
+        <where>
+            <if test="id != null  and id != ''">
+                and cm_distribution_product.id
+                <if test="id.toUpperCase().indexOf('=')==-1">
+                    = #{id}
+                </if>
+                <if test="id.toUpperCase().indexOf('=')!=-1">
+                    <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{idIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="productId != null "> and cm_distribution_product.productId = #{productId}</if>
+            <if test="validFlag != null  and validFlag != ''"> and cm_distribution_product.validFlag = #{validFlag}</if>
+            <if test="includedTax != null  and includedTax != ''"> and cm_distribution_product.includedTax = #{includedTax}</if>
+            <if test="invoiceType != null  and invoiceType != ''">
+                and cm_distribution_product.invoiceType
+                <if test="invoiceType.toUpperCase().indexOf('=')==-1">
+                    = #{invoiceType}
+                </if>
+                <if test="invoiceType.toUpperCase().indexOf('=')!=-1">
+                    <if test="invoiceType.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="invoiceType.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="typeIn" collection="invoiceType.substring(invoiceType.toUpperCase().indexOf('=')+1,invoiceType.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{typeIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="clubTaxPoint != null "> and cm_distribution_product.clubTaxPoint = #{clubTaxPoint}</if>
+            <if test="shopTaxPoint != null "> and cm_distribution_product.shopTaxPoint = #{shopTaxPoint}</if>
+            <if test="commission != null "> and cm_distribution_product.commission = #{commission}</if>
+            <if test="addTime != null "> and cm_distribution_product.addTime = #{addTime}</if>
+            <if test="name != null  and name != ''"> and p.name  LIKE concat('%',#{name},'%')</if>
+            <if test="shopName != null  and shopName != ''"> and s.name  LIKE concat('%',#{shopName},'%')</if>
+        </where>
+        group by cm_distribution_product.id
+        order by cm_distribution_product.addTime desc
+        limit 0,1
+    </select>
+
+
+
+    <select id="findTeamProductPage" parameterType="com.caimei365.commodity.model.po.CmDistributionProduct" resultMap="CmDistributionProductResult">
+        select
+        cm_distribution_product.id,
+        cm_distribution_product.productId,
+        cdtp.validFlag,
+        cm_distribution_product.includedTax,
+        cm_distribution_product.invoiceType,
+        ifnull(cm_distribution_product.clubTaxPoint,0) AS clubTaxPoint,
+        ifnull(cm_distribution_product.shopTaxPoint,0) AS shopTaxPoint,
+        ifnull(cm_distribution_product.commission,0) AS commission,
+        p.name,
+        p.mainImage,
+        p.shopID,
+        s.name AS shopName,
+        cm_distribution_product.addTime,
+        cm_distribution_sku.skuId,
+        ifnull(cm_distribution_sku.price,0) AS price,
+        cdtp.distributionId
+       from cm_distribution_team_product AS cdtp
+        LEFT JOIN cm_distribution AS cm_distribution on cdtp.distributionId=cm_distribution.id
+        LEFT JOIN cm_distribution_product AS cm_distribution_product  on cdtp.productId=cm_distribution_product.productId
+        LEFT JOIN product p ON  cm_distribution_product.productId = p.productID
+        LEFT JOIN shop s on p.shopID = s.shopID
+        LEFT JOIN cm_distribution_sku cm_distribution_sku ON  cm_distribution_sku.productId = p.productID
+        <where>
+            <if test="id != null  and id != ''">
+                and cm_distribution_product.id
+                <if test="id.toUpperCase().indexOf('=')==-1">
+                    = #{id}
+                </if>
+                <if test="id.toUpperCase().indexOf('=')!=-1">
+                    <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{idIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="productId != null "> and cm_distribution_product.productId = #{productId}</if>
+            <if test="validFlag != null  and validFlag != ''"> and cdtp.validFlag = #{validFlag}</if>
+            <if test="includedTax != null  and includedTax != ''"> and cm_distribution_product.includedTax = #{includedTax}</if>
+            <if test="invoiceType != null  and invoiceType != ''">
+                and cm_distribution_product.invoiceType
+                <if test="invoiceType.toUpperCase().indexOf('=')==-1">
+                    = #{invoiceType}
+                </if>
+                <if test="invoiceType.toUpperCase().indexOf('=')!=-1">
+                    <if test="invoiceType.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="invoiceType.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="typeIn" collection="invoiceType.substring(invoiceType.toUpperCase().indexOf('=')+1,invoiceType.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{typeIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="clubTaxPoint != null "> and cm_distribution_product.clubTaxPoint = #{clubTaxPoint}</if>
+            <if test="shopTaxPoint != null "> and cm_distribution_product.shopTaxPoint = #{shopTaxPoint}</if>
+            <if test="commission != null "> and cm_distribution_product.commission = #{commission}</if>
+            <if test="addTime != null "> and cm_distribution_product.addTime = #{addTime}</if>
+            <if test="name != null  and name != ''"> and p.name  LIKE concat('%',#{name},'%')</if>
+            <if test="shopName != null  and shopName != ''"> and s.name  LIKE concat('%',#{shopName},'%')</if>
+            <if test="distributionId != null "> and cdtp.distributionId = #{distributionId}</if>
+        </where>
+        group by cm_distribution_product.id
+        order by cm_distribution_product.addTime desc
+    </select>
+
+
+    <select id="getCmDistributionProductList" parameterType="com.caimei365.commodity.model.po.CmDistributionProduct" resultMap="CmDistributionProductResult">
+        <include refid="selectCmDistributionProductVo"/>
+       from cm_distribution_product AS cm_distribution_product
+        LEFT JOIN product p ON  cm_distribution_product.productId = p.productID
+        LEFT JOIN shop s on p.shopID = s.shopID
+        LEFT JOIN cm_distribution_sku cm_distribution_sku ON  cm_distribution_sku.productId = p.productID
+        <where>
+            <if test="id != null  and id != ''">
+                and cm_distribution_product.id
+                <if test="id.toUpperCase().indexOf('=')==-1">
+                    = #{id}
+                </if>
+                <if test="id.toUpperCase().indexOf('=')!=-1">
+                    <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{idIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="productId != null "> and cm_distribution_product.productId = #{productId}</if>
+            <if test="validFlag != null  and validFlag != ''"> and cm_distribution_product.validFlag = #{validFlag}</if>
+            <if test="includedTax != null  and includedTax != ''"> and cm_distribution_product.includedTax = #{includedTax}</if>
+            <if test="invoiceType != null  and invoiceType != ''">
+                and cm_distribution_product.invoiceType
+                <if test="invoiceType.toUpperCase().indexOf('=')==-1">
+                    = #{invoiceType}
+                </if>
+                <if test="invoiceType.toUpperCase().indexOf('=')!=-1">
+                    <if test="invoiceType.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="invoiceType.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="typeIn" collection="invoiceType.substring(invoiceType.toUpperCase().indexOf('=')+1,invoiceType.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{typeIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="clubTaxPoint != null "> and cm_distribution_product.clubTaxPoint = #{clubTaxPoint}</if>
+            <if test="shopTaxPoint != null "> and cm_distribution_product.shopTaxPoint = #{shopTaxPoint}</if>
+            <if test="commission != null "> and cm_distribution_product.commission = #{commission}</if>
+            <if test="addTime != null "> and cm_distribution_product.addTime = #{addTime}</if>
+            <if test="name != null  and name != ''"> and p.name  LIKE concat('%',#{name},'%')</if>
+            <if test="shopName != null  and shopName != ''"> and s.name  LIKE concat('%',#{shopName},'%')</if>
+        </where>
+        group by cm_distribution_product.id
+        order by cm_distribution_product.addTime desc
+    </select>
+    <select id="getCmDistributionTeamProductList" parameterType="com.caimei365.commodity.model.po.CmDistributionTeamProduct" resultType="com.caimei365.commodity.model.po.CmDistributionTeamProduct">
+        SELECT
+        cm_distribution_team_product.id,
+        cm_distribution_team_product.distributionId,
+        cm_distribution_team_product.productId,
+        cm_distribution_team_product.validFlag,
+        p.name,
+        p.mainImage,
+        p.shopID,
+        s.name AS shopName
+        from cm_distribution_team_product AS cm_distribution_team_product
+        left join cm_distribution_product AS cm_distribution_product on cm_distribution_product.productId=cm_distribution_team_product.productId
+        LEFT JOIN product p ON  cm_distribution_product.productId = p.productID
+        LEFT JOIN shop s on p.shopID = s.shopID
+        <where>  cm_distribution_team_product.delFlag = 0 and cm_distribution_product.delFlag = 0
+            <if test="id != null  and id != ''">
+                and cm_distribution_team_product.id
+                <if test="id.toUpperCase().indexOf('=')==-1">
+                    = #{id}
+                </if>
+                <if test="id.toUpperCase().indexOf('=')!=-1">
+                    <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{idIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="distributionId != null "> and cm_distribution_team_product.distributionId = #{distributionId}</if>
+            <if test="productId != null "> and cm_distribution_team_product.productId = #{productId}</if>
+            <if test="validFlag != null  and validFlag != ''"> and cm_distribution_team_product.validFlag = #{validFlag}</if>
+            <if test="name != null  and name != ''"> and p.name like concat('%', #{name}, '%')</if>
+        </where>
+        group by cm_distribution_team_product.id
+        order by cm_distribution_team_product.createTime desc
+    </select>
+    <select id="getProductArchiveList" resultType="com.caimei365.commodity.model.vo.ArchiveVo">
+        select cpa.id AS "archiveId",
+        cpa.productId AS "productId",
+        if(cpa.productId is not null, p.name, cpa.productName) AS "productName",
+        if(cpa.productId is not null, s.name, cpa.shopName) AS "shopName",
+        if(cpa.productId is not null, p.mainImage, cpa.productImage) AS "productImage",
+        if(cpa.productId is not null, ifnull(p.commodityType, cpa.productType),cpa.productType) AS "productType",
+        if(cpa.productId is not null,1,2) AS "redirectType"
+        from cm_distribution_team_product AS cm_distribution_team_product
+        left join cm_product_archive cpa on cpa.productId = cm_distribution_team_product.productID
+        left join product p on cm_distribution_team_product.productId = p.productID
+        left join shop s on p.shopID = s.shopID
+        <where>
+            <if test="productName != null and productName != ''">
+                and cpa.productName LIKE concat('%', #{productName}, '%')
+            </if>
+        </where>
+        order by cpa.addTime desc
+    </select>
+    <select id="getCmDistributionProductCount" parameterType="com.caimei365.commodity.model.po.CmDistributionProduct" resultType="int">
+        select count(1)
+       from cm_distribution_product AS cm_distribution_product
+        LEFT JOIN product p ON  cm_distribution_product.productId = p.productID
+        LEFT JOIN shop s on p.shopID = s.shopID
+        LEFT JOIN cm_distribution_sku cm_distribution_sku ON  cm_distribution_sku.productId = p.productID
+        <where>
+            <if test="id != null  and  id != ''">
+                and cm_distribution_product.id
+                <if test="id.toUpperCase().indexOf('=')==-1">
+                    = #{id}
+                </if>
+                <if test="id.toUpperCase().indexOf('=')!=-1">
+                    <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{idIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="productId != null "> and cm_distribution_product.productId = #{productId}</if>
+            <if test="validFlag != null  and validFlag != ''"> and cm_distribution_product.validFlag = #{validFlag}</if>
+            <if test="includedTax != null  and includedTax != ''"> and cm_distribution_product.includedTax = #{includedTax}</if>
+            <if test="invoiceType != null  and invoiceType != ''">
+                and cm_distribution_product.invoiceType
+                <if test="invoiceType.toUpperCase().indexOf('=')==-1">
+                    = #{invoiceType}
+                </if>
+                <if test="invoiceType.toUpperCase().indexOf('=')!=-1">
+                    <if test="invoiceType.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="invoiceType.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="typeIn" collection="invoiceType.substring(invoiceType.toUpperCase().indexOf('=')+1,invoiceType.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{typeIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="clubTaxPoint != null "> and cm_distribution_product.clubTaxPoint = #{clubTaxPoint}</if>
+            <if test="shopTaxPoint != null "> and cm_distribution_product.shopTaxPoint = #{shopTaxPoint}</if>
+            <if test="commission != null "> and cm_distribution_product.commission = #{commission}</if>
+            <if test="addTime != null "> and cm_distribution_product.addTime = #{addTime}</if>
+        </where>
+        group by cm_distribution_product.id
+    </select>
+
+    <select id="getCmDistributionTeamProductCount" parameterType="CmDistributionTeamProduct" resultType="int">
+        select count(1)
+        from cm_distribution_team_product AS cm_distribution_team_product
+        <where>  cm_distribution_team_product.delFlag = 0
+            <if test="id != null  and  id != ''">
+                and cm_distribution_team_product.id
+                <if test="id.toUpperCase().indexOf('=')==-1">
+                    = #{id}
+                </if>
+                <if test="id.toUpperCase().indexOf('=')!=-1">
+                    <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{idIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="distributionId != null "> and cm_distribution_team_product.distributionId = #{distributionId}</if>
+            <if test="productId != null "> and cm_distribution_team_product.productId = #{productId}</if>
+            <if test="validFlag != null  and validFlag != ''"> and cm_distribution_team_product.validFlag = #{validFlag}</if>
+        </where>
+        group by cm_distribution_team_product.id
+    </select>
+
+
+    <select id="getCmDistributionProductById" parameterType="String" resultMap="CmDistributionProductResult">
+        <include refid="selectCmDistributionProductVo"/>
+       from cm_distribution_product AS cm_distribution_product
+        LEFT JOIN product p ON  cm_distribution_product.productId = p.productID
+        LEFT JOIN shop s on p.shopID = s.shopID
+        LEFT JOIN cm_distribution_sku cm_distribution_sku ON  cm_distribution_sku.productId = p.productID
+        where    cm_distribution_product.id = #{id} group by cm_distribution_product.id
+    </select>
+
+    <select id="getByIds" parameterType="com.caimei365.commodity.model.po.CmDistributionProduct" resultType="Int">
+        select cm_distribution_product.id
+       from cm_distribution_product AS cm_distribution_product
+        LEFT JOIN product p ON  cm_distribution_product.productId = p.productID
+        LEFT JOIN shop s on p.shopID = s.shopID
+        LEFT JOIN cm_distribution_sku cm_distribution_sku ON  cm_distribution_sku.productId = p.productID
+        <where>
+            <if test="id != null  and id != ''">
+                and cm_distribution_product.id
+                <if test="id.toUpperCase().indexOf('=')==-1">
+                    = #{id}
+                </if>
+                <if test="id.toUpperCase().indexOf('=')!=-1">
+                    <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{idIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="productId != null "> and cm_distribution_product.productId = #{productId}</if>
+            <if test="validFlag != null  and validFlag != ''"> and cm_distribution_product.validFlag = #{validFlag}</if>
+            <if test="includedTax != null  and includedTax != ''"> and cm_distribution_product.includedTax = #{includedTax}</if>
+            <if test="invoiceType != null  and invoiceType != ''">
+                and cm_distribution_product.invoiceType
+                <if test="invoiceType.toUpperCase().indexOf('=')==-1">
+                    = #{invoiceType}
+                </if>
+                <if test="invoiceType.toUpperCase().indexOf('=')!=-1">
+                    <if test="invoiceType.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="invoiceType.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="typeIn" collection="invoiceType.substring(invoiceType.toUpperCase().indexOf('=')+1,invoiceType.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{typeIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="clubTaxPoint != null "> and cm_distribution_product.clubTaxPoint = #{clubTaxPoint}</if>
+            <if test="shopTaxPoint != null "> and cm_distribution_product.shopTaxPoint = #{shopTaxPoint}</if>
+            <if test="commission != null "> and cm_distribution_product.commission = #{commission}</if>
+            <if test="addTime != null "> and cm_distribution_product.addTime = #{addTime}</if>
+        </where>
+        group by cm_distribution_product.id
+    </select>
+    <select id="getByProductIds" parameterType="com.caimei365.commodity.model.po.CmDistributionProduct" resultType="Int">
+        select cm_distribution_product.productId
+       from cm_distribution_product AS cm_distribution_product
+        LEFT JOIN product p ON  cm_distribution_product.productId = p.productID
+        LEFT JOIN shop s on p.shopID = s.shopID
+        LEFT JOIN cm_distribution_sku cm_distribution_sku ON  cm_distribution_sku.productId = p.productID
+        <where>
+            <if test="id != null  and id != ''">
+                and cm_distribution_product.id
+                <if test="id.toUpperCase().indexOf('=')==-1">
+                    = #{id}
+                </if>
+                <if test="id.toUpperCase().indexOf('=')!=-1">
+                    <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{idIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="productId != null "> and cm_distribution_product.productId = #{productId}</if>
+            <if test="validFlag != null  and validFlag != ''"> and cm_distribution_product.validFlag = #{validFlag}</if>
+            <if test="includedTax != null  and includedTax != ''"> and cm_distribution_product.includedTax = #{includedTax}</if>
+            <if test="invoiceType != null  and invoiceType != ''">
+                and cm_distribution_product.invoiceType
+                <if test="invoiceType.toUpperCase().indexOf('=')==-1">
+                    = #{invoiceType}
+                </if>
+                <if test="invoiceType.toUpperCase().indexOf('=')!=-1">
+                    <if test="invoiceType.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="invoiceType.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="typeIn" collection="invoiceType.substring(invoiceType.toUpperCase().indexOf('=')+1,invoiceType.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{typeIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="clubTaxPoint != null "> and cm_distribution_product.clubTaxPoint = #{clubTaxPoint}</if>
+            <if test="shopTaxPoint != null "> and cm_distribution_product.shopTaxPoint = #{shopTaxPoint}</if>
+            <if test="commission != null "> and cm_distribution_product.commission = #{commission}</if>
+            <if test="addTime != null "> and cm_distribution_product.addTime = #{addTime}</if>
+        </where>
+        group by cm_distribution_product.id
+    </select>
+
+    <select id="getByTeamProductIds" parameterType="com.caimei365.commodity.model.po.CmDistributionProduct" resultType="Int">
+        select cm_distribution_team_product.productId
+       from cm_distribution_team_product AS cm_distribution_team_product
+        <where>
+            <if test="distributionId != null "> and cm_distribution_team_product.distributionId = #{distributionId}</if>
+        </where>
+        group by cm_distribution_team_product.id
+    </select>
+
+    <select id="getById" parameterType="com.caimei365.commodity.model.po.CmDistributionProduct" resultType="String">
+        select id
+       from cm_distribution_product AS cm_distribution_product
+        LEFT JOIN product p ON  cm_distribution_product.productId = p.productID
+        LEFT JOIN shop s on p.shopID = s.shopID
+        LEFT JOIN cm_distribution_sku cm_distribution_sku ON  cm_distribution_sku.productId = p.productID
+        <where>
+            <if test="id != null  and id != ''">
+                and cm_distribution_product.id
+                <if test="id.toString().toUpperCase().indexOf('=')==-1">
+                    = #{id}
+                </if>
+                <if test="id.toString().toUpperCase().indexOf('=')!=-1">
+                    <if test="id.toString().toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="id.toString().toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="idIn" collection="id.toString().substring(id.toString().toUpperCase().indexOf('=')+1,id.toString().length()).trim().split(',')" open="(" separator="," close=")">
+                        #{idIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="productId != null "> and cm_distribution_product.productId = #{productId}</if>
+            <if test="validFlag != null  and validFlag != ''"> and cm_distribution_product.validFlag = #{validFlag}</if>
+            <if test="includedTax != null  and includedTax != ''"> and cm_distribution_product.includedTax = #{includedTax}</if>
+            <if test="invoiceType != null  and invoiceType != ''">
+                and cm_distribution_product.invoiceType
+                <if test="invoiceType.toUpperCase().indexOf('=')==-1">
+                    = #{invoiceType}
+                </if>
+                <if test="invoiceType.toUpperCase().indexOf('=')!=-1">
+                    <if test="invoiceType.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="invoiceType.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="typeIn" collection="invoiceType.substring(invoiceType.toUpperCase().indexOf('=')+1,invoiceType.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{typeIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="clubTaxPoint != null "> and cm_distribution_product.clubTaxPoint = #{clubTaxPoint}</if>
+            <if test="shopTaxPoint != null "> and cm_distribution_product.shopTaxPoint = #{shopTaxPoint}</if>
+            <if test="commission != null "> and cm_distribution_product.commission = #{commission}</if>
+            <if test="addTime != null "> and cm_distribution_product.addTime = #{addTime}</if>
+        </where>
+        group by cm_distribution_product.id
+        limit 0,1
+    </select>
+
+    <insert id="addCmDistributionProduct" parameterType="com.caimei365.commodity.model.po.CmDistributionProduct" useGeneratedKeys="true" keyProperty="id">
+        insert into cm_distribution_product
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null and id != ''">id,</if>
+            <if test="productId != null">productId,</if>
+            <if test="validFlag != null and validFlag != ''">validFlag,</if>
+            <if test="includedTax != null and includedTax != ''">includedTax,</if>
+            <if test="invoiceType != null and invoiceType != ''">invoiceType,</if>
+            <if test="clubTaxPoint != null">clubTaxPoint,</if>
+            <if test="shopTaxPoint != null">shopTaxPoint,</if>
+            <if test="commission != null">commission,</if>
+            <if test="addTime != null">addTime,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null and id != ''">#{id},</if>
+            <if test="productId != null">#{productId},</if>
+            <if test="validFlag != null and validFlag != ''">#{validFlag},</if>
+            <if test="includedTax != null and includedTax != ''">#{includedTax},</if>
+            <if test="invoiceType != null and invoiceType != ''">#{invoiceType},</if>
+            <if test="clubTaxPoint != null">#{clubTaxPoint},</if>
+            <if test="shopTaxPoint != null">#{shopTaxPoint},</if>
+            <if test="commission != null">#{commission},</if>
+            <if test="addTime != null">#{addTime},</if>
+        </trim>
+    </insert>
+
+    <insert id="addCmDistributionTeamProduct" parameterType="com.caimei365.commodity.model.po.CmDistributionTeamProduct" useGeneratedKeys="true" keyProperty="id">
+        insert into cm_distribution_team_product
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null and id != ''">id,</if>
+            <if test="distributionId != null">distributionId,</if>
+            <if test="productId != null">productId,</if>
+            <if test="validFlag != null and validFlag != ''">validFlag,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null and id != ''">#{id},</if>
+            <if test="distributionId != null">#{distributionId},</if>
+            <if test="productId != null">#{productId},</if>
+            <if test="validFlag != null and validFlag != ''">#{validFlag},</if>
+        </trim>
+    </insert>
+    <update id="updateCmDistributionProduct" parameterType="com.caimei365.commodity.model.po.CmDistributionProduct">
+        update cm_distribution_product
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="productId != null">productId = #{productId},</if>
+            <if test="validFlag != null and validFlag != ''">validFlag = #{validFlag},</if>
+            <if test="includedTax != null and includedTax != ''">includedTax = #{includedTax},</if>
+            <if test="invoiceType != null and invoiceType != ''">invoiceType = #{invoiceType},</if>
+            <if test="clubTaxPoint != null">clubTaxPoint = #{clubTaxPoint},</if>
+            <if test="shopTaxPoint != null">shopTaxPoint = #{shopTaxPoint},</if>
+            <if test="commission != null">commission = #{commission},</if>
+            <if test="addTime != null">addTime = #{addTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+
+
+    <delete id="delCmDistributionProductById" parameterType="String">
+        delete
+        from cm_distribution_product where id = #{id}
+    </delete>
+
+    <delete id="delCmDistributionProduct" parameterType="com.caimei365.commodity.model.po.CmDistributionProduct">
+        delete
+       from cm_distribution_product AS cm_distribution_product
+        <where>
+            <if test="id != null  and id != ''">
+                and cm_distribution_product.id
+                <if test="id.toUpperCase().indexOf('=')==-1">
+                    = #{id}
+                </if>
+                <if test="id.toUpperCase().indexOf('=')!=-1">
+                    <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{idIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="productId != null "> and cm_distribution_product.productId = #{productId}</if>
+            <if test="validFlag != null  and validFlag != ''"> and cm_distribution_product.validFlag = #{validFlag}</if>
+            <if test="includedTax != null  and includedTax != ''"> and cm_distribution_product.includedTax = #{includedTax}</if>
+            <if test="invoiceType != null  and invoiceType != ''">
+                and cm_distribution_product.invoiceType
+                <if test="invoiceType.toUpperCase().indexOf('=')==-1">
+                    = #{invoiceType}
+                </if>
+                <if test="invoiceType.toUpperCase().indexOf('=')!=-1">
+                    <if test="invoiceType.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="invoiceType.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="typeIn" collection="invoiceType.substring(invoiceType.toUpperCase().indexOf('=')+1,invoiceType.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{typeIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="clubTaxPoint != null "> and cm_distribution_product.clubTaxPoint = #{clubTaxPoint}</if>
+            <if test="shopTaxPoint != null "> and cm_distribution_product.shopTaxPoint = #{shopTaxPoint}</if>
+            <if test="commission != null "> and cm_distribution_product.commission = #{commission}</if>
+            <if test="addTime != null "> and cm_distribution_product.addTime = #{addTime}</if>
+        </where>
+    </delete>
+
+    <delete id="delCmDistributionProductByIds" parameterType="String">
+        delete from cm_distribution_product where id in
+        <foreach item="id" collection="ids" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <delete id="delCmDistributionTeamProduct" parameterType="com.caimei365.commodity.model.po.CmDistributionTeamProduct">
+        delete
+        from cm_distribution_team_product AS cm_distribution_team_product
+        <where>
+            <if test="id != null  and id != ''">
+                and cm_distribution_team_product.id
+                <if test="id.toUpperCase().indexOf('=')==-1">
+                    = #{id}
+                </if>
+                <if test="id.toUpperCase().indexOf('=')!=-1">
+                    <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{idIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="distributionId != null "> and cm_distribution_team_product.distributionId = #{distributionId}</if>
+            <if test="productId != null "> and cm_distribution_team_product.productId = #{productId}</if>
+            <if test="validFlag != null  and validFlag != ''"> and cm_distribution_team_product.validFlag = #{validFlag}</if>
+        </where>
+    </delete>
+    <update id="updateCmDistributionTeamProduct" parameterType="com.caimei365.commodity.model.po.CmDistributionTeamProduct">
+        update cm_distribution_team_product
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="validFlag != null and validFlag != ''">validFlag = #{validFlag},</if>
+        </trim>
+        where distributionId = #{distributionId} and productId = #{productId}
+    </update>
+</mapper>

+ 289 - 0
src/main/resources/mapper/CmDistributionSkuMapper.xml

@@ -0,0 +1,289 @@
+<?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.caimei365.commodity.mapper.CmDistributionSkuMapper">
+
+    <resultMap type="CmDistributionSku" id="CmDistributionSkuResult">
+        <result property="skuId"    column="skuId"    />
+        <result property="productId"    column="productId"    />
+        <result property="price"    column="price"    />
+        <result property="shopPercent"    column="shopPercent"    />
+        <result property="organizePercent"    column="organizePercent"    />
+        <result property="cmPercent"    column="cmPercent"    />
+        <result property="costCheckFlag"    column="costCheckFlag"    />
+        <result property="unit"    column="unit"    />
+        <result property="costPrice"    column="costPrice"    />
+        <result property="cmCostPrice"    column="cmCostPrice"    />
+        <result property="organizeCostPrice"    column="organizeCostPrice"    />
+    </resultMap>
+
+    <sql id="selectCmDistributionSkuVo">
+        select
+            cm_distribution_sku.skuId,
+            cm_distribution_sku.productId,
+            ifnull(cm_distribution_sku.price,0) AS price,
+            cm_distribution_sku.shopPercent,
+            cm_distribution_sku.organizePercent,
+            cm_distribution_sku.cmPercent,
+            cm_distribution_sku.costCheckFlag,
+            cs.unit,
+            ifnull(cm_distribution_sku.costPrice,0) AS costPrice,
+            ifnull(cm_distribution_sku.cmCostPrice,0) AS cmCostPrice,
+            ifnull(cm_distribution_sku.organizeCostPrice,0) AS organizeCostPrice
+    </sql>
+
+    <select id="getByCmDistributionSku" parameterType="com.caimei365.commodity.model.po.CmDistributionSku" resultMap="CmDistributionSkuResult">
+        <include refid="selectCmDistributionSkuVo"/>
+        from cm_distribution_sku AS cm_distribution_sku
+        LEFT JOIN cm_sku cs ON  cs.skuId = cm_distribution_sku.skuId
+        <where>
+            <if test="skuId != null  and skuId != ''">
+                and cm_distribution_sku.skuId
+                <if test="skuId.toUpperCase().indexOf('=')==-1">
+                    = #{skuId}
+                </if>
+                <if test="skuId.toUpperCase().indexOf('=')!=-1">
+                    <if test="skuId.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="skuId.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="skuIdIn" collection="skuId.substring(skuId.toUpperCase().indexOf('=')+1,skuId.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{skuIdIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="productId != null "> and cm_distribution_sku.productId = #{productId}</if>
+            <if test="price != null "> and cm_distribution_sku.price = #{price}</if>
+            <if test="shopPercent != null "> and cm_distribution_sku.shopPercent = #{shopPercent}</if>
+            <if test="organizePercent != null "> and cm_distribution_sku.organizePercent = #{organizePercent}</if>
+            <if test="cmPercent != null "> and cm_distribution_sku.cmPercent = #{cmPercent}</if>
+            <if test="costCheckFlag != null  and costCheckFlag != ''"> and cm_distribution_sku.costCheckFlag = #{costCheckFlag}</if>
+        </where>
+        group by cm_distribution_sku.skuId
+        order by cm_distribution_sku.skuId desc
+        limit 0,1
+    </select>
+
+    <select id="getCmDistributionSkuList" parameterType="com.caimei365.commodity.model.po.CmDistributionSku" resultMap="CmDistributionSkuResult">
+        <include refid="selectCmDistributionSkuVo"/>
+        from cm_distribution_sku AS cm_distribution_sku
+        LEFT JOIN cm_sku cs ON  cs.skuId = cm_distribution_sku.skuId
+        <where>
+            <if test="skuId != null  and skuId != ''">
+                and cm_distribution_sku.skuId
+                <if test="skuId.toUpperCase().indexOf('=')==-1">
+                    = #{skuId}
+                </if>
+                <if test="skuId.toUpperCase().indexOf('=')!=-1">
+                    <if test="skuId.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="skuId.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="skuIdIn" collection="skuId.substring(skuId.toUpperCase().indexOf('=')+1,skuId.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{skuIdIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="productId != null "> and cm_distribution_sku.productId = #{productId}</if>
+            <if test="price != null "> and cm_distribution_sku.price = #{price}</if>
+            <if test="shopPercent != null "> and cm_distribution_sku.shopPercent = #{shopPercent}</if>
+            <if test="organizePercent != null "> and cm_distribution_sku.organizePercent = #{organizePercent}</if>
+            <if test="cmPercent != null "> and cm_distribution_sku.cmPercent = #{cmPercent}</if>
+            <if test="costCheckFlag != null  and costCheckFlag != ''"> and cm_distribution_sku.costCheckFlag = #{costCheckFlag}</if>
+        </where>
+        group by cm_distribution_sku.skuId
+        order by cm_distribution_sku.skuId desc
+    </select>
+
+    <select id="findDistributionSku" resultType="com.caimei365.commodity.model.po.CmSku">
+        select cs.skuId,
+               cs.productId,
+               cs.organizeId,
+               cs.unit,
+               cs.stock,
+               (select costCheckFlag
+                from cm_organize_product_info
+                where productId = cs.productId and organizeId = cs.organizeId) as costCheckFlag,
+               cs.costPrice,
+               cs.cmCostPrice,
+               cs.organizeCostPrice,
+               ifnull(cs.shopPercent, 0)                                       as shopPercent,
+               ifnull(cs.organizePercent, 0)                                   as organizePercent,
+               ifnull(cs.cmPercent, 0)                                         as cmPercent,
+               chs.price
+        from cm_sku cs
+                 left join cm_distribution_sku chs on cs.skuId = chs.skuId
+        where cs.productId = #{productID}
+          and cs.organizeId = (SELECT SUBSTRING(groundMall, 1, 1) FROM product WHERE productID = cs.productId)
+    </select>
+    <select id="getCmDistributionSkuCount" parameterType="com.caimei365.commodity.model.po.CmDistributionSku" resultType="int">
+        select count(1)
+        from cm_distribution_sku AS cm_distribution_sku
+        <where>
+            <if test="skuId != null  and  skuId != ''">
+                and cm_distribution_sku.skuId
+                <if test="skuId.toUpperCase().indexOf('=')==-1">
+                    = #{skuId}
+                </if>
+                <if test="skuId.toUpperCase().indexOf('=')!=-1">
+                    <if test="skuId.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="skuId.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="skuIdIn" collection="skuId.substring(skuId.toUpperCase().indexOf('=')+1,skuId.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{skuIdIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="productId != null "> and cm_distribution_sku.productId = #{productId}</if>
+            <if test="price != null "> and cm_distribution_sku.price = #{price}</if>
+            <if test="shopPercent != null "> and cm_distribution_sku.shopPercent = #{shopPercent}</if>
+            <if test="organizePercent != null "> and cm_distribution_sku.organizePercent = #{organizePercent}</if>
+            <if test="cmPercent != null "> and cm_distribution_sku.cmPercent = #{cmPercent}</if>
+            <if test="costCheckFlag != null  and costCheckFlag != ''"> and cm_distribution_sku.costCheckFlag = #{costCheckFlag}</if>
+        </where>
+        group by cm_distribution_sku.skuId
+    </select>
+
+    <select id="getCmDistributionSkuBySkuId" parameterType="String" resultMap="CmDistributionSkuResult">
+        <include refid="selectCmDistributionSkuVo"/>
+        from cm_distribution_sku AS cm_distribution_sku
+        LEFT JOIN cm_sku cs ON  cs.skuId = cm_distribution_sku.skuId
+        where  cm_distribution_sku.skuId = #{skuId}
+    </select>
+
+    <select id="getByIds" parameterType="com.caimei365.commodity.model.po.CmDistributionSku" resultType="String">
+        select skuId
+        from cm_distribution_sku AS cm_distribution_sku
+        <where>
+            <if test="skuId != null  and skuId != ''">
+                and cm_distribution_sku.skuId
+                <if test="skuId.toUpperCase().indexOf('=')==-1">
+                    = #{skuId}
+                </if>
+                <if test="skuId.toUpperCase().indexOf('=')!=-1">
+                    <if test="skuId.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="skuId.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="skuIdIn" collection="skuId.substring(skuId.toUpperCase().indexOf('=')+1,skuId.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{skuIdIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="productId != null "> and cm_distribution_sku.productId = #{productId}</if>
+            <if test="price != null "> and cm_distribution_sku.price = #{price}</if>
+            <if test="shopPercent != null "> and cm_distribution_sku.shopPercent = #{shopPercent}</if>
+            <if test="organizePercent != null "> and cm_distribution_sku.organizePercent = #{organizePercent}</if>
+            <if test="cmPercent != null "> and cm_distribution_sku.cmPercent = #{cmPercent}</if>
+            <if test="costCheckFlag != null  and costCheckFlag != ''"> and cm_distribution_sku.costCheckFlag = #{costCheckFlag}</if>
+        </where>
+        group by cm_distribution_sku.skuId
+    </select>
+
+    <select id="getById" parameterType="com.caimei365.commodity.model.po.CmDistributionSku" resultType="String">
+        select skuId
+        from cm_distribution_sku AS cm_distribution_sku
+        <where>
+            <if test="skuId != null  and skuId != ''">
+                and cm_distribution_sku.skuId
+                <if test="skuId.toString().toUpperCase().indexOf('=')==-1">
+                    = #{skuId}
+                </if>
+                <if test="skuId.toString().toUpperCase().indexOf('=')!=-1">
+                    <if test="skuId.toString().toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="skuId.toString().toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="skuIdIn" collection="skuId.toString().substring(skuId.toString().toUpperCase().indexOf('=')+1,skuId.toString().length()).trim().split(',')" open="(" separator="," close=")">
+                        #{skuIdIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="productId != null "> and cm_distribution_sku.productId = #{productId}</if>
+            <if test="price != null "> and cm_distribution_sku.price = #{price}</if>
+            <if test="shopPercent != null "> and cm_distribution_sku.shopPercent = #{shopPercent}</if>
+            <if test="organizePercent != null "> and cm_distribution_sku.organizePercent = #{organizePercent}</if>
+            <if test="cmPercent != null "> and cm_distribution_sku.cmPercent = #{cmPercent}</if>
+            <if test="costCheckFlag != null  and costCheckFlag != ''"> and cm_distribution_sku.costCheckFlag = #{costCheckFlag}</if>
+        </where>
+        group by cm_distribution_sku.skuId
+        limit 0,1
+    </select>
+
+    <insert id="addCmDistributionSku" parameterType="com.caimei365.commodity.model.po.CmDistributionSku" useGeneratedKeys="true" keyProperty="skuId">
+        insert into cm_distribution_sku
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="skuId != null and skuId != ''">skuId,</if>
+            <if test="productId != null">productId,</if>
+            <if test="price != null">price,</if>
+            <if test="shopPercent != null">shopPercent,</if>
+            <if test="organizePercent != null">organizePercent,</if>
+            <if test="cmPercent != null">cmPercent,</if>
+            <if test="costCheckFlag != null and costCheckFlag != ''">costCheckFlag,</if>
+            <if test="costPrice != null">costPrice,</if>
+            <if test="cmCostPrice != null">cmCostPrice,</if>
+            <if test="organizeCostPrice != null">organizeCostPrice,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="skuId != null and skuId != ''">#{skuId},</if>
+            <if test="productId != null">#{productId},</if>
+            <if test="price != null">#{price},</if>
+            <if test="shopPercent != null">#{shopPercent},</if>
+            <if test="organizePercent != null">#{organizePercent},</if>
+            <if test="cmPercent != null">#{cmPercent},</if>
+            <if test="costCheckFlag != null and costCheckFlag != ''">#{costCheckFlag},</if>
+            <if test="costPrice != null">#{costPrice},</if>
+            <if test="cmCostPrice != null">#{cmCostPrice},</if>
+            <if test="organizeCostPrice != null">#{organizeCostPrice},</if>
+        </trim>
+    </insert>
+
+    <update id="updateCmDistributionSku" parameterType="com.caimei365.commodity.model.po.CmDistributionSku">
+        update cm_distribution_sku
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="productId != null">productId = #{productId},</if>
+            <if test="price != null">price = #{price},</if>
+            <if test="shopPercent != null">shopPercent = #{shopPercent},</if>
+            <if test="organizePercent != null">organizePercent = #{organizePercent},</if>
+            <if test="cmPercent != null">cmPercent = #{cmPercent},</if>
+            <if test="costCheckFlag != null and costCheckFlag != ''">costCheckFlag = #{costCheckFlag},</if>
+            <if test="costPrice != null">costPrice = #{costPrice},</if>
+            <if test="cmCostPrice != null">cmCostPrice = #{cmCostPrice},</if>
+            <if test="organizeCostPrice != null">organizeCostPrice = #{organizeCostPrice},</if>
+        </trim>
+        where skuId = #{skuId}
+    </update>
+
+
+
+    <delete id="delCmDistributionSkuBySkuId" parameterType="String">
+        delete
+        from cm_distribution_sku where skuId = #{skuId}
+    </delete>
+
+    <delete id="delCmDistributionSku" parameterType="com.caimei365.commodity.model.po.CmDistributionSku">
+        delete
+        from cm_distribution_sku AS cm_distribution_sku
+        <where>
+            <if test="skuId != null  and skuId != ''">
+                and cm_distribution_sku.skuId
+                <if test="skuId.toUpperCase().indexOf('=')==-1">
+                    = #{skuId}
+                </if>
+                <if test="skuId.toUpperCase().indexOf('=')!=-1">
+                    <if test="skuId.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="skuId.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="skuIdIn" collection="skuId.substring(skuId.toUpperCase().indexOf('=')+1,skuId.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{skuIdIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="productId != null "> and cm_distribution_sku.productId = #{productId}</if>
+            <if test="price != null "> and cm_distribution_sku.price = #{price}</if>
+            <if test="shopPercent != null "> and cm_distribution_sku.shopPercent = #{shopPercent}</if>
+            <if test="organizePercent != null "> and cm_distribution_sku.organizePercent = #{organizePercent}</if>
+            <if test="cmPercent != null "> and cm_distribution_sku.cmPercent = #{cmPercent}</if>
+            <if test="costCheckFlag != null  and costCheckFlag != ''"> and cm_distribution_sku.costCheckFlag = #{costCheckFlag}</if>
+        </where>
+    </delete>
+
+    <delete id="delCmDistributionSkuBySkuIds" parameterType="String">
+        delete from cm_distribution_sku where skuId in
+        <foreach item="skuId" collection="skuIds" open="(" separator="," close=")">
+            #{skuId}
+        </foreach>
+    </delete>
+
+</mapper>

+ 320 - 0
src/main/resources/mapper/CmRelatedImageMapper.xml

@@ -0,0 +1,320 @@
+<?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.caimei365.commodity.mapper.CmRelatedImageMapper">
+
+	<resultMap type="com.caimei365.commodity.model.po.CmRelatedImage" id="CmRelatedImageResult">
+		<result property="id"    column="id"    />
+		<result property="type"    column="type"    />
+		<result property="authorId"    column="authorId"    />
+		<result property="image"    column="image"    />
+		<result property="delFlag"    column="delFlag"    />
+		<result property="updateTime"    column="updateTime"    />
+		<result property="createTime"    column="createTime"    />
+	</resultMap>
+
+	<sql id="selectCmRelatedImageVo">
+		select
+			cm_related_image.id,
+			cm_related_image.type,
+			cm_related_image.authorId,
+			cm_related_image.image,
+			cm_related_image.delFlag,
+			cm_related_image.updateTime,
+			cm_related_image.createTime
+	</sql>
+
+	<select id="getByCmRelatedImage" parameterType="com.caimei365.commodity.model.po.CmRelatedImage" resultMap="CmRelatedImageResult">
+		<include refid="selectCmRelatedImageVo"/>
+		from cm_related_image AS cm_related_image
+		<where>  cm_related_image.delFlag = 0
+			<if test="id != null  and id != ''">
+				and cm_related_image.id
+				<if test="id.toUpperCase().indexOf('=')==-1">
+					= #{id}
+				</if>
+				<if test="id.toUpperCase().indexOf('=')!=-1">
+					<if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="type != null  and type != ''">
+				and cm_related_image.type
+				<if test="type.toUpperCase().indexOf('=')==-1">
+					= #{type}
+				</if>
+				<if test="type.toUpperCase().indexOf('=')!=-1">
+					<if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
+						#{typeIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="authorId != null  and authorId != ''"> and cm_related_image.authorId = #{authorId}</if>
+			<if test="image != null  and image != ''"> and cm_related_image.image = #{image}</if>
+			<if test="updateTime != null "> and cm_related_image.updateTime = #{updateTime}</if>
+			<if test="createTime != null "> and cm_related_image.createTime = #{createTime}</if>
+		</where>
+		group by cm_related_image.id
+		order by cm_related_image.createTime desc
+		limit 0,1
+	</select>
+
+	<select id="getCmRelatedImageList" parameterType="com.caimei365.commodity.model.po.CmRelatedImage" resultMap="CmRelatedImageResult">
+		<include refid="selectCmRelatedImageVo"/>
+		from cm_related_image AS cm_related_image
+		<where>  cm_related_image.delFlag = 0
+			<if test="id != null  and id != ''">
+				and cm_related_image.id
+				<if test="id.toUpperCase().indexOf('=')==-1">
+					= #{id}
+				</if>
+				<if test="id.toUpperCase().indexOf('=')!=-1">
+					<if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="type != null  and type != ''">
+				and cm_related_image.type
+				<if test="type.toUpperCase().indexOf('=')==-1">
+					= #{type}
+				</if>
+				<if test="type.toUpperCase().indexOf('=')!=-1">
+					<if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
+						#{typeIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="authorId != null  and authorId != ''"> and cm_related_image.authorId = #{authorId}</if>
+			<if test="image != null  and image != ''"> and cm_related_image.image = #{image}</if>
+			<if test="updateTime != null "> and cm_related_image.updateTime = #{updateTime}</if>
+			<if test="createTime != null "> and cm_related_image.createTime = #{createTime}</if>
+		</where>
+		group by cm_related_image.id
+		order by cm_related_image.createTime desc
+	</select>
+
+	<select id="getCmRelatedImageCount" parameterType="com.caimei365.commodity.model.po.CmRelatedImage" resultType="int">
+		select count(1)
+		from cm_related_image AS cm_related_image
+		<where>  cm_related_image.delFlag = 0
+			<if test="id != null  and  id != ''">
+				and cm_related_image.id
+				<if test="id.toUpperCase().indexOf('=')==-1">
+					= #{id}
+				</if>
+				<if test="id.toUpperCase().indexOf('=')!=-1">
+					<if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="type != null  and type != ''">
+				and cm_related_image.type
+				<if test="type.toUpperCase().indexOf('=')==-1">
+					= #{type}
+				</if>
+				<if test="type.toUpperCase().indexOf('=')!=-1">
+					<if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
+						#{typeIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="authorId != null  and authorId != ''"> and cm_related_image.authorId = #{authorId}</if>
+			<if test="image != null  and image != ''"> and cm_related_image.image = #{image}</if>
+			<if test="updateTime != null "> and cm_related_image.updateTime = #{updateTime}</if>
+			<if test="createTime != null "> and cm_related_image.createTime = #{createTime}</if>
+		</where>
+		group by cm_related_image.id
+	</select>
+
+	<select id="getCmRelatedImageById" parameterType="String" resultMap="CmRelatedImageResult">
+		<include refid="selectCmRelatedImageVo"/>
+		from cm_related_image AS cm_related_image
+		where  cm_related_image.delFlag = 0 and cm_related_image.id = #{id}
+	</select>
+
+	<select id="getByIds" parameterType="com.caimei365.commodity.model.po.CmRelatedImage" resultType="String">
+		select id
+		from cm_related_image AS cm_related_image
+		<where>  cm_related_image.delFlag = 0
+			<if test="id != null  and id != ''">
+				and cm_related_image.id
+				<if test="id.toUpperCase().indexOf('=')==-1">
+					= #{id}
+				</if>
+				<if test="id.toUpperCase().indexOf('=')!=-1">
+					<if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="type != null  and type != ''">
+				and cm_related_image.type
+				<if test="type.toUpperCase().indexOf('=')==-1">
+					= #{type}
+				</if>
+				<if test="type.toUpperCase().indexOf('=')!=-1">
+					<if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
+						#{typeIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="authorId != null  and authorId != ''"> and cm_related_image.authorId = #{authorId}</if>
+			<if test="image != null  and image != ''"> and cm_related_image.image = #{image}</if>
+			<if test="updateTime != null "> and cm_related_image.updateTime = #{updateTime}</if>
+			<if test="createTime != null "> and cm_related_image.createTime = #{createTime}</if>
+		</where>
+		group by cm_related_image.id
+	</select>
+
+	<select id="getById" parameterType="com.caimei365.commodity.model.po.CmRelatedImage" resultType="String">
+		select id
+		from cm_related_image AS cm_related_image
+		<where>  cm_related_image.delFlag = 0
+			<if test="id != null  and id != ''">
+				and cm_related_image.id
+				<if test="id.toString().toUpperCase().indexOf('=')==-1">
+					= #{id}
+				</if>
+				<if test="id.toString().toUpperCase().indexOf('=')!=-1">
+					<if test="id.toString().toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="id.toString().toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="id.toString().substring(id.toString().toUpperCase().indexOf('=')+1,id.toString().length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="type != null  and type != ''">
+				and cm_related_image.type
+				<if test="type.toUpperCase().indexOf('=')==-1">
+					= #{type}
+				</if>
+				<if test="type.toUpperCase().indexOf('=')!=-1">
+					<if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
+						#{typeIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="authorId != null  and authorId != ''"> and cm_related_image.authorId = #{authorId}</if>
+			<if test="image != null  and image != ''"> and cm_related_image.image = #{image}</if>
+			<if test="updateTime != null "> and cm_related_image.updateTime = #{updateTime}</if>
+			<if test="createTime != null "> and cm_related_image.createTime = #{createTime}</if>
+		</where>
+		group by cm_related_image.id
+		limit 0,1
+	</select>
+
+	<insert id="addCmRelatedImage" parameterType="com.caimei365.commodity.model.po.CmRelatedImage" useGeneratedKeys="true" keyProperty="id">
+		insert into cm_related_image
+		<trim prefix="(" suffix=")" suffixOverrides=",">
+			<if test="id != null and id != ''">id,</if>
+			<if test="type != null and type != ''">type,</if>
+			<if test="authorId != null and authorId != ''">authorId,</if>
+			<if test="image != null and image != ''">image,</if>
+			<if test="delFlag != null">delFlag,</if>
+			<if test="updateTime != null">updateTime,</if>
+			<if test="createTime != null">createTime,</if>
+		</trim>
+		<trim prefix="values (" suffix=")" suffixOverrides=",">
+			<if test="id != null and id != ''">#{id},</if>
+			<if test="type != null and type != ''">#{type},</if>
+			<if test="authorId != null and authorId != ''">#{authorId},</if>
+			<if test="image != null and image != ''">#{image},</if>
+			<if test="delFlag != null">#{delFlag},</if>
+			<if test="updateTime != null">#{updateTime},</if>
+			<if test="createTime != null">#{createTime},</if>
+		</trim>
+	</insert>
+
+	<update id="updateCmRelatedImage" parameterType="com.caimei365.commodity.model.po.CmRelatedImage">
+		update cm_related_image
+		<trim prefix="SET" suffixOverrides=",">
+			<if test="type != null and type != ''">type = #{type},</if>
+			<if test="authorId != null and authorId != ''">authorId = #{authorId},</if>
+			<if test="image != null and image != ''">image = #{image},</if>
+			<if test="delFlag != null">delFlag = #{delFlag},</if>
+			<if test="updateTime != null">updateTime = #{updateTime},</if>
+			<if test="createTime != null">createTime = #{createTime},</if>
+		</trim>
+		where id = #{id}
+	</update>
+
+	<update id="updateDelCmRelatedImageByIds" parameterType="String">
+		update cm_related_image set delFlag=#{delFlag} where id in
+		<foreach item="id" collection="ids" open="(" separator="," close=")">
+			#{id}
+		</foreach>
+	</update>
+
+	<delete id="delCmRelatedImageById" parameterType="String">
+		delete
+		from cm_related_image where id = #{id}
+	</delete>
+
+	<delete id="delCmRelatedImage" parameterType="com.caimei365.commodity.model.po.CmRelatedImage">
+		delete
+		from cm_related_image AS cm_related_image
+		<where>
+			<if test="id != null  and id != ''">
+				and cm_related_image.id
+				<if test="id.toUpperCase().indexOf('=')==-1">
+					= #{id}
+				</if>
+				<if test="id.toUpperCase().indexOf('=')!=-1">
+					<if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="type != null  and type != ''">
+				and cm_related_image.type
+				<if test="type.toUpperCase().indexOf('=')==-1">
+					= #{type}
+				</if>
+				<if test="type.toUpperCase().indexOf('=')!=-1">
+					<if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
+						#{typeIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="authorId != null  and authorId != ''"> and cm_related_image.authorId = #{authorId}</if>
+			<if test="image != null  and image != ''"> and cm_related_image.image = #{image}</if>
+			<if test="delFlag != null "> and cm_related_image.delFlag = #{delFlag}</if>
+			<if test="updateTime != null "> and cm_related_image.updateTime = #{updateTime}</if>
+			<if test="createTime != null "> and cm_related_image.createTime = #{createTime}</if>
+		</where>
+	</delete>
+
+	<delete id="delCmRelatedImageByIds" parameterType="String">
+		delete from cm_related_image where id in
+		<foreach item="id" collection="ids" open="(" separator="," close=")">
+			#{id}
+		</foreach>
+	</delete>
+
+</mapper>

+ 359 - 0
src/main/resources/mapper/CmReportingClubMapper.xml

@@ -0,0 +1,359 @@
+<?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.caimei365.commodity.mapper.CmReportingClubMapper">
+
+	<resultMap type="com.caimei365.commodity.model.po.CmReportingClub" id="CmReportingClubResult">
+		<result property="id"    column="id"    />
+		<result property="clubName"    column="clubName"    />
+		<result property="linkMan"    column="linkMan"    />
+		<result property="mobile"    column="mobile"    />
+		<result property="productId"    column="productId"    />
+		<result property="orderStatus"    column="orderStatus"    />
+		<result property="lockStatus"    column="lockStatus"    />
+		<result property="lockTime"    column="lockTime"    />
+		<result property="distributionId"    column="distributionId"    />
+		<result property="delFlag"    column="delFlag"    />
+		<result property="updateTime"    column="updateTime"    />
+		<result property="createTime"    column="createTime"    />
+		<result property="distributionName"    column="distributionName"    />
+		<result property="productName"    column="productName"    />
+		<result property="productImage"    column="productImage"    />
+		<result property="commission"    column="commission"    />
+		<result property="settleStatus"    column="settleStatus"    />
+		<result property="settleTime"    column="settleTime"    />
+		<result property="orderId"    column="orderId"    />
+	</resultMap>
+
+	<sql id="selectCmReportingClubVo">
+		select
+			cm_reporting_club.id,
+			cm_reporting_club.clubName,
+			cm_reporting_club.linkMan,
+			cm_reporting_club.mobile,
+			cm_reporting_club.productId,
+			cm_reporting_club.orderId,
+			cm_reporting_club.orderStatus,
+			cm_reporting_club.lockStatus,
+			cm_reporting_club.lockTime,
+			cm_reporting_club.distributionId,
+			cm_reporting_club.delFlag,
+			cm_reporting_club.updateTime,
+			cm_reporting_club.createTime,
+			ifnull(cm_reporting_club.commission,0) AS commission,
+			cm_reporting_club.settleStatus,
+			cm_reporting_club.settleTime,
+			cm_distribution.name AS distributionName,
+			p.name AS productName,
+			p.mainImage AS productImage
+	</sql>
+
+	<select id="getByCmReportingClub" parameterType="com.caimei365.commodity.model.po.CmReportingClub" resultMap="CmReportingClubResult">
+		<include refid="selectCmReportingClubVo"/>
+		from cm_reporting_club AS cm_reporting_club
+		LEFT JOIN cm_distribution_product AS cm_distribution_product  on cm_reporting_club.productId=cm_distribution_product.productId
+		LEFT JOIN product p ON  cm_distribution_product.productId = p.productID
+		LEFT JOIN cm_distribution AS cm_distribution ON  cm_reporting_club.distributionId = cm_distribution.id
+		<where>  cm_reporting_club.delFlag = 0
+			<if test="id != null  and id != ''">
+				and cm_reporting_club.id
+				<if test="id.toUpperCase().indexOf('=')==-1">
+					= #{id}
+				</if>
+				<if test="id.toUpperCase().indexOf('=')!=-1">
+					<if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="clubName != null  and clubName != ''"> and cm_reporting_club.clubName like concat('%', #{clubName}, '%')</if>
+			<if test="linkMan != null  and linkMan != ''"> and cm_reporting_club.linkMan = #{linkMan}</if>
+			<if test="mobile != null  and mobile != ''"> and cm_reporting_club.mobile = #{mobile}</if>
+			<if test="productId != null "> and cm_reporting_club.productId = #{productId}</if>
+			<if test="orderId != null "> and cm_reporting_club.orderId = #{orderId}</if>
+			<if test="orderStatus != null "> and cm_reporting_club.orderStatus = #{orderStatus}</if>
+			<if test="lockStatus != null "> and cm_reporting_club.lockStatus = #{lockStatus}</if>
+			<if test="distributionId != null "> and cm_reporting_club.distributionId = #{distributionId}</if>
+			<if test="updateTime != null "> and cm_reporting_club.updateTime = #{updateTime}</if>
+			<if test="createTime != null "> and cm_reporting_club.createTime = #{createTime}</if>
+			<if test="commission != null "> and cm_reporting_club.commission = #{commission}</if>
+			<if test="settleStatus != null "> and cm_reporting_club.settleStatus = #{settleStatus}</if>
+			<if test="settleTime != null "> and cm_reporting_club.settleTime = #{settleTime}</if>
+			<if test="productName != null and productName!='' "> and p.name  like concat('%', #{productName}, '%')</if>
+		</where>
+		group by cm_reporting_club.id
+		order by cm_reporting_club.createTime desc
+		limit 0,1
+	</select>
+
+
+	<select id="getCmReportingClubList" parameterType="com.caimei365.commodity.model.po.CmReportingClub" resultMap="CmReportingClubResult">
+		<include refid="selectCmReportingClubVo"/>
+		from cm_reporting_club AS cm_reporting_club
+		LEFT JOIN cm_distribution_product AS cm_distribution_product  on cm_reporting_club.productId=cm_distribution_product.productId
+		LEFT JOIN product p ON  cm_distribution_product.productId = p.productID
+		LEFT JOIN cm_distribution AS cm_distribution ON  cm_reporting_club.distributionId = cm_distribution.id
+
+		<where>  cm_reporting_club.delFlag = 0
+			<if test="id != null  and id != ''">
+				and cm_reporting_club.id
+				<if test="id.toUpperCase().indexOf('=')==-1">
+					= #{id}
+				</if>
+				<if test="id.toUpperCase().indexOf('=')!=-1">
+					<if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="clubName != null  and clubName != ''"> and cm_reporting_club.clubName like concat('%', #{clubName}, '%')</if>
+			<if test="linkMan != null  and linkMan != ''"> and cm_reporting_club.linkMan = #{linkMan}</if>
+			<if test="mobile != null  and mobile != ''"> and cm_reporting_club.mobile = #{mobile}</if>
+			<if test="productId != null "> and cm_reporting_club.productId = #{productId}</if>
+			<if test="orderId != null "> and cm_reporting_club.orderId = #{orderId}</if>
+			<if test="orderStatus != null "> and cm_reporting_club.orderStatus = #{orderStatus}</if>
+			<if test="lockStatus != null "> and cm_reporting_club.lockStatus = #{lockStatus}</if>
+			<if test="distributionId != null "> and cm_reporting_club.distributionId = #{distributionId}</if>
+			<if test="updateTime != null "> and cm_reporting_club.updateTime = #{updateTime}</if>
+			<if test="createTime != null "> and cm_reporting_club.createTime = #{createTime}</if>
+			<if test="commission != null "> and cm_reporting_club.commission = #{commission}</if>
+			<if test="settleStatus != null "> and cm_reporting_club.settleStatus = #{settleStatus}</if>
+			<if test="settleTime != null "> and cm_reporting_club.settleTime = #{settleTime}</if>
+			<if test="productName != null and productName!='' "> and p.name  like concat('%', #{productName}, '%')</if>
+
+		</where>
+		group by cm_reporting_club.id
+		order by cm_reporting_club.createTime desc
+	</select>
+
+	<select id="getCmReportingClubCount" parameterType="com.caimei365.commodity.model.po.CmReportingClub" resultType="int">
+		select count(1)
+		from cm_reporting_club AS cm_reporting_club
+		<where>  cm_reporting_club.delFlag = 0
+			<if test="id != null  and  id != ''">
+				and cm_reporting_club.id
+				<if test="id.toUpperCase().indexOf('=')==-1">
+					= #{id}
+				</if>
+				<if test="id.toUpperCase().indexOf('=')!=-1">
+					<if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="clubName != null  and clubName != ''"> and cm_reporting_club.clubName like concat('%', #{clubName}, '%')</if>
+			<if test="linkMan != null  and linkMan != ''"> and cm_reporting_club.linkMan = #{linkMan}</if>
+			<if test="mobile != null  and mobile != ''"> and cm_reporting_club.mobile = #{mobile}</if>
+			<if test="productId != null "> and cm_reporting_club.productId = #{productId}</if>
+			<if test="orderId != null "> and cm_reporting_club.orderId = #{orderId}</if>
+			<if test="orderStatus != null "> and cm_reporting_club.orderStatus = #{orderStatus}</if>
+			<if test="lockStatus != null "> and cm_reporting_club.lockStatus = #{lockStatus}</if>
+			<if test="distributionId != null "> and cm_reporting_club.distributionId = #{distributionId}</if>
+			<if test="updateTime != null "> and cm_reporting_club.updateTime = #{updateTime}</if>
+			<if test="createTime != null "> and cm_reporting_club.createTime = #{createTime}</if>
+			<if test="commission != null "> and cm_reporting_club.commission = #{commission}</if>
+			<if test="settleStatus != null "> and cm_reporting_club.settleStatus = #{settleStatus}</if>
+			<if test="settleTime != null "> and cm_reporting_club.settleTime = #{settleTime}</if>
+		</where>
+		group by cm_reporting_club.id
+	</select>
+
+
+	<select id="getCmReportingClubById" parameterType="String" resultMap="CmReportingClubResult">
+		<include refid="selectCmReportingClubVo"/>
+		from cm_reporting_club AS cm_reporting_club
+		LEFT JOIN cm_distribution_product AS cm_distribution_product  on cm_reporting_club.productId=cm_distribution_product.productId
+		LEFT JOIN product p ON  cm_distribution_product.productId = p.productID
+		LEFT JOIN cm_distribution AS cm_distribution ON  cm_reporting_club.distributionId = cm_distribution.id
+		where  cm_reporting_club.delFlag = 0 and cm_reporting_club.id = #{id}
+	</select>
+
+	<select id="getByIds" parameterType="com.caimei365.commodity.model.po.CmReportingClub" resultType="String">
+		select id
+		from cm_reporting_club AS cm_reporting_club
+		<where>  cm_reporting_club.delFlag = 0
+			<if test="id != null  and id != ''">
+				and cm_reporting_club.id
+				<if test="id.toUpperCase().indexOf('=')==-1">
+					= #{id}
+				</if>
+				<if test="id.toUpperCase().indexOf('=')!=-1">
+					<if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="clubName != null  and clubName != ''"> and cm_reporting_club.clubName like concat('%', #{clubName}, '%')</if>
+			<if test="linkMan != null  and linkMan != ''"> and cm_reporting_club.linkMan = #{linkMan}</if>
+			<if test="mobile != null  and mobile != ''"> and cm_reporting_club.mobile = #{mobile}</if>
+			<if test="productId != null "> and cm_reporting_club.productId = #{productId}</if>
+			<if test="orderId != null "> and cm_reporting_club.orderId = #{orderId}</if>
+			<if test="orderStatus != null "> and cm_reporting_club.orderStatus = #{orderStatus}</if>
+			<if test="lockStatus != null "> and cm_reporting_club.lockStatus = #{lockStatus}</if>
+			<if test="distributionId != null "> and cm_reporting_club.distributionId = #{distributionId}</if>
+			<if test="updateTime != null "> and cm_reporting_club.updateTime = #{updateTime}</if>
+			<if test="createTime != null "> and cm_reporting_club.createTime = #{createTime}</if>
+			<if test="commission != null "> and cm_reporting_club.commission = #{commission}</if>
+			<if test="settleStatus != null "> and cm_reporting_club.settleStatus = #{settleStatus}</if>
+			<if test="settleTime != null "> and cm_reporting_club.settleTime = #{settleTime}</if>
+		</where>
+		group by cm_reporting_club.id
+	</select>
+
+	<select id="getById" parameterType="com.caimei365.commodity.model.po.CmReportingClub" resultType="String">
+		select id
+		from cm_reporting_club AS cm_reporting_club
+		<where>  cm_reporting_club.delFlag = 0
+			<if test="id != null  and id != ''">
+				and cm_reporting_club.id
+				<if test="id.toString().toUpperCase().indexOf('=')==-1">
+					= #{id}
+				</if>
+				<if test="id.toString().toUpperCase().indexOf('=')!=-1">
+					<if test="id.toString().toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="id.toString().toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="id.toString().substring(id.toString().toUpperCase().indexOf('=')+1,id.toString().length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="clubName != null  and clubName != ''"> and cm_reporting_club.clubName like concat('%', #{clubName}, '%')</if>
+			<if test="linkMan != null  and linkMan != ''"> and cm_reporting_club.linkMan = #{linkMan}</if>
+			<if test="mobile != null  and mobile != ''"> and cm_reporting_club.mobile = #{mobile}</if>
+			<if test="productId != null "> and cm_reporting_club.productId = #{productId}</if>
+			<if test="orderId != null "> and cm_reporting_club.orderId = #{orderId}</if>
+			<if test="orderStatus != null "> and cm_reporting_club.orderStatus = #{orderStatus}</if>
+			<if test="lockStatus != null "> and cm_reporting_club.lockStatus = #{lockStatus}</if>
+			<if test="distributionId != null "> and cm_reporting_club.distributionId = #{distributionId}</if>
+			<if test="updateTime != null "> and cm_reporting_club.updateTime = #{updateTime}</if>
+			<if test="createTime != null "> and cm_reporting_club.createTime = #{createTime}</if>
+			<if test="commission != null "> and cm_reporting_club.commission = #{commission}</if>
+			<if test="settleStatus != null "> and cm_reporting_club.settleStatus = #{settleStatus}</if>
+			<if test="settleTime != null "> and cm_reporting_club.settleTime = #{settleTime}</if>
+		</where>
+		group by cm_reporting_club.id
+		limit 0,1
+	</select>
+
+	<insert id="addCmReportingClub" parameterType="com.caimei365.commodity.model.po.CmReportingClub" useGeneratedKeys="true" keyProperty="id">
+		insert into cm_reporting_club
+		<trim prefix="(" suffix=")" suffixOverrides=",">
+			<if test="id != null and id != ''">id,</if>
+			<if test="clubName != null and clubName != ''">clubName,</if>
+			<if test="linkMan != null and linkMan != ''">linkMan,</if>
+			<if test="mobile != null and mobile != ''">mobile,</if>
+			<if test="productId != null">productId,</if>
+			<if test="orderStatus != null">orderStatus,</if>
+			<if test="lockStatus != null">lockStatus,</if>
+			<if test="lockTime != null">lockTime,</if>
+			<if test="distributionId != null">distributionId,</if>
+			<if test="delFlag != null">delFlag,</if>
+			<if test="updateTime != null">updateTime,</if>
+			<if test="createTime != null">createTime,</if>
+			<if test="commission != null">commission,</if>
+			<if test="settleStatus != null">settleStatus,</if>
+			<if test="settleTime != null">settleTime,</if>
+		</trim>
+		<trim prefix="values (" suffix=")" suffixOverrides=",">
+			<if test="id != null and id != ''">#{id},</if>
+			<if test="clubName != null and clubName != ''">#{clubName},</if>
+			<if test="linkMan != null and linkMan != ''">#{linkMan},</if>
+			<if test="mobile != null and mobile != ''">#{mobile},</if>
+			<if test="productId != null">#{productId},</if>
+			<if test="orderStatus != null">#{orderStatus},</if>
+			<if test="lockStatus != null">#{lockStatus},</if>
+			<if test="lockTime != null">#{lockTime},</if>
+			<if test="distributionId != null">#{distributionId},</if>
+			<if test="delFlag != null">#{delFlag},</if>
+			<if test="updateTime != null">#{updateTime},</if>
+			<if test="createTime != null">#{createTime},</if>
+			<if test="commission != null">#{commission},</if>
+			<if test="settleStatus != null">#{settleStatus},</if>
+			<if test="settleTime != null">#{settleTime},</if>
+		</trim>
+	</insert>
+
+	<update id="updateCmReportingClub" parameterType="com.caimei365.commodity.model.po.CmReportingClub">
+		update cm_reporting_club
+		<trim prefix="SET" suffixOverrides=",">
+			<if test="clubName != null and clubName != ''">clubName = #{clubName},</if>
+			<if test="linkMan != null and linkMan != ''">linkMan = #{linkMan},</if>
+			<if test="mobile != null and mobile != ''">mobile = #{mobile},</if>
+			<if test="productId != null">productId = #{productId},</if>
+			<if test="orderStatus != null">orderStatus = #{orderStatus},</if>
+			<if test="lockStatus != null">lockStatus = #{lockStatus},</if>
+			<if test="lockTime != null">lockTime = #{lockTime},</if>
+			<if test="distributionId != null">distributionId = #{distributionId},</if>
+			<if test="delFlag != null">delFlag = #{delFlag},</if>
+			<if test="updateTime != null">updateTime = #{updateTime},</if>
+			<if test="createTime != null">createTime = #{createTime},</if>
+			<if test="commission != null">commission = #{commission},</if>
+			<if test="settleStatus != null">settleStatus = #{settleStatus},</if>
+			<if test="settleTime != null">settleTime = #{settleTime},</if>
+		</trim>
+		where id = #{id}
+	</update>
+
+	<update id="updateDelCmReportingClubByIds" parameterType="String">
+		update cm_reporting_club set delFlag=#{delFlag} where id in
+		<foreach item="id" collection="ids" open="(" separator="," close=")">
+			#{id}
+		</foreach>
+	</update>
+
+	<delete id="delCmReportingClubById" parameterType="String">
+		delete
+		from cm_reporting_club where id = #{id}
+	</delete>
+
+	<delete id="delCmReportingClub" parameterType="com.caimei365.commodity.model.po.CmReportingClub">
+		delete
+		from cm_reporting_club AS cm_reporting_club
+		<where>
+			<if test="id != null  and id != ''">
+				and cm_reporting_club.id
+				<if test="id.toUpperCase().indexOf('=')==-1">
+					= #{id}
+				</if>
+				<if test="id.toUpperCase().indexOf('=')!=-1">
+					<if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="clubName != null  and clubName != ''"> and cm_reporting_club.clubName like concat('%', #{clubName}, '%')</if>
+			<if test="linkMan != null  and linkMan != ''"> and cm_reporting_club.linkMan = #{linkMan}</if>
+			<if test="mobile != null  and mobile != ''"> and cm_reporting_club.mobile = #{mobile}</if>
+			<if test="productId != null "> and cm_reporting_club.productId = #{productId}</if>
+			<if test="orderId != null "> and cm_reporting_club.orderId = #{orderId}</if>
+			<if test="orderStatus != null "> and cm_reporting_club.orderStatus = #{orderStatus}</if>
+			<if test="lockStatus != null "> and cm_reporting_club.lockStatus = #{lockStatus}</if>
+			<if test="distributionId != null "> and cm_reporting_club.distributionId = #{distributionId}</if>
+			<if test="delFlag != null "> and cm_reporting_club.delFlag = #{delFlag}</if>
+			<if test="updateTime != null "> and cm_reporting_club.updateTime = #{updateTime}</if>
+			<if test="createTime != null "> and cm_reporting_club.createTime = #{createTime}</if>
+			<if test="commission != null "> and cm_reporting_club.commission = #{commission}</if>
+			<if test="settleStatus != null "> and cm_reporting_club.settleStatus = #{settleStatus}</if>
+			<if test="settleTime != null "> and cm_reporting_club.settleTime = #{settleTime}</if>
+		</where>
+	</delete>
+
+	<delete id="delCmReportingClubByIds" parameterType="String">
+		delete from cm_reporting_club where id in
+		<foreach item="id" collection="ids" open="(" separator="," close=")">
+			#{id}
+		</foreach>
+	</delete>
+
+</mapper>

+ 368 - 0
src/main/resources/mapper/CmReportingMemberMapper.xml

@@ -0,0 +1,368 @@
+<?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.caimei365.commodity.mapper.CmReportingMemberMapper">
+
+	<resultMap type="com.caimei365.commodity.model.po.CmReportingMember" id="CmReportingMemberResult">
+		<result property="id"    column="id"    />
+		<result property="distributionId"    column="distributionId"    />
+		<result property="clubReportingId"    column="clubReportingId"    />
+		<result property="auditStatus"    column="auditStatus"    />
+		<result property="auditText"    column="auditText"    />
+		<result property="auditTime"    column="auditTime"    />
+		<result property="delFlag"    column="delFlag"    />
+		<result property="updateTime"    column="updateTime"    />
+		<result property="createTime"    column="createTime"    />
+		<result property="remarks"    column="remarks"    />
+		<result property="auditBy"    column="auditBy"    />
+		<result property="commission"    column="commission"    />
+		<result property="settleStatus"    column="settleStatus"    />
+		<result property="settleTime"    column="settleTime"    />
+	</resultMap>
+
+	<sql id="selectCmReportingMemberVo">
+		select
+			cm_reporting_member.id,
+			cm_reporting_member.distributionId,
+			cm_reporting_member.clubReportingId,
+			cm_reporting_member.auditStatus,
+			cm_reporting_member.auditText,
+			cm_reporting_member.auditTime,
+			cm_reporting_member.remarks,
+			cm_reporting_member.auditBy,
+			cm_reporting_member.delFlag,
+			cm_reporting_member.updateTime,
+			cm_reporting_member.createTime,
+			ifnull(cm_reporting_member.commission,0) AS commission,
+			cm_reporting_member.settleStatus,
+			cm_reporting_member.settleTime
+	</sql>
+
+	<select id="getByCmReportingMember" parameterType="com.caimei365.commodity.model.po.CmReportingMember" resultMap="CmReportingMemberResult">
+		<include refid="selectCmReportingMemberVo"/>
+		from cm_reporting_member AS cm_reporting_member
+		<where>  cm_reporting_member.delFlag = 0
+			<if test="id != null  and id != ''">
+				and cm_reporting_member.id
+				<if test="id.toUpperCase().indexOf('=')==-1">
+					= #{id}
+				</if>
+				<if test="id.toUpperCase().indexOf('=')!=-1">
+					<if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="distributionId != null "> and cm_reporting_member.distributionId = #{distributionId}</if>
+			<if test="clubReportingId != null "> and cm_reporting_member.clubReportingId = #{clubReportingId}</if>
+			<if test="auditStatus != null  and  auditStatus != '' "> and cm_reporting_member.auditStatus = #{auditStatus}</if>
+			<if test="auditText != null  and auditText != ''"> and cm_reporting_member.auditText = #{auditText}</if>
+			<if test="auditTime != null "> and cm_reporting_member.auditTime = #{auditTime}</if>
+			<if test="updateTime != null "> and cm_reporting_member.updateTime = #{updateTime}</if>
+			<if test="createTime != null "> and cm_reporting_member.createTime = #{createTime}</if>
+			<if test="commission != null "> and cm_reporting_member.commission = #{commission}</if>
+			<if test="settleStatus != null "> and cm_reporting_member.settleStatus = #{settleStatus}</if>
+			<if test="settleTime != null "> and cm_reporting_member.settleTime = #{settleTime}</if>
+		</where>
+		group by cm_reporting_member.id
+		order by cm_reporting_member.createTime desc
+		limit 0,1
+	</select>
+
+	<select id="getCmReportingMemberList" parameterType="com.caimei365.commodity.model.po.CmReportingMember" resultMap="CmReportingMemberResult">
+		<include refid="selectCmReportingMemberVo"/>
+		from cm_reporting_member AS cm_reporting_member
+		<where>  cm_reporting_member.delFlag = 0
+			<if test="id != null  and id != ''">
+				and cm_reporting_member.id
+				<if test="id.toUpperCase().indexOf('=')==-1">
+					= #{id}
+				</if>
+				<if test="id.toUpperCase().indexOf('=')!=-1">
+					<if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="distributionId != null "> and cm_reporting_member.distributionId = #{distributionId}</if>
+			<if test="clubReportingId != null "> and cm_reporting_member.clubReportingId = #{clubReportingId}</if>
+			<if test="auditStatus != null  and  auditStatus != '' "> and cm_reporting_member.auditStatus = #{auditStatus}</if>
+			<if test="auditText != null  and auditText != ''"> and cm_reporting_member.auditText = #{auditText}</if>
+			<if test="auditTime != null "> and cm_reporting_member.auditTime = #{auditTime}</if>
+			<if test="updateTime != null "> and cm_reporting_member.updateTime = #{updateTime}</if>
+			<if test="createTime != null "> and cm_reporting_member.createTime = #{createTime}</if>
+			<if test="commission != null "> and cm_reporting_member.commission = #{commission}</if>
+			<if test="settleStatus != null "> and cm_reporting_member.settleStatus = #{settleStatus}</if>
+			<if test="settleTime != null "> and cm_reporting_member.settleTime = #{settleTime}</if>
+		</where>
+		group by cm_reporting_member.id
+		order by cm_reporting_member.createTime desc
+	</select>
+
+	<select id="getCmDistributionMemberList" parameterType="com.caimei365.commodity.model.po.CmDistribution" resultMap="CmReportingMemberResult">
+		<include refid="selectCmReportingMemberVo"/>
+		from cm_reporting_member AS cm_reporting_member
+		left join  cm_reporting_club AS cm_reporting_club on cm_reporting_club.id=cm_reporting_member.clubReportingId
+		left join cm_distribution AS cm_distribution on cm_distribution.id=cm_reporting_member.distributionId
+		<where>  cm_reporting_member.delFlag = 0 and cm_distribution.delFlag = 0
+			<if test="id != null  and id != ''">
+				and cm_distribution.id
+				<if test="id.toUpperCase().indexOf('=')==-1">
+					= #{id}
+				</if>
+				<if test="id.toUpperCase().indexOf('=')!=-1">
+					<if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="userId != null "> and cm_distribution.userId = #{userId}</if>
+			<if test="name != null  and name != ''"> and cm_distribution.name like concat('%', #{name}, '%')</if>
+			<if test="linkMan != null  and linkMan != ''"> and cm_distribution.linkMan = #{linkMan}</if>
+			<if test="mobile != null  and mobile != ''"> and cm_distribution.mobile = #{mobile}</if>
+			<if test="password != null  and password != ''"> and cm_distribution.password = #{password}</if>
+			<if test="corporateName != null  and corporateName != ''"> and cm_distribution.corporateName like concat('%', #{corporateName}, '%')</if>
+			<if test="splitCode != null  and splitCode != ''"> and cm_distribution.splitCode = #{splitCode}</if>
+			<if test="bankName != null  and bankName != ''"> and cm_distribution.bankName like concat('%', #{bankName}, '%')</if>
+			<if test="bankAccount != null  and bankAccount != ''"> and cm_distribution.bankAccount = #{bankAccount}</if>
+			<if test="status != null "> and cm_distribution.status = #{status}</if>
+			<if test="qrCode != null  and qrCode != ''"> and cm_distribution.qrCode = #{qrCode}</if>
+			<if test="parentId != null "> and cm_distribution.parentId = #{parentId}</if>
+			<if test="parentIds != null  and parentIds != ''"> and cm_distribution.parentIds = #{parentIds}</if>
+			<if test="updateTime != null "> and cm_distribution.updateTime = #{updateTime}</if>
+			<if test="addTime != null "> and cm_distribution.addTime = #{addTime}</if>
+			<if test="clubName != null and clubName != ''"> and cm_reporting_club.clubName like concat('%', #{clubName}, '%')</if>
+		</where>
+		group by cm_reporting_member.id
+		order by cm_reporting_member.createTime desc
+	</select>
+
+
+	<select id="getCmReportingMemberCount" parameterType="com.caimei365.commodity.model.po.CmReportingMember" resultType="Integer">
+		select ifnull(count(1),0)
+		from cm_reporting_member AS cm_reporting_member
+		<where>  cm_reporting_member.delFlag = 0
+			<if test="id != null  and  id != ''">
+				and cm_reporting_member.id
+				<if test="id.toUpperCase().indexOf('=')==-1">
+					= #{id}
+				</if>
+				<if test="id.toUpperCase().indexOf('=')!=-1">
+					<if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="distributionId != null "> and cm_reporting_member.distributionId = #{distributionId}</if>
+			<if test="clubReportingId != null "> and cm_reporting_member.clubReportingId = #{clubReportingId}</if>
+			<if test="auditStatus != null  and  auditStatus != ''">
+				and cm_reporting_member.auditStatus
+				<if test="auditStatus.toUpperCase().indexOf('=')==-1">
+					= #{auditStatus}
+				</if>
+				<if test="auditStatus.toUpperCase().indexOf('=')!=-1">
+					<if test="auditStatus.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="auditStatus.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="auditStatus.substring(auditStatus.toUpperCase().indexOf('=')+1,auditStatus.length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="auditText != null  and auditText != ''"> and cm_reporting_member.auditText = #{auditText}</if>
+			<if test="auditTime != null "> and cm_reporting_member.auditTime = #{auditTime}</if>
+			<if test="updateTime != null "> and cm_reporting_member.updateTime = #{updateTime}</if>
+			<if test="createTime != null "> and cm_reporting_member.createTime = #{createTime}</if>
+			<if test="commission != null "> and cm_reporting_member.commission = #{commission}</if>
+			<if test="settleStatus != null "> and cm_reporting_member.settleStatus = #{settleStatus}</if>
+			<if test="settleTime != null "> and cm_reporting_member.settleTime = #{settleTime}</if>
+		</where>
+-- 		group by cm_reporting_member.id
+	</select>
+
+
+
+	<select id="getCmReportingMemberById" parameterType="String" resultMap="CmReportingMemberResult">
+		<include refid="selectCmReportingMemberVo"/>
+		from cm_reporting_member AS cm_reporting_member
+		where  cm_reporting_member.delFlag = 0 and cm_reporting_member.id = #{id}
+	</select>
+
+	<select id="getByIds" parameterType="com.caimei365.commodity.model.po.CmReportingMember" resultType="String">
+		select id
+		from cm_reporting_member AS cm_reporting_member
+		<where>  cm_reporting_member.delFlag = 0
+			<if test="id != null  and id != ''">
+				and cm_reporting_member.id
+				<if test="id.toUpperCase().indexOf('=')==-1">
+					= #{id}
+				</if>
+				<if test="id.toUpperCase().indexOf('=')!=-1">
+					<if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="distributionId != null "> and cm_reporting_member.distributionId = #{distributionId}</if>
+			<if test="clubReportingId != null "> and cm_reporting_member.clubReportingId = #{clubReportingId}</if>
+			<if test="auditStatus != null  and  auditStatus != '' "> and cm_reporting_member.auditStatus = #{auditStatus}</if>
+			<if test="auditText != null  and auditText != ''"> and cm_reporting_member.auditText = #{auditText}</if>
+			<if test="auditTime != null "> and cm_reporting_member.auditTime = #{auditTime}</if>
+			<if test="updateTime != null "> and cm_reporting_member.updateTime = #{updateTime}</if>
+			<if test="createTime != null "> and cm_reporting_member.createTime = #{createTime}</if>
+			<if test="commission != null "> and cm_reporting_member.commission = #{commission}</if>
+			<if test="settleStatus != null "> and cm_reporting_member.settleStatus = #{settleStatus}</if>
+			<if test="settleTime != null "> and cm_reporting_member.settleTime = #{settleTime}</if>
+		</where>
+		group by cm_reporting_member.id
+	</select>
+
+	<select id="getById" parameterType="com.caimei365.commodity.model.po.CmReportingMember" resultType="String">
+		select id
+		from cm_reporting_member AS cm_reporting_member
+		<where>  cm_reporting_member.delFlag = 0
+			<if test="id != null  and id != ''">
+				and cm_reporting_member.id
+				<if test="id.toString().toUpperCase().indexOf('=')==-1">
+					= #{id}
+				</if>
+				<if test="id.toString().toUpperCase().indexOf('=')!=-1">
+					<if test="id.toString().toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="id.toString().toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="id.toString().substring(id.toString().toUpperCase().indexOf('=')+1,id.toString().length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="distributionId != null "> and cm_reporting_member.distributionId = #{distributionId}</if>
+			<if test="clubReportingId != null "> and cm_reporting_member.clubReportingId = #{clubReportingId}</if>
+			<if test="auditStatus != null  and  auditStatus != '' "> and cm_reporting_member.auditStatus = #{auditStatus}</if>
+			<if test="auditText != null  and auditText != ''"> and cm_reporting_member.auditText = #{auditText}</if>
+			<if test="auditTime != null "> and cm_reporting_member.auditTime = #{auditTime}</if>
+			<if test="updateTime != null "> and cm_reporting_member.updateTime = #{updateTime}</if>
+			<if test="createTime != null "> and cm_reporting_member.createTime = #{createTime}</if>
+			<if test="commission != null "> and cm_reporting_member.commission = #{commission}</if>
+			<if test="settleStatus != null "> and cm_reporting_member.settleStatus = #{settleStatus}</if>
+			<if test="settleTime != null "> and cm_reporting_member.settleTime = #{settleTime}</if>
+		</where>
+		group by cm_reporting_member.id
+		limit 0,1
+	</select>
+
+	<insert id="addCmReportingMember" parameterType="com.caimei365.commodity.model.po.CmReportingMember" useGeneratedKeys="true" keyProperty="id">
+		insert into cm_reporting_member
+		<trim prefix="(" suffix=")" suffixOverrides=",">
+			<if test="id != null and id != ''">id,</if>
+			<if test="distributionId != null">distributionId,</if>
+			<if test="clubReportingId != null">clubReportingId,</if>
+			<if test="auditStatus != null">auditStatus,</if>
+			<if test="auditText != null and auditText != ''">auditText,</if>
+			<if test="auditBy != null">auditBy,</if>
+			<if test="auditTime != null">auditTime,</if>
+			<if test="delFlag != null">delFlag,</if>
+			<if test="updateTime != null">updateTime,</if>
+			<if test="createTime != null">createTime,</if>
+			<if test="remarks != null and remarks != ''">remarks,</if>
+			<if test="commission != null">commission,</if>
+			<if test="settleStatus != null">settleStatus,</if>
+			<if test="settleTime != null">settleTime,</if>
+		</trim>
+		<trim prefix="values (" suffix=")" suffixOverrides=",">
+			<if test="id != null and id != ''">#{id},</if>
+			<if test="distributionId != null">#{distributionId},</if>
+			<if test="clubReportingId != null">#{clubReportingId},</if>
+			<if test="auditStatus != null">#{auditStatus},</if>
+			<if test="auditText != null and auditText != ''">#{auditText},</if>
+			<if test="auditBy != null">#{auditBy},</if>
+			<if test="auditTime != null">#{auditTime},</if>
+			<if test="delFlag != null">#{delFlag},</if>
+			<if test="updateTime != null">#{updateTime},</if>
+			<if test="createTime != null">#{createTime},</if>
+			<if test="remarks != null and remarks != ''">#{remarks},</if>
+			<if test="commission != null">#{commission},</if>
+			<if test="settleStatus != null">#{settleStatus},</if>
+			<if test="settleTime != null">#{settleTime},</if>
+		</trim>
+	</insert>
+
+	<update id="updateCmReportingMember" parameterType="com.caimei365.commodity.model.po.CmReportingMember">
+		update cm_reporting_member
+		<trim prefix="SET" suffixOverrides=",">
+			<if test="distributionId != null">distributionId = #{distributionId},</if>
+			<if test="clubReportingId != null">clubReportingId = #{clubReportingId},</if>
+			<if test="auditStatus != null">auditStatus = #{auditStatus},</if>
+			<if test="auditText != null and auditText != ''">auditText = #{auditText},</if>
+			<if test="auditBy != null">auditBy = #{auditBy},</if>
+			<if test="auditTime != null">auditTime = #{auditTime},</if>
+			<if test="delFlag != null">delFlag = #{delFlag},</if>
+			<if test="updateTime != null">updateTime = #{updateTime},</if>
+			<if test="createTime != null">createTime = #{createTime},</if>
+			<if test="remarks != null and remarks != ''">remarks = #{remarks},</if>
+			<if test="commission != null">commission = #{commission},</if>
+			<if test="settleStatus != null">settleStatus = #{settleStatus},</if>
+			<if test="settleTime != null">settleTime = #{settleTime},</if>
+		</trim>
+		where id = #{id}
+	</update>
+
+	<update id="updateDelCmReportingMemberByIds" parameterType="String">
+		update cm_reporting_member set delFlag=#{delFlag} where id in
+		<foreach item="id" collection="ids" open="(" separator="," close=")">
+			#{id}
+		</foreach>
+	</update>
+
+	<delete id="delCmReportingMemberById" parameterType="String">
+		delete
+		from cm_reporting_member where id = #{id}
+	</delete>
+
+	<delete id="delCmReportingMember" parameterType="com.caimei365.commodity.model.po.CmReportingMember">
+		delete
+		from cm_reporting_member AS cm_reporting_member
+		<where>
+			<if test="id != null  and id != ''">
+				and cm_reporting_member.id
+				<if test="id.toUpperCase().indexOf('=')==-1">
+					= #{id}
+				</if>
+				<if test="id.toUpperCase().indexOf('=')!=-1">
+					<if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+					<if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+					<foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+						#{idIn}
+					</foreach>
+				</if>
+			</if>
+			<if test="distributionId != null "> and cm_reporting_member.distributionId = #{distributionId}</if>
+			<if test="clubReportingId != null "> and cm_reporting_member.clubReportingId = #{clubReportingId}</if>
+			<if test="auditStatus != null  and  auditStatus != '' "> and cm_reporting_member.auditStatus = #{auditStatus}</if>
+			<if test="auditText != null  and auditText != ''"> and cm_reporting_member.auditText = #{auditText}</if>
+			<if test="auditTime != null "> and cm_reporting_member.auditTime = #{auditTime}</if>
+			<if test="delFlag != null "> and cm_reporting_member.delFlag = #{delFlag}</if>
+			<if test="updateTime != null "> and cm_reporting_member.updateTime = #{updateTime}</if>
+			<if test="createTime != null "> and cm_reporting_member.createTime = #{createTime}</if>
+			<if test="commission != null "> and cm_reporting_member.commission = #{commission}</if>
+			<if test="settleStatus != null "> and cm_reporting_member.settleStatus = #{settleStatus}</if>
+			<if test="settleTime != null "> and cm_reporting_member.settleTime = #{settleTime}</if>
+		</where>
+	</delete>
+
+	<delete id="delCmReportingMemberByIds" parameterType="String">
+		delete from cm_reporting_member where id in
+		<foreach item="id" collection="ids" open="(" separator="," close=")">
+			#{id}
+		</foreach>
+	</delete>
+
+</mapper>