LIVE_YE пре 3 година
родитељ
комит
e01d57cd2c

+ 104 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/business/InterestsNumberTableController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.web.controller.business;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.domain.InterestsNumberTable;
+import com.ruoyi.system.service.IInterestsNumberTableService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 商户权益次数记录Controller
+ * 
+ * @author ruoyi
+ * @date 2022-07-08
+ */
+@RestController
+@RequestMapping("/system/numberTable")
+public class InterestsNumberTableController extends BaseController
+{
+    @Autowired
+    private IInterestsNumberTableService interestsNumberTableService;
+
+    /**
+     * 查询商户权益次数记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:table:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(InterestsNumberTable interestsNumberTable)
+    {
+        startPage();
+        List<InterestsNumberTable> list = interestsNumberTableService.selectInterestsNumberTableList(interestsNumberTable);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出商户权益次数记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:table:export')")
+    @Log(title = "商户权益次数记录", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, InterestsNumberTable interestsNumberTable)
+    {
+        List<InterestsNumberTable> list = interestsNumberTableService.selectInterestsNumberTableList(interestsNumberTable);
+        ExcelUtil<InterestsNumberTable> util = new ExcelUtil<InterestsNumberTable>(InterestsNumberTable.class);
+        util.exportExcel(response, list, "商户权益次数记录数据");
+    }
+
+    /**
+     * 获取商户权益次数记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:table:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(interestsNumberTableService.selectInterestsNumberTableById(id));
+    }
+
+    /**
+     * 新增商户权益次数记录
+     */
+    @PreAuthorize("@ss.hasPermi('system:table:add')")
+    @Log(title = "商户权益次数记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody InterestsNumberTable interestsNumberTable)
+    {
+        return toAjax(interestsNumberTableService.insertInterestsNumberTable(interestsNumberTable));
+    }
+
+    /**
+     * 修改商户权益次数记录
+     */
+    @PreAuthorize("@ss.hasPermi('system:table:edit')")
+    @Log(title = "商户权益次数记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody InterestsNumberTable interestsNumberTable)
+    {
+        return toAjax(interestsNumberTableService.updateInterestsNumberTable(interestsNumberTable));
+    }
+
+    /**
+     * 删除商户权益次数记录
+     */
+    @PreAuthorize("@ss.hasPermi('system:table:remove')")
+    @Log(title = "商户权益次数记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{numberId}")
+    public AjaxResult remove(@PathVariable Long numberId)
+    {
+        return toAjax(interestsNumberTableService.deleteInterestsNumberTableById(numberId));
+    }
+}

+ 103 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/business/InterestsTableController.java

@@ -0,0 +1,103 @@
+package com.ruoyi.web.controller.business;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.domain.InterestsTable;
+import com.ruoyi.system.service.IInterestsTableService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 商户权益记录Controller
+ * 
+ * @author ruoyi
+ * @date 2022-07-08
+ */
+@RestController
+@RequestMapping("/system/table")
+public class InterestsTableController extends BaseController
+{
+    @Autowired
+    private IInterestsTableService interestsTableService;
+
+    /**
+     * 查询商户权益记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:table:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(InterestsTable interestsTable)
+    {
+        List<InterestsTable> list = interestsTableService.selectInterestsTableList(interestsTable);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出商户权益记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:table:export')")
+    @Log(title = "商户权益记录", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, InterestsTable interestsTable)
+    {
+        List<InterestsTable> list = interestsTableService.selectInterestsTableList(interestsTable);
+        ExcelUtil<InterestsTable> util = new ExcelUtil<InterestsTable>(InterestsTable.class);
+        util.exportExcel(response, list, "商户权益记录数据");
+    }
+
+    /**
+     * 获取商户权益记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:table:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(interestsTableService.selectInterestsTableById(id));
+    }
+
+    /**
+     * 新增商户权益记录
+     */
+    @PreAuthorize("@ss.hasPermi('system:table:add')")
+    @Log(title = "商户权益记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody InterestsTable interestsTable)
+    {
+        return interestsTableService.insertInterestsTable(interestsTable);
+    }
+
+    /**
+     * 修改商户权益记录
+     */
+    @PreAuthorize("@ss.hasPermi('system:table:edit')")
+    @Log(title = "商户权益记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody InterestsTable interestsTable)
+    {
+        return interestsTableService.updateInterestsTable(interestsTable);
+    }
+
+    /**
+     * 删除商户权益记录
+     */
+    @PreAuthorize("@ss.hasPermi('system:table:remove')")
+    @Log(title = "商户权益记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(interestsTableService.deleteInterestsTableByIds(ids));
+    }
+}

+ 10 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/business/SettledMerchantsController.java

@@ -47,7 +47,16 @@ public class SettledMerchantsController extends BaseController
         return getDataTable(list);
     }
 
-
+    /**
+     * 查询入驻商家列表(不分页)
+     */
+    @PreAuthorize("@ss.hasPermi('system:merchants:list')")
+    @GetMapping("/listAll")
+    public TableDataInfo listAll(SettledMerchants settledMerchants)
+    {
+        List<SettledMerchants> list = settledMerchantsService.selectSettledMerchantsList(settledMerchants);
+        return getDataTable(list);
+    }
 
     /**
      * 导出入驻商家列表

+ 302 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/ObjectUtils.java

@@ -0,0 +1,302 @@
+package com.ruoyi.common.utils;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.*;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.function.ToIntFunction;
+import java.util.stream.Collectors;
+
+/**
+ * @author shiqian
+ * @date 2021年03月26日 10:39
+ **/
+public class ObjectUtils {
+
+    private static final String NULL = "null";
+    private static final String UNDEFINED = "undefined";
+
+    public static  <T> Collection<T> requireNonNull(Collection<T> input, String errorMsg){
+        if (null == input || input.size() == 0) {
+            throw new IllegalArgumentException(errorMsg);
+        }
+        return input;
+    }
+
+    public static  <T> List<T> requireNonNull(List<T> input, String errorMsg){
+        if (null == input || input.size() == 0) {
+            throw new IllegalArgumentException(errorMsg);
+        }
+        return input;
+    }
+
+    public static  <T> boolean isEmpty(Collection<T> input){
+        return null == input || input.size() == 0;
+    }
+
+    public static  <T> boolean isNotEmpty(Collection<T> input){
+        return !isEmpty(input);
+    }
+
+    public static long[] requireNonNull(long[] input, String errorMsg){
+        if (ArrayUtils.isEmpty(input)) {
+            throw new IllegalArgumentException(errorMsg);
+        }
+
+        return input;
+    }
+
+
+    public static Long[] requireNonNull(Long[] input, String errorMsg){
+        if (ArrayUtils.isEmpty(input)) {
+            throw new IllegalArgumentException(errorMsg);
+        }
+
+        return input;
+    }
+
+    public static Boolean requireNonNull(Boolean input, String errorMsg) {
+        if (input == null) {
+            throw new IllegalArgumentException(errorMsg);
+        }
+        return input;
+    }
+
+    public static <T> T requireNonNull(T input, String errorMsg) {
+        if (input == null) {
+            throw new IllegalArgumentException(errorMsg);
+        }
+        return input;
+    }
+
+    public static Integer requireNonNull(Integer input, String errorMsg) {
+        if (input == null || input < 0) {
+            throw new IllegalArgumentException(errorMsg);
+        }
+        return input;
+    }
+
+    public static boolean isEmpty(Integer input) {
+        return input == null || input < 0;
+    }
+
+    public static boolean isNotEmpty(Integer input) {
+        return !isEmpty(input);
+    }
+
+
+    public static boolean isEmpty(Long input) {
+        return input == null || input < 0;
+    }
+
+    public static boolean isNotEmpty(Long input) {
+        return !isEmpty(input);
+    }
+
+    public static String requireNonNull(String input, String errorMsg) {
+        if (input == null || input.isEmpty() || NULL.equalsIgnoreCase(input) || UNDEFINED.equalsIgnoreCase(input)) {
+            throw new IllegalArgumentException(errorMsg);
+        }
+        return input;
+    }
+
+    public static int requireNonNull(int input, String errorMsg) {
+        if (input <= 0) {
+            throw new IllegalArgumentException(errorMsg);
+        }
+        return input;
+    }
+
+
+    public static JSONObject requireNonNull(JSONObject input, String errorMsg) {
+        if (input == null || input.isEmpty()) {
+            throw new IllegalArgumentException(errorMsg);
+        }
+        return input;
+    }
+
+
+    public static JSONObject ifNullSetEmpty(JSONObject input) {
+        if (input == null || input.isEmpty()) {
+            input = new JSONObject();
+        }
+        return input;
+    }
+
+
+    public static List<JSONObject> ifNullSetEmpty(List<JSONObject> input) {
+        if (input == null || input.isEmpty()) {
+            input = Collections.emptyList();
+        }
+        return input;
+    }
+
+    public static JSONArray ifNullSetEmpty(JSONArray input) {
+        if (input == null || input.isEmpty()) {
+            input = new JSONArray();
+        }
+        return input;
+    }
+
+
+    public static boolean isNotEmpty(JSONObject input){
+        return input != null && !input.isEmpty();
+    }
+
+    public static boolean isEmpty(JSONObject input){
+        return !isNotEmpty(input);
+    }
+
+    public static boolean isNotEmpty(JSONArray input){
+        return input != null && !input.isEmpty();
+    }
+
+    public static boolean isEmpty(JSONArray input){
+        return !isNotEmpty(input);
+    }
+
+    /**
+     * 功能描述: 暂且只做 string collection long 三种类型的校验
+     *
+     * @param input input
+     * @return boolean
+     */
+    public static boolean isEmpty(Object input) {
+        if (input instanceof String) {
+            return StringUtils.isEmpty((String) input);
+        } else if (input instanceof Collection) {
+            return CollectionUtils.isEmpty(((Collection<?>) input));
+        } else {
+            return Objects.isNull(input);
+        }
+    }
+
+    public static boolean isNotEmpty(Object input) {
+        return !isEmpty(input);
+    }
+
+    public static boolean isEmpty(String input) {
+        return input == null || input.isEmpty() || NULL.equalsIgnoreCase(input) || UNDEFINED.equalsIgnoreCase(input);
+    }
+
+    public static boolean isNotEmpty(String input) {
+        return !isEmpty(input);
+    }
+
+    public static JSONArray requireNonNull(JSONArray input, String errorMsg) {
+        if (input == null || input.isEmpty()) {
+            throw new IllegalArgumentException(errorMsg);
+        }
+        return input;
+    }
+
+    /**
+     * 功能描述: 需要判断数据库是什么类型,如果是VARCHAR则需要转,如果是数字则无需转
+     *
+     * @param input 输入
+     * @return java.lang.String
+     */
+    public static String escapeStr(String input) {
+        return "'" + input + "'";
+    }
+
+
+    /**
+     * 功能描述: 是否小于0
+     *
+     * @param aLong aLong
+     * @return boolean true小于0
+     */
+    public static boolean ltZero(Long aLong) {
+        return null != aLong && aLong < 0;
+    }
+
+
+    /**
+     * 功能描述: 根据规则过滤
+     *
+     * @param input     原数据
+     * @param predicate FunctionalInterface
+     * @return java.util.List<T>
+     */
+    public static <T> List<T> filter(List<T> input, Predicate<T> predicate) {
+        return requireNonNull(input, "list is null")
+                .stream().filter(predicate).collect(Collectors.toList());
+    }
+
+    public static <T> int count(List<T> input, ToIntFunction<T> toIntFunction) {
+        return requireNonNull(input, "list is null").stream().mapToInt(toIntFunction).sum();
+    }
+
+    public static <T> boolean anyMatch(List<T> input, Predicate<T> predicate){
+        return requireNonNull(input, "list is null").stream().anyMatch(predicate);
+    }
+
+
+    public static <T> boolean noneMatch(List<T> input, Predicate<T> predicate) {
+        return requireNonNull(input, "list is null").stream().noneMatch(predicate);
+    }
+
+    /**
+     * 功能描述: 根据规则过滤
+     *
+     * @param input     原数据
+     * @param predicate FunctionalInterface
+     * @return java.util.List<T>
+     */
+    public static <T> T filterOne(List<T> input, Predicate<T> predicate) {
+        return requireNonNull(input, "list is null")
+                .stream().filter(predicate).findFirst().orElse(null);
+    }
+
+    /**
+     * 功能描述: 根据规则获取
+     *
+     * @param input    原数据
+     * @param function FunctionalInterface
+     * @return java.util.List<T>
+     */
+    public static <T, R> List<R> map(List<T> input, Function<T, R> function) {
+        return requireNonNull(input, "list is null")
+                .stream().map(function).distinct().collect(Collectors.toList());
+    }
+
+    /**
+     * 功能描述: 根据规则获取
+     *
+     * @param input     原数据
+     * @param predicate predicate
+     * @param function  FunctionalInterface
+     * @return java.util.List<R>
+     */
+    public static <T, R> List<R> mapFilter(List<T> input, Predicate<T> predicate, Function<T, R> function) {
+        return requireNonNull(input, "list is null")
+                .stream()
+                .filter(predicate)
+                .map(function)
+                .distinct()
+                .collect(Collectors.toList());
+    }
+
+
+    /**
+     * 功能描述: 根据规则获取单个
+     *
+     * @param input    原数据
+     * @param function FunctionalInterface
+     * @return java.util.List<T>
+     */
+    public static <T, R> R mapFirst(List<T> input, Function<T, R> function) {
+        requireNonNull(input, "list is null");
+        List<R> rList = input.stream().map(function).collect(Collectors.toList());
+        requireNonNull(rList, "rList is null");
+        Optional<R> optionalR = rList.stream().findFirst();
+        return optionalR.orElse(null);
+    }
+
+}

+ 91 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/InterestsNumberTable.java

@@ -0,0 +1,91 @@
+package com.ruoyi.system.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 商户权益次数记录对象 interests_number_table
+ * 
+ * @author ruoyi
+ * @date 2022-07-08
+ */
+public class InterestsNumberTable extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long id;
+
+    /***映射主键id**/
+    private Long numberId;
+
+    /** 权益id */
+    @Excel(name = "权益id")
+    private Long interestsId;
+
+    /** 权益等级 */
+    @Excel(name = "权益等级")
+    private String rightsRank;
+
+    /** 权益次数 */
+    @Excel(name = "权益次数")
+    private Long number;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setInterestsId(Long interestsId) 
+    {
+        this.interestsId = interestsId;
+    }
+
+    public Long getInterestsId() 
+    {
+        return interestsId;
+    }
+    public void setRightsRank(String rightsRank) 
+    {
+        this.rightsRank = rightsRank;
+    }
+
+    public String getRightsRank() 
+    {
+        return rightsRank;
+    }
+    public void setNumber(Long number) 
+    {
+        this.number = number;
+    }
+
+    public Long getNumber() 
+    {
+        return number;
+    }
+
+    public Long getNumberId() {
+        return numberId;
+    }
+
+    public void setNumberId(Long numberId) {
+        this.numberId = numberId;
+    }
+
+    @Override
+    public String toString() {
+        return "InterestsNumberTable{" +
+                "id=" + id +
+                ", numberId=" + numberId +
+                ", interestsId=" + interestsId +
+                ", rightsRank='" + rightsRank + '\'' +
+                ", number=" + number +
+                '}';
+    }
+}

+ 151 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/InterestsTable.java

@@ -0,0 +1,151 @@
+package com.ruoyi.system.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+import java.util.List;
+
+/**
+ * 商户权益记录对象 interests_table
+ * 
+ * @author ruoyi
+ * @date 2022-07-08
+ */
+public class InterestsTable extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /**  */
+    private Long id;
+
+    /** 商户id */
+    private Long merchantsId;
+
+    /** 商户名称 */
+    @Excel(name = "商户名称")
+    private String merchantsName;
+
+    /** 权益所属政策类型id */
+    private int interestsPolicyId;
+
+    /** 权益所属政策类型名称 */
+    private String interestsPolicyName;
+
+    /** 权益描述 */
+    @Excel(name = "权益描述")
+    private String account;
+
+    /** 权益等级和次数 */
+    private List<InterestsNumberTable> interestsNumberTableList;
+
+    /** 权益等级(返给前端页面,用‘,’分割) */
+    private String interestsLevel;
+
+    /** 权益次数(返给前端页面,用‘,’分割) */
+    private String interestsNumber;
+
+    /** 是否删除 */
+    private String isDel;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public Long getMerchantsId() {
+        return merchantsId;
+    }
+
+    public String getMerchantsName() {
+        return merchantsName;
+    }
+
+    public String getAccount() {
+        return account;
+    }
+
+    public List<InterestsNumberTable> getInterestsNumberTableList() {
+        return interestsNumberTableList;
+    }
+
+    public String getInterestsLevel() {
+        return interestsLevel;
+    }
+
+    public String getInterestsNumber() {
+        return interestsNumber;
+    }
+
+    public String getIsDel() {
+        return isDel;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public void setMerchantsId(Long merchantsId) {
+        this.merchantsId = merchantsId;
+    }
+
+    public void setMerchantsName(String merchantsName) {
+        this.merchantsName = merchantsName;
+    }
+
+    public void setAccount(String account) {
+        this.account = account;
+    }
+
+    public void setInterestsNumberTableList(List<InterestsNumberTable> interestsNumberTableList) {
+        this.interestsNumberTableList = interestsNumberTableList;
+    }
+
+    public void setInterestsLevel(String interestsLevel) {
+        this.interestsLevel = interestsLevel;
+    }
+
+    public void setInterestsNumber(String interestsNumber) {
+        this.interestsNumber = interestsNumber;
+    }
+
+    public void setIsDel(String isDel) {
+        this.isDel = isDel;
+    }
+
+    public int getInterestsPolicyId() {
+        return interestsPolicyId;
+    }
+
+    public String getInterestsPolicyName() {
+        return interestsPolicyName;
+    }
+
+    public void setInterestsPolicyId(int interestsPolicyId) {
+        this.interestsPolicyId = interestsPolicyId;
+    }
+
+    public void setInterestsPolicyName(String interestsPolicyName) {
+        this.interestsPolicyName = interestsPolicyName;
+    }
+
+    @Override
+    public String toString() {
+        return "InterestsTable{" +
+                "id=" + id +
+                ", merchantsId=" + merchantsId +
+                ", merchantsName='" + merchantsName + '\'' +
+                ", interestsPolicyId=" + interestsPolicyId +
+                ", interestsPolicyName='" + interestsPolicyName + '\'' +
+                ", account='" + account + '\'' +
+                ", interestsNumberTableList=" + interestsNumberTableList +
+                ", interestsLevel='" + interestsLevel + '\'' +
+                ", interestsNumber='" + interestsNumber + '\'' +
+                ", isDel='" + isDel + '\'' +
+                '}';
+    }
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/InterestsNumberTableMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+import com.ruoyi.system.domain.InterestsNumberTable;
+
+/**
+ * 商户权益次数记录Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2022-07-08
+ */
+public interface InterestsNumberTableMapper 
+{
+    /**
+     * 查询商户权益次数记录
+     * 
+     * @param id 商户权益次数记录主键
+     * @return 商户权益次数记录
+     */
+    public InterestsNumberTable selectInterestsNumberTableById(Long id);
+
+    /**
+     * 查询商户权益次数记录列表
+     * 
+     * @param interestsNumberTable 商户权益次数记录
+     * @return 商户权益次数记录集合
+     */
+    public List<InterestsNumberTable> selectInterestsNumberTableList(InterestsNumberTable interestsNumberTable);
+
+    /**
+     * 新增商户权益次数记录
+     * 
+     * @param interestsNumberTable 商户权益次数记录
+     * @return 结果
+     */
+    public int insertInterestsNumberTable(InterestsNumberTable interestsNumberTable);
+
+    /**
+     * 修改商户权益次数记录
+     * 
+     * @param interestsNumberTable 商户权益次数记录
+     * @return 结果
+     */
+    public int updateInterestsNumberTable(InterestsNumberTable interestsNumberTable);
+
+    /**
+     * 删除商户权益次数记录
+     * 
+     * @param id 商户权益次数记录主键
+     * @return 结果
+     */
+    public int deleteInterestsNumberTableById(Long id);
+
+    /**
+     * 批量删除商户权益次数记录
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteInterestsNumberTableByIds(Long[] ids);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/InterestsTableMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+import com.ruoyi.system.domain.InterestsTable;
+
+/**
+ * 商户权益记录Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2022-07-08
+ */
+public interface InterestsTableMapper 
+{
+    /**
+     * 查询商户权益记录
+     * 
+     * @param id 商户权益记录主键
+     * @return 商户权益记录
+     */
+    public InterestsTable selectInterestsTableById(Long id);
+
+    /**
+     * 查询商户权益记录列表
+     * 
+     * @param interestsTable 商户权益记录
+     * @return 商户权益记录集合
+     */
+    public List<InterestsTable> selectInterestsTableList(InterestsTable interestsTable);
+
+    /**
+     * 新增商户权益记录
+     * 
+     * @param interestsTable 商户权益记录
+     * @return 结果
+     */
+    public int insertInterestsTable(InterestsTable interestsTable);
+
+    /**
+     * 修改商户权益记录
+     * 
+     * @param interestsTable 商户权益记录
+     * @return 结果
+     */
+    public int updateInterestsTable(InterestsTable interestsTable);
+
+    /**
+     * 删除商户权益记录
+     * 
+     * @param id 商户权益记录主键
+     * @return 结果
+     */
+    public int deleteInterestsTableById(Long id);
+
+    /**
+     * 批量删除商户权益记录
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteInterestsTableByIds(Long[] ids);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IInterestsNumberTableService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+import com.ruoyi.system.domain.InterestsNumberTable;
+
+/**
+ * 商户权益次数记录Service接口
+ * 
+ * @author ruoyi
+ * @date 2022-07-08
+ */
+public interface IInterestsNumberTableService 
+{
+    /**
+     * 查询商户权益次数记录
+     * 
+     * @param id 商户权益次数记录主键
+     * @return 商户权益次数记录
+     */
+    public InterestsNumberTable selectInterestsNumberTableById(Long id);
+
+    /**
+     * 查询商户权益次数记录列表
+     * 
+     * @param interestsNumberTable 商户权益次数记录
+     * @return 商户权益次数记录集合
+     */
+    public List<InterestsNumberTable> selectInterestsNumberTableList(InterestsNumberTable interestsNumberTable);
+
+    /**
+     * 新增商户权益次数记录
+     * 
+     * @param interestsNumberTable 商户权益次数记录
+     * @return 结果
+     */
+    public int insertInterestsNumberTable(InterestsNumberTable interestsNumberTable);
+
+    /**
+     * 修改商户权益次数记录
+     * 
+     * @param interestsNumberTable 商户权益次数记录
+     * @return 结果
+     */
+    public int updateInterestsNumberTable(InterestsNumberTable interestsNumberTable);
+
+    /**
+     * 批量删除商户权益次数记录
+     * 
+     * @param ids 需要删除的商户权益次数记录主键集合
+     * @return 结果
+     */
+    public int deleteInterestsNumberTableByIds(Long[] ids);
+
+    /**
+     * 删除商户权益次数记录信息
+     * 
+     * @param id 商户权益次数记录主键
+     * @return 结果
+     */
+    public int deleteInterestsNumberTableById(Long id);
+}

+ 63 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IInterestsTableService.java

@@ -0,0 +1,63 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.system.domain.InterestsTable;
+
+/**
+ * 商户权益记录Service接口
+ * 
+ * @author ruoyi
+ * @date 2022-07-08
+ */
+public interface IInterestsTableService 
+{
+    /**
+     * 查询商户权益记录
+     * 
+     * @param id 商户权益记录主键
+     * @return 商户权益记录
+     */
+    public InterestsTable selectInterestsTableById(Long id);
+
+    /**
+     * 查询商户权益记录列表
+     * 
+     * @param interestsTable 商户权益记录
+     * @return 商户权益记录集合
+     */
+    public List<InterestsTable> selectInterestsTableList(InterestsTable interestsTable);
+
+    /**
+     * 新增商户权益记录
+     * 
+     * @param interestsTable 商户权益记录
+     * @return 结果
+     */
+    public AjaxResult insertInterestsTable(InterestsTable interestsTable);
+
+    /**
+     * 修改商户权益记录
+     * 
+     * @param interestsTable 商户权益记录
+     * @return 结果
+     */
+    public AjaxResult updateInterestsTable(InterestsTable interestsTable);
+
+    /**
+     * 批量删除商户权益记录
+     * 
+     * @param ids 需要删除的商户权益记录主键集合
+     * @return 结果
+     */
+    public int deleteInterestsTableByIds(Long[] ids);
+
+    /**
+     * 删除商户权益记录信息
+     * 
+     * @param id 商户权益记录主键
+     * @return 结果
+     */
+    public int deleteInterestsTableById(Long id);
+}

+ 93 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/InterestsNumberTableServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.InterestsNumberTableMapper;
+import com.ruoyi.system.domain.InterestsNumberTable;
+import com.ruoyi.system.service.IInterestsNumberTableService;
+
+/**
+ * 商户权益次数记录Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2022-07-08
+ */
+@Service
+public class InterestsNumberTableServiceImpl implements IInterestsNumberTableService 
+{
+    @Autowired
+    private InterestsNumberTableMapper interestsNumberTableMapper;
+
+    /**
+     * 查询商户权益次数记录
+     * 
+     * @param id 商户权益次数记录主键
+     * @return 商户权益次数记录
+     */
+    @Override
+    public InterestsNumberTable selectInterestsNumberTableById(Long id)
+    {
+        return interestsNumberTableMapper.selectInterestsNumberTableById(id);
+    }
+
+    /**
+     * 查询商户权益次数记录列表
+     * 
+     * @param interestsNumberTable 商户权益次数记录
+     * @return 商户权益次数记录
+     */
+    @Override
+    public List<InterestsNumberTable> selectInterestsNumberTableList(InterestsNumberTable interestsNumberTable)
+    {
+        return interestsNumberTableMapper.selectInterestsNumberTableList(interestsNumberTable);
+    }
+
+    /**
+     * 新增商户权益次数记录
+     * 
+     * @param interestsNumberTable 商户权益次数记录
+     * @return 结果
+     */
+    @Override
+    public int insertInterestsNumberTable(InterestsNumberTable interestsNumberTable)
+    {
+        return interestsNumberTableMapper.insertInterestsNumberTable(interestsNumberTable);
+    }
+
+    /**
+     * 修改商户权益次数记录
+     * 
+     * @param interestsNumberTable 商户权益次数记录
+     * @return 结果
+     */
+    @Override
+    public int updateInterestsNumberTable(InterestsNumberTable interestsNumberTable)
+    {
+        return interestsNumberTableMapper.updateInterestsNumberTable(interestsNumberTable);
+    }
+
+    /**
+     * 批量删除商户权益次数记录
+     * 
+     * @param ids 需要删除的商户权益次数记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteInterestsNumberTableByIds(Long[] ids)
+    {
+        return interestsNumberTableMapper.deleteInterestsNumberTableByIds(ids);
+    }
+
+    /**
+     * 删除商户权益次数记录信息
+     * 
+     * @param id 商户权益次数记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteInterestsNumberTableById(Long id)
+    {
+        return interestsNumberTableMapper.deleteInterestsNumberTableById(id);
+    }
+}

+ 170 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/InterestsTableServiceImpl.java

@@ -0,0 +1,170 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+
+import com.github.pagehelper.PageHelper;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.PageDomain;
+import com.ruoyi.common.core.page.TableSupport;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.ObjectUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.sql.SqlUtil;
+import com.ruoyi.system.domain.InterestsNumberTable;
+import com.ruoyi.system.domain.InterestsTable;
+import com.ruoyi.system.domain.SettledMerchants;
+import com.ruoyi.system.mapper.InterestsNumberTableMapper;
+import com.ruoyi.system.mapper.InterestsTableMapper;
+import com.ruoyi.system.mapper.SettledMerchantsMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ruoyi.system.service.IInterestsTableService;
+
+/**
+ * 商户权益记录Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2022-07-08
+ */
+@Service
+public class InterestsTableServiceImpl implements IInterestsTableService 
+{
+    @Autowired
+    private InterestsTableMapper interestsTableMapper;
+    @Autowired
+    private InterestsNumberTableMapper interestsNumberTableMapper;
+    @Autowired
+    private SettledMerchantsMapper settledMerchantsMapper;
+
+    /**
+     * 查询商户权益记录
+     * 
+     * @param id 商户权益记录主键
+     * @return 商户权益记录
+     */
+    @Override
+    public InterestsTable selectInterestsTableById(Long id)
+    {
+        return interestsTableMapper.selectInterestsTableById(id);
+    }
+
+    /**
+     * 查询商户权益记录列表
+     * 
+     * @param interestsTable 商户权益记录
+     * @return 商户权益记录
+     */
+    @Override
+    public List<InterestsTable> selectInterestsTableList(InterestsTable interestsTable)
+    {
+        startPage();
+        List<InterestsTable> interestsTableList = interestsTableMapper.selectInterestsTableList(interestsTable);
+
+        //拼接权益等级和权益次数
+        for (InterestsTable table : interestsTableList) {
+            StringBuilder interestsLevel = new StringBuilder();
+            StringBuilder interestsNumber = new StringBuilder();
+            for (int i=0;i<table.getInterestsNumberTableList().size();i++) {
+                if(i==0){
+                    interestsLevel.append(table.getInterestsNumberTableList().get(i).getRightsRank());
+                    interestsNumber.append(table.getInterestsNumberTableList().get(i).getNumber());
+                }else{
+                    interestsLevel.append(",").append(table.getInterestsNumberTableList().get(i).getRightsRank());
+                    interestsNumber.append(",").append(table.getInterestsNumberTableList().get(i).getNumber());
+                }
+            }
+            table.setInterestsLevel(interestsLevel.toString());
+            table.setInterestsNumber(interestsNumber.toString());
+        }
+
+        return interestsTableList;
+    }
+
+    /**
+     * 新增商户权益记录
+     * 
+     * @param interestsTable 商户权益记录
+     * @return 结果
+     */
+    @Override
+    public AjaxResult insertInterestsTable(InterestsTable interestsTable)
+    {
+
+        List<InterestsNumberTable> interestsNumberTableList = interestsTable.getInterestsNumberTableList();
+        //查询商户的权益所属政策类型id
+        SettledMerchants settledMerchants = settledMerchantsMapper.selectSettledMerchantsByBusinessId(interestsTable.getMerchantsId());
+
+        interestsTable.setInterestsPolicyId(settledMerchants.getPolicyId());
+        interestsTable.setCreateTime(DateUtils.getNowDate());
+        int count = interestsTableMapper.insertInterestsTable(interestsTable);
+        if (count < 1) return AjaxResult.error("新增权益信息失败");
+        int childCount = 0;
+        for (InterestsNumberTable interestsNumberTable : interestsNumberTableList) {
+            interestsNumberTable.setInterestsId(interestsTable.getId());
+            childCount += interestsNumberTableMapper.insertInterestsNumberTable(interestsNumberTable);
+        }
+        return childCount > 0 ? AjaxResult.success() : AjaxResult.error();
+    }
+
+    /**
+     * 修改商户权益记录
+     * 
+     * @param interestsTable 商户权益记录
+     * @return 结果
+     */
+    @Override
+    public AjaxResult updateInterestsTable(InterestsTable interestsTable)
+    {
+        List<InterestsNumberTable> interestsNumberTableList = interestsTable.getInterestsNumberTableList();
+
+        interestsTable.setUpdateTime(DateUtils.getNowDate());
+        interestsTableMapper.updateInterestsTable(interestsTable);
+        for (InterestsNumberTable interestsNumberTable : interestsNumberTableList) {
+            if(interestsNumberTable.getNumberId()!=null && interestsNumberTable.getNumberId()!=0){
+                interestsNumberTable.setId(interestsNumberTable.getNumberId());
+                interestsNumberTableMapper.updateInterestsNumberTable(interestsNumberTable);
+            }else{
+                interestsNumberTable.setInterestsId(interestsTable.getId());
+                interestsNumberTableMapper.insertInterestsNumberTable(interestsNumberTable);
+            }
+        }
+
+        return AjaxResult.success();
+    }
+
+    /**
+     * 批量删除商户权益记录
+     * 
+     * @param ids 需要删除的商户权益记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteInterestsTableByIds(Long[] ids)
+    {
+        return interestsTableMapper.deleteInterestsTableByIds(ids);
+    }
+
+    /**
+     * 删除商户权益记录信息
+     * 
+     * @param id 商户权益记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteInterestsTableById(Long id)
+    {
+        return interestsTableMapper.deleteInterestsTableById(id);
+    }
+
+
+    private void startPage() {
+        PageDomain pageDomain = TableSupport.buildPageRequest();
+        Integer pageNum = pageDomain.getPageNum();
+        Integer pageSize = pageDomain.getPageSize();
+        if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) {
+            String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
+            PageHelper.startPage(pageNum, pageSize, orderBy);
+        }
+    }
+}

+ 66 - 0
ruoyi-system/src/main/resources/mapper/system/InterestsNumberTableMapper.xml

@@ -0,0 +1,66 @@
+<?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.ruoyi.system.mapper.InterestsNumberTableMapper">
+    
+    <resultMap type="InterestsNumberTable" id="InterestsNumberTableResult">
+        <result property="id"    column="id"    />
+        <result property="interestsId"    column="interests_id"    />
+        <result property="rightsRank"    column="rights_rank"    />
+        <result property="number"    column="number"    />
+    </resultMap>
+
+    <sql id="selectInterestsNumberTableVo">
+        select id, interests_id, rights_rank, number from interests_number_table
+    </sql>
+
+    <select id="selectInterestsNumberTableList" parameterType="InterestsNumberTable" resultMap="InterestsNumberTableResult">
+        <include refid="selectInterestsNumberTableVo"/>
+        <where>  
+            <if test="interestsId != null "> and interests_id = #{interestsId}</if>
+            <if test="rightsRank != null  and rightsRank != ''"> and rights_rank = #{rightsRank}</if>
+            <if test="number != null "> and number = #{number}</if>
+        </where>
+    </select>
+    
+    <select id="selectInterestsNumberTableById" parameterType="Long" resultMap="InterestsNumberTableResult">
+        <include refid="selectInterestsNumberTableVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertInterestsNumberTable" parameterType="InterestsNumberTable">
+        insert into interests_number_table
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="interestsId != null">interests_id,</if>
+            <if test="rightsRank != null">rights_rank,</if>
+            <if test="number != null">number,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="interestsId != null">#{interestsId},</if>
+            <if test="rightsRank != null">#{rightsRank},</if>
+            <if test="number != null">#{number},</if>
+         </trim>
+    </insert>
+
+    <update id="updateInterestsNumberTable" parameterType="InterestsNumberTable">
+        update interests_number_table
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="interestsId != null">interests_id = #{interestsId},</if>
+            <if test="rightsRank != null">rights_rank = #{rightsRank},</if>
+            <if test="number != null">number = #{number},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteInterestsNumberTableById" parameterType="Long">
+        delete from interests_number_table where id = #{id}
+    </delete>
+
+    <delete id="deleteInterestsNumberTableByIds" parameterType="String">
+        delete from interests_number_table where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 117 - 0
ruoyi-system/src/main/resources/mapper/system/InterestsTableMapper.xml

@@ -0,0 +1,117 @@
+<?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.ruoyi.system.mapper.InterestsTableMapper">
+    
+    <resultMap type="InterestsTable" id="InterestsTableResult">
+        <result property="id"    column="id"    />
+        <result property="merchantsId"    column="merchants_id"    />
+        <result property="merchantsName"    column="merchants_name"    />
+        <result property="interestsPolicyId"    column="interests_policy_id"    />
+        <result property="interestsPolicyName"    column="interests_policy_name"    />
+        <result property="account"    column="account"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="isDel"    column="is_del"    />
+
+        <collection property="interestsNumberTableList" javaType="java.util.List" resultMap="InterestsNumberTableResult"/>
+    </resultMap>
+
+    <resultMap type="InterestsNumberTable" id="InterestsNumberTableResult">
+        <result property="id"    column="id"    />
+        <result property="interestsId"    column="interests_id"    />
+        <result property="rightsRank"    column="rights_rank"    />
+        <result property="number"    column="number"    />
+        <result property="numberId"    column="numberId"    />
+
+    </resultMap>
+
+    <sql id="selectInterestsTableVo">
+        select id, merchants_id, merchants_name,interests_policy_id,interests_policy_name, account, create_by, create_time, update_by, update_time, is_del from interests_table
+    </sql>
+
+    <select id="selectInterestsTableList" parameterType="InterestsTable" resultMap="InterestsTableResult">
+        select i.id, i.merchants_id, i.merchants_name,i.interests_policy_id,i.interests_policy_name, i.account, i.create_by, i.create_time, i.update_by, i.update_time, i.is_del,
+         n.interests_id, n.rights_rank, n.number
+        from interests_table i
+        left join interests_number_table n on i.id = n.interests_id
+
+
+        <where>  
+            <if test="merchantsName != null  and merchantsName != ''"> and merchants_name like concat('%', #{merchantsName}, '%')</if>
+            <if test="account != null  and account != ''"> and account = #{account}</if>
+            <if test="isDel != null  and isDel != ''"> and is_del = #{isDel}</if>
+        </where>
+    </select>
+    
+    <select id="selectInterestsTableById" parameterType="Long" resultMap="InterestsTableResult">
+        select i.id, i.merchants_id, i.merchants_name,i.interests_policy_id,i.interests_policy_name, i.account, i.create_by, i.create_time, i.update_by, i.update_time, i.is_del,
+               n.id as numberId, n.interests_id, n.rights_rank, n.number
+        from interests_table i
+        left join interests_number_table n on i.id = n.interests_id
+        where i.id = #{id}
+    </select>
+        
+    <insert id="insertInterestsTable" parameterType="InterestsTable" useGeneratedKeys="true" keyProperty="id">
+        insert into interests_table
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="merchantsId != null">merchants_id,</if>
+            <if test="merchantsName != null and merchantsName != ''">merchants_name,</if>
+
+            <if test="interestsPolicyId != null and interestsPolicyId != ''">interests_policy_id,</if>
+            <if test="interestsPolicyName != null and interestsPolicyName != ''">interests_policy_name,</if>
+
+            <if test="account != null">account,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="isDel != null and isDel != ''">is_del,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="merchantsId != null">#{merchantsId},</if>
+            <if test="merchantsName != null and merchantsName != ''">#{merchantsName},</if>
+
+            <if test="interestsPolicyId != null and interestsPolicyId != ''">#{interestsPolicyId},</if>
+            <if test="interestsPolicyName != null and interestsPolicyName != ''">#{interestsPolicyName},</if>
+
+            <if test="account != null">#{account},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="isDel != null and isDel != ''">#{isDel},</if>
+         </trim>
+    </insert>
+
+    <update id="updateInterestsTable" parameterType="InterestsTable">
+        update interests_table
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="merchantsId != null">merchants_id = #{merchantsId},</if>
+            <if test="merchantsName != null and merchantsName != ''">merchants_name = #{merchantsName},</if>
+            <if test="interestsPolicyId != null and interestsPolicyId != ''">interests_policy_id = #{interestsPolicyId},</if>
+            <if test="interestsPolicyName != null and interestsPolicyName != ''">interests_policy_name = #{interestsPolicyName},</if>
+            <if test="account != null">account = #{account},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="isDel != null and isDel != ''">is_del = #{isDel},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteInterestsTableById" parameterType="Long">
+        delete from interests_table where id = #{id}
+    </delete>
+
+    <delete id="deleteInterestsTableByIds" parameterType="String">
+        delete from interests_table where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>