Przeglądaj źródła

添加表gen_table_relation

Administrator 4 lat temu
rodzic
commit
2a382cfcc8

+ 3 - 8
boman-modules/boman-gen/pom.xml

@@ -75,18 +75,13 @@
     </dependencies>
 
     <build>
-        <finalName>${project.artifactId}</finalName>
         <plugins>
             <plugin>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>repackage</goal>
-                        </goals>
-                    </execution>
-                </executions>
+                <configuration>
+                    <classifier>execute</classifier>
+                </configuration>
             </plugin>
         </plugins>
     </build>

+ 77 - 0
boman-modules/boman-gen/src/main/java/com/boman/gen/controller/GenTableRelationController.java

@@ -0,0 +1,77 @@
+package com.boman.gen.controller;
+
+
+import com.boman.common.core.utils.SecurityUtils;
+import com.boman.common.core.web.controller.BaseController;
+import com.boman.common.core.web.domain.AjaxResult;
+import com.boman.common.core.web.page.TableDataInfo;
+import com.boman.gen.domain.GenTableRelation;
+import com.boman.gen.service.IGenTableRelationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**关联关系表
+ * @author tjf
+ * @Date: 2021/03/25/16:02
+ */
+@RequestMapping("/genTableRelation")
+@RestController
+public class GenTableRelationController extends BaseController {
+    @Autowired
+    private IGenTableRelationService genTableRelationService;
+
+
+    /**
+     * 查询关联关系表列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo genTableRelationList(GenTableRelation genTableRelation) {
+        startPage();
+        List<GenTableRelation> list = genTableRelationService.selectGenTableRelationList(genTableRelation);
+        return getDataTable(list);
+    }
+
+    /**
+     * 根据关联关系表编号获取详细信息
+     */
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable Long id)
+    {
+        return AjaxResult.success(genTableRelationService.selectGenTableRelationById(id));
+    }
+
+    /**
+     * 新增关联关系表
+     */
+    @PostMapping
+    public AjaxResult add(@Validated @RequestBody GenTableRelation genTableRelation)
+    {
+
+        genTableRelation.setCreateBy(SecurityUtils.getUsername());
+        return toAjax(genTableRelationService.insertGenTableRelation(genTableRelation));
+    }
+
+    /**
+     * 修改关联关系表
+     */
+    @PutMapping
+    public AjaxResult edit(@Validated @RequestBody GenTableRelation genTableRelation)
+    {
+
+        genTableRelation.setUpdateBy(SecurityUtils.getUsername());
+        return toAjax(genTableRelationService.updateGenTableRelation(genTableRelation));
+    }
+
+    /**
+     * 删除关联关系表
+     */
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(genTableRelationService.deleteGenTableRelation(ids));
+    }
+
+}

+ 101 - 0
boman-modules/boman-gen/src/main/java/com/boman/gen/domain/GenTableRelation.java

@@ -0,0 +1,101 @@
+package com.boman.gen.domain;
+
+import com.boman.common.core.web.domain.BaseEntity;
+
+/**
+ * @author tjf
+ * @Date: 2021/03/25/16:04
+ */
+public class GenTableRelation extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 描述(tap页显示的名称)
+     */
+    private String description;
+
+    /**
+     * 关联表(gen_table的id)
+     */
+    private Long relationParentId;
+
+    /**
+     * 字段(关联主表PK gen_table_column的id)
+     */
+    private Long relationChildId;
+
+    /**
+     *关联方式(1:1 1:N 取值字典表)
+     */
+    private Long relationType;
+
+    /**
+     * 是否删除(1是)
+     */
+    private String idDel;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public Long getRelationParentId() {
+        return relationParentId;
+    }
+
+    public void setRelationParentId(Long relationParentId) {
+        this.relationParentId = relationParentId;
+    }
+
+    public Long getRelationChildId() {
+        return relationChildId;
+    }
+
+    public void setRelationChildId(Long relationChildId) {
+        this.relationChildId = relationChildId;
+    }
+
+    public Long getRelationType() {
+        return relationType;
+    }
+
+    public void setRelationType(Long relationType) {
+        this.relationType = relationType;
+    }
+
+    public String getIdDel() {
+        return idDel;
+    }
+
+    public void setIdDel(String idDel) {
+        this.idDel = idDel;
+    }
+
+    @Override
+    public String toString() {
+        return "GenTableRelation{" +
+                "id=" + id +
+                ", description='" + description + '\'' +
+                ", relationParentId=" + relationParentId +
+                ", relationChildId=" + relationChildId +
+                ", relationType=" + relationType +
+                ", idDel='" + idDel + '\'' +
+                '}';
+    }
+}

