Browse Source

增加创建者id跟更改者id

侯茂昌 1 năm trước cách đây
mục cha
commit
2c67ef35fd

+ 106 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/dragForm/DragTableGroupController.java

@@ -0,0 +1,106 @@
+package com.ruoyi.web.controller.dragForm;
+
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.entity.DragTableGroup;
+import com.ruoyi.system.service.IDragTableGroupService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * @author hmc
+ * @date 2023-11-01 14:29
+ * @Description:
+ */
+@RestController
+@RequestMapping("/system/group")
+@Api(value = "/system/group", description = "拖拽格组-接口")
+public class DragTableGroupController extends BaseController {
+
+    @Autowired
+    private IDragTableGroupService dragTableGroupService;
+
+    /**
+     * 查询拖拽格组列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:group:list')")
+    @GetMapping("/list")
+    @ApiOperation(value = "查询拖拽格组列表")
+    public TableDataInfo list(DragTableGroup dragTableGroup)
+    {
+        startPage();
+        List<DragTableGroup> list = dragTableGroupService.selectDragTableGroupList(dragTableGroup);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出拖拽格组列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:group:export')")
+    @Log(title = "拖拽格组", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    @ApiOperation(value = "导出拖拽格组列表")
+    public void export(HttpServletResponse response, DragTableGroup dragTableGroup)
+    {
+        List<DragTableGroup> list = dragTableGroupService.selectDragTableGroupList(dragTableGroup);
+        ExcelUtil<DragTableGroup> util = new ExcelUtil<DragTableGroup>(DragTableGroup.class);
+        util.exportExcel(response, list, "拖拽格组数据");
+    }
+
+    /**
+     * 获取拖拽格组详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:group:query')")
+    @GetMapping(value = "/{id}")
+    @ApiOperation(value = "获取拖拽格组详细信息")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(dragTableGroupService.selectDragTableGroupById(id));
+    }
+
+    /**
+     * 新增拖拽格组
+     */
+    @PreAuthorize("@ss.hasPermi('system:group:add')")
+    @Log(title = "拖拽格组", businessType = BusinessType.INSERT)
+    @PostMapping
+    @ApiOperation(value = "新增拖拽格组")
+    public AjaxResult add(@RequestBody DragTableGroup dragTableGroup)
+    {
+        return toAjax(dragTableGroupService.insertDragTableGroup(dragTableGroup));
+    }
+
+    /**
+     * 修改拖拽格组
+     */
+    @PreAuthorize("@ss.hasPermi('system:group:edit')")
+    @Log(title = "拖拽格组", businessType = BusinessType.UPDATE)
+    @PutMapping
+    @ApiOperation(value = "修改拖拽格组")
+    public AjaxResult edit(@RequestBody DragTableGroup dragTableGroup)
+    {
+        return toAjax(dragTableGroupService.updateDragTableGroup(dragTableGroup));
+    }
+
+    /**
+     * 删除拖拽格组
+     */
+    @PreAuthorize("@ss.hasPermi('system:group:remove')")
+    @Log(title = "拖拽格组", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    @ApiOperation(value = "删除拖拽格组")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(dragTableGroupService.deleteDragTableGroupByIds(ids));
+    }
+}

+ 22 - 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java

@@ -21,9 +21,31 @@ public class BaseEntity implements Serializable
     @JsonIgnore
     private String searchValue;
 
+    /** 创建者Id*/
+    private Long createById;
+
+    /** 修改者Id*/
+    private Long updateById;
+
+    public Long getUpdateById() {
+        return updateById;
+    }
+
+    public void setUpdateById(Long updateById) {
+        this.updateById = updateById;
+    }
+
     /** 创建者 */
     private String createBy;
 
