Browse Source

动态表格

xuezizhuo 2 years ago
parent
commit
896345f00b

+ 105 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/dragForm/DragTableConditionController.java

@@ -0,0 +1,105 @@
+package com.ruoyi.web.controller.dragForm;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.system.entity.DragTableCondition;
+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.IDragTableConditionService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 动态格条件Controller
+ * 
+ * @author ruoyi
+ * @date 2023-07-31
+ */
+@RestController
+@RequestMapping("/system/condition")
+public class DragTableConditionController extends BaseController
+{
+    @Autowired
+    private IDragTableConditionService dragTableConditionService;
+
+    /**
+     * 查询动态格条件列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:condition:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(DragTableCondition dragTableCondition)
+    {
+        startPage();
+        List<DragTableCondition> list = dragTableConditionService.selectDragTableConditionList(dragTableCondition);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出动态格条件列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:condition:export')")
+    @Log(title = "动态格条件", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, DragTableCondition dragTableCondition)
+    {
+        List<DragTableCondition> list = dragTableConditionService.selectDragTableConditionList(dragTableCondition);
+        ExcelUtil<DragTableCondition> util = new ExcelUtil<DragTableCondition>(DragTableCondition.class);
+        util.exportExcel(response, list, "动态格条件数据");
+    }
+
+    /**
+     * 获取动态格条件详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:condition:query')")
+    @GetMapping(value = "/{tcId}")
+    public AjaxResult getInfo(@PathVariable("tcId") Long tcId)
+    {
+        return success(dragTableConditionService.selectDragTableConditionByTcId(tcId));
+    }
+
+    /**
+     * 新增动态格条件
+     */
+    @PreAuthorize("@ss.hasPermi('system:condition:add')")
+    @Log(title = "动态格条件", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody DragTableCondition dragTableCondition)
+    {
+        return toAjax(dragTableConditionService.insertDragTableCondition(dragTableCondition));
+    }
+
+    /**
+     * 修改动态格条件
+     */
+    @PreAuthorize("@ss.hasPermi('system:condition:edit')")
+    @Log(title = "动态格条件", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody DragTableCondition dragTableCondition)
+    {
+        return toAjax(dragTableConditionService.updateDragTableCondition(dragTableCondition));
+    }
+
+    /**
+     * 删除动态格条件
+     */
+    @PreAuthorize("@ss.hasPermi('system:condition:remove')")
+    @Log(title = "动态格条件", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{tcIds}")
+    public AjaxResult remove(@PathVariable Long[] tcIds)
+    {
+        return toAjax(dragTableConditionService.deleteDragTableConditionByTcIds(tcIds));
+    }
+}

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

@@ -0,0 +1,105 @@
+package com.ruoyi.web.controller.dragForm;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.system.entity.DragTable;
+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.IDragTableService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 动态格Controller
+ * 
+ * @author ruoyi
+ * @date 2023-07-31
+ */
+@RestController
+@RequestMapping("/system/table")
+public class DragTableController extends BaseController
+{
+    @Autowired
+    private IDragTableService dragTableService;
+
+    /**
+     * 查询动态格列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:table:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(DragTable dragTable)
+    {
+        startPage();
+        List<DragTable> list = dragTableService.selectDragTableList(dragTable);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出动态格列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:table:export')")
+    @Log(title = "动态格", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, DragTable dragTable)
+    {
+        List<DragTable> list = dragTableService.selectDragTableList(dragTable);
+        ExcelUtil<DragTable> util = new ExcelUtil<DragTable>(DragTable.class);
+        util.exportExcel(response, list, "动态格数据");
+    }
+
+    /**
+     * 获取动态格详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:table:query')")
+    @GetMapping(value = "/{tId}")
+    public AjaxResult getInfo(@PathVariable("tId") Long tId)
+    {
+        return success(dragTableService.selectDragTableByTId(tId));
+    }
+
+    /**
+     * 新增动态格
+     */
+    @PreAuthorize("@ss.hasPermi('system:table:add')")
+    @Log(title = "动态格", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody DragTable dragTable)
+    {
+        return toAjax(dragTableService.insertDragTable(dragTable));
+    }
+
+    /**
+     * 修改动态格
+     */
+    @PreAuthorize("@ss.hasPermi('system:table:edit')")
+    @Log(title = "动态格", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody DragTable dragTable)
+    {
+        return toAjax(dragTableService.updateDragTable(dragTable));
+    }
+
+    /**
+     * 删除动态格
+     */
+    @PreAuthorize("@ss.hasPermi('system:table:remove')")
+    @Log(title = "动态格", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{tIds}")
+    public AjaxResult remove(@PathVariable Long[] tIds)
+    {
+        return toAjax(dragTableService.deleteDragTableByTIds(tIds));
+    }
+}

+ 180 - 0
ruoyi-system/src/main/java/com/ruoyi/system/entity/DragTable.java

@@ -0,0 +1,180 @@
+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
+ * 
+ * @author ruoyi
+ * @date 2023-07-31
+ */
+public class DragTable extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 表格主键 */
+    private Long tId;
+
+    /** 表格名称 */
+    @Excel(name = "表格名称")
+    private String dtName;
+
+    /** 表格别名 */
+    @Excel(name = "表格别名")
+    private String dtNickname;
+
+    /** table编号 */
+    @Excel(name = "table编号")
+    private String tableKey;
+
+    /** sql编号 */
+    @Excel(name = "sql编号")
+    private String sqlKey;
+
+    /** 绑定表名称 */
+    @Excel(name = "绑定表名称")
+    private String dtTableName;
+
+    /** 表格描述 */
+    @Excel(name = "表格描述")
+    private String dtNotes;
+
+    /** 列字段标题名称 */
+    @Excel(name = "列字段标题名称")
+    private String dtColumnName;
+
+    /** 备用列 */
+    @Excel(name = "备用列")
+    private String spare;
+
+    /** 备用列 */
+    @Excel(name = "备用列")
+    private String spare1;
+
+    /** 逻辑删除 */
+    private String delFlag;
+
+    public void settId(Long tId) 
+    {
+        this.tId = tId;
+    }
+
+    public Long gettId() 
+    {
+        return tId;
+    }
+    public void setDtName(String dtName) 
+    {
+        this.dtName = dtName;
+    }
+
+    public String getDtName() 
+    {
+        return dtName;
+    }
+    public void setDtNickname(String dtNickname) 
+    {
+        this.dtNickname = dtNickname;
+    }
+
+    public String getDtNickname() 
+    {
+        return dtNickname;
+    }
+    public void setTableKey(String tableKey) 
+    {
+        this.tableKey = tableKey;
+    }
+
+    public String getTableKey() 
+    {
+        return tableKey;
+    }
+    public void setSqlKey(String sqlKey) 
+    {
+        this.sqlKey = sqlKey;
+    }
+
+    public String getSqlKey() 
+    {
+        return sqlKey;
+    }
+    public void setDtTableName(String dtTableName) 
+    {
+        this.dtTableName = dtTableName;
+    }
+
+    public String getDtTableName() 
+    {
+        return dtTableName;
+    }
+    public void setDtNotes(String dtNotes) 
+    {
+        this.dtNotes = dtNotes;
+    }
+
+    public String getDtNotes() 
+    {
+        return dtNotes;
+    }
+    public void setDtColumnName(String dtColumnName) 
+    {
+        this.dtColumnName = dtColumnName;
+    }
+
+    public String getDtColumnName() 
+    {
+        return dtColumnName;
+    }
+    public void setSpare(String spare) 
+    {
+        this.spare = spare;
+    }
+
+    public String getSpare() 
+    {
+        return spare;
+    }
+    public void setSpare1(String spare1) 
+    {
+        this.spare1 = spare1;
+    }
+
+    public String getSpare1() 
+    {
+        return spare1;
+    }
+    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("tId", gettId())
+            .append("dtName", getDtName())
+            .append("dtNickname", getDtNickname())
+            .append("tableKey", getTableKey())
+            .append("sqlKey", getSqlKey())
+            .append("dtTableName", getDtTableName())
+            .append("dtNotes", getDtNotes())
+            .append("dtColumnName", getDtColumnName())
+            .append("spare", getSpare())
+            .append("spare1", getSpare1())
+            .append("delFlag", getDelFlag())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 166 - 0
ruoyi-system/src/main/java/com/ruoyi/system/entity/DragTableCondition.java

@@ -0,0 +1,166 @@
+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_condition
+ * 
+ * @author ruoyi
+ * @date 2023-07-31
+ */
+public class DragTableCondition extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 编号 */
+    private Long tcId;
+
+    /** 动态表格编号 */
+    @Excel(name = "动态表格编号")
+    private Long tId;
+
+    /** 条件名称 */
+    @Excel(name = "条件名称")
+    private String conditionName;
+
+    /** 条件字段 */
+    @Excel(name = "条件字段")
+    private String conditionField;
+
+    /** 条件描述 */
+    @Excel(name = "条件描述")
+    private String conditionNotes;
+
+    /** 条件类型 */
+    @Excel(name = "条件类型")
+    private String conditionType;
+
+    /** 默认值 */
+    @Excel(name = "默认值")
+    private String conditionDefaultValue;
+
+    /** 排序 */
+    @Excel(name = "排序")
+    private Long sort;
+
+    /** 是否隐藏(0 显示; 1 隐藏) */
+    @Excel(name = "是否隐藏(0 显示; 1 隐藏)")
+    private String isHidden;
+
+    /** 逻辑删除(0 否; 1 是) */
+    private String delFlag;
+
+    public void setTcId(Long tcId) 
+    {
+        this.tcId = tcId;
+    }
+
+    public Long getTcId() 
+    {
+        return tcId;
+    }
+    public void settId(Long tId) 
+    {
+        this.tId = tId;
+    }
+
+    public Long gettId() 
+    {
+        return tId;
+    }
+    public void setConditionName(String conditionName) 
+    {
+        this.conditionName = conditionName;
+    }
+
+    public String getConditionName() 
+    {
+        return conditionName;
+    }
+    public void setConditionField(String conditionField) 
+    {
+        this.conditionField = conditionField;
+    }
+
+    public String getConditionField() 
+    {
+        return conditionField;
+    }
+    public void setConditionNotes(String conditionNotes) 
+    {
+        this.conditionNotes = conditionNotes;
+    }
+
+    public String getConditionNotes() 
+    {
+        return conditionNotes;
+    }
+    public void setConditionType(String conditionType) 
+    {
+        this.conditionType = conditionType;
+    }
+
+    public String getConditionType() 
+    {
+        return conditionType;
+    }
+    public void setConditionDefaultValue(String conditionDefaultValue) 
+    {
+        this.conditionDefaultValue = conditionDefaultValue;
+    }
+
+    public String getConditionDefaultValue() 
+    {
+        return conditionDefaultValue;
+    }
+    public void setSort(Long sort) 
+    {
+        this.sort = sort;
+    }
+
+    public Long getSort() 
+    {
+        return sort;
+    }
+    public void setIsHidden(String isHidden) 
+    {
+        this.isHidden = isHidden;
+    }
+
+    public String getIsHidden() 
+    {
+        return isHidden;
+    }
+    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("tcId", getTcId())
+            .append("tId", gettId())
+            .append("conditionName", getConditionName())
+            .append("conditionField", getConditionField())
+            .append("conditionNotes", getConditionNotes())
+            .append("conditionType", getConditionType())
+            .append("conditionDefaultValue", getConditionDefaultValue())
+            .append("sort", getSort())
+            .append("isHidden", getIsHidden())
+            .append("delFlag", getDelFlag())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 62 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/DragTableConditionMapper.java

@@ -0,0 +1,62 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.system.entity.DragTableCondition;
+
+import java.util.List;
+
+/**
+ * 动态格条件Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2023-07-31
+ */
+public interface DragTableConditionMapper 
+{
+    /**
+     * 查询动态格条件
+     * 
+     * @param tcId 动态格条件主键
+     * @return 动态格条件
+     */
+    public DragTableCondition selectDragTableConditionByTcId(Long tcId);
+
+    /**
+     * 查询动态格条件列表
+     * 
+     * @param dragTableCondition 动态格条件
+     * @return 动态格条件集合
+     */
+    public List<DragTableCondition> selectDragTableConditionList(DragTableCondition dragTableCondition);
+
+    /**
+     * 新增动态格条件
+     * 
+     * @param dragTableCondition 动态格条件
+     * @return 结果
+     */
+    public int insertDragTableCondition(DragTableCondition dragTableCondition);
+
+    /**
+     * 修改动态格条件
+     * 
+     * @param dragTableCondition 动态格条件
+     * @return 结果
+     */
+    public int updateDragTableCondition(DragTableCondition dragTableCondition);
+
+    /**
+     * 删除动态格条件
+     * 
+     * @param tcId 动态格条件主键
+     * @return 结果
+     */
+    public int deleteDragTableConditionByTcId(Long tcId);
+
+    /**
+     * 批量删除动态格条件
+     * 
+     * @param tcIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteDragTableConditionByTcIds(Long[] tcIds);
+}

+ 62 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/DragTableMapper.java

@@ -0,0 +1,62 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.system.entity.DragTable;
+
+import java.util.List;
+
+/**
+ * 动态格Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2023-07-31
+ */
+public interface DragTableMapper 
+{
+    /**
+     * 查询动态格
+     * 
+     * @param tId 动态格主键
+     * @return 动态格
+     */
+    public DragTable selectDragTableByTId(Long tId);
+
+    /**
+     * 查询动态格列表
+     * 
+     * @param dragTable 动态格
+     * @return 动态格集合
+     */
+    public List<DragTable> selectDragTableList(DragTable dragTable);
+
+    /**
+     * 新增动态格
+     * 
+     * @param dragTable 动态格
+     * @return 结果
+     */
+    public int insertDragTable(DragTable dragTable);
+
+    /**
+     * 修改动态格
+     * 
+     * @param dragTable 动态格
+     * @return 结果
+     */
+    public int updateDragTable(DragTable dragTable);
+
+    /**
+     * 删除动态格
+     * 
+     * @param tId 动态格主键
+     * @return 结果
+     */
+    public int deleteDragTableByTId(Long tId);
+
+    /**
+     * 批量删除动态格
+     * 
+     * @param tIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteDragTableByTIds(Long[] tIds);
+}

+ 62 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IDragTableConditionService.java

@@ -0,0 +1,62 @@
+package com.ruoyi.system.service;
+
+import com.ruoyi.system.entity.DragTableCondition;
+
+import java.util.List;
+
+/**
+ * 动态格条件Service接口
+ * 
+ * @author ruoyi
+ * @date 2023-07-31
+ */
+public interface IDragTableConditionService 
+{
+    /**
+     * 查询动态格条件
+     * 
+     * @param tcId 动态格条件主键
+     * @return 动态格条件
+     */
+    public DragTableCondition selectDragTableConditionByTcId(Long tcId);
+
+    /**
+     * 查询动态格条件列表
+     * 
+     * @param dragTableCondition 动态格条件
+     * @return 动态格条件集合
+     */
+    public List<DragTableCondition> selectDragTableConditionList(DragTableCondition dragTableCondition);
+
+    /**
+     * 新增动态格条件
+     * 
+     * @param dragTableCondition 动态格条件
+     * @return 结果
+     */
+    public int insertDragTableCondition(DragTableCondition dragTableCondition);
+
+    /**
+     * 修改动态格条件
+     * 
+     * @param dragTableCondition 动态格条件
+     * @return 结果
+     */
+    public int updateDragTableCondition(DragTableCondition dragTableCondition);
+
+    /**
+     * 批量删除动态格条件
+     * 
+     * @param tcIds 需要删除的动态格条件主键集合
+     * @return 结果
+     */
+    public int deleteDragTableConditionByTcIds(Long[] tcIds);
+
+    /**
+     * 删除动态格条件信息
+     * 
+     * @param tcId 动态格条件主键
+     * @return 结果
+     */
+    public int deleteDragTableConditionByTcId(Long tcId);
+}

+ 62 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IDragTableService.java

@@ -0,0 +1,62 @@
+package com.ruoyi.system.service;
+
+import com.ruoyi.system.entity.DragTable;
+
+import java.util.List;
+
+/**
+ * 动态格Service接口
+ * 
+ * @author ruoyi
+ * @date 2023-07-31
+ */
+public interface IDragTableService 
+{
+    /**
+     * 查询动态格
+     * 
+     * @param tId 动态格主键
+     * @return 动态格
+     */
+    public DragTable selectDragTableByTId(Long tId);
+
+    /**
+     * 查询动态格列表
+     * 
+     * @param dragTable 动态格
+     * @return 动态格集合
+     */
+    public List<DragTable> selectDragTableList(DragTable dragTable);
+
+    /**
+     * 新增动态格
+     * 
+     * @param dragTable 动态格
+     * @return 结果
+     */
+    public int insertDragTable(DragTable dragTable);
+
+    /**
+     * 修改动态格
+     * 
+     * @param dragTable 动态格
+     * @return 结果
+     */
+    public int updateDragTable(DragTable dragTable);
+
+    /**
+     * 批量删除动态格
+     * 
+     * @param tIds 需要删除的动态格主键集合
+     * @return 结果
+     */
+    public int deleteDragTableByTIds(Long[] tIds);
+
+    /**
+     * 删除动态格信息
+     * 
+     * @param tId 动态格主键
+     * @return 结果
+     */
+    public int deleteDragTableByTId(Long tId);
+}

+ 96 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DragTableConditionServiceImpl.java

@@ -0,0 +1,96 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.system.entity.DragTableCondition;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.DragTableConditionMapper;
+import com.ruoyi.system.service.IDragTableConditionService;
+
+/**
+ * 动态格条件Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2023-07-31
+ */
+@Service
+public class DragTableConditionServiceImpl implements IDragTableConditionService 
+{
+    @Autowired
+    private DragTableConditionMapper dragTableConditionMapper;
+
+    /**
+     * 查询动态格条件
+     * 
+     * @param tcId 动态格条件主键
+     * @return 动态格条件
+     */
+    @Override
+    public DragTableCondition selectDragTableConditionByTcId(Long tcId)
+    {
+        return dragTableConditionMapper.selectDragTableConditionByTcId(tcId);
+    }
+
+    /**
+     * 查询动态格条件列表
+     * 
+     * @param dragTableCondition 动态格条件
+     * @return 动态格条件
+     */
+    @Override
+    public List<DragTableCondition> selectDragTableConditionList(DragTableCondition dragTableCondition)
+    {
+        return dragTableConditionMapper.selectDragTableConditionList(dragTableCondition);
+    }
+
+    /**
+     * 新增动态格条件
+     * 
+     * @param dragTableCondition 动态格条件
+     * @return 结果
+     */
+    @Override
+    public int insertDragTableCondition(DragTableCondition dragTableCondition)
+    {
+        dragTableCondition.setCreateTime(DateUtils.getNowDate());
+        return dragTableConditionMapper.insertDragTableCondition(dragTableCondition);
+    }
+
+    /**
+     * 修改动态格条件
+     * 
+     * @param dragTableCondition 动态格条件
+     * @return 结果
+     */
+    @Override
+    public int updateDragTableCondition(DragTableCondition dragTableCondition)
+    {
+        dragTableCondition.setUpdateTime(DateUtils.getNowDate());
+        return dragTableConditionMapper.updateDragTableCondition(dragTableCondition);
+    }
+
+    /**
+     * 批量删除动态格条件
+     * 
+     * @param tcIds 需要删除的动态格条件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDragTableConditionByTcIds(Long[] tcIds)
+    {
+        return dragTableConditionMapper.deleteDragTableConditionByTcIds(tcIds);
+    }
+
+    /**
+     * 删除动态格条件信息
+     * 
+     * @param tcId 动态格条件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDragTableConditionByTcId(Long tcId)
+    {
+        return dragTableConditionMapper.deleteDragTableConditionByTcId(tcId);
+    }
+}

+ 96 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DragTableServiceImpl.java

@@ -0,0 +1,96 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.system.entity.DragTable;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.DragTableMapper;
+import com.ruoyi.system.service.IDragTableService;
+
+/**
+ * 动态格Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2023-07-31
+ */
+@Service
+public class DragTableServiceImpl implements IDragTableService 
+{
+    @Autowired
+    private DragTableMapper dragTableMapper;
+
+    /**
+     * 查询动态格
+     * 
+     * @param tId 动态格主键
+     * @return 动态格
+     */
+    @Override
+    public DragTable selectDragTableByTId(Long tId)
+    {
+        return dragTableMapper.selectDragTableByTId(tId);
+    }
+
+    /**
+     * 查询动态格列表
+     * 
+     * @param dragTable 动态格
+     * @return 动态格
+     */
+    @Override
+    public List<DragTable> selectDragTableList(DragTable dragTable)
+    {
+        return dragTableMapper.selectDragTableList(dragTable);
+    }
+
+    /**
+     * 新增动态格
+     * 
+     * @param dragTable 动态格
+     * @return 结果
+     */
+    @Override
+    public int insertDragTable(DragTable dragTable)
+    {
+        dragTable.setCreateTime(DateUtils.getNowDate());
+        return dragTableMapper.insertDragTable(dragTable);
+    }
+
+    /**
+     * 修改动态格
+     * 
+     * @param dragTable 动态格
+     * @return 结果
+     */
+    @Override
+    public int updateDragTable(DragTable dragTable)
+    {
+        dragTable.setUpdateTime(DateUtils.getNowDate());
+        return dragTableMapper.updateDragTable(dragTable);
+    }
+
+    /**
+     * 批量删除动态格
+     * 
+     * @param tIds 需要删除的动态格主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDragTableByTIds(Long[] tIds)
+    {
+        return dragTableMapper.deleteDragTableByTIds(tIds);
+    }
+
+    /**
+     * 删除动态格信息
+     * 
+     * @param tId 动态格主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDragTableByTId(Long tId)
+    {
+        return dragTableMapper.deleteDragTableByTId(tId);
+    }
+}

+ 111 - 0
ruoyi-system/src/main/resources/mapper/dragmapper/DragTableConditionMapper.xml

@@ -0,0 +1,111 @@
+<?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.DragTableConditionMapper">
+    
+    <resultMap type="com.ruoyi.system.entity.DragTableCondition" id="DragTableConditionResult">
+        <result property="tcId"    column="tc_id"    />
+        <result property="tId"    column="t_id"    />
+        <result property="conditionName"    column="condition_name"    />
+        <result property="conditionField"    column="condition_field"    />
+        <result property="conditionNotes"    column="condition_notes"    />
+        <result property="conditionType"    column="condition_type"    />
+        <result property="conditionDefaultValue"    column="condition_default_value"    />
+        <result property="sort"    column="sort"    />
+        <result property="isHidden"    column="is_hidden"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectDragTableConditionVo">
+        select tc_id, t_id, condition_name, condition_field, condition_notes, condition_type, condition_default_value, sort, is_hidden, del_flag, create_by, create_time, update_by, update_time from drag_table_condition
+    </sql>
+
+    <select id="selectDragTableConditionList" parameterType="com.ruoyi.system.entity.DragTableCondition" resultMap="DragTableConditionResult">
+        <include refid="selectDragTableConditionVo"/>
+        <where>  
+            <if test="tId != null "> and t_id = #{tId}</if>
+            <if test="conditionName != null  and conditionName != ''"> and condition_name like concat('%', #{conditionName}, '%')</if>
+            <if test="conditionField != null  and conditionField != ''"> and condition_field = #{conditionField}</if>
+            <if test="conditionNotes != null  and conditionNotes != ''"> and condition_notes = #{conditionNotes}</if>
+            <if test="conditionType != null  and conditionType != ''"> and condition_type = #{conditionType}</if>
+            <if test="conditionDefaultValue != null  and conditionDefaultValue != ''"> and condition_default_value = #{conditionDefaultValue}</if>
+            <if test="sort != null "> and sort = #{sort}</if>
+            <if test="isHidden != null  and isHidden != ''"> and is_hidden = #{isHidden}</if>
+        </where>
+    </select>
+    
+    <select id="selectDragTableConditionByTcId" parameterType="Long" resultMap="DragTableConditionResult">
+        <include refid="selectDragTableConditionVo"/>
+        where tc_id = #{tcId}
+    </select>
+        
+    <insert id="insertDragTableCondition" parameterType="com.ruoyi.system.entity.DragTableCondition" useGeneratedKeys="true" keyProperty="tcId">
+        insert into drag_table_condition
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="tId != null">t_id,</if>
+            <if test="conditionName != null">condition_name,</if>
+            <if test="conditionField != null">condition_field,</if>
+            <if test="conditionNotes != null">condition_notes,</if>
+            <if test="conditionType != null">condition_type,</if>
+            <if test="conditionDefaultValue != null">condition_default_value,</if>
+            <if test="sort != null">sort,</if>
+            <if test="isHidden != null">is_hidden,</if>
+            <if test="delFlag != null">del_flag,</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>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="tId != null">#{tId},</if>
+            <if test="conditionName != null">#{conditionName},</if>
+            <if test="conditionField != null">#{conditionField},</if>
+            <if test="conditionNotes != null">#{conditionNotes},</if>
+            <if test="conditionType != null">#{conditionType},</if>
+            <if test="conditionDefaultValue != null">#{conditionDefaultValue},</if>
+            <if test="sort != null">#{sort},</if>
+            <if test="isHidden != null">#{isHidden},</if>
+            <if test="delFlag != null">#{delFlag},</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>
+         </trim>
+    </insert>
+
+    <update id="updateDragTableCondition" parameterType="com.ruoyi.system.entity.DragTableCondition">
+        update drag_table_condition
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="tId != null">t_id = #{tId},</if>
+            <if test="conditionName != null">condition_name = #{conditionName},</if>
+            <if test="conditionField != null">condition_field = #{conditionField},</if>
+            <if test="conditionNotes != null">condition_notes = #{conditionNotes},</if>
+            <if test="conditionType != null">condition_type = #{conditionType},</if>
+            <if test="conditionDefaultValue != null">condition_default_value = #{conditionDefaultValue},</if>
+            <if test="sort != null">sort = #{sort},</if>
+            <if test="isHidden != null">is_hidden = #{isHidden},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</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>
+        </trim>
+        where tc_id = #{tcId}
+    </update>
+
+    <delete id="deleteDragTableConditionByTcId" parameterType="Long">
+        delete from drag_table_condition where tc_id = #{tcId}
+    </delete>
+
+    <delete id="deleteDragTableConditionByTcIds" parameterType="String">
+        delete from drag_table_condition where tc_id in 
+        <foreach item="tcId" collection="array" open="(" separator="," close=")">
+            #{tcId}
+        </foreach>
+    </delete>
+</mapper>

+ 116 - 0
ruoyi-system/src/main/resources/mapper/dragmapper/DragTableMapper.xml

@@ -0,0 +1,116 @@
+<?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.DragTableMapper">
+    
+    <resultMap type="com.ruoyi.system.entity.DragTable" id="DragTableResult">
+        <result property="tId"    column="t_id"    />
+        <result property="dtName"    column="dt_name"    />
+        <result property="dtNickname"    column="dt_nickname"    />
+        <result property="tableKey"    column="table_key"    />
+        <result property="sqlKey"    column="sql_key"    />
+        <result property="dtTableName"    column="dt_table_name"    />
+        <result property="dtNotes"    column="dt_notes"    />
+        <result property="dtColumnName"    column="dt_column_name"    />
+        <result property="spare"    column="spare"    />
+        <result property="spare1"    column="spare1"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectDragTableVo">
+        select t_id, dt_name, dt_nickname, table_key, sql_key, dt_table_name, dt_notes, dt_column_name, spare, spare1, del_flag, create_by, create_time, update_by, update_time from drag_table
+    </sql>
+
+    <select id="selectDragTableList" parameterType="com.ruoyi.system.entity.DragTable" resultMap="DragTableResult">
+        <include refid="selectDragTableVo"/>
+        <where>  
+            <if test="dtName != null  and dtName != ''"> and dt_name like concat('%', #{dtName}, '%')</if>
+            <if test="dtNickname != null  and dtNickname != ''"> and dt_nickname like concat('%', #{dtNickname}, '%')</if>
+            <if test="tableKey != null  and tableKey != ''"> and table_key = #{tableKey}</if>
+            <if test="sqlKey != null  and sqlKey != ''"> and sql_key = #{sqlKey}</if>
+            <if test="dtTableName != null  and dtTableName != ''"> and dt_table_name like concat('%', #{dtTableName}, '%')</if>
+            <if test="dtNotes != null  and dtNotes != ''"> and dt_notes = #{dtNotes}</if>
+            <if test="dtColumnName != null  and dtColumnName != ''"> and dt_column_name like concat('%', #{dtColumnName}, '%')</if>
+            <if test="spare != null  and spare != ''"> and spare = #{spare}</if>
+            <if test="spare1 != null  and spare1 != ''"> and spare1 = #{spare1}</if>
+        </where>
+    </select>
+    
+    <select id="selectDragTableByTId" parameterType="Long" resultMap="DragTableResult">
+        <include refid="selectDragTableVo"/>
+        where t_id = #{tId}
+    </select>
+        
+    <insert id="insertDragTable" parameterType="com.ruoyi.system.entity.DragTable" useGeneratedKeys="true" keyProperty="tId">
+        insert into drag_table
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="dtName != null">dt_name,</if>
+            <if test="dtNickname != null">dt_nickname,</if>
+            <if test="tableKey != null">table_key,</if>
+            <if test="sqlKey != null">sql_key,</if>
+            <if test="dtTableName != null">dt_table_name,</if>
+            <if test="dtNotes != null">dt_notes,</if>
+            <if test="dtColumnName != null">dt_column_name,</if>
+            <if test="spare != null">spare,</if>
+            <if test="spare1 != null">spare1,</if>
+            <if test="delFlag != null">del_flag,</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>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="dtName != null">#{dtName},</if>
+            <if test="dtNickname != null">#{dtNickname},</if>
+            <if test="tableKey != null">#{tableKey},</if>
+            <if test="sqlKey != null">#{sqlKey},</if>
+            <if test="dtTableName != null">#{dtTableName},</if>
+            <if test="dtNotes != null">#{dtNotes},</if>
+            <if test="dtColumnName != null">#{dtColumnName},</if>
+            <if test="spare != null">#{spare},</if>
+            <if test="spare1 != null">#{spare1},</if>
+            <if test="delFlag != null">#{delFlag},</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>
+         </trim>
+    </insert>
+
+    <update id="updateDragTable" parameterType="com.ruoyi.system.entity.DragTable">
+        update drag_table
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="dtName != null">dt_name = #{dtName},</if>
+            <if test="dtNickname != null">dt_nickname = #{dtNickname},</if>
+            <if test="tableKey != null">table_key = #{tableKey},</if>
+            <if test="sqlKey != null">sql_key = #{sqlKey},</if>
+            <if test="dtTableName != null">dt_table_name = #{dtTableName},</if>
+            <if test="dtNotes != null">dt_notes = #{dtNotes},</if>
+            <if test="dtColumnName != null">dt_column_name = #{dtColumnName},</if>
+            <if test="spare != null">spare = #{spare},</if>
+            <if test="spare1 != null">spare1 = #{spare1},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</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>
+        </trim>
+        where t_id = #{tId}
+    </update>
+
+    <delete id="deleteDragTableByTId" parameterType="Long">
+        delete from drag_table where t_id = #{tId}
+    </delete>
+
+    <delete id="deleteDragTableByTIds" parameterType="String">
+        delete from drag_table where t_id in 
+        <foreach item="tId" collection="array" open="(" separator="," close=")">
+            #{tId}
+        </foreach>
+    </delete>
+</mapper>