+ 47 - 0
boman-modules/boman-gen/src/main/java/com/boman/gen/mapper/GenTableRelationMapper.java

@@ -0,0 +1,47 @@
+package com.boman.gen.mapper;
+
+import com.boman.gen.domain.GenTableRelation;
+
+import java.util.List;
+
+/**
+ * @author tjf
+ * @Date: 2021/03/25/16:13
+ */
+public interface GenTableRelationMapper {
+    /**
+     * 查询列表
+     * @param genTableRelation
+     * @return
+     */
+    List<GenTableRelation> selectGenTableRelationList (GenTableRelation genTableRelation);
+
+    /**
+     * 根据id查询详情
+     * @param id
+     * @return
+     */
+    GenTableRelation selectGenTableRelationById (Long id);
+
+
+    /**
+     * 插入
+     * @param genTableRelation
+     * @return
+     */
+    int insertGenTableRelation (GenTableRelation genTableRelation);
+
+    /**
+     * 修改
+     * @param genTableRelation
+     * @return
+     */
+    int updateGenTableRelation (GenTableRelation genTableRelation);
+
+    /**
+     * 删除
+     * @param ids
+     * @return
+     */
+    int deleteGenTableRelation (Long[] ids);
+}

+ 0 - 2
boman-modules/boman-gen/src/main/java/com/boman/gen/service/GenTableColumnServiceImpl.java

@@ -1,11 +1,9 @@
 package com.boman.gen.service;
 
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
 import com.boman.common.core.constant.UserConstants;
-import com.boman.common.core.utils.DateUtils;
 import com.boman.common.core.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;

+ 78 - 0
boman-modules/boman-gen/src/main/java/com/boman/gen/service/GenTableRelationServiceImpl.java

@@ -0,0 +1,78 @@
+package com.boman.gen.service;
+
+import com.boman.gen.domain.GenTableRelation;
+import com.boman.gen.mapper.GenTableRelationMapper;
+import org.checkerframework.checker.units.qual.A;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author tjf
+ * @Date: 2021/03/25/16:14
+ */
+@Service
+public class GenTableRelationServiceImpl implements IGenTableRelationService {
+
+    @Autowired
+    private GenTableRelationMapper genTableRelationMapper;
+
+    /**
+     * 查询列表
+     *
+     * @param genTableRelation
+     * @return
+     */
+    @Override
+    public List<GenTableRelation> selectGenTableRelationList(GenTableRelation genTableRelation) {
+        List<GenTableRelation> genTableRelations = genTableRelationMapper.selectGenTableRelationList(genTableRelation);
+        return genTableRelations;
+    }
+
+    /**
+     * 根据id查询详情
+     *
+     * @param id
+     * @return
+     */
+    @Override
+    public GenTableRelation selectGenTableRelationById(Long id) {
+        GenTableRelation genTableRelation = genTableRelationMapper.selectGenTableRelationById(id);
+        return genTableRelation;
+    }
+
+    /**
+     * 新增
+     *
+     * @param genTableRelation
+     * @return
+     */
+    @Override
+    public int insertGenTableRelation(GenTableRelation genTableRelation) {
+        return genTableRelationMapper.insertGenTableRelation(genTableRelation);
+    }
+
+    /**
+     * 修改
+     *
+     * @param genTableRelation
+     * @return
+     */
+    @Override
+    public int updateGenTableRelation(GenTableRelation genTableRelation) {
+        genTableRelationMapper.updateGenTableRelation(genTableRelation);
+        return 0;
+    }
+
+    /**
+     * 删除
+     *
+     * @param ids
+     * @return
+     */
+    @Override
+    public int deleteGenTableRelation(Long[] ids) {
+        return genTableRelationMapper.deleteGenTableRelation(ids);
+    }
+}

