STC89C52单片机相关资料压缩包

需积分: 5 0 下载量 15 浏览量 更新于2024-11-01 收藏 74KB RAR 举报
资源摘要信息: "No_4_STC89C52.rar"是一个压缩文件,包含有关STC89C52单片机的相关资料或项目代码。由于文件内没有提供更多详细信息,因此这里将主要围绕STC89C52单片机及其应用进行说明。 STC89C52是STC公司生产的一款8位单片机,属于51单片机系列,因为其广泛的使用范围和灵活的应用特性而广受欢迎。STC89C52单片机基于经典的8051内核,并且进行了一系列的性能增强和功能扩展,使之更加适合现代的嵌入式系统设计。 首先,STC89C52单片机拥有以下特点和参数: 1. 核心:基于8051内核,拥有标准的8051指令集。 2. 存储器:具有8KB的程序存储空间(Flash ROM),512字节的内部RAM。 3. I/O口:共4个8位并行I/O口,分别是P0、P1、P2和P3。 4. 定时器:2个16位定时器/计数器。 5. 串行口:具有全双工串行口。 6. 中断系统:具有5个中断源,2个优先级。 7. 工作频率:最高工作频率可达40MHz。 8. 电源:工作电压范围较宽,一般为5V。 在使用STC89C52单片机时,开发者通常需要以下几种开发工具: 1. 编程器/烧写器:用于将编译好的程序烧写进单片机。 2. 编程软件:如Keil uVision、SDCC、IAR Embedded Workbench等用于编写、编译和调试程序。 3. 硬件仿真器:可选设备,用于在不实际烧写芯片的情况下模拟程序执行情况。 开发者通常会在项目中对STC89C52单片机进行以下操作: 1. 编程:编写控制程序,实现特定功能,如控制电机、读取传感器数据、显示信息到LCD等。 2. 烧写:使用编程器将程序烧写到单片机中。 3. 调试:通过串口打印、LED指示灯等手段,观察程序运行状态,并进行调试。 4. 扩展:根据项目需求,可能需要设计扩展电路,如添加外部RAM、外部存储器等。 STC89C52单片机的应用领域非常广泛,包括: 1. 家用电器控制:如洗衣机、微波炉、空调遥控器等。 2. 智能仪表:如数字万用表、温度控制器、智能水表等。 3. 通信设备:如电话机、交换机、安防监控系统等。 4. 工业控制:如自动生产线控制、电机控制等。 5. 医疗设备:如心电图机、血压计等。 6. 汽车电子:如车载收音机、汽车防盗系统等。 STC89C52单片机的编程语言通常为C语言或汇编语言。C语言由于其代码的可读性和可维护性,更适合大型项目的开发。而汇编语言则由于其对硬件的高度控制和代码的高效率,适合对性能要求较高的场合。 在实际开发过程中,开发者通常需要熟练掌握STC89C52单片机的硬件资源,包括I/O口的配置、定时器/计数器的设置、串行通信的配置、中断系统的管理等。此外,还需要了解如何使用各种外围设备,例如ADC(模数转换器)、DAC(数模转换器)、外部存储器、各种传感器等。 总结以上知识点,STC89C52是一款功能强大的8位单片机,它广泛应用于各种嵌入式系统项目。开发者需要通过合理的开发工具、编程语言和硬件资源的运用,才能充分发挥STC89C52单片机的性能,满足各种复杂应用场景的需求。

