MaterialsUsingDao_getDetails4NewBill.sql 527 B

123456789101112131415161718
  1. select
  2. itde.goods_id as goodsId,
  3. goods.goods_code as pnumber,
  4. goods.goods_name as pname ,
  5. goods.specification as specType ,
  6. itde.measure_unit as measureUnit
  7. from t_b_materialsusing_detail itde
  8. left join t_b_materialsusing it on itde.fk_id = it.id
  9. left join t_b_goods_info goods on itde.goods_id = goods.id
  10. where 1= 1
  11. and it.order_onumber in (select max(order_onumber) from t_b_materialsusing
  12. where 1 = 1
  13. <#if ( warehouseid )?? && warehouseid ?length gt 0>
  14. /* 仓库 */
  15. and warehouse_id = :warehouseid
  16. </#if>
  17. )