本文简单介绍了查询(Query)和语义模型(Semantic Model)的介绍与创建。
;
)SELECT
products.part AS product_part,
products.product_time AS product_product_time,
products.progress AS product_progress,
products.c_name,
parts.part AS part_part,
parts.product_time AS part_product_time,
parts.progress AS part_progress,
parts.lot_id,
parts.assemble_percept_num,
inspections.work_type,
inspections.time,
inspections.result
FROM
products_product AS products
INNER JOIN parts_part AS parts ON products.line_id = parts.line_id
INNER JOIN inspections_inspection AS inspections ON parts.assemble_percept_num = inspections.assemble_percept_num
WHERE
products.part = '镜框'
U0VMRUNUDQogICAgcHJvZHVjdHMucGFydCBBUyBwcm9kdWN0X3BhcnQsDQogICAgcHJvZH......
SELECT
products.part AS product_part,
products.product_time AS product_product_time,
products.progress AS product_progress,
products.c_name,
products.lot_id AS product_lot_id,
parts.part AS part_part,
parts.product_time AS part_product_time,
parts.progress AS part_progress,
parts.lot_id AS part_lot_id,
parts.assemble_percept_num,
inspections.work_type,
inspections.time,
inspections.result
FROM
products_product AS products
INNER JOIN parts_part AS parts ON products.line_id = parts.line_id
INNER JOIN inspections_inspection AS inspections ON parts.assemble_percept_num = inspections.assemble_percept_num
WHERE
products.lot_id = :"products_product.lot_id" AND parts.progress = :"parts_part.progress"
U0VMRUNUDQogICAgcHJvZHVjdHMucGFydCBBUyBwcm9kdWN0X3BhcnQsDQo......
id
来查询具体查询的结果:"data": []
,因为我们在执行 Job 时提供的针对 products_product.lot_id
参数的值为:'WS_AG_001'
;针对 parts_part.progress
的值为:'组装'
,真实数据中是没有这个记录的。'HD0020'
、'焊接'
,然后再执行查询 Job:SELECT
Product.part AS productPart,
Product.productTime AS productProductTime,
Product.progress AS productProgress,
Product.cName,
Product.lotId,
Part.part AS partPart,
Part.productTime AS partProductTime,
Part.progress AS partProgress,
Part.lotId,
Part.assemblePerceptNum,
Inspection.workType,
Inspection.time,
Inspection.result
FROM
Product
INNER JOIN Part ON Product.lineId = Part.lineId
INNER JOIN Inspection ON Part.assemblePerceptNum = Inspection.assemblePerceptNum
U0VMRUNUDQogICAgUHJvZHVjdC5wYXJ0IEFTIHByb2R1Y3RQYXJ0LA0......
SELECT
Product.part AS productPart,
Product.productTime AS productProductTime,
Product.progress AS productProgress,
Product.cName,
Product.lotId,
Part.part AS partPart,
Part.productTime AS partProductTime,
Part.progress AS partProgress,
Part.lotId,
Part.assemblePerceptNum,
Inspection.workType,
Inspection.dataMax,
Inspection.time,
Inspection.result
FROM
Product
INNER JOIN Part ON Product.lineId = Part.lineId
INNER JOIN Inspection ON Part.assemblePerceptNum = Inspection.assemblePerceptNum
WHERE
Inspection.dataMax = (
SELECT MAX(Inspection.dataMax) FROM Inspection
)
OR
Product.lotId = :"Product.lotId"
U0VMRUNUDQogICAgUHJvZHVjdC5wYXJ0IEFTIHByb2R1Y3RQYXJ0LA......
Product.lotId
值为 'HD0020'
,以及在 Inspection 类中拥有最大 dataMax 值的记录都被返回了: