<?php

/**
 * Class that operate on table 'employeeclosedaygroupstatus'. Database Mysql.
 *
 * @author: http://phpdao.com
 * @date: 2020-11-19 05:41
 */
class EmployeeclosedaygroupstatusMySqlExtDAO extends EmployeeclosedaygroupstatusMySqlDAO {

    public function queryByStatusAndDay($day) {
        $sql = 'SELECT * FROM employeeclosedaygroupstatus WHERE status = 1 and day = "' . $day . '"';
        $sqlQuery = new SqlQuery($sql);
        return $this->getList($sqlQuery);
    }

    public function getNoOfGroupsClosedInADay($day) {
        $sql = 'SELECT count(*) FROM employeeclosedaygroupstatus WHERE status = 1 and day = "' . $day . '"';
        $sqlQuery = new SqlQuery($sql);
        return $this->querySingleResult($sqlQuery);
    }
    
    public function queryByDayAndEmployeegroupid($employeegroupid, $day) {
        $sql = 'SELECT *
                FROM employeeclosedaygroupstatus
                WHERE employeegroupid = ' . $employeegroupid . ' and day="' . $day . '" ';
        $sqlQuery = new SqlQuery($sql);
        return $this->getRow($sqlQuery);
    }

}

?>