소스 검색

Merge remote-tracking branch 'origin/master'

sunruiqi 2 년 전
부모
커밋
d8fa465b21

+ 11 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/typeDict/controller/ProgramTypeDictController.java

@@ -104,6 +104,17 @@ public class ProgramTypeDictController {
     }
 
     /**
+     * 查询全部一级项目类型
+     * @return
+     */
+    @ApiLog("查询全部一级项目类型")
+    @GetMapping("getList")
+    public ResponseEntity<List<ProgramTypeDictDTO>> getList() {
+        List<ProgramTypeDictDTO> list = programTypeDictService.getList();
+        return ResponseEntity.ok (list);
+    }
+
+    /**
      * 保存项目类型
      * @param programTypeDictDTO
      * @return

+ 4 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/typeDict/mapper/ProgramTypeDictMapper.java

@@ -10,6 +10,8 @@ import com.jeeplus.test.program.configuration.typeDict.service.dto.ProgramTypeDi
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
  * @Entity com.jeeplus.test.program.configuration.typeDict.domain.ProgramTypeDict
  */
@@ -19,6 +21,8 @@ public interface ProgramTypeDictMapper extends BaseMapper<ProgramTypeDict> {
     public IPage<ProgramTypeDictDTO> findList(Page<ProgramTypeDictDTO> page, @Param(Constants.WRAPPER) QueryWrapper<ProgramTypeDict> queryWrapper);
 
     public ProgramTypeDictDTO queryById(@Param("id") String id);
+
+    public List<ProgramTypeDictDTO> getList();
 }
 
 

+ 29 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/typeDict/mapper/xml/ProgramTypeDictMapper.xml

@@ -43,4 +43,33 @@
         from program_type_dict ptd
         where ptd.del_flag = '0' and ptd.id = ${id}
     </select>
+
+    <select id="getList" resultMap="Map">
+        select
+        <include refid="Base_Column_List"></include>
+        from program_type_dict ptd
+        where ptd.del_flag = '0' and ptd.parent_id = '0'
+    </select>
+
+    <resultMap id="Map" type="com.jeeplus.test.program.configuration.typeDict.service.dto.ProgramTypeDictDTO">
+        <id property="id" column="id" jdbcType="VARCHAR"/>
+        <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
+        <result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
+        <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
+        <result property="updateDate" column="update_date" jdbcType="TIMESTAMP"/>
+        <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
+        <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
+        <result property="type" column="type" jdbcType="VARCHAR"/>
+        <result property="parentId" column="parent_id" jdbcType="VARCHAR"/>
+        <result property="sort" column="sort" jdbcType="VARCHAR"/>
+        <collection property="childrenList" column="id" select="getChildList" ofType="com.jeeplus.test.program.configuration.typeDict.service.dto.ProgramTypeDictDTO"/>
+    </resultMap>
+
+    <select id="getChildList" resultType="com.jeeplus.test.program.configuration.typeDict.service.dto.ProgramTypeDictDTO">
+        select
+        <include refid="Base_Column_List"></include>
+        from program_type_dict ptd
+        where ptd.del_flag = '0' and ptd.parent_id = ${id}
+    </select>
+
 </mapper>

+ 5 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/typeDict/service/ProgramTypeDictService.java

@@ -61,6 +61,11 @@ public class ProgramTypeDictService extends ServiceImpl<ProgramTypeDictMapper, P
         return programTypeDictDTO;
     }
 
+    public List<ProgramTypeDictDTO> getList() {
+        List<ProgramTypeDictDTO> list = programTypeDictMapper.getList();
+        return list;
+    }
+
     public ResponseEntity saveType(ProgramTypeDictDTO programTypeDictDTO) {
         ProgramTypeDict programTypeDict = ProgramTypeDictWrapper.INSTANCE.toEntity(programTypeDictDTO);
         this.saveOrUpdate(programTypeDict);

+ 7 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/typeDict/service/dto/ProgramTypeDictDTO.java

@@ -6,6 +6,8 @@ import com.jeeplus.core.service.dto.BaseDTO;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.util.List;
+
 /**
  * 
  * @TableName program_type_dict
@@ -34,5 +36,10 @@ public class ProgramTypeDictDTO extends BaseDTO {
      */
     private String sort;
 
+    /**
+     * 子类型集合
+     */
+    List<ProgramTypeDictDTO> childrenList;
+
     private static final long serialVersionUID = 1L;
 }