<?php

/**
 * Class that operate on table 'transferbtweenbankaccount'. Database Mysql.
 *
 * @author: http://phpdao.com
 * @date: 2021-10-28 01:37
 */
class TransferbtweenbankaccountMySqlExtDAO extends TransferbtweenbankaccountMySqlDAO {

    public function queryAllEX($queryString = '') {
        $sql = 'SELECT transferbtweenbankaccount.*,bankFrom.bankname bankNameFrom,bankTo.bankname bankNameTo,accountFrom.accountname accountNameFrom,accountTo.accountname accountNameTo
                FROM transferbtweenbankaccount
                join bank          bankFrom on bankFrom.bankid = transferbtweenbankaccount.bankidfrom
                join bankaccount   accountFrom on accountFrom.accountid = transferbtweenbankaccount.accountidfrom
                join bank          bankTo on bankTo.bankid = transferbtweenbankaccount.bankidto
                join bankaccount   accountTo on accountTo.accountid = transferbtweenbankaccount.accountidto
                where 1 ' . $queryString . ' ';
        //echo $sql
        $sqlQuery = new SqlQuery($sql);
        return $this->getList($sqlQuery);
    }

    public function loadEX($queryString = '') {
        $sql = 'SELECT transferbtweenbankaccount.*,bankFrom.bankname bankNameFrom,bankTo.bankname bankNameTo,accountFrom.accountname accountNameFrom,accountTo.accountname accountNameTo
                FROM transferbtweenbankaccount
                join bank          bankFrom on bankFrom.bankid = transferbtweenbankaccount.bankidfrom
                join bankaccount   accountFrom on accountFrom.accountid = transferbtweenbankaccount.accountidfrom
                join bank          bankTo on bankTo.bankid = transferbtweenbankaccount.bankidto
                join bankaccount   accountTo on accountTo.accountid = transferbtweenbankaccount.accountidto
                where 1 ' . $queryString . ' ';
        $sqlQuery = new SqlQuery($sql);
        return $this->getRow($sqlQuery);
    }

}

?>