SELECT DISTINCT c.ID AS id, c.NAME AS contName, c.CONTRACT_NO AS contractNo, c.INSTANCE_ID AS instanceId, c.UNDERTAKE_DEPT_ID AS remindDeptId, c.UNDERTAKE_DEPT_NAME AS sendDeptName, c.CREATE_USER_ID, c.CREATE_USER_NAME AS contractOpteraterName, c.PLAN_STATE AS planState, c.PLAN_STATE_NAME AS planStateName, aw.INSTANCE_ID AS inId, aw.CREATE_TIME AS sendTime FROM ( SELECT c.* FROM ( SELECT c.* FROM ( SELECT c.ORIGINAL_CONTRACT_ID, MAX(CREATE_TIME) CREATE_TIME FROM CONTRACT_DRAFT.C_CONTRACT_INFO c WHERE c.ORIGINAL_CONTRACT_ID IS NOT NULL AND c.ORIGINAL_CONTRACT_ID != '' GROUP BY c.ORIGINAL_CONTRACT_ID ) t LEFT JOIN CONTRACT_DRAFT.C_CONTRACT_INFO c ON t.ORIGINAL_CONTRACT_ID = c.ORIGINAL_CONTRACT_ID AND t.CREATE_TIME = c.CREATE_TIME UNION ALL SELECT c.* FROM CONTRACT_DRAFT.C_CONTRACT_INFO c WHERE ( c.ORIGINAL_CONTRACT_ID IS NULL OR c.ORIGINAL_CONTRACT_ID = '' ) AND c.ID NOT IN ( SELECT c.ORIGINAL_CONTRACT_ID FROM CONTRACT_DRAFT.C_CONTRACT_INFO c WHERE c.ORIGINAL_CONTRACT_ID IS NOT NULL AND c.ORIGINAL_CONTRACT_ID != '')) c WHERE c.deleted_flag = 0 AND c.BELONG = 1 AND sysdate > c.end_date AND c.plan_state IN (4100, 4110, 4120, 4200, 4210, 4220, 5100, 5110, 5120) ) c INNER JOIN (SELECT INSTANCE_ID,create_time,state FROM CONTRACT_DRAFT.C_ACTIVITY_WORKITEMS WHERE state = 'Waiting') aw ON c.INSTANCE_ID = aw.INSTANCE_ID LEFT JOIN (SELECT deleted_flag,CONT_ID FROM CONTRACT_DRAFT.C_GET_PAY_PLAN WHERE deleted_flag = 0 ) g ON c.ID = g.CONT_ID LEFT JOIN CONTRACT_DRAFT.C_OUR_ENTITY_INFO oe ON c.OUR_ENTITY_ID = oe.ID AND oe.DELETED_FLAG = 0 ORDER BY aw.CREATE_TIME DESC 优化

2023-07-08 上传

