Ver Fonte

新增查询字段接口(过滤HR字段)

Administrator há 4 anos atrás
pai
commit
30a9c985c0

+ 13 - 0
boman-modules/boman-gen/src/main/java/com/boman/gen/controller/GenTableColumnController.java

@@ -6,15 +6,19 @@ import com.boman.common.core.utils.DateUtils;
 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.common.log.annotation.Log;
 import com.boman.common.log.enums.BusinessType;
 import com.boman.common.security.annotation.PreAuthorize;
+import com.boman.gen.domain.GenTable;
 import com.boman.gen.domain.GenTableColumn;
 import com.boman.gen.service.IGenTableColumnService;
 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
  * @Description gen_table_column
@@ -28,6 +32,15 @@ public class GenTableColumnController extends BaseController {
     private IGenTableColumnService genTableColumnService;
 
 
+    /**
+     * 查询代码生成列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo genTableColumnList(GenTableColumn genTableColumn) {
+        startPage();
+        List<GenTableColumn> list = genTableColumnService.selectGenTableColumnList(genTableColumn);
+        return getDataTable(list);
+    }
 
     /**
     * @Description 新增业务表字段

+ 7 - 0
boman-modules/boman-gen/src/main/java/com/boman/gen/mapper/GenTableColumnMapper.java

@@ -27,6 +27,13 @@ public interface GenTableColumnMapper
      */
     public List<GenTableColumn> selectGenTableColumnListByTableId(Long tableId);
 
+    /**
+     * 查询字段列表
+     * @param genTableColumn
+     * @return
+     */
+    public List<GenTableColumn> selectGenTableColumnList(GenTableColumn genTableColumn);
+
     /**
      * 根据gen_table_column的id查询字段对象
      * @param columnId

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

@@ -44,6 +44,11 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService {
         return genTableColumnMapper.selectGenTableColumnListByTableId(tableId);
     }
 
+    @Override
+    public List<GenTableColumn> selectGenTableColumnList(GenTableColumn genTableColumn) {
+        return genTableColumnMapper.selectGenTableColumnList(genTableColumn);
+    }
+
     /**
      * 根据gen_table_column的id查询字段对象
      *

+ 7 - 0
boman-modules/boman-gen/src/main/java/com/boman/gen/service/IGenTableColumnService.java

@@ -18,6 +18,13 @@ public interface IGenTableColumnService
      */
     public List<GenTableColumn> selectGenTableColumnListByTableId(Long tableId);
 
+    /**
+     * 查询字段列表
+     * @param genTableColumn
+     * @return
+     */
+    public List<GenTableColumn> selectGenTableColumnList(GenTableColumn genTableColumn);
+
     /**
      * 根据gen_table_column的id查询字段对象
      * @param columnId

+ 15 - 0
boman-modules/boman-gen/src/main/resources/mapper/generator/GenTableColumnMapper.xml

@@ -49,6 +49,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         order by sort
     </select>
 
+    <select id="selectGenTableColumnList" parameterType="GenTableColumn" resultMap="GenTableColumnResult">
+        <include refid="selectGenTableColumnVo"/>
+        <where>
+            <if test="tableId != null and tableId != ''">
+                AND table_id = #{tableId}
+            </if>
+            <if test="columnName != null and columnName != ''">
+                AND lower(column_name) like lower(concat('%', #{columnName}, '%'))
+            </if>
+            <if test="htmlType != null and htmlType != ''">
+                AND html_type = #{htmlType}
+            </if>
+        </where>
+    </select>
+
     <select id="selectGenTableColumnByColumnId" parameterType="GenTableColumn" resultMap="GenTableColumnResult">
         <include refid="selectGenTableColumnVo"/>
         where column_id = #{columnId}