+    public Long getCreateById() {
+        return createById;
+    }
+
+    public void setCreateById(Long createById) {
+        this.createById = createById;
+    }
+
     /** 创建时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date createTime;

+ 81 - 0
ruoyi-system/src/main/java/com/ruoyi/system/entity/DragTableGroup.java

@@ -0,0 +1,81 @@
+package com.ruoyi.system.entity;
+
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * @author hmc
+ * @date 2023-11-01 14:19
+ * @Description: 拖拽格组对象 drag_table_group
+ */
+public class DragTableGroup extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    private Long id;
+
+    /** 表格组名称 */
+    @Excel(name = "表格组名称")
+    private String groupName;
+
+    /** 表格组描述 */
+    @Excel(name = "表格组描述")
+    private String groupDescription;
+
+    /** 存放表格联动信息 */
+    @Excel(name = "存放表格联动信息")
+    private String groupTableInfo;
+
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public String getGroupName() {
+        return groupName;
+    }
+
+    public void setGroupName(String groupName) {
+        this.groupName = groupName;
+    }
+
+    public String getGroupDescription() {
+        return groupDescription;
+    }
+
+    public void setGroupDescription(String groupDescription) {
+        this.groupDescription = groupDescription;
+    }
+
+    public String getGroupTableInfo() {
+        return groupTableInfo;
+    }
+
+    public void setGroupTableInfo(String groupTableInfo) {
+        this.groupTableInfo = groupTableInfo;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("groupName", getGroupName())
+                .append("groupDescription", getGroupDescription())
+                .append("groupTableInfo", getGroupTableInfo())
+                .append("createById", getCreateById())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateById", getUpdateById())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .toString();
+    }
+}

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

@@ -0,0 +1,61 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.system.entity.DragTableGroup;
+
+import java.util.List;
+
+/**
+ * @author hmc
+ * @date 2023-11-01 14:24
+ * @Description:
+ */
+public interface DragTableGroupMapper {
+
+    /**
+     * 查询拖拽格组
+     *
+     * @param id 拖拽格组主键
+     * @return 拖拽格组
+     */
+    public DragTableGroup selectDragTableGroupById(Long id);
+
+    /**
+     * 查询拖拽格组列表
+     *
+     * @param dragTableGroup 拖拽格组
+     * @return 拖拽格组集合
+     */
+    public List<DragTableGroup> selectDragTableGroupList(DragTableGroup dragTableGroup);
+
+    /**
+     * 新增拖拽格组
+     *
+     * @param dragTableGroup 拖拽格组
+     * @return 结果
+     */
+    public int insertDragTableGroup(DragTableGroup dragTableGroup);
+
+    /**
+     * 修改拖拽格组
+     *
+     * @param dragTableGroup 拖拽格组
+     * @return 结果
+     */
+    public int updateDragTableGroup(DragTableGroup dragTableGroup);
+
+    /**
+     * 删除拖拽格组
+     *
+     * @param id 拖拽格组主键
+     * @return 结果
+     */
+    public int deleteDragTableGroupById(Long id);
+
+    /**
+     * 批量删除拖拽格组
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteDragTableGroupByIds(Long[] ids);
+}

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

@@ -0,0 +1,61 @@
+package com.ruoyi.system.service;
+
+import com.ruoyi.system.entity.DragTableGroup;
+
+import java.util.List;
+
+/**
+ * @author hmc
+ * @date 2023-11-01 14:26
+ * @Description:
+ */
+public interface IDragTableGroupService {
+
+    /**
+     * 查询拖拽格组
+     *
+     * @param id 拖拽格组主键
+     * @return 拖拽格组
+     */
+    public DragTableGroup selectDragTableGroupById(Long id);
+
+    /**
+     * 查询拖拽格组列表
+     *
+     * @param dragTableGroup 拖拽格组
+     * @return 拖拽格组集合
+     */
+    public List<DragTableGroup> selectDragTableGroupList(DragTableGroup dragTableGroup);
+
+    /**
+     * 新增拖拽格组
+     *
+     * @param dragTableGroup 拖拽格组
+     * @return 结果
+     */
+    public int insertDragTableGroup(DragTableGroup dragTableGroup);
+
+    /**
+     * 修改拖拽格组
+     *
+     * @param dragTableGroup 拖拽格组
+     * @return 结果
+     */
+    public int updateDragTableGroup(DragTableGroup dragTableGroup);
+
+    /**
+     * 批量删除拖拽格组
+     *
+     * @param ids 需要删除的拖拽格组主键集合
+     * @return 结果
+     */
+    public int deleteDragTableGroupByIds(Long[] ids);
+
+    /**
+     * 删除拖拽格组信息
+     *
+     * @param id 拖拽格组主键
+     * @return 结果
+     */
+    public int deleteDragTableGroupById(Long id);
+}

+ 3 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CommonServiceImpl.java

@@ -48,6 +48,7 @@ public class CommonServiceImpl implements ICommonService {
         list.forEach(item -> {  // 批量导入数据给导入数据增加默认值
             item.put("create_time", DateUtils.getTime());
             item.put("create_by", SecurityUtils.getUsername());
+            item.put("create_by_id", String.valueOf(SecurityUtils.getUserId()));
             item.put("del_flag", "0");
         });
         List<Map<String, Object>> mapList = new ArrayList<>();
@@ -97,7 +98,9 @@ public class CommonServiceImpl implements ICommonService {
             endfields.put(toUnderScoreCase(item), fields.get(item));
         });
         endfields.put("update_by", SecurityUtils.getUsername());
+        endfields.put("update_by_id", SecurityUtils.getUserId());
         endfields.put("update_time", DateUtils.getTime());
+
         return commonMapper.edit(endfields, tableName, conditions);
     }
 

