@@ -6,6 +6,18 @@ class ConditionEntity
66{
77 protected array $ changeLog = [];
88
9+ /**
10+ * @var array
11+ */
12+ protected array $ where = [];
13+
14+ protected int $ limit = 0 ;
15+ protected int $ offset = 0 ;
16+ protected array $ column = ['* ' ];
17+ protected array $ group = [];
18+ protected array $ order = [];
19+ protected array $ having = [];
20+
921 /**
1022 * @param array $condition 条件
1123 */
@@ -29,6 +41,120 @@ public function getCondition(): array
2941 return $ this ->condition ;
3042 }
3143
44+ public function getQueryWhere (): array
45+ {
46+ return $ this ->where ;
47+ }
48+
49+ public function setQueryWhere (array $ where )
50+ {
51+ $ this ->where = $ where ;
52+ }
53+
54+ public function addQueryWhere (string $ key , string $ sql , array $ bindArgs = [])
55+ {
56+ $ this ->where [$ key ] = [
57+ 'sql ' => $ sql ,
58+ 'bind ' => $ bindArgs
59+ ];
60+ }
61+
62+ /**
63+ * @param array|string[] $column
64+ */
65+ public function setColumn (array $ column ): void
66+ {
67+ $ this ->column = $ column ;
68+ }
69+
70+ /**
71+ * @param array $group
72+ */
73+ public function setGroup (array $ group ): void
74+ {
75+ $ this ->group = $ group ;
76+ }
77+
78+ /**
79+ * @param array $having
80+ */
81+ public function setHaving (array $ having ): void
82+ {
83+ $ this ->having = $ having ;
84+ }
85+
86+ /**
87+ * @param int $limit
88+ */
89+ public function setLimit (int $ limit ): void
90+ {
91+ $ this ->limit = $ limit ;
92+ }
93+
94+ /**
95+ * @param int $offset
96+ */
97+ public function setOffset (int $ offset ): void
98+ {
99+ $ this ->offset = $ offset ;
100+ }
101+
102+ /**
103+ * @param array $order
104+ */
105+ public function setOrder (array $ order ): void
106+ {
107+ $ this ->order = $ order ;
108+ }
109+
110+ /**
111+ * @return array
112+ */
113+ public function getColumn (): array
114+ {
115+ return $ this ->column ;
116+ }
117+
118+ /**
119+ * @return array
120+ */
121+ public function getGroup (): array
122+ {
123+ return $ this ->group ;
124+ }
125+
126+ /**
127+ * @return array
128+ */
129+ public function getHaving (): array
130+ {
131+ return $ this ->having ;
132+ }
133+
134+ /**
135+ * @return int
136+ */
137+ public function getLimit (): int
138+ {
139+ return $ this ->limit ;
140+ }
141+
142+ /**
143+ * @return int
144+ */
145+ public function getOffset (): int
146+ {
147+ return $ this ->offset ;
148+ }
149+
150+ /**
151+ * @return array
152+ */
153+ public function getOrder (): array
154+ {
155+ return $ this ->order ;
156+ }
157+
32158 protected function log (array $ condition )
33159 {
34160 $ this ->changeLog [] = [
0 commit comments