优化这个sql SELECT count( 1 ) FROM ( SELECT B.ID, B.PURCHASE_REQUEST_ID, B.MATERIAL_ID, B.MATERIAL_CODE, B.MATERIAL_NAME, B.STANDARD, B.MODEL_ID, B.BILL_ROW_ID, B.BILL_NO, BILL_NAME, B.MODEL_CODE, B.MODEL_NAME, B.PARENT_MODEL_ID, B.PARENT_MODEL_CODE, B.PARENT_MODEL_NAME, B.UNIT_CODE, B.UNIT_NAME, B.PURCHASE_TYPE_CODE, CAST( NVL( B.APPLY_NUM, 0 ) AS NUMBER ( 24, 10 ) ) AS APPLY_NUM, CAST( NVL( B.DEAL_NUM, 0 ) AS NUMBER ( 24, 10 ) ) AS DEAL_NUM, CAST( NVL( B.RETURN_NUM, 0 ) AS NUMBER ( 24, 10 ) ) AS RETURN_NUM, B.DEAL_USER_ID, B.DEAL_USER_NAME, CAST( NVL( B.PRICE, 0 ) AS NUMBER ( 24, 10 ) ) AS PRICE, CAST( NVL( B.AMOUNT, 0 ) AS NUMBER ( 24, 10 ) ) AMOUNT, B.IMPLEMENT_CODE, B.IMPLEMENT_NAME, B.IMPLEMENT_INVEST_AMOUNT, B.PURCHASE_MANAGER_ID, B.PURCHASE_MANAGER_NAME, B.PROVIDER_ID, B.PROVIDER_NAME, B.REMARK, B.DELIVER_AREA, B.DELIVER_ADDRESS, B.RECEIVE_PEOPLE, B.RECEIVE_PEOPLE_PHONE, B.ITEM_STATUS, B.COST_CENTER, B.COST_BUDGET_CODE, B.COST_IMPLEMENT_NAME, B.FRAME_CONT_ID, B.FRAME_CONT_CODE, B.FRAME_CONT_NAME, B.DETAIL_CONFIG, B.PURCHASE_CATEGORY_CODE, B.INVOICE_TITLE_CODE, B.INVOICE_SEND_ADDRRSS, B.MATERIAL_REQUEST_ITEM_ID, B.YEAR, B.DELETE_FLAG, B.PROVINCE_CODE, B.REASON, B.PARENT_ITEM_ID, B.FRAME_CONT_ITEM_ID, B.SUB_MATERIAL_REQUEST_ID, B.SUB_MATERIAL_REQUEST_CODE, B.MATERIAL_URL, B.RECOMMEND_PROVIDER_NAMES, C.PURCHASE_REQUEST_CODE, C.PURCHASE_REQUEST_NAME, C.APPLY_TYPE_CODE, C.CREATOR_NAME, C.APPLY_TELEPHONE, C.COMPANY_NAME, C.DEPT_NAME, B.CREATE_TIME, TO_CHAR( B.CREATE_TIME, 'YYYY-MM-DD' ) CREATE_TIME_STR, C.ARRIVE_TIME, C.IS_TO_END, C.MONEY_WAY_CODE, C.OWN, C.APPLY_CATEGORY_CODE, C.manu_Type, C.BILL_ID, MMD.MATERIAL_TYPE_CODE, B.BRANCH_COMPANY_DEAL_USER_ID, B.BRANCH_COMPANY_DEAL_USER_NAME, ( SELECT ORG_NAME FROM ORGANIZATIONS WHERE DELETE_FLAG = '0' AND ORG_CODE = ( SELECT PARENT_COMPANY_NO FROM ORGANIZATIONS WHERE ID = B.MATERIAL_DEPT_ID )) AS MATERIAL_COMPANY_NAME, B.ORIGINAL, B.PROVIDER_PRODUCT_MODEL, B.PROVIDER_PRODUCT_NAME, B.PRODUCT_DESC, B.Back_Flag, CASE WHEN MMD.material_type_code = 'WZ' THEN '1' WHEN MMD.material_type_code = 'FW' THEN '2' ELSE '3' END apply_category_code_item, NVL( C.IS_CARDSYSTEM_REQUEST, '0' ) IS_CARDSYSTEM_REQUEST, B.APPLY_GROUP_AUTHORITES, B.SCIENTIFIC_RESEARCH_ID, B.SCIENTIFIC_RESEARCH_CODE, B.SCIENTIFIC_RESEARCH_NAME, B.PREQUALFY_CODE, nvl( C.IS_QUICK, '0' ) AS IS_QUICK, C.PURCHASE_WAY_CODE, C.PURCHASE_TYPE_CODE PURCHASE_TYPE_CODE_P, C.ORIGINAL_TYPE, C.PURCHASE_REQUEST_BILLS_TYPE, B.IS_FRAME_CONT_MONAD FROM PURCHASE_REQUEST_ITEM B LEFT JOIN PURCHASE_REQUEST C ON B.PURCHASE_REQUEST_ID = C.ID LEFT JOIN MATERIAL_DATA MMD ON MMD.ID = B.MATERIAL_ID AND MMD.DELETE_FLAG = '0' WHERE B.delete_flag = '0' AND B.Item_Status IN ( 1 ) AND NOT EXISTS ( SELECT * FROM purchase_request_item_log pril WHERE B.id = pril.purchase_request_item_id AND pril.lock_status = '1' AND pril.delete_flag = '0' ) AND ( ( c.apply_type_code NOT IN ( '20', '41', '3' ) AND nvl( B.Apply_Num, 0 ) > nvl( B.Deal_Num, 0 )) OR c.apply_type_code IN ( '20', '41', '3' ) ) AND B.Deal_User_Id =: 1 AND C.MONEY_WAY_CODE =: 2 AND C.APPLY_TYPE_CODE =: 3 AND C.PAY_OUT_TYPE_CODE =: 4 AND C.APPLY_CATEGORY_CODE =: 5 AND NVL( C.IS_CARDSYSTEM_REQUEST, '0' ) = : 6 AND NOT EXISTS ( SELECT * FROM purchase_request_item p left join material_province mp ON p.material_id = mp.material_id WHERE p.delete_flag = 0 AND mp.delete_flag = 0 AND mp.material_status = 03 AND mp.org_code = p.province_code AND p.id = B.id ) ORDER BY C.ID, B.ID ASC)

2023-06-08 上传