+ 3 - 2
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DragFormServiceImpl.java

@@ -4,6 +4,7 @@ import com.ruoyi.common.config.RuoYiConfig;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.utils.DateUtils;
 
+import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.system.entity.DragForm;
 import com.ruoyi.system.entity.DragTableForm;
@@ -76,7 +77,7 @@ public class DragFormServiceImpl implements IDragFormService {
         // 使用租户名 加uuid 定义表单文件名称
         dragForm.setDfFliePath(fileName);
         dragForm.setCreateTime(DateUtils.getNowDate());
-
+        dragForm.setCreateById(SecurityUtils.getUserId());
         //校验dtId是否唯一
         if (dragTableFormMapper.selectDtIdCount(dragForm.getDtId()) > 0) {
             return AjaxResult.warn("该表格已绑定表单!");
@@ -84,7 +85,6 @@ public class DragFormServiceImpl implements IDragFormService {
         //新增表单
         dragFormMapper.insertDragForm(dragForm);
 
-
         //新增关联表
         DragTableForm dragTableForm = new DragTableForm();
         dragTableForm.setDfId(dragForm.getfId());
@@ -104,6 +104,7 @@ public class DragFormServiceImpl implements IDragFormService {
         // 修改的时候删除表单源文件后重新创建
         delFileForm(dragForm.getfId());
         dragForm.setUpdateTime(DateUtils.getNowDate());
+        dragForm.setUpdateById(SecurityUtils.getUserId());
         return dragFormMapper.updateDragForm(dragForm);
     }
 

+ 97 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DragTableGroupServiceImpl.java

@@ -0,0 +1,97 @@
+package com.ruoyi.system.service.impl;
+
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.system.entity.DragTableGroup;
+import com.ruoyi.system.mapper.DragTableGroupMapper;
+import com.ruoyi.system.service.IDragTableGroupService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author hmc
+ * @date 2023-11-01 14:27
+ * @Description:
+ */
+
+@Service
+public class DragTableGroupServiceImpl implements IDragTableGroupService {
+
+    @Autowired
+    private DragTableGroupMapper dragTableGroupMapper;
+
+    /**
+     * 查询拖拽格组
+     *
+     * @param id 拖拽格组主键
+     * @return 拖拽格组
+     */
+    @Override
+    public DragTableGroup selectDragTableGroupById(Long id)
+    {
+        return dragTableGroupMapper.selectDragTableGroupById(id);
+    }
+
+    /**
+     * 查询拖拽格组列表
+     *
+     * @param dragTableGroup 拖拽格组
+     * @return 拖拽格组
+     */
+    @Override
+    public List<DragTableGroup> selectDragTableGroupList(DragTableGroup dragTableGroup)
+    {
+        return dragTableGroupMapper.selectDragTableGroupList(dragTableGroup);
+    }
+
+    /**
+     * 新增拖拽格组
+     *
+     * @param dragTableGroup 拖拽格组
+     * @return 结果
+     */
+    @Override
+    public int insertDragTableGroup(DragTableGroup dragTableGroup)
+    {
+        dragTableGroup.setCreateTime(DateUtils.getNowDate());
+        return dragTableGroupMapper.insertDragTableGroup(dragTableGroup);
+    }
+
+    /**
+     * 修改拖拽格组
+     *
+     * @param dragTableGroup 拖拽格组
+     * @return 结果
+     */
+    @Override
+    public int updateDragTableGroup(DragTableGroup dragTableGroup)
+    {
+        dragTableGroup.setUpdateTime(DateUtils.getNowDate());
+        return dragTableGroupMapper.updateDragTableGroup(dragTableGroup);
+    }
+
+    /**
+     * 批量删除拖拽格组
+     *
+     * @param ids 需要删除的拖拽格组主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDragTableGroupByIds(Long[] ids)
+    {
+        return dragTableGroupMapper.deleteDragTableGroupByIds(ids);
+    }
+
+    /**
+     * 删除拖拽格组信息
+     *
+     * @param id 拖拽格组主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDragTableGroupById(Long id)
+    {
+        return dragTableGroupMapper.deleteDragTableGroupById(id);
+    }
+}

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

@@ -84,6 +84,7 @@ public class DragTableServiceImpl implements IDragTableService {
     @Override
     public int insertDragTable(DragTable dragTable) {
         dragTable.setCreateTime(DateUtils.getNowDate());
+        dragTable.setCreateById(SecurityUtils.getUserId());
         return dragTableMapper.insertDragTable(dragTable);
     }
 
@@ -165,10 +166,13 @@ public class DragTableServiceImpl implements IDragTableService {
         dragTable.setDtColumnName(JSON.toJSONString(dragTableVo.getDtColumnName()));
         dragTable.setPrimaryKey(dragTableVo.getPrimaryKey());
         dragTable.setMenuId(dragTableVo.getMenuId());
+        dragTable.setCreateTime(DateUtils.getNowDate());
+        dragTable.setCreateById(SecurityUtils.getUserId());
         //add table_sql
         TableSql tableSql = new TableSql();
         tableSql.setTableSql(dragTableVo.getTableSql());
         tableSql.setCreateTime(DateUtils.getNowDate());
+        tableSql.setCreateById(SecurityUtils.getUserId());
         dragTableMapper.insertDragTable(dragTable);
         // 拼接sql查询条件
         switch (SecurityUtils.getDatabaseType().toUpperCase()) {
@@ -209,6 +213,9 @@ public class DragTableServiceImpl implements IDragTableService {
             dragTableVo.getSearchFieldList().forEach(item -> {
                 dragTableConditionList.add(new DragTableCondition(dragTable.gettId(), item));
             });
+            dragTableConditionList.forEach(e->{
+                e.setCreateById(SecurityUtils.getUserId());
+            });
             dragTableConditionMapper.insertDragTableConditionByList(dragTableConditionList);
         }
     }
@@ -232,12 +239,14 @@ public class DragTableServiceImpl implements IDragTableService {
         DragTable dragTable = new DragTable();
         BeanUtils.copyProperties(dragTableVo, dragTable);
         dragTable.setDtColumnName(JSON.toJSONString(dragTableVo.getDtColumnName()));
+        dragTable.setUpdateById(SecurityUtils.getUserId());
         dragTableMapper.updateDragTable(dragTable);
 
         //update table_sql
         TableSql tableSql = new TableSql();
         tableSql.setTableSql(dragTableVo.getTableSql());
-
+        //tableSql.setUpdateBy(dragTableVo.getTableSql());
+        tableSql.setUpdateById(SecurityUtils.getUserId());
         // 拼接sql查询条件
         switch (SecurityUtils.getDatabaseType().toUpperCase()) {
             case "MYSQL":
@@ -280,6 +289,9 @@ public class DragTableServiceImpl implements IDragTableService {
             dragTableVo.getSearchFieldList().forEach(item -> {
                 dragTableConditionList.add(new DragTableCondition(dragTableVo.gettId(), item));
             });
+            dragTableConditionList.forEach(e->{
+                e.setUpdateById(SecurityUtils.getUserId());
+            });
             dragTableConditionMapper.insertDragTableConditionByList(dragTableConditionList);
         }
     }

+ 3 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TableSqlServiceImpl.java

@@ -3,6 +3,7 @@ package com.ruoyi.system.service.impl;
 import java.util.List;
 
 import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.system.entity.TableSql;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -56,6 +57,7 @@ public class TableSqlServiceImpl implements ITableSqlService {
     @Override
     public int insertTableSql(TableSql tableSql) {
         tableSql.setCreateTime(DateUtils.getNowDate());
+        tableSql.setCreateById(SecurityUtils.getUserId());
         return tableSqlMapper.insertTableSql(tableSql);
     }
 
@@ -68,6 +70,7 @@ public class TableSqlServiceImpl implements ITableSqlService {
     @Override
     public int updateTableSql(TableSql tableSql) {
         tableSql.setUpdateTime(DateUtils.getNowDate());
+        tableSql.setUpdateById(SecurityUtils.getUserId());
         return tableSqlMapper.updateTableSql(tableSql);
     }
 

+ 5 - 0
ruoyi-system/src/main/resources/mapper/common/TableSqlMapper.xml

@@ -67,6 +67,7 @@
             <if test="tableAlias != null">table_alias,</if>
             <if test="sqlKey != null">sql_key,</if>
             <if test="tableExportField != null">table_export_field,</if>
+            <if test="createById != null">create_by_id,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateBy != null">update_by,</if>
@@ -81,6 +82,7 @@
             <if test="tableAlias != null">#{tableAlias},</if>
             <if test="sqlKey != null">#{sqlKey},</if>
             <if test="tableExportField != null">#{tableExportField},</if>
+            <if test="createById != null">#{createById},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
@@ -108,8 +110,10 @@
             <if test="tableAlias != null">table_alias = #{tableAlias},</if>
             <if test="sqlKey != null">sql_key = #{sqlKey},</if>
             <if test="tableExportField != null">table_export_field = #{tableExportField},</if>
+            <if test="createById != null">create_by_id = #{createById},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateById != null">update_by_id = #{updateById},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="delFlag != null">del_flag = #{delFlag},</if>
@@ -141,6 +145,7 @@
             <if test="tableExportField != null">table_export_field = #{tableExportField},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateById != null">update_by_id = #{updateById},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="delFlag != null">del_flag = #{delFlag},</if>

+ 3 - 0
ruoyi-system/src/main/resources/mapper/dragmapper/DragFormMapper.xml

@@ -96,6 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="dfNotes != null">df_notes,</if>
             <if test="delFlag != null">del_flag,</if>
             <if test="createTime != null">create_time,</if>
+            <if test="createById != null">create_by_id,</if>
             <if test="createBy != null">create_by,</if>
             <if test="updateBy != null">update_by,</if>
             <if test="updateTime != null">update_time,</if>
@@ -116,6 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="dfNotes != null">#{dfNotes},</if>
             <if test="delFlag != null">#{delFlag},</if>
             <if test="createTime != null">#{createTime},</if>
+            <if test="createById != null">#{createById},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateTime != null">#{updateTime},</if>
@@ -141,6 +143,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <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="updateById != null">update_by_id = #{updateById},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="spare != null">spare = #{spare},</if>

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

@@ -64,10 +64,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <insert id="insertDragTableConditionByList"  parameterType="java.util.List">
         insert into drag_table_condition
-        (t_id,condition_field)
+        (t_id,condition_field,create_by_id)
         values
         <foreach collection="list" item="item" index="index" separator=",">
-            (#{item.tId},#{item.conditionField})
+            (#{item.tId},#{item.conditionField},#{item.createById})
         </foreach>
     </insert>
 

+ 95 - 0
ruoyi-system/src/main/resources/mapper/dragmapper/DragTableGroupMapper.xml

@@ -0,0 +1,95 @@
+<?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.DragTableGroupMapper">
+
+    <resultMap type="com.ruoyi.system.entity.DragTableGroup" id="DragTableGroupResult">
+        <result property="id"    column="id"    />
+        <result property="groupName"    column="group_name"    />
+        <result property="groupDescription"    column="group_description"    />
+        <result property="groupTableInfo"    column="group_table_info"    />
+        <result property="createById"    column="create_by_id"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateById"    column="update_by_id"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectDragTableGroupVo">
+        select id, group_name, group_description, group_table_info, create_by_id, create_by, create_time, update_by_id, update_by, update_time from drag_table_group
+    </sql>
+
+    <select id="selectDragTableGroupList" parameterType="com.ruoyi.system.entity.DragTableGroup" resultMap="DragTableGroupResult">
+        <include refid="selectDragTableGroupVo"/>
+        <where>
+            <if test="groupName != null  and groupName != ''"> and group_name like concat('%', #{groupName}, '%')</if>
+            <if test="groupDescription != null  and groupDescription != ''"> and group_description = #{groupDescription}</if>
+            <if test="groupTableInfo != null  and groupTableInfo != ''"> and group_table_info = #{groupTableInfo}</if>
+            <if test="createById != null  and createById != ''"> and create_by_id = #{createById}</if>
+            <if test="updateById != null  and updateById != ''"> and update_by_id = #{updateById}</if>
+        </where>
+    </select>
+
+    <select id="selectDragTableGroupById" parameterType="Long" resultMap="DragTableGroupResult">
+        <include refid="selectDragTableGroupVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertDragTableGroup" parameterType="com.ruoyi.system.entity.DragTableGroup">
+        insert into drag_table_group
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="groupName != null">group_name,</if>
+            <if test="groupDescription != null">group_description,</if>
+            <if test="groupTableInfo != null">group_table_info,</if>
+            <if test="createById != null">create_by_id,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateById != null">update_by_id,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="groupName != null">#{groupName},</if>
+            <if test="groupDescription != null">#{groupDescription},</if>
+            <if test="groupTableInfo != null">#{groupTableInfo},</if>
+            <if test="createById != null">#{createById},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateById != null">#{updateById},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+        </trim>
+    </insert>
+
+    <update id="updateDragTableGroup" parameterType="com.ruoyi.system.entity.DragTableGroup">
+        update drag_table_group
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="groupName != null">group_name = #{groupName},</if>
+            <if test="groupDescription != null">group_description = #{groupDescription},</if>
+            <if test="groupTableInfo != null">group_table_info = #{groupTableInfo},</if>
+            <if test="createById != null">create_by_id = #{createById},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateById != null">update_by_id = #{updateById},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteDragTableGroupById" parameterType="Long">
+        delete from drag_table_group where id = #{id}
+    </delete>
+
+    <delete id="deleteDragTableGroupByIds" parameterType="String">
+        delete from drag_table_group where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+</mapper>

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

@@ -93,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="echoData != null">echo_data,</if>
             <if test="menuId != null">menu_id,</if>
             <if test="primaryKey != null">primary_key,</if>
+            <if test="createById != null">create_by_id,</if>
             <if test="createTime != null">create_time,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -112,6 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="echoData != null">#{echoData},</if>
             <if test="menuId != null">#{menuId},</if>
             <if test="primaryKey != null">#{primaryKey},</if>
+            <if test="createById != null">#{createById},</if>
             <if test="createTime != null">#{createTime},</if>
          </trim>
     </insert>
@@ -132,6 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <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="createById != null">create_by_id = #{createById},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="isSelection != null">is_selection = #{isSelection},</if>