| | |
| | | iiq.is_copper, |
| | | iiq.material_prop, |
| | | ip.son_laboratory, |
| | | iiq.update_batch_no, |
| | | iiq.part_desc, |
| | | iiq.supplier_name, |
| | | iiq.contract |
| | | CASE |
| | | WHEN io.ifs_inventory_id IS NOT NULL THEN iiq.update_batch_no |
| | | ELSE io.update_batch_no |
| | | END AS update_batch_no, |
| | | CASE |
| | | WHEN io.ifs_inventory_id IS NOT NULL THEN iiq.part_desc |
| | | ELSE io.part_desc |
| | | END AS part_desc, |
| | | CASE |
| | | WHEN io.ifs_inventory_id IS NOT NULL THEN iiq.supplier_name |
| | | ELSE io.supplier_name |
| | | END AS supplier_name, |
| | | CASE |
| | | WHEN io.ifs_inventory_id IS NOT NULL THEN iiq.contract |
| | | ELSE io.contract |
| | | END AS contract |
| | | from ins_report ir |
| | | left join ins_order io on io.id = ir.ins_order_id |
| | | LEFT JOIN ifs_inventory_quantity iiq ON iiq.id = io.ifs_inventory_id |
| | |
| | | left join laboratory l on s.lab_id = l.id |
| | | where l.laboratory_name = #{name} |
| | | and s.type = #{type} |
| | | and s.contract = #{contract} |
| | | order by s.create_time desc |
| | | limit 1 |
| | | </select> |