+ 49 - 0
boman-modules/boman-gen/src/main/java/com/boman/gen/service/IGenTableRelationService.java

@@ -0,0 +1,49 @@
+package com.boman.gen.service;
+
+import com.boman.gen.domain.GenTableRelation;
+
+import java.util.List;
+
+/**
+ * @author tjf
+ * @Date: 2021/03/25/16:14
+ */
+public interface IGenTableRelationService {
+
+    /**
+     * 查询列表
+     * @param genTableRelation
+     * @return
+     */
+    public List<GenTableRelation> selectGenTableRelationList(GenTableRelation genTableRelation);
+
+    /**
+     * 根据id查询
+     * @param id
+     * @return
+     */
+    public GenTableRelation selectGenTableRelationById(Long id);
+
+
+    /**
+     * 新增
+     * @param genTableRelation
+     * @return
+     */
+    public int insertGenTableRelation(GenTableRelation genTableRelation);
+
+    /**
+     * 修改
+     * @param genTableRelation
+     * @return
+     */
+    public int updateGenTableRelation(GenTableRelation genTableRelation);
+
+    /**
+     * 删除
+     * @param ids
+     * @return
+     */
+    public int deleteGenTableRelation(Long[] ids);
+
+}

+ 94 - 0
boman-modules/boman-gen/src/main/resources/mapper/generator/GenTableRelationMapper.xml

