"supplier_type": { "id": 1, "name": "企业" }
时间: 2024-01-15 11:05:38 浏览: 130
This JSON object represents a supplier type, which has an ID of 1 and a name of "企业" (which translates to "enterprise" in English). This suggests that the supplier type is a classification used to distinguish between different types of suppliers, and in this case, the "企业" type likely refers to businesses or corporations.
相关问题
怎么调用"supplier_type": { "id": 1, "name": "企业" }里面的name
调用"supplier_type"中的"name"可以使用以下代码:
```
supplier_type = {
"id": 1,
"name": "企业"
}
name = supplier_type["name"]
print(name)
```
输出:
```
企业
```
这样就可以获取到"supplier_type"中的"name"值了。
SELECT TOP 10 tag_id, tag_code, RFID, storage_stock_id, material_id, material_code, data_status, material_name, spec, model, factory_name, supplier_id, supplier_name, lot_number, valid_to_date, material_type, pack_id, unit_code, unit, pack_type, sub_unit_code, sub_unit, dept_name, sub_conversion_rate, conversion_rate, status, original_barcode, udi, create_time, min_material_code, insurance_id, insurance_spec_code, order_in_code, order_in_id, is_used FROM ( SELECT ROW_NUMBER ( ) OVER ( ORDER BY create_time DESC ) PAGE_ROW_NUMBER, tag_id, tag_code, RFID, storage_stock_id, material_id, material_code, data_status, material_name, spec, model, factory_name, supplier_id, supplier_name, lot_number, valid_to_date, material_type, pack_id, unit_code, unit, pack_type, sub_unit_code, sub_unit, dept_name, sub_conversion_rate, conversion_rate, status, original_barcode, udi, create_time, min_material_code, insurance_id, insurance_spec_code, order_in_code, order_in_id, is_used FROM ( SELECT mt.tag_id, mt.tag_code, mt.RFID, mt.storage_stock_id, mss.material_id, mss.material_code, mt.data_status, mi.material_name, mi.spec, mi.model, mi.factory_name, mss.supplier_id, mss.supplier_name, mt.lot_number, mt.valid_to_date, mi.material_type, mss.pack_id, mss.unit_code, CASE WHEN mi.material_type = 'MAT-GZ' THEN mp.pack_unit ELSE mt.unit + '(' + CONVERT ( VARCHAR ( 10 ), mtd.quantity ) + mtd.unit + '/' + mt.unit + ')' END AS unit, mp.pack_type, mss.sub_unit_code, mss.sub_unit, sd.dept_name, mp.sub_conversion_rate, mp.conversion_rate, mt.status, mt.original_barcode, mt.udi, mt.create_time, mi.min_material_code, mi.insurance_id, mi.insurance_spec_code, mssd.order_in_code, mssd.order_in_id, mt.is_used FROM material_tag mt LEFT JOIN material_tag_detail mtd ON mtd.tag_id = mt.tag_id LEFT JOIN material_storage_stock_detail mssd ON mssd.stock_detail_id = mtd.stock_detail_id LEFT JOIN material_storage_stock mss ON mss.stock_id = mssd.storage_stock_id LEFT JOIN material_pack mp ON mp.pack_id = mss.pack_id LEFT JOIN material_info mi ON mi.material_id = mss.material_id LEFT JOIN sys_dept sd ON sd.dept_id = mss.store_dept_id LEFT JOIN material_storage_stock_batch mssb ON mssb.stock_id = mss.stock_id LEFT JOIN order_in oi ON oi.order_in_code = mssb.batch_no LEFT JOIN material_pack mpk ON mpk.material_id = mss.material_id AND mpk.is_purchase_unit = 1 WHERE mt.hospital_id = 1 AND mss.store_dept_id = 367 ) AS PAGE_TABLE_ALIAS ) AS PAGE_TABLE_ALIAS WHERE PAGE_ROW_NUMBER > 0 ORDER BY PAGE_ROW_NUMBER查询速度19秒如何添加索引
首先需要确定哪些字段经常被用作查询条件或者作为排序字段,可以根据实际情况来选择适合的字段添加索引。根据这个 SQL 查询语句,可以考虑添加以下索引:
1. `hospital_id`、`store_dept_id`、`status`、`create_time`:这几个字段都经常被用作查询条件,可以添加组合索引来提高查询速度。
2. `material_id`、`material_code`、`min_material_code`:这几个字段都涉及到物料信息,如果物料信息表很大,可以考虑单独为它们添加索引。
3. `tag_id`、`tag_code`、`RFID`:这几个字段都涉及到标签信息,如果标签信息表很大,可以考虑单独为它们添加索引。
4. `storage_stock_id`、`stock_detail_id`、`batch_no`、`order_in_id`、`order_in_code`:这几个字段都涉及到库存信息和订单信息,如果这些表很大,可以考虑单独为它们添加索引。
需要注意的是,添加索引会占用一定的磁盘空间和内存,还会对插入、更新和删除操作产生一定的影响,因此需要谨慎考虑。同时,如果添加了过多的索引,也会影响数据库性能,因此需要根据实际情况进行权衡和调整。
阅读全文