Browse Source

电子表格相关模块更新

何力凯 4 weeks ago
parent
commit
fd0a1412af

+ 31 - 1
zkqy-admin/src/main/java/com/zkqy/web/controller/dragForm/DragTableController.java

@@ -103,7 +103,7 @@ public class DragTableController extends BaseController {
         //新增动态表格信息
         dragTableService.addDragTable(dragTableVo);
         //新增动态表格样式信息
-        if(dragTableVo.getDragTableStyleList().size() > 0){
+        if(dragTableVo.getDragTableStyleList() != null && dragTableVo.getDragTableStyleList().size() > 0){
             dragTableStyleService.batchInsertDragTableStyle(dragTableVo);
         }
         //新增动态表格数据统计信息
@@ -157,6 +157,36 @@ public class DragTableController extends BaseController {
         dragTableBtnRelevanceService.deleteDragTableBtnRelevanceByTableKeys(tableKeys);
         return AjaxResult.success();
     }
+    /**
+     * 删除动态表格
+     */
+    @DeleteMapping("/removeByTableKey")
+    public AjaxResult removeByTableKey(@RequestBody Map<String, Object> map) {
+        Object o = map.get("tableKey");
+        if (o == null || o.toString().equals("")){
+            return AjaxResult.error("请求参数缺失tableKey");
+        }
+        String tableKey = o.toString();
+        DragTable dragTable = dragTableService.selectSqlKeyByTableKey(tableKey);
+        // 构建tids集合
+        Long l = dragTable.gettId();
+        List<Long> tIds = new ArrayList<>();
+        tIds.add(l);
+        // 构建 sqlKeys集合
+        List<String> sqlKeys = new ArrayList<>();
+        sqlKeys.add(dragTable.getSqlKey());
+        List<String> tableKeys = new ArrayList<>();
+        tableKeys.add(tableKey);
+        // 删除动态表格
+        dragTableService.deleteDragTable(tIds, sqlKeys);
+        // 删除动态表格统计
+        dragTableStatisticService.deleteDragTableStatisticByTableKeys(tableKeys);
+        // 删除动态表格样式
+        dragTableStyleService.deleteDragTableStyleByTableKeys(tableKeys);
+        // 删除动态表格和按钮关联表
+        dragTableBtnRelevanceService.deleteDragTableBtnRelevanceByTableKeys(tableKeys);
+        return AjaxResult.success();
+    }
 
     /**
      * 查询动态表格列表

+ 133 - 0
zkqy-admin/src/main/java/com/zkqy/web/controller/excel/ExcelSheetController.java

@@ -0,0 +1,133 @@
+package com.zkqy.web.controller.excel;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.zkqy.system.entity.DragTable;
+import com.zkqy.system.service.IDragTableService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+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.zkqy.common.annotation.Log;
+import com.zkqy.common.core.controller.BaseController;
+import com.zkqy.common.core.domain.AjaxResult;
+import com.zkqy.common.enums.BusinessType;
+import com.zkqy.system.entity.ExcelSheet;
+import com.zkqy.system.service.IExcelSheetService;
+import com.zkqy.common.utils.poi.ExcelUtil;
+import com.zkqy.common.core.page.TableDataInfo;
+
+/**
+ * excel配置Controller
+ *
+ * @author zkqy
+ * @date 2025-06-25
+ */
+@RestController
+@RequestMapping("/excel/excelSheet")
+@Api(value = "/excel/excelSheet", description = "excel配置-接口")
+public class ExcelSheetController extends BaseController
+{
+    @Autowired
+    private IExcelSheetService excelSheetService;
+
+    @Autowired
+    private IDragTableService dragTableService;
+
+/**
+ * 查询excel配置列表
+ */
+//@PreAuthorize("@ss.hasPermi('excel:excelSheet:list')")
+    @GetMapping("/list")
+    @ApiOperation(value = "查询excel配置列表")
+    public TableDataInfo list(ExcelSheet excelSheet)
+    {
+        startPage();
+        List<ExcelSheet> list = excelSheetService.selectExcelSheetList(excelSheet);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出excel配置列表
+     */
+    @Log(title = "excel配置", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    @ApiOperation(value = "导出excel配置列表")
+    public void export(HttpServletResponse response, ExcelSheet excelSheet)
+    {
+        List<ExcelSheet> list = excelSheetService.selectExcelSheetList(excelSheet);
+        ExcelUtil<ExcelSheet> util = new ExcelUtil<ExcelSheet>(ExcelSheet.class);
+        util.exportExcel(response, list, "excel配置数据");
+    }
+
+    /**
+     * 获取excel配置详细信息
+     */
+//    @PreAuthorize("@ss.hasPermi('excel:excelSheet:query')")
+    @GetMapping(value = "/{id}")
+    @ApiOperation(value = "获取excel配置详细信息")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(excelSheetService.selectExcelSheetById(id));
+    }
+
+    /**
+     * 新增excel配置
+     */
+//    @PreAuthorize("@ss.hasPermi('excel:excelSheet:add')")
+    @Log(title = "excel配置", businessType = BusinessType.INSERT)
+    @PostMapping
+    @ApiOperation(value = "新增excel配置")
+    public AjaxResult add(@RequestBody ExcelSheet excelSheet)
+    {
+        return toAjax(excelSheetService.insertExcelSheet(excelSheet));
+    }
+
+    /**
+     * 修改excel配置
+     */
+//    @PreAuthorize("@ss.hasPermi('excel:excelSheet:edit')")
+    @Log(title = "excel配置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    @ApiOperation(value = "修改excel配置")
+    public AjaxResult edit(@RequestBody ExcelSheet excelSheet)
+    {
+        return toAjax(excelSheetService.updateExcelSheet(excelSheet));
+    }
+
+    /**
+     * 删除excel配置
+     */
+//    @PreAuthorize("@ss.hasPermi('excel:excelSheet:remove')")
+    @Log(title = "excel配置", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    @ApiOperation(value = "删除excel配置")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(excelSheetService.deleteExcelSheetByIds(ids));
+    }
+
+    //根据tableKey获取表格信息
+    @GetMapping("/getTableInfoByTableKey")
+    @ApiOperation(value = "根据tableKey获取表格信息")
+    public AjaxResult getTableInfoByTableKey(String tableKey){
+        return AjaxResult.success(excelSheetService.getTableInfoByTableKey(tableKey));
+    }
+    //根据tableKey获取t_id的接口
+    @GetMapping("/getTIdByTableKey")
+    @ApiOperation(value = "根据tableKey获取t_id的接口")
+    public AjaxResult getTIdByTableKey(String tableKey){
+        DragTable dragTable = dragTableService.selectSqlKeyByTableKey(tableKey);
+        Long l = dragTable.gettId();
+        return AjaxResult.success(l);
+    }
+}

+ 117 - 0
zkqy-system/src/main/java/com/zkqy/system/entity/ExcelSheet.java

@@ -0,0 +1,117 @@
+package com.zkqy.system.entity;
+
+import com.alibaba.fastjson2.JSONArray;
+import com.alibaba.fastjson2.JSONObject;
+import com.zkqy.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.zkqy.common.annotation.Excel;
+
+/**
+ * excel配置对象 excel_sheet
+ * 
+ * @author zkqy
+ * @date 2025-06-25
+ */
+public class ExcelSheet extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    private Long id;
+
+    /** excel的名称 */
+    @Excel(name = "excel的名称")
+    private String name;
+
+    /** excel的json数据 */
+    @Excel(name = "excel的json数据")
+    private String excelJson;
+
+    private JSONArray excelJsonList;
+
+    /** 列表配置 */
+    @Excel(name = "列表配置")
+    private String excelTableConfig;
+
+    private JSONArray excelTableConfigList;
+    /** 删除字段 */
+    private String delFlag;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setName(String name) 
+    {
+        this.name = name;
+    }
+
+    public String getName() 
+    {
+        return name;
+    }
+    public void setExcelJson(String excelJson)
+    {
+        this.excelJson = excelJson;
+    }
+
+    public String getExcelJson()
+    {
+        return excelJson;
+    }
+    public void setExcelTableConfig(String excelTableConfig)
+    {
+        this.excelTableConfig = excelTableConfig;
+    }
+
+    public String getExcelTableConfig()
+    {
+        return excelTableConfig;
+    }
+    public void setDelFlag(String delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() 
+    {
+        return delFlag;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("name", getName())
+            .append("excelJson", getExcelJson())
+            .append("excelTableConfig", getExcelTableConfig())
+            .append("delFlag", getDelFlag())
+            .append("createTime", getCreateTime())
+            .append("createBy", getCreateBy())
+            .append("updateTime", getUpdateTime())
+            .append("updateBy", getUpdateBy())
+            .toString();
+    }
+
+    public JSONArray getExcelJsonList() {
+        return excelJsonList;
+    }
+
+    public void setExcelJsonList(JSONArray excelJsonList) {
+        this.excelJsonList = excelJsonList;
+    }
+
+    public JSONArray getExcelTableConfigList() {
+        return excelTableConfigList;
+    }
+
+    public void setExcelTableConfigList(JSONArray excelTableConfigList) {
+        this.excelTableConfigList = excelTableConfigList;
+    }
+}

+ 61 - 0
zkqy-system/src/main/java/com/zkqy/system/mapper/ExcelSheetMapper.java

@@ -0,0 +1,61 @@
+package com.zkqy.system.mapper;
+
+import java.util.List;
+import com.zkqy.system.entity.ExcelSheet;
+
+/**
+ * excel配置Mapper接口
+ * 
+ * @author zkqy
+ * @date 2025-06-25
+ */
+public interface ExcelSheetMapper 
+{
+    /**
+     * 查询excel配置
+     * 
+     * @param id excel配置主键
+     * @return excel配置
+     */
+    public ExcelSheet selectExcelSheetById(Long id);
+
+    /**
+     * 查询excel配置列表
+     * 
+     * @param excelSheet excel配置
+     * @return excel配置集合
+     */
+    public List<ExcelSheet> selectExcelSheetList(ExcelSheet excelSheet);
+
+    /**
+     * 新增excel配置
+     * 
+     * @param excelSheet excel配置
+     * @return 结果
+     */
+    public int insertExcelSheet(ExcelSheet excelSheet);
+
+    /**
+     * 修改excel配置
+     * 
+     * @param excelSheet excel配置
+     * @return 结果
+     */
+    public int updateExcelSheet(ExcelSheet excelSheet);
+
+    /**
+     * 删除excel配置
+     * 
+     * @param id excel配置主键
+     * @return 结果
+     */
+    public int deleteExcelSheetById(Long id);
+
+    /**
+     * 批量删除excel配置
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteExcelSheetByIds(Long[] ids);
+}

+ 65 - 0
zkqy-system/src/main/java/com/zkqy/system/service/IExcelSheetService.java

@@ -0,0 +1,65 @@
+package com.zkqy.system.service;
+
+import java.util.List;
+
+import com.zkqy.common.core.domain.AjaxResult;
+import com.zkqy.system.entity.ExcelSheet;
+
+/**
+ * excel配置Service接口
+ * 
+ * @author zkqy
+ * @date 2025-06-25
+ */
+public interface IExcelSheetService 
+{
+    /**
+     * 查询excel配置
+     * 
+     * @param id excel配置主键
+     * @return excel配置
+     */
+    public ExcelSheet selectExcelSheetById(Long id);
+
+    /**
+     * 查询excel配置列表
+     * 
+     * @param excelSheet excel配置
+     * @return excel配置集合
+     */
+    public List<ExcelSheet> selectExcelSheetList(ExcelSheet excelSheet);
+
+    /**
+     * 新增excel配置
+     * 
+     * @param excelSheet excel配置
+     * @return 结果
+     */
+    public int insertExcelSheet(ExcelSheet excelSheet);
+
+    /**
+     * 修改excel配置
+     * 
+     * @param excelSheet excel配置
+     * @return 结果
+     */
+    public int updateExcelSheet(ExcelSheet excelSheet);
+
+    /**
+     * 批量删除excel配置
+     * 
+     * @param ids 需要删除的excel配置主键集合
+     * @return 结果
+     */
+    public int deleteExcelSheetByIds(Long[] ids);
+
+    /**
+     * 删除excel配置信息
+     * 
+     * @param id excel配置主键
+     * @return 结果
+     */
+    public int deleteExcelSheetById(Long id);
+
+    List<List> getTableInfoByTableKey(String tableKey);
+}

+ 8 - 6
zkqy-system/src/main/java/com/zkqy/system/service/impl/DragTableServiceImpl.java

@@ -205,11 +205,13 @@ public class DragTableServiceImpl implements IDragTableService {
         tableSql.setTableSql(dragTableVo.getTableSql());
         dragTableMapper.insertDragTable(dragTable);
         List<String> searchFieldList = new ArrayList<>();
-        dragTableVo.getSearchFieldList().forEach(item -> {
-            if (item.getConditionType().equals("SuperQuery")) { // 当前表格的查询条件是超级查询
-                searchFieldList.add(item.getConditionField());
-            }
-        });
+        if (dragTableVo.getSearchFieldList() != null){
+            dragTableVo.getSearchFieldList().forEach(item -> {
+                if (item.getConditionType().equals("SuperQuery")) { // 当前表格的查询条件是超级查询
+                    searchFieldList.add(item.getConditionField());
+                }
+            });
+        }
         // 拼接sql查询条件
         switch (SecurityUtils.getDatabaseType().toUpperCase()) {
             case "MYSQL":
@@ -256,7 +258,7 @@ public class DragTableServiceImpl implements IDragTableService {
         tableSqlMapper.insertTableSql(tableSql);
 
         // add drag_table_condition 添加动态表格高级查询条件以及共通页面条件框类型
-        if (dragTableVo.getSearchFieldList().size() > 0) {
+        if (dragTableVo.getSearchFieldList() != null && dragTableVo.getSearchFieldList().size() > 0) {
             dragTableVo.getConditionDefaultValueMap().keySet().forEach(item -> {
                 dragTableVo.getSearchFieldList().add(new DragTableCondition(dragTable.gettId(), "默认查询", item,
                     "DefaultQuery", dragTableVo.getConditionDefaultValueMap().get(item).toString()));

+ 159 - 0
zkqy-system/src/main/java/com/zkqy/system/service/impl/ExcelSheetServiceImpl.java

@@ -0,0 +1,159 @@
+package com.zkqy.system.service.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONArray;
+import com.alibaba.fastjson2.JSONObject;
+import com.zkqy.common.core.domain.AjaxResult;
+import com.zkqy.common.utils.DateUtils;
+import com.zkqy.common.utils.StringUtils;
+import com.zkqy.system.entity.DragTable;
+import com.zkqy.system.entity.TableSql;
+import com.zkqy.system.mapper.CommonMapper;
+import com.zkqy.system.service.IDragTableService;
+import com.zkqy.system.service.ITableSqlService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.zkqy.system.mapper.ExcelSheetMapper;
+import com.zkqy.system.entity.ExcelSheet;
+import com.zkqy.system.service.IExcelSheetService;
+
+/**
+ * excel配置Service业务层处理
+ * 
+ * @author zkqy
+ * @date 2025-06-25
+ */
+@Service
+public class ExcelSheetServiceImpl implements IExcelSheetService 
+{
+    @Autowired
+    private ExcelSheetMapper excelSheetMapper;
+
+    @Autowired
+    private IDragTableService dragTableService;
+
+    @Autowired
+    private ITableSqlService tableSqlService;
+    @Autowired
+    private CommonMapper commonMapper;
+
+    /**
+     * 查询excel配置
+     * 
+     * @param id excel配置主键
+     * @return excel配置
+     */
+    @Override
+    public ExcelSheet selectExcelSheetById(Long id)
+    {
+        return excelSheetMapper.selectExcelSheetById(id);
+    }
+
+    /**
+     * 查询excel配置列表
+     * 
+     * @param excelSheet excel配置
+     * @return excel配置
+     */
+    @Override
+    public List<ExcelSheet> selectExcelSheetList(ExcelSheet excelSheet)
+    {
+        List<ExcelSheet> excelSheets = excelSheetMapper.selectExcelSheetList(excelSheet);
+        for (ExcelSheet sheet : excelSheets) {
+            sheet.setExcelJsonList(JSONArray.parseArray(sheet.getExcelJson()));
+            sheet.setExcelTableConfigList(JSONArray.parseArray(sheet.getExcelTableConfig()));
+        }
+        return excelSheets;
+    }
+
+    /**
+     * 新增excel配置
+     * 
+     * @param excelSheet excel配置
+     * @return 结果
+     */
+    @Override
+    public int insertExcelSheet(ExcelSheet excelSheet)
+    {
+        excelSheet.setCreateTime(DateUtils.getNowDate());
+        return excelSheetMapper.insertExcelSheet(excelSheet);
+    }
+
+    /**
+     * 修改excel配置
+     * 
+     * @param excelSheet excel配置
+     * @return 结果
+     */
+    @Override
+    public int updateExcelSheet(ExcelSheet excelSheet)
+    {
+        excelSheet.setUpdateTime(DateUtils.getNowDate());
+        return excelSheetMapper.updateExcelSheet(excelSheet);
+    }
+
+    /**
+     * 批量删除excel配置
+     * 
+     * @param ids 需要删除的excel配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteExcelSheetByIds(Long[] ids)
+    {
+        return excelSheetMapper.deleteExcelSheetByIds(ids);
+    }
+
+    /**
+     * 删除excel配置信息
+     * 
+     * @param id excel配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteExcelSheetById(Long id)
+    {
+        return excelSheetMapper.deleteExcelSheetById(id);
+    }
+
+    @Override
+    public List<List> getTableInfoByTableKey(String tableKey) {
+        DragTable dragTable = dragTableService.selectSqlKeyByTableKey(tableKey);
+        //选出要展示的列
+        String dtColumnName = dragTable.getDtColumnName();
+        JSONArray columnsField = JSONArray.parseArray(dtColumnName);
+        List<List> listResult = new ArrayList<>();
+        List<String> columnListValue = new ArrayList<>();
+        List<String> columnListKey = new ArrayList<>();
+        for (int i = 0; i < columnsField.size(); i++) {
+            JSONObject obj = columnsField.getJSONObject(i);
+            // 获取第一个键的值
+            String key = obj.keySet().iterator().next();
+            columnListValue.add(obj.getString(key));
+            columnListKey.add(key);
+        }
+        listResult.add(columnListValue);
+        // 根据sqlkey查询出要找的值
+        String sqlKey = dragTable.getSqlKey();
+        TableSql tableSql = tableSqlService.selectTableSqlByTSqlKey(sqlKey);
+        if (tableSql != null) {
+            String tableSqlSelect = tableSql.getTableSql();
+//            String tableCondition = tableSql.getTableCondition().replace("#{val}", "");
+            String sqlString = tableSqlSelect;
+            List<Map<String, Object>> maps = commonMapper.executeSql(sqlString);
+            for (Map<String, Object> map : maps) {
+                List<String> list = new ArrayList<>();
+                for (String key : columnListKey) {
+                    String camelCaseKey = StringUtils.toCamelCase(key);
+                    list.add(String.valueOf(map.get(camelCaseKey)));
+                }
+                listResult.add(list);
+            }
+        }
+        return listResult;
+    }
+}

+ 1 - 4
zkqy-system/src/main/resources/mapper/dragmapper/DragTableMapper.xml

@@ -49,9 +49,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <sql id="selectDragTableVo">
         select t_id, dt_name, dt_nickname, table_key, sql_key, dt_table_name,time_format, dt_notes, dt_column_name, spare, spare1, del_flag, create_by, create_time, update_by, update_time, is_selection,echo_data,menu_id,primary_key from {DBNAME}.drag_table
     </sql>
-    <sql id="selectDragTableVoOne">
-        select t_id, dt_name, dt_nickname, table_key, sql_key, dt_table_name,time_format, dt_notes, dt_column_name, spare, spare1, del_flag, create_by, create_time, update_by, update_time, is_selection,echo_data,menu_id,primary_key from {DBNAME}.drag_table
-    </sql>
     <select id="selectDragTableList" parameterType="com.zkqy.system.entity.DragTable" resultMap="DragTableResult">
         <include refid="selectDragTableVo"/>
         <where>
@@ -189,7 +186,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="selectDragTableByTableKey" parameterType="String" resultMap="DragTableResult">
-        <include refid="selectDragTableVoOne"/>
+        <include refid="selectDragTableVo"/>
         where table_key = #{tableKey}
     </select>
 

+ 89 - 0
zkqy-system/src/main/resources/mapper/excel/ExcelSheetMapper.xml

@@ -0,0 +1,89 @@
+<?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.zkqy.system.mapper.ExcelSheetMapper">
+
+    <resultMap type="com.zkqy.system.entity.ExcelSheet" id="ExcelSheetResult">
+        <result property="id"    column="id"    />
+        <result property="name"    column="name"    />
+        <result property="excelJson"    column="excel_json"    />
+        <result property="excelTableConfig"    column="excel_table_config"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="updateBy"    column="update_by"    />
+    </resultMap>
+
+    <sql id="selectExcelSheetVo">
+        select id, name, excel_json, excel_table_config, del_flag, create_time, create_by, update_time, update_by from excel_sheet
+    </sql>
+
+    <select id="selectExcelSheetList" parameterType="com.zkqy.system.entity.ExcelSheet" resultMap="ExcelSheetResult">
+        <include refid="selectExcelSheetVo"/>
+        <where>  
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="excelJson != null  and excelJson != ''"> and excel_json = #{excelJson}</if>
+            <if test="excelTableConfig != null  and excelTableConfig != ''"> and excel_table_config = #{excelTableConfig}</if>
+        </where>
+        order by update_time desc
+    </select>
+    
+    <select id="selectExcelSheetById" parameterType="Long" resultMap="ExcelSheetResult">
+        <include refid="selectExcelSheetVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertExcelSheet" parameterType="com.zkqy.system.entity.ExcelSheet">
+        insert into excel_sheet
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="name != null">name,</if>
+            <if test="excelJson != null">excel_json,</if>
+            <if test="excelTableConfig != null">excel_table_config,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="updateBy != null">update_by,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="name != null">#{name},</if>
+            <if test="excelJson != null">#{excelJson},</if>
+            <if test="excelTableConfig != null">#{excelTableConfig},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+         </trim>
+    </insert>
+
+    <update id="updateExcelSheet" parameterType="com.zkqy.system.entity.ExcelSheet">
+        update excel_sheet
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="name != null">name = #{name},</if>
+            <if test="excelJson != null">excel_json = #{excelJson},</if>
+            <if test="excelTableConfig != null">excel_table_config = #{excelTableConfig},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteExcelSheetById" parameterType="Long">
+        delete from excel_sheet where id = #{id}
+    </delete>
+
+    <delete id="deleteExcelSheetByIds" parameterType="String">
+        delete from excel_sheet where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>