@provis/provis-common-be-module 2.2.1 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -193,7 +193,12 @@ class MainRepository extends typeorm_1.Repository {
|
|
|
193
193
|
relations.forEach((relation) => {
|
|
194
194
|
var _a, _b;
|
|
195
195
|
if (relation) {
|
|
196
|
-
|
|
196
|
+
if (relation && relation.join == "left" /* Join.LEFT */) {
|
|
197
|
+
query.leftJoin(`${modelName}.${relation.model}`, relation.model);
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
query.innerJoin(`${modelName}.${relation.model}`, relation.model);
|
|
201
|
+
}
|
|
197
202
|
(_a = relation.searchs) === null || _a === void 0 ? void 0 : _a.forEach((valueSearch) => {
|
|
198
203
|
if (valueSearch) {
|
|
199
204
|
query = query.andWhere(`${relation.model}.${valueSearch.query}`, { [valueSearch.key]: valueSearch.value });
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import Join from "../constants/join";
|
|
1
2
|
import ISearchQuery from "./search.query.interface";
|
|
2
3
|
export default interface IMultiJoin {
|
|
3
4
|
model: string;
|
|
4
|
-
|
|
5
|
+
join?: Join;
|
|
6
|
+
searchs?: ISearchQuery[];
|
|
5
7
|
additionalSearchOr?: ISearchQuery[][];
|
|
6
8
|
}
|