Java程序递归及mybatis递归查询

之前项目组有个需求,定时同步机构的信息。已知三方接口由于返回数据量很大,所以最后需要三方提供一个可根据机构编号获取当前机构及子机构信息的接口。而不是一次性返回全部机构信息!

由于这次需求也用到了递归,所以记录下!

Java程序递归查询

pom.xml文件

<dependency>
	<groupId>com.alibaba</groupId>
	<artifactId>fastjson</artifactId>
	<version>1.2.73</version>
</dependency>

数据库 

organization机构表

表结构sql

DROP TABLE IF EXISTS `organization`;
CREATE TABLE `organization`  (
  `id` int(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `org_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '机构编号',
  `org_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '机构名称',
  `parent_id` int(20) NULL DEFAULT NULL COMMENT '父级机构id',
  `parent_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '父级机构编码',
  `parent_all_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '所有父级code',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 50 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic;

organization_record 机构记录表

将机构表数据及原始三方接口数据以子节点形式存储到记录表中

CREATE TABLE `organization_record`  (
  `id` int(4) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `organization_info` mediumtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '机构数据的json串存储',
  `organization_source_info` mediumtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '原始机构数据的json串存储',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 18 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

机构实体类 Organization

package com.example.demo.entity;

import lombok.Data;
import java.io.Serializable;
import java.util.List;

@Data
public class Organization  implements Serializable {

    private   int id;
    //机构编号
    private  String orgCode;
    //机构名称
    private  String orgName;
    //父级id
    private  int parentId;
    //父级机构编号
    private  String parentCode;
    //所有父级code
    private  String parentAllCode;

    private List<Organization> children;
}

mapper

机构mapper

package com.example.demo.mapper;

import com.example.demo.entity.Organization;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface OrganizationMapper {

    //添加组织机构
    int insertOrganization(Organization organization);

    //根据组织编号查询信息
    Organization queryOrganizationByCode(String code);

    //修改组织机构信息
    int updateOrganization(Organization organization);

    //根据code查询对应的组织机构
    List<Organization> queryOrganizationByParentId(@Param("parentId") String parentId);
}

 机构记录mapper

package com.example.demo.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface OrganizationRecordMapper {

    //添加
    void  insertOrganizationRecord(@Param("organizationInfo") String organizationInfo,
                                   @Param("organizationSourceInfo") String organizationSourceInfo);

}

SQL

机构sql

<?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.example.demo.mapper.OrganizationMapper">

    <resultMap id="organizationMap" type="com.example.demo.entity.Organization">
        <result property="id" column="id"/>
        <result property="orgCode" column="org_code"/>
        <result property="orgName" column="org_name"/>
        <result property="parentId" column="parent_id"/>
        <result property="parentCode" column="parent_code"/>
        <result property="parentAllCode" column="parent_all_code"/>
    </resultMap>

    <!--新增-->
    <insert id="insertOrganization" parameterType="com.example.demo.entity.Organization">
       INSERT INTO organization (org_code,org_name,parent_id,parent_code,parent_all_code)
       VALUE (#{orgCode},#{orgName},#{parentId},#{parentCode},#{parentAllCode})
    </insert>

    <!--根据code查询对应的组织机构-->
    <select id="queryOrganizationByParentId" resultMap="organizationMap">
       select * from organization
       <where>
           <if test="parentId!='-1'">
               and  parent_id=#{parentId}
           </if>
       </where>
    </select>

    <!--根据组织编号查询机构信息-->
    <select id="queryOrganizationByCode" parameterType="string" resultMap="organizationMap">
       select * from organization where org_code=#{code} limit 0,1
    </select>
    
    <!--修改-->
    <update id="updateOrganization" parameterType="com.example.demo.entity.Organization">
      UPDATE organization
      SET org_name = #{orgName},
      parent_id = #{parentId},
      parent_code = #{parentCode},
      parent_all_code = #{parentAllCode}
      WHERE org_code = #{orgCode}
    </update>
</mapper>

机构记录sql

<?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.example.demo.mapper.OrganizationRecordMapper">
    <!--添加-->
    <insert id="insertOrganizationRecord" >
       insert into organization_record(organization_info,organization_source_info)
       VALUES(#{organizationInfo},#{organizationSourceInfo})
    </insert>
</mapper>

 业务逻辑service

package com.example.demo.service;

import com.alibaba.fastjson.JSONArray;
import com.example.demo.entity.Organization;
import com.example.demo.mapper.OrganizationMapper;
import com.example.demo.mapper.OrganizationRecordMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

@Slf4j
@Service
public class TestDiGuiService {

    @Autowired
    private OrganizationMapper organizationMapper;

    @Autowired
    private OrganizationRecordMapper organizationRecordMapper;

    public HashMap<String, Object> syncOrganization() {
        HashMap<String, Object> resultMap = new HashMap<>();
        List<HashMap<String, Object>> sourceList = new ArrayList<>();  //原始机构信息集合

        //1.模拟请求三方接口获取信息 TODO
        Map emp = new HashMap();
        List<HashMap<String, Object>> mapList = new ArrayList<>();
        HashMap<String, Object> hashMap = new HashMap<>();
        hashMap.put("ORG_CODE", "0001");
        hashMap.put("ORG_NAME", "中国工商银行");
        mapList.add(hashMap);
        hashMap = new HashMap<>();
        hashMap.put("ORG_CODE", "0002");
        hashMap.put("ORG_NAME", "北京银行");
        mapList.add(hashMap);
        emp.put("result", mapList);
        emp.put("status", "200");

        String code = (String) emp.get("status");
        if (!"200".equals(code)) {
            resultMap.put("code", "500");
            return resultMap;
        }
        List<HashMap<String, Object>> list = (List<HashMap<String, Object>>) emp.get("result");
        sourceList.addAll(list);
        //2.对数据进行逻辑处理
        if (list.size() != 0) {
            for (HashMap<String, Object> object : list) {
                //2.1 对信息封装为组织机构代码对象
                Organization organization = conversionOrg("0", object);
                //2.2 新增/修改机构信息
                disposeOrg(organization);
                //2.3 递归遍历
                recursive(organization, sourceList);
            }
        }
        resultMap.put("code", "200");
        //3.查询出全部机构信息,整理为json串
        queryOrganization(sourceList);

        return resultMap;
    }

    //封装成对象
    public Organization conversionOrg(String orgCode, HashMap<String, Object> map) {
        Organization o = new Organization();
        String code = (String) map.get("ORG_CODE");
        String name = (String) map.get("ORG_NAME");
        log.info("组织机构名称={},机构编号={}", name, code);
        o.setOrgCode(code);
        o.setOrgName(name);
        Organization organization = organizationMapper.queryOrganizationByCode(orgCode);
        if (organization == null) {
            o.setParentAllCode("0,");
        } else {
            String parentAllCode = StringUtils.isEmpty(organization.getParentAllCode()) ? "0," : organization.getParentAllCode() + orgCode + ",";
            o.setParentAllCode(parentAllCode);
            o.setParentId(organization.getId());
            o.setParentCode(organization.getOrgCode());
        }
        return o;
    }

    //逻辑处理 机构若存在该机构代码,则进行修改;否则进行新增
    public void disposeOrg(Organization organization) {
        Organization org = organizationMapper.queryOrganizationByCode(organization.getOrgCode());
        if (org == null || "".equals(org.getOrgCode()) || !organization.getOrgCode().equals(org.getOrgCode())) {
            organizationMapper.insertOrganization(organization);
            log.info("新增完成!机构编号={},组织机构名称={}", organization.getOrgCode(), organization.getOrgName());
        } else {
            organizationMapper.updateOrganization(organization);
            log.info("修改完成!机构编号={},组织机构名称={}", organization.getOrgCode(), organization.getOrgName());
        }
    }

    //递归遍历机构下面的子机构信息
    public void recursive(Organization organization, List<HashMap<String, Object>> sourceList) {
        try {
            Thread.currentThread().sleep(2000);
        } catch (Exception e) {
            e.printStackTrace();
        }
        //模拟请求三方接口中二级机构及其子机构的信息 TODO
        Map emp = new HashMap();
        List<HashMap<String, Object>> mapList = new ArrayList<>();
        HashMap<String, Object> hashMap = new HashMap<>();
        if ("0001".equals(organization.getOrgCode())) {
            hashMap = new HashMap<>();
            hashMap.put("ORG_CODE", "0011");
            hashMap.put("ORG_NAME", "丰台区");
            mapList.add(hashMap);
            hashMap = new HashMap<>();
            hashMap.put("ORG_CODE", "0021");
            hashMap.put("ORG_NAME", "海淀区");
            mapList.add(hashMap);
        }
        if ("0002".equals(organization.getOrgCode())) {
            hashMap = new HashMap<>();
            hashMap.put("ORG_CODE", "0012");
            hashMap.put("ORG_NAME", "丰台区");
            mapList.add(hashMap);
            hashMap = new HashMap<>();
            hashMap.put("ORG_CODE", "0022");
            hashMap.put("ORG_NAME", "大兴区");
            mapList.add(hashMap);
        }
        if ("0011".equals(organization.getOrgCode())) {
            hashMap = new HashMap<>();
            hashMap.put("ORG_CODE", "0031");
            hashMap.put("ORG_NAME", "马家堡");
            mapList.add(hashMap);
            hashMap = new HashMap<>();
            hashMap.put("ORG_CODE", "0041");
            hashMap.put("ORG_NAME", "角门西");
            mapList.add(hashMap);
        }
        if ("0021".equals(organization.getOrgCode())) {
            hashMap = new HashMap<>();
            hashMap.put("ORG_CODE", "0051");
            hashMap.put("ORG_NAME", "白堆子");
            mapList.add(hashMap);
        }

        if ("0012".equals(organization.getOrgCode())) {
            hashMap = new HashMap<>();
            hashMap.put("ORG_CODE", "0032");
            hashMap.put("ORG_NAME", "岳各庄");
            mapList.add(hashMap);
            hashMap = new HashMap<>();
            hashMap.put("ORG_CODE", "0042");
            hashMap.put("ORG_NAME", "大红门");
            mapList.add(hashMap);
        }
        if ("0022".equals(organization.getOrgCode())) {
            hashMap = new HashMap<>();
            hashMap.put("ORG_CODE", "0052");
            hashMap.put("ORG_NAME", "圆明园");
            mapList.add(hashMap);
        }
        emp.put("result", mapList);
        emp.put("status", "200");
        String code = (String) emp.get("status");
        if (!"200".equals(code)) {
            return;
        }
        List<HashMap<String, Object>> list = (List<HashMap<String, Object>>) emp.get("result");
        sourceList.addAll(list);
        if (list.size() != 0) {
            for (HashMap<String, Object> object : list) {
                Organization conversionOrg = conversionOrg(organization.getOrgCode(), object);
                disposeOrg(conversionOrg);
                recursive(conversionOrg, sourceList);
            }
        }
    }

    public List<Organization> queryOrganization(List<HashMap<String, Object>> sourceList) {
        List<Organization> organizationList = organizationMapper.queryOrganizationByParentId("-1");
        List<Organization> parentList = organizationList.stream()
                .filter(item -> item.getParentId() == 0)
                .collect(Collectors.toList());
        for (Organization organization : parentList) {
            List<Organization> children = getChildren(organization, organizationList);
            organization.setChildren(children);
        }
        String json = JSONArray.toJSONString(parentList);
        String sourceJson = JSONArray.toJSONString(sourceList);
        organizationRecordMapper.insertOrganizationRecord(json,sourceJson);
        return parentList;
    }

    //获取当前节点的所有子节点
    public List<Organization> getChildren(Organization organization, List<Organization> organizationList) {
        List<Organization> list = organizationList.stream()
                .filter(item -> item.getParentId() == organization.getId())
                .collect(Collectors.toList());
        if (CollectionUtils.isEmpty(list)) {
            return null;
        }
        for (Organization org : list) {
            org.setChildren(getChildren(org, organizationList));
        }
        return list;
    }
}

controller类

package com.example.demo.controller;

import com.example.demo.service.TestDiGuiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;

@RestController
@RequestMapping("/digui")
public class DiGuiController {

    @Autowired
    TestDiGuiService testDiGuiService;

    @RequestMapping("syncOrg")
    public HashMap<String, Object> synchronousOrganization() {
        return testDiGuiService.syncOrganization();
    }
}

请求结果

postman调用接口

机构表 

 机构记录表

mybatis递归查询

也可通过mybatis查询属性结构信息,一般数据量少的可以通过SQL实现

OrganizationMapper文件

package com.example.demo.mapper;

import com.example.demo.entity.Organization;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

/**
 * 组织机构mapper
 */
@Mapper
public interface OrganizationMapper {
 
    //查询全部数据
    List<Organization> queryAll(@Param("code") String code);
}

SQL

<collection property="children" column="org_code" select="getChildrenTreeByParentCode"/>的column设置的是父节点SQL的返回结果的列名。

<?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.example.demo.mapper.OrganizationMapper">
    <resultMap id="orgResultMap" type="com.example.demo.entity.Organization">
        <id property="id" column="id"/>
        <result property="orgCode" column="org_code"/>
        <result property="orgName" column="org_name"/>
        <result property="parentCode" column="parent_code"/>
        <result property="parentId" column="parent_id"/>
        <result property="parentAllCode" column="parent_all_code"/>
        <collection property="children" column="org_code" select="getChildrenTreeByParentCode"></collection>
    </resultMap>

    <!--级联查询父节点-->
    <select id="queryAll" resultMap="orgResultMap" parameterType="String">
        select *
        from organization
        where parent_code=#{code}
    </select>

    <!--级联查询子节点-->
    <select id="getChildrenTreeByParentCode" resultMap="orgResultMap">
        select *
        from organization
        where parent_code=#{org_code}
    </select>
</mapper>

controller

package com.example.demo.controller;

import com.example.demo.entity.Organization;
import com.example.demo.mapper.OrganizationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;

@RestController
@RequestMapping("/digui")
public class DiGuiController {

    @Autowired
    OrganizationMapper organizationMapper;

    @RequestMapping("test")
    public List<Organization> test(@RequestParam("code")String code) {
        List<Organization> organizationList = organizationMapper.queryAll(code);
        return organizationList;
    }
}

调用结果

可看出执行顺序:先执行父节点SQL,后根据每条返回的结果SQL的org_code列作为入参递归查询子节点SQL。

递归能力欠缺,请各位大佬提出意见及错误!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/746245.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

2024.6.26 刷题总结

2024.6.26 **每日一题** 526.优美的排列&#xff0c;该题考察的是状压dp的知识&#xff0c;用一个n位的二进制数表示排列中的数被选取的情况&#xff0c;若为1&#xff0c;则表示该位被选取&#xff0c;若为0&#xff0c;则表示该位没有被选取&#xff0c;用一个数组来存储当前…

【Vue】集成富文本编辑器

这文章使用的是wangeditor插件&#xff0c;官网地址&#xff1a;wangEditor&#xff0c;这个比较简单 安装 npm i wangeditor --save 使用 <div id"editor"></div>import E from "wangeditor"const editor new E("#editor") e…

兰州市红古区市场监管管理局调研食家巷品牌,关注细节,推动进步

近日&#xff0c;兰州市红古区市场监管管理局临平凉西北绿源电子商务有限公司进行了深入视察&#xff0c;为企业发展带来了关怀与指导。 食家巷品牌作为平凉地区特色美食的代表之一&#xff0c;一直以来凭借其纯手工工艺和独特的风味&#xff0c;在市场上占据了一席之地。领导…

charls抓包工具 mumu模拟器抓包apk

1.先安装mumu 官网添加链接描述 2.配置 设置&#xff0c;点进互联网&#xff0c;点编辑&#xff0c;选择手动代理 主机名写自己电脑的ip地址&#xff0c;端口随便&#xff0c;只要不被占用&#xff0c;一般参考其他人都是8888 3.下载charls 参考这个添加链接描述 先官网…

一文详解:什么是企业邮箱?最全百科

什么是企业邮箱&#xff1f;企业邮箱即绑定企业自有域名作为邮箱后缀的邮箱&#xff0c;是企业用于内部成员沟通和客户沟通的邮箱系统。 一、企业邮箱概念拆解 1.什么是企业邮箱&#xff1f; 企业邮箱即使用企业域名作为后缀的邮箱系统。它不仅提供专业的电子邮件收发功能&a…

How to persist LangChain conversation memory (save and load)

题意&#xff1a;如何持久化 LangChain 对话记忆&#xff08;保存和加载&#xff09; 问题背景&#xff1a; Im creating a conversation like so: 我正在创建一个对话&#xff0c;如下所示&#xff1a; llm ChatOpenAI(temperature0, openai_api_keyOPENAI_API_KEY,…

大学生毕业季,寄物流快递避雷指南

随着毕业季的来临&#xff0c;大学生们纷纷开始整理自己的行李&#xff0c;准备离开校园&#xff0c;踏入社会。 在这个过程中&#xff0c;寄送快递成为了一个不可或缺的环节。然而&#xff0c;在寄送快递的过程中&#xff0c;如果不注意一些细节&#xff0c;很容易遭遇各种“…

【别再用Excel了!】这款免费可视化工具能帮你轻松提升效率

现代数据分析和展示的需求已经远远超出了传统工具的能力&#xff0c;尤其是在需要快速、直观和高效地处理复杂数据的情况下。山海鲸可视化通过其强大的功能和易用性&#xff0c;成为了设计师以及各类新手用户的理想选择。下面我就以一个可视化设计师的角度&#xff0c;和大家简…

金升阳电源被制裁,广州顶源电源模块可以完美替换

广州顶源电子科技股份有限公司,座落于国家高新技术开发区---广州科学城&#xff0c;是一家集研发、生产、销售及服务于一体的DC-DC&#xff0c;AC-DC电源的生产厂家。 公司通过了IATF16949汽车认证及ISO9001:2015质量管理体系认证。拥有专家级研发团队&#xff0c;产品研发经过…

Python中20个鲜为人知的字符串函数

目录 1. capitalize() 2. casefold() 3. join() 和 split() 4. strip(), lstrip(), rstrip() 5. replace() 6. format() 7. enumerate() 8. isalpha(), isdigit(), isalnum() 9. startswith(), endswith() 10. center() 11. count() 12. find(), index() 13. make…

ATFX汇市:澳大利亚5月CPI大增0.4百分点,降息预期显著降温

ATFX汇市&#xff1a;据澳大利亚统计局数据&#xff0c;澳大利亚5月加权CPI年率为4%&#xff0c;高于前值3.6%&#xff0c;高于预期3.8%&#xff0c;显示出澳大利亚通胀率颇具韧性。5月份数据公布之前&#xff0c;月度CPI年率平均波幅不足0.1个百分点&#xff0c;呈现出横盘震荡…

2024年高级会计职称题库。高效备考!!!

61.下列各项中&#xff0c;属于对会计职业道德进行自律管理与约束的机构是&#xff08;&#xff09;。 A.纪律检查部门 B.财政部门 C.会计行业组织 D.其他组织 答案&#xff1a;C 62.下列各项中&#xff0c;对会计职业行为自我约束和自我控制的部门主要是&#xff08;&am…

光伏储能为什么变得那么受欢迎?

在当今这个追求可持续发展和清洁能源的时代&#xff0c;光伏储能技术逐渐崭露头角&#xff0c;并成为了能源领域的热门话题。其受欢迎程度不断攀升&#xff0c;背后有着多方面的原因。光伏储能技术的优点众多&#xff0c;涵盖了多个方面&#xff0c;以下是关于其安全、寿命等关…

数学学习与研究杂志社《数学学习与研究》杂志社2024年第6期目录

课改前沿 基于核心素养的高中数学课堂教学研究——以“直线与圆、圆与圆的位置关系”为例 张亚红; 2-4 核心素养视角下初中生数学阅读能力的培养策略探究 贾象虎; 5-7 初中数学大单元教学实践策略探索 耿忠义; 8-10《数学学习与研究》投稿&#xff1a;cn7kantougao…

【精品方案】智能制造之路(93页PPT)

引言&#xff1a;智能制造之路&#xff1a;革新制造业的引领之旅 随着科技的迅猛发展&#xff0c;特别是人工智能、物联网、大数据等技术的不断进步&#xff0c;制造业正迎来一场深刻的变革。智能制造&#xff0c;作为这场变革的核心&#xff0c;正逐步成为推动产业升级和转型发…

mid360配置lio-sam、point-lio和faster-lio(faster-lio未敢配置)

一、使用mid360配置lio-sam 1.首先从GitHub - nkymzsy/LIO-SAM-MID360 at Livox-ros-driver2 下载能支持mid360的lio-sam版本到 ws_livox/src中&#xff0c;直接编译&#xff0c;就可以成功。 2.使用 roslaunch lio_sam run6axis.launch以及播之前我才记得Mid360的包&#x…

YOLO系列改进

yolo核心思想&#xff1a;把目标检测转变成一个回归问题。将整个图像作为网络的输入&#xff0c;仅仅经过一个神经网络&#xff0c;得到边界框的位置及其所属的类别。 YOLOv1 CVPR2016 输出7730的张量表示2个框的5个参数和20个种类。leaky ReLU&#xff0c;leaky并不会让负数…

【笔记】备份VScode代码至GitHub

目录 不小心把代码删掉了&#xff0c;还没备份备份步骤创建新工作区和测试文件还有GitHub项目初始化git注意 最后一步 不小心把代码删掉了&#xff0c;还没备份 试着安装了一下GitHub Pull Requests&#xff0c;不会用 备份步骤 创建新工作区和测试文件还有GitHub项目 首先…

RT-Thread Studio实现动态线程

1创建项目 我的板子为STM32F03ZET6 点击RT-Thread项目 2选择板子&#xff08;根据自己的板子选择&#xff09; 3找到主函数 4编写代码 4-1创建函数入口 // 线程入口函数 static void thread_entry(void *parameter) {rt_uint32_t count 0;while (1){// 线程执行的代码rt_k…

图书馆书籍管理系统

项目名称与项目简介 图书馆书籍管理系统 本项目是一个计算机管理系统&#xff0c;也就是将传统手工的管理方式转变为智能化、标准化、规范化的管理管理模式&#xff0c;对图书馆中所有的图书、文献资料、音像资料、报刊、期刊等各种类型的资料实现采编、收集图书信息、检索、归…