Explorar el Código

feat:动态表格样式相关接口

xuezizhuo hace 1 año
padre
commit
5d234c5033

+ 11 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/dragForm/DragTableController.java

@@ -8,6 +8,7 @@ import com.ruoyi.common.annotation.Anonymous;
 import com.ruoyi.system.entity.DragTable;
 import com.ruoyi.system.entity.vo.DragTableVo;
 import com.ruoyi.system.service.IDragTableStatisticService;
+import com.ruoyi.system.service.IDragTableStyleService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -34,6 +35,9 @@ public class DragTableController extends BaseController {
     @Autowired
     private IDragTableStatisticService dragTableStatisticService;
 
+    @Autowired
+    private IDragTableStyleService dragTableStyleService;
+
     /**
      * 查询动态表格列表
      */
@@ -95,7 +99,10 @@ public class DragTableController extends BaseController {
      */
     @PostMapping("/addDragTable")
     public AjaxResult addDragTable(@RequestBody DragTableVo dragTableVo){
+        //新增动态表格信息
         dragTableService.addDragTable(dragTableVo);
+        //新增动态表格样式
+        dragTableStyleService.batchInsertDragTableStyle(dragTableVo);
         return AjaxResult.success();
     }
 
@@ -112,7 +119,10 @@ public class DragTableController extends BaseController {
      */
     @PutMapping("/edit")
     public AjaxResult edit(@RequestBody DragTableVo dragTableVo) {
+        //修改动态表格信息
         dragTableService.updateDragTable(dragTableVo);
+        //修改动态表格样式信息
+        dragTableStyleService.updateDragTableStyle(dragTableVo);
         return AjaxResult.success();
     }
 
@@ -126,6 +136,7 @@ public class DragTableController extends BaseController {
         List<String> tableKeys = (List<String>)map.get("tableKeys");
         dragTableService.deleteDragTable(tIds,sqlKeys);
         dragTableStatisticService.deleteDragTableStatisticByTableKeys(tableKeys);
+        dragTableStyleService.deleteDragTableStyleByTableKeys(tableKeys);
         return AjaxResult.success();
     }
 

+ 107 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/dragForm/DragTableStyleController.java

@@ -0,0 +1,107 @@
+package com.ruoyi.web.controller.dragForm;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.system.entity.DragTableStyle;
+import com.ruoyi.system.entity.vo.DragTableVo;
+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.service.IDragTableStyleService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 动态格样式Controller
+ * 
+ * @author ruoyi
+ * @date 2023-11-03
+ */
+@RestController
+@RequestMapping("/system/style")
+public class DragTableStyleController extends BaseController
+{
+    @Autowired
+    private IDragTableStyleService dragTableStyleService;
+
+    /**
+     * 查询动态格样式列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:style:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(DragTableStyle dragTableStyle)
+    {
+        startPage();
+        List<DragTableStyle> list = dragTableStyleService.selectDragTableStyleList(dragTableStyle);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出动态格样式列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:style:export')")
+    @Log(title = "动态格样式", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, DragTableStyle dragTableStyle)
+    {
+        List<DragTableStyle> list = dragTableStyleService.selectDragTableStyleList(dragTableStyle);
+        ExcelUtil<DragTableStyle> util = new ExcelUtil<DragTableStyle>(DragTableStyle.class);
+        util.exportExcel(response, list, "动态格样式数据");
+    }
+
+    /**
+     * 获取动态格样式详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:style:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(dragTableStyleService.selectDragTableStyleById(id));
+    }
+
+    /**
+     * 新增动态格样式
+     */
+    @PreAuthorize("@ss.hasPermi('system:style:add')")
+    @Log(title = "动态格样式", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody DragTableVo vo)
+    {
+        return toAjax(dragTableStyleService.batchInsertDragTableStyle(vo));
+    }
+
+    /**
+     * 修改动态格样式
+     */
+    @PreAuthorize("@ss.hasPermi('system:style:edit')")
+    @Log(title = "动态格样式", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody DragTableVo vo)
+    {
+        dragTableStyleService.updateDragTableStyle(vo);
+        return AjaxResult.success();
+    }
+
+    /**
+     * 删除动态格样式
+     */
+    @PreAuthorize("@ss.hasPermi('system:style:remove')")
+    @Log(title = "动态格样式", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable List<Long> ids)
+    {
+        return toAjax(dragTableStyleService.deleteDragTableStyleByIds(ids));
+    }
+}

+ 197 - 0
ruoyi-system/src/main/java/com/ruoyi/system/entity/DragTableStyle.java

@@ -0,0 +1,197 @@
+package com.ruoyi.system.entity;
+
+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;
+
+/**
+ * 动态格样式对象 drag_table_style
+ * 
+ * @author ruoyi
+ * @date 2023-11-03
+ */
+public class DragTableStyle extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    private Long id;
+
+    /** 样式名称 */
+    private String styleName;
+
+    /** 样式代码 */
+    private String styleCode;
+
+    /** 动态表格主键 */
+    private String tableKey;
+
+    /** 显示样式条件/字典类型 */
+    private String styleCondtion;
+
+    /** 字段名称 */
+    private String styleField;
+
+    /** 类型(0:整行1:单个字段2:字典类型) */
+    private Long styleType;
+
+    /** 样式描述 */
+    private String styleDescription;
+
+    /** 备用列(未启用) */
+    private String spare1;
+
+    /** 备用列(未启用) */
+    private String spare2;
+
+    /** 删除标志(0:否 2:是) */
+    private String delFlag;
+
+    /** 创建者id */
+    private Long createById;
+
+    /** 更新者id */
+    private Long updateById;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setStyleName(String styleName) 
+    {
+        this.styleName = styleName;
+    }
+
+    public String getStyleName() 
+    {
+        return styleName;
+    }
+    public void setStyleCode(String styleCode) 
+    {
+        this.styleCode = styleCode;
+    }
+
+    public String getStyleCode() 
+    {
+        return styleCode;
+    }
+    public void setTableKey(String tableKey) 
+    {
+        this.tableKey = tableKey;
+    }
+
+    public String getTableKey() 
+    {
+        return tableKey;
+    }
+    public void setStyleCondtion(String styleCondtion) 
+    {
+        this.styleCondtion = styleCondtion;
+    }
+
+    public String getStyleCondtion() 
+    {
+        return styleCondtion;
+    }
+    public void setStyleField(String styleField) 
+    {
+        this.styleField = styleField;
+    }
+
+    public String getStyleField() 
+    {
+        return styleField;
+    }
+    public void setStyleType(Long styleType) 
+    {
+        this.styleType = styleType;
+    }
+
+    public Long getStyleType() 
+    {
+        return styleType;
+    }
+    public void setStyleDescription(String styleDescription) 
+    {
+        this.styleDescription = styleDescription;
+    }
+
+    public String getStyleDescription() 
+    {
+        return styleDescription;
+    }
+    public void setSpare1(String spare1) 
+    {
+        this.spare1 = spare1;
+    }
+
+    public String getSpare1() 
+    {
+        return spare1;
+    }
+    public void setSpare2(String spare2) 
+    {
+        this.spare2 = spare2;
+    }
+
+    public String getSpare2() 
+    {
+        return spare2;
+    }
+    public void setDelFlag(String delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() 
+    {
+        return delFlag;
+    }
+    public void setCreateById(Long createById) 
+    {
+        this.createById = createById;
+    }
+
+    public Long getCreateById() 
+    {
+        return createById;
+    }
+    public void setUpdateById(Long updateById) 
+    {
+        this.updateById = updateById;
+    }
+
+    public Long getUpdateById() 
+    {
+        return updateById;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("styleName", getStyleName())
+            .append("styleCode", getStyleCode())
+            .append("tableKey", getTableKey())
+            .append("styleCondtion", getStyleCondtion())
+            .append("styleField", getStyleField())
+            .append("styleType", getStyleType())
+            .append("styleDescription", getStyleDescription())
+            .append("spare1", getSpare1())
+            .append("spare2", getSpare2())
+            .append("delFlag", getDelFlag())
+            .append("createBy", getCreateBy())
+            .append("createById", getCreateById())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateById", getUpdateById())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 16 - 2
ruoyi-system/src/main/java/com/ruoyi/system/entity/vo/DragTableVo.java

@@ -3,6 +3,7 @@ package com.ruoyi.system.entity.vo;
 import com.ruoyi.common.annotation.Excel;
 import com.ruoyi.common.core.domain.BaseEntity;
 import com.ruoyi.system.entity.DragTableStatistic;
+import com.ruoyi.system.entity.DragTableStyle;
 import com.ruoyi.system.entity.TableSql;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
@@ -114,9 +115,12 @@ public class DragTableVo {
     /** 表格统计 */
     private List<DragTableStatistic> dragTableStatisticList;
 
-    /** tableList */
+    /** table sql List */
     private List<TableSql> tableSqlList;
 
+    /** 表格样式 */
+    private List<DragTableStyle> dragTableStyleList;
+
     public Long gettId() {
         return tId;
     }
@@ -285,10 +289,18 @@ public class DragTableVo {
         this.tableSqlList = tableSqlList;
     }
 
+    public List<DragTableStyle> getDragTableStyleList() {
+        return dragTableStyleList;
+    }
+
+    public void setDragTableStyleList(List<DragTableStyle> dragTableStyleList) {
+        this.dragTableStyleList = dragTableStyleList;
+    }
+
     public DragTableVo() {
     }
 
-    public DragTableVo(Long tId, String dtName, String dtNickname, String tableKey, String sqlKey, String dtTableName, Object dtColumnName, String dtColumnNameEcho, String timeFormat, String isSelection, List<String> searchFieldList, String tableSql, Object tableExportField, String tableExportFieldEcho, String echoData, Long menuId, String primaryKey, String orderByColumn, String sortOrder, List<DragTableStatistic> dragTableStatisticList, List<TableSql> tableSqlList) {
+    public DragTableVo(Long tId, String dtName, String dtNickname, String tableKey, String sqlKey, String dtTableName, Object dtColumnName, String dtColumnNameEcho, String timeFormat, String isSelection, List<String> searchFieldList, String tableSql, Object tableExportField, String tableExportFieldEcho, String echoData, Long menuId, String primaryKey, String orderByColumn, String sortOrder, List<DragTableStatistic> dragTableStatisticList, List<TableSql> tableSqlList,List<DragTableStyle> dragTableStyleList) {
         this.tId = tId;
         this.dtName = dtName;
         this.dtNickname = dtNickname;
@@ -310,6 +322,7 @@ public class DragTableVo {
         this.sortOrder = sortOrder;
         this.dragTableStatisticList = dragTableStatisticList;
         this.tableSqlList = tableSqlList;
+        this.dragTableStyleList = dragTableStyleList;
     }
 
     @Override
@@ -336,6 +349,7 @@ public class DragTableVo {
                 ", sortOrder='" + sortOrder + '\'' +
                 ", dragTableStatisticList=" + dragTableStatisticList +
                 ", tableSqlList=" + tableSqlList +
+                ", dragTableStyleList=" + dragTableStyleList +
                 '}';
     }
 }

+ 67 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/DragTableStyleMapper.java

@@ -0,0 +1,67 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.system.entity.DragTableStyle;
+
+import java.util.List;
+
+/**
+ * 动态格样式Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2023-11-03
+ */
+public interface DragTableStyleMapper 
+{
+    /**
+     * 查询动态格样式
+     * 
+     * @param id 动态格样式主键
+     * @return 动态格样式
+     */
+    DragTableStyle selectDragTableStyleById(Long id);
+
+    /**
+     * 查询动态格样式列表
+     * 
+     * @param dragTableStyle 动态格样式
+     * @return 动态格样式集合
+     */
+    List<DragTableStyle> selectDragTableStyleList(DragTableStyle dragTableStyle);
+
+    /**
+     * 批量新增动态格样式
+     * 
+     * @param dragTableStyleList 动态格样式
+     * @return 结果
+     */
+    int batchInsertDragTableStyle(List<DragTableStyle> dragTableStyleList);
+
+    /**
+     * 批量修改动态格样式
+     * 
+     * @param dragTableStyleList 动态格样式
+     * @return 结果
+     */
+    int batchUpdateDragTableStyle(List<DragTableStyle> dragTableStyleList);
+
+    /**
+     * 删除动态格样式
+     * 
+     * @param tableKeys 动态格样式主键
+     * @return 结果
+     */
+    int deleteDragTableStyleByTableKeys(List<String> tableKeys);
+
+    /**
+     * 批量删除动态格样式
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteDragTableStyleByIds(List<Long> ids);
+
+    /**
+     * 根据tableKey查询动态表格样式编号
+     */
+    List<Long> selectIdByTableKey(String tableKey);
+}

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

@@ -0,0 +1,63 @@
+package com.ruoyi.system.service;
+
+import com.ruoyi.system.entity.DragTableStyle;
+import com.ruoyi.system.entity.vo.DragTableVo;
+
+import java.util.List;
+
+/**
+ * 动态格样式Service接口
+ * 
+ * @author ruoyi
+ * @date 2023-11-03
+ */
+public interface IDragTableStyleService 
+{
+    /**
+     * 查询动态格样式
+     * 
+     * @param id 动态格样式主键
+     * @return 动态格样式
+     */
+    DragTableStyle selectDragTableStyleById(Long id);
+
+    /**
+     * 查询动态格样式列表
+     * 
+     * @param dragTableStyle 动态格样式
+     * @return 动态格样式集合
+     */
+    List<DragTableStyle> selectDragTableStyleList(DragTableStyle dragTableStyle);
+
+    /**
+     * 新增动态格样式
+     * 
+     * @param vo 动态格样式
+     * @return 结果
+     */
+    int batchInsertDragTableStyle(DragTableVo vo);
+
+    /**
+     * 修改动态格样式
+     * 
+     * @param vo 动态格样式
+     * @return 结果
+     */
+    void updateDragTableStyle(DragTableVo vo);
+
+    /**
+     * 批量删除动态格样式
+     * 
+     * @param ids 需要删除的动态格样式主键集合
+     * @return 结果
+     */
+    int deleteDragTableStyleByIds(List<Long> ids);
+
+    /**
+     * 删除动态格样式信息
+     * 
+     * @param tableKeys 动态格样式主键
+     * @return 结果
+     */
+    int deleteDragTableStyleByTableKeys(List<String> tableKeys);
+}

+ 14 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DragTableServiceImpl.java

@@ -53,6 +53,9 @@ public class DragTableServiceImpl implements IDragTableService {
     @Resource
     private DragTableStatisticMapper dragTableStatisticMapper;
 
+    @Resource
+    private DragTableStyleMapper dragTableStyleMapper;
+
     /**
      * 查询动态表格
      *
@@ -139,6 +142,12 @@ public class DragTableServiceImpl implements IDragTableService {
         });
         resultMap.put("where", dragTableConditions);
         resultMap.put("querySql", tableSqlMapper.selectTableSqlByTSqlKey(sqlKey));
+        // 表格样式信息
+        DragTableStyle dragTableStyle = new DragTableStyle();
+        dragTableStyle.setTableKey(dragTable.getTableKey());
+        List<DragTableStyle> dragTableStyleList = dragTableStyleMapper.selectDragTableStyleList(dragTableStyle);
+        resultMap.put("style",dragTableStyleList);
+
         CommonEntity commonEntity = new CommonEntity();
         commonEntity.setResultMap(resultMap);
         return commonEntity;
@@ -224,10 +233,14 @@ public class DragTableServiceImpl implements IDragTableService {
     public DragTableVo selectDragTableVoByTId(Long tId) {
         DragTableVo vo = dragTableMapper.selectDragTableVoByTId(tId);
         vo.setSearchFieldList(dragTableConditionMapper.selectDragTableSearchField(tId));
-        //查询数据统计
+        //查询动态表格数据统计
         DragTableStatistic dragTableStatistic = new DragTableStatistic();
         dragTableStatistic.setTableKey(vo.getTableKey());
         vo.setDragTableStatisticList(dragTableStatisticMapper.selectDragTableStatisticList(dragTableStatistic));
+        //查询动态表格样式
+        DragTableStyle dragTableStyle = new DragTableStyle();
+        dragTableStyle.setTableKey(vo.getTableKey());
+        vo.setDragTableStyleList(dragTableStyleMapper.selectDragTableStyleList(dragTableStyle));
         return vo;
     }
 

+ 3 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DragTableStatisticServiceImpl.java

@@ -69,7 +69,9 @@ public class DragTableStatisticServiceImpl implements IDragTableStatisticService
     @Transactional
     public int batchInsertDragTableStatistic(DragTableVo vo)
     {
-        vo.getDragTableStatisticList().forEach(s -> s.setCreateBy(SecurityUtils.getUserId().toString()));
+        vo.getDragTableStatisticList().forEach(s -> {
+            s.setCreateBy(SecurityUtils.getUserId().toString());
+        });
         // 拼接sql查询条件
         String SQL = "";
         switch (SecurityUtils.getDatabaseType().toUpperCase()) {

+ 126 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DragTableStyleServiceImpl.java

@@ -0,0 +1,126 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.system.entity.DragTableStyle;
+import com.ruoyi.system.entity.vo.DragTableVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.DragTableStyleMapper;
+import com.ruoyi.system.service.IDragTableStyleService;
+
+/**
+ * 动态格样式Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2023-11-03
+ */
+@Service
+public class DragTableStyleServiceImpl implements IDragTableStyleService 
+{
+    @Autowired
+    private DragTableStyleMapper dragTableStyleMapper;
+
+    /**
+     * 查询动态格样式
+     * 
+     * @param id 动态格样式主键
+     * @return 动态格样式
+     */
+    @Override
+    public DragTableStyle selectDragTableStyleById(Long id)
+    {
+        return dragTableStyleMapper.selectDragTableStyleById(id);
+    }
+
+    /**
+     * 查询动态格样式列表
+     * 
+     * @param dragTableStyle 动态格样式
+     * @return 动态格样式
+     */
+    @Override
+    public List<DragTableStyle> selectDragTableStyleList(DragTableStyle dragTableStyle)
+    {
+        return dragTableStyleMapper.selectDragTableStyleList(dragTableStyle);
+    }
+
+    /**
+     * 新增动态格样式
+     * 
+     * @param vo 动态格样式
+     * @return 结果
+     */
+    @Override
+    public int batchInsertDragTableStyle(DragTableVo vo)
+    {
+        vo.getDragTableStyleList().forEach(v -> {
+            v.setCreateById(SecurityUtils.getUserId());
+            v.setCreateBy(SecurityUtils.getUsername());
+        });
+        return dragTableStyleMapper.batchInsertDragTableStyle(vo.getDragTableStyleList());
+    }
+
+    /**
+     * 修改动态格样式
+     * 
+     * @param vo 动态格样式
+     * @return 结果
+     */
+    @Override
+    public void updateDragTableStyle(DragTableVo vo)
+    {
+        LinkedList<DragTableStyle> addList = new LinkedList<>();
+        LinkedList<DragTableStyle> editList = new LinkedList<>();
+        List<Long> numList = new ArrayList<>();
+        //判断新增还是修改
+        vo.getDragTableStyleList().stream().forEach(s -> {
+            if (s.getId() == null){
+                s.setCreateBy(SecurityUtils.getUsername());
+                s.setCreateById(SecurityUtils.getUserId());
+                s.setCreateTime(DateUtils.getNowDate());
+                addList.add(s);
+            }else {
+                s.setUpdateBy(SecurityUtils.getUsername());
+                s.setUpdateById(SecurityUtils.getUserId());
+                s.setUpdateTime(DateUtils.getNowDate());
+                editList.add(s);
+            }
+            numList.add(s.getId());
+        });
+        //查询动态表格样式编号
+        List<Long> allIds = dragTableStyleMapper.selectIdByTableKey(vo.getTableKey());
+        allIds.removeAll(numList);
+        //删除动态表格样式
+        if(allIds.size() > 0){
+            dragTableStyleMapper.deleteDragTableStyleByIds(allIds);
+        }
+        if(addList.size() > 0){
+            dragTableStyleMapper.batchInsertDragTableStyle(addList);
+        }
+        if(editList.size() >0){
+            dragTableStyleMapper.batchUpdateDragTableStyle(editList);
+        }
+    }
+
+    /**
+     * 批量删除动态格样式
+     * 
+     * @param ids 需要删除的动态格样式主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDragTableStyleByIds(List<Long> ids)
+    {
+        return dragTableStyleMapper.deleteDragTableStyleByIds(ids);
+    }
+
+    @Override
+    public int deleteDragTableStyleByTableKeys(List<String> tableKeys)
+    {
+        return dragTableStyleMapper.deleteDragTableStyleByTableKeys(tableKeys);
+    }
+}

+ 101 - 0
ruoyi-system/src/main/resources/mapper/DragTableStyleMapper.xml

@@ -0,0 +1,101 @@
+<?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.DragTableStyleMapper">
+    
+    <resultMap type="com.ruoyi.system.entity.DragTableStyle" id="DragTableStyleResult">
+        <result property="id"    column="id"    />
+        <result property="styleName"    column="style_name"    />
+        <result property="styleCode"    column="style_code"    />
+        <result property="tableKey"    column="table_key"    />
+        <result property="styleCondtion"    column="style_condtion"    />
+        <result property="styleField"    column="style_field"    />
+        <result property="styleType"    column="style_type"    />
+        <result property="styleDescription"    column="style_description"    />
+        <result property="spare1"    column="spare1"    />
+        <result property="spare2"    column="spare2"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createById"    column="create_by_id"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateById"    column="update_by_id"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectDragTableStyleVo">
+        select id, style_name, style_code, table_key, style_condtion, style_field, style_type, style_description, spare1, spare2, del_flag, create_by, create_by_id, create_time, update_by, update_by_id, update_time from drag_table_style
+    </sql>
+
+    <select id="selectDragTableStyleList" parameterType="com.ruoyi.system.entity.DragTableStyle" resultMap="DragTableStyleResult">
+        <include refid="selectDragTableStyleVo"/>
+        where del_flag = '0'
+            <if test="styleName != null  and styleName != ''"> and style_name like concat('%', #{styleName}, '%')</if>
+            <if test="styleCode != null  and styleCode != ''"> and style_code = #{styleCode}</if>
+            <if test="tableKey != null  and tableKey != ''"> and table_key = #{tableKey}</if>
+            <if test="styleCondtion != null  and styleCondtion != ''"> and style_condtion = #{styleCondtion}</if>
+            <if test="styleField != null  and styleField != ''"> and style_field = #{styleField}</if>
+            <if test="styleType != null "> and style_type = #{styleType}</if>
+            <if test="styleDescription != null  and styleDescription != ''"> and style_description = #{styleDescription}</if>
+            <if test="spare1 != null  and spare1 != ''"> and spare1 = #{spare1}</if>
+            <if test="spare2 != null  and spare2 != ''"> and spare2 = #{spare2}</if>
+            <if test="createById != null "> and create_by_id = #{createById}</if>
+            <if test="updateById != null "> and update_by_id = #{updateById}</if>
+            order by create_time desc
+    </select>
+    
+    <select id="selectDragTableStyleById" parameterType="Long" resultMap="DragTableStyleResult">
+        <include refid="selectDragTableStyleVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="batchInsertDragTableStyle" parameterType="com.ruoyi.system.entity.DragTableStyle">
+        insert into drag_table_style
+            (style_name,style_code,table_key,style_condtion,style_field,style_type,style_description,spare1,spare2,create_by,create_by_id,create_time,del_flag)
+        values
+            <foreach collection="list" item="item" separator=",">
+                (#{item.styleName},#{item.styleCode},#{item.tableKey},#{item.styleCondtion},#{item.styleField},#{item.styleType},
+                 #{item.styleDescription},#{item.spare1},#{item.spare2},#{item.createBy},#{item.createById},#{item.createTime},'0')
+            </foreach>
+    </insert>
+
+    <update id="batchUpdateDragTableStyle" parameterType="com.ruoyi.system.entity.DragTableStyle">
+        <foreach collection="list" item="item" separator=";">
+            update drag_table_style
+            <trim prefix="SET" suffixOverrides=",">
+                <if test="item.styleName != null">style_name = #{item.styleName},</if>
+                <if test="item.styleCode != null">style_code = #{item.styleCode},</if>
+                <if test="item.tableKey != null">table_key = #{item.tableKey},</if>
+                <if test="item.styleCondtion != null and item.styleCondtion != ''">style_condtion = #{item.styleCondtion},</if>
+                <if test="item.styleField != null">style_field = #{item.styleField},</if>
+                <if test="item.styleType != null">style_type = #{item.styleType},</if>
+                <if test="item.styleDescription != null">style_description = #{item.styleDescription},</if>
+                <if test="item.spare1 != null">spare1 = #{item.spare1},</if>
+                <if test="item.spare2 != null">spare2 = #{item.spare2},</if>
+                <if test="item.updateBy != null">update_by = #{item.updateBy},</if>
+                <if test="item.updateById != null">update_by_id = #{item.updateById},</if>
+                <if test="item.updateTime != null">update_time = #{item.updateTime},</if>
+            </trim>
+            where id = #{item.id}
+        </foreach>
+    </update>
+
+    <update id="deleteDragTableStyleByTableKeys" parameterType="String">
+        update drag_table_style set del_flag = '2' where table_key in
+        <foreach collection="list" item="tableKey" open="(" close=")" separator=",">
+            #{tableKey}
+        </foreach>
+    </update>
+
+    <update id="deleteDragTableStyleByIds">
+        update drag_table_style set del_flag = '2' where id in
+        <foreach item="id" collection="list" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+
+    <select id="selectIdByTableKey" resultType="long">
+        select id from drag_table_style where del_flag = '0' and table_key = #{tableKey}
+    </select>
+</mapper>