<?php

/**
 * Class that operate on table 'employeegroup'. Database Mysql.
 *
 * @author: http://phpdao.com
 * @date: 2020-11-11 22:24
 */
class EmployeegroupMySqlExtDAO extends EmployeegroupMySqlDAO {

    public function queryAllEX() {
        $sql = 'SELECT * FROM employeegroup where del = 0';
        $sqlQuery = new SqlQuery($sql);
        return $this->getList($sqlQuery);
    }

    public function queryAllEXCount() {
        $sql = 'SELECT count(*) FROM employeegroup where del = 0';
        $sqlQuery = new SqlQuery($sql);
        return $this->querySingleResult($sqlQuery);
    }

    public function queryByNameEX($name) {
        $sql = 'SELECT * FROM employeegroup WHERE name LIKE "%' . $name . '%" ';
        $sqlQuery = new SqlQuery($sql);
        return $this->getList($sqlQuery);
    }

    public function queryByNameWithDayStatue($name, $day) {
        $sql = 'SELECT employeegroup.*,employeeclosedaygroupstatus.status
                FROM employeegroup
                left join employeeclosedaygroupstatus on (employeeclosedaygroupstatus.employeegroupid = employeegroup.id and employeeclosedaygroupstatus.day= "' . $day . '")
                WHERE name LIKE "%' . $name . '%" ';
        $sqlQuery = new SqlQuery($sql);
        return $this->getList($sqlQuery);
    }

}

?>