<?php

/**
 * Class that operate on table 'productionexecutionwaste'. Database Mysql.
 *
 * @author: http://phpdao.com
 * @date: 2018-11-28 13:58
 */
class ProductionexecutionwasteMySqlExtDAO extends ProductionexecutionwasteMySqlDAO {

    public function queryAllProductsByExecutionId($id) {
        $sql = 'SELECT productionexecutionwaste. * , product.productName ,product.productBuyPrice,size.name as sizeName,color.name as colorName
		FROM productionexecutionwaste
		JOIN product ON product.productId = productionexecutionwaste.productid

                left join sizecolor as size on size.id=productionexecutionwaste.sizeid
                left join sizecolor as color on color.id=productionexecutionwaste.colorid

		where productionexecutionwaste.executionid=' . $id . '
		';
        $sqlQuery = new SqlQuery($sql);
        return $this->getList($sqlQuery);
    }

}

?>