@@ -0,0 +1,94 @@
+<?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.boman.gen.mapper.GenTableRelationMapper">
+
+	<resultMap type="GenTableRelation" id="GenTableRelationResult">
+		<result property="id"     column="id"      />
+		<result property="description"     column="description"      />
+		<result property="relationParentId"     column="relation_parent_id"      />
+		<result property="relationChildId"     column="relation_child_id"      />
+		<result property="relationType"     column="relation_type"      />
+	</resultMap>
+
+	<sql id="selectGenTableRelationVo">
+        select id, description, relation_parent_id, relation_child_id, relation_type, create_by, create_time, update_by, update_time
+		from gen_table_relation
+    </sql>
+
+	<select id="selectGenTableRelationList" parameterType="GenTableRelation" resultMap="GenTableRelationResult">
+		<include refid="selectGenTableRelationVo"/>
+		<where>
+			<if test="description != null and description != ''">
+				AND description like concat('%', #{description}, '%')
+			</if>
+			<if test="relationParentId != null">
+				AND relation_parent_id = #{relationParentId}
+			</if>
+			<if test="relationChildId != null ">
+				AND relation_child_id = #{relationChildId}
+			</if>
+			<if test="relationType != null ">
+				AND relation_type = #{relationType}
+			</if>
+			<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
+				and date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
+			</if>
+			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
+				and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
+			</if>
+		</where>
+	</select>
+
+
+	<select id="selectGenTableRelationById" parameterType="GenTableRelation" resultMap="GenTableRelationResult">
+		<include refid="selectGenTableRelationVo"/>
+		where id = #{id}
+	</select>
+
+	<insert id="insertGenTableRelation" parameterType="GenTableRelation">
+		insert into gen_table_relation (
+		<if test="description != null and description != '' ">description,</if>
+		<if test="relationParentId != null">relation_parent_id,</if>
+		<if test="relationChildId != null">relation_child_id,</if>
+		<if test="relationType != null">relation_type,</if>
+		<if test="createBy != null and createBy != ''">create_by,</if>
+		<if test="updateBy != null and updateBy != ''">update_by,</if>
+		<if test="updateTime != null and updateTime != ''">update_time,</if>
+		create_time
+		)values(
+		<if test="description != null and description != ''">#{description},</if>
+		<if test="relationParentId != null">#{relationParentId},</if>
+		<if test="relationChildId != null">#{relationChildId},</if>
+		<if test="relationType != null">#{relationType},</if>
+		<if test="createBy != null and createBy != ''">#{createBy},</if>
+		<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
+		<if test="updateTime != null and updateTime != ''">#{updateTime},</if>
+		sysdate()
+		)
+	</insert>
+
+	<update id="updateGenTableRelation" parameterType="GenTableRelation">
+		update gen_table_relation
+		<set>
+			<if test="description != null and description != ''">description = #{description},</if>
+			<if test="relationParentId != null">relation_parent_id = #{relationParentId},</if>
+			<if test="relationChildId != null">relation_child_id = #{relationChildId},</if>
+			<if test="relationType != null">relation_type = #{relationType},</if>
+			<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
+			<if test="create_time != null">create_time = #{createTime},</if>
+			<if test="updateBy != null and updateBy != null">update_by = #{updateBy},</if>
+			update_time = sysdate()
+		</set>
+		where id = #{id}
+	</update>
+
+	<update id="deleteGenTableRelation" parameterType="GenTableRelation">
+		update gen_table_relation
+		set is_del = '1' where id in
+		<foreach item="ids" collection="array" open="(" separator="," close=")">
+			#{ids}
+		</foreach>
+	</update>
+</mapper> 

+ 0 - 0
boman-modules/boman-job/src/main/resources/mapper/job/SysJobMapper.xml → boman-modules/boman-job/src/main/resources/mapper/job/GenTableRelationMapper.xml


+ 2 - 0
boman-modules/boman-system/src/main/java/com/boman/system/common/MainTableRecord.java

@@ -1,6 +1,8 @@
 package com.boman.system.common;
 
 import com.alibaba.fastjson.JSONObject;
+
+
 import com.boman.gen.domain.GenTable;
 import com.google.common.collect.Maps;
 import lombok.Data;

+ 4 - 4
boman-modules/boman-system/src/main/java/com/boman/system/common/StoredProcedureService.java

@@ -18,17 +18,17 @@ import java.util.Map;
 @Slf4j
 public class StoredProcedureService {
 
-    @Autowired
+/*    @Autowired
     private StoredProcedureMapper storedProcedureMapper;
 
-    /**
+    *//**
      * 增删改提交 统一存储过程
      *
      * @param state      是否启用存储过程
      * @param storedName 存储过程名
      * @param pId        对象ID
      * @param tableName  表名
-     */
+     *//*
     @Transactional(rollbackFor = Exception.class)
     public void storedProcedure(String state, String storedName, Long pId, Long pIsAdd, String tableName) {
         if (StringUtils.isNotBlank(state)) {
@@ -66,7 +66,7 @@ public class StoredProcedureService {
                 }
             }
         }
-    }
+    }*/
 
     /**
      * 页面调用存储过程

+ 2 - 0
boman-modules/boman-system/src/main/java/com/boman/system/mapper/SysConfigMapper.java

@@ -3,12 +3,14 @@ package com.boman.system.mapper;
 import java.util.List;
 
 import com.boman.system.domain.SysConfig;
+import org.apache.ibatis.annotations.Mapper;
 
 /**
  * 参数配置 数据层
  * 
  * @author ruoyi
  */
+@Mapper
 public interface SysConfigMapper
 {
     /**

+ 16 - 0
boman-modules/boman-system/src/main/resources/rebel.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
+  Refer to https://manuals.jrebel.com/jrebel/standalone/config.html for more information.
+-->
+<application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_3.xsd">
+
+	<id>boman-modules-system</id>
+
+	<classpath>
+		<dir name="E:/boman-framwork/boman-modules/boman-system/target/classes">
+		</dir>
+	</classpath>
+
+</application>