2020-08-31 12:38:32 +08:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* Created by PhpStorm.
|
|
|
|
|
* User: whwyy
|
|
|
|
|
* Date: 2018/6/27 0027
|
|
|
|
|
* Time: 17:49
|
|
|
|
|
*/
|
2020-10-29 18:17:25 +08:00
|
|
|
declare(strict_types=1);
|
2021-02-24 18:34:57 +08:00
|
|
|
|
2020-08-31 12:38:32 +08:00
|
|
|
namespace Database;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use Database\Traits\QueryTrait;
|
2020-12-17 14:09:14 +08:00
|
|
|
use Exception;
|
2020-08-31 12:38:32 +08:00
|
|
|
|
|
|
|
|
/**
|
2021-03-27 02:59:15 +08:00
|
|
|
* Class Query
|
2020-08-31 12:38:32 +08:00
|
|
|
* @package Database
|
|
|
|
|
*/
|
2021-03-27 02:59:15 +08:00
|
|
|
class Query implements ISqlBuilder
|
2020-08-31 12:38:32 +08:00
|
|
|
{
|
2021-02-24 18:34:57 +08:00
|
|
|
|
2020-08-31 12:38:32 +08:00
|
|
|
use QueryTrait;
|
2021-02-24 18:34:57 +08:00
|
|
|
|
2020-08-31 12:38:32 +08:00
|
|
|
/**
|
|
|
|
|
* @return string
|
2020-12-17 14:09:14 +08:00
|
|
|
* @throws Exception
|
2020-08-31 12:38:32 +08:00
|
|
|
*/
|
2020-12-17 14:09:14 +08:00
|
|
|
public function getSql(): string
|
2020-08-31 12:38:32 +08:00
|
|
|
{
|
2021-02-25 17:57:20 +08:00
|
|
|
return SqlBuilder::builder($this)->get();
|
2020-08-31 12:38:32 +08:00
|
|
|
}
|
2021-02-24 18:34:57 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return string
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
public function getCondition(): string
|
|
|
|
|
{
|
2021-02-25 17:57:20 +08:00
|
|
|
return SqlBuilder::builder($this)->getCondition();
|
2021-02-24 18:34:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2020-08-31 12:38:32 +08:00
|
|
|
}
|