test-entity-library-asm 3.9.58 → 3.9.59
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.
|
@@ -25,5 +25,10 @@ export declare class CustomRepository<T extends ObjectLiteral> extends Repositor
|
|
|
25
25
|
getLocalsCompanyInformationForTheTableWrapper(params: IBasicCompany): Promise<{
|
|
26
26
|
data: any[];
|
|
27
27
|
totalRecords: number;
|
|
28
|
+
query: [string, any[]];
|
|
29
|
+
} | {
|
|
30
|
+
data: never[];
|
|
31
|
+
totalRecords: number;
|
|
32
|
+
query: null;
|
|
28
33
|
}>;
|
|
29
34
|
}
|
|
@@ -3,4 +3,9 @@ import { IBasicCompany } from "../interfaces";
|
|
|
3
3
|
export declare function getLocalsCompanyInformationTable(repository: Repository<any>, { company, status, visible, lazyEvent }: IBasicCompany): Promise<{
|
|
4
4
|
data: any[];
|
|
5
5
|
totalRecords: number;
|
|
6
|
+
query: [string, any[]];
|
|
7
|
+
} | {
|
|
8
|
+
data: never[];
|
|
9
|
+
totalRecords: number;
|
|
10
|
+
query: null;
|
|
6
11
|
}>;
|
|
@@ -10,7 +10,7 @@ async function getLocalsCompanyInformationTable(repository, { company, status, v
|
|
|
10
10
|
// DOC: Filtro global
|
|
11
11
|
if (lazyEvent.filters["global"] && lazyEvent.filters["global"].value) {
|
|
12
12
|
const globalValue = `%${lazyEvent.filters["global"].value.toLowerCase()}%`;
|
|
13
|
-
queryBuilder.andWhere("(LOWER(locals_company_information_for_the_table.name) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.address) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.partner_name) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.partner_surname) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.partner_full_name) LIKE :globalValue OR locals_company_information_for_the_table.partner_full_name LIKE :globalValue)", { globalValue });
|
|
13
|
+
queryBuilder.andWhere("(LOWER(locals_company_information_for_the_table.code) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.name) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.address) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.partner_name) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.partner_surname) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.partner_full_name) LIKE :globalValue OR locals_company_information_for_the_table.partner_full_name LIKE :globalValue)", { globalValue });
|
|
14
14
|
}
|
|
15
15
|
// DOC: Filtro por estado FILTRO POR DEFECTO.
|
|
16
16
|
if (status !== null && status >= 0) {
|
|
@@ -211,16 +211,19 @@ async function getLocalsCompanyInformationTable(repository, { company, status, v
|
|
|
211
211
|
const [data, totalRecords] = await queryBuilder.getManyAndCount();
|
|
212
212
|
// DOC: Si quieres ver la consulta generada, puedes descomentar las siguientes líneas:
|
|
213
213
|
// console.log("Query:", queryBuilder.getQuery());
|
|
214
|
-
|
|
214
|
+
console.log("Query:", queryBuilder.getQueryAndParameters());
|
|
215
215
|
return {
|
|
216
216
|
data,
|
|
217
217
|
totalRecords,
|
|
218
|
+
query: queryBuilder.getQueryAndParameters(),
|
|
218
219
|
};
|
|
219
220
|
}
|
|
220
221
|
catch (error) {
|
|
222
|
+
console.log(error, "error por acá");
|
|
221
223
|
return {
|
|
222
224
|
data: [],
|
|
223
225
|
totalRecords: 0,
|
|
226
|
+
query: null,
|
|
224
227
|
};
|
|
225
228
|
}
|
|
226
229
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -33,5 +33,10 @@ export declare const getRepositoryByEntity: <T extends ObjectLiteral>(entity: En
|
|
|
33
33
|
getLocalsCompanyInformationForTheTableWrapper(params: IBasicCompany): Promise<{
|
|
34
34
|
data: any[];
|
|
35
35
|
totalRecords: number;
|
|
36
|
+
query: [string, any[]];
|
|
37
|
+
} | {
|
|
38
|
+
data: never[];
|
|
39
|
+
totalRecords: number;
|
|
40
|
+
query: null;
|
|
36
41
|
}>;
|
|
37
42
|
}>;
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Repository } from "typeorm";
|
|
2
2
|
import { IBasicCompany } from "../interfaces";
|
|
3
|
+
import { query } from "express";
|
|
3
4
|
|
|
4
5
|
export async function getLocalsCompanyInformationTable(
|
|
5
6
|
repository: Repository<any>,
|
|
@@ -17,7 +18,7 @@ export async function getLocalsCompanyInformationTable(
|
|
|
17
18
|
"global"
|
|
18
19
|
].value.toLowerCase()}%`;
|
|
19
20
|
queryBuilder.andWhere(
|
|
20
|
-
"(LOWER(locals_company_information_for_the_table.name) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.address) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.partner_name) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.partner_surname) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.partner_full_name) LIKE :globalValue OR locals_company_information_for_the_table.partner_full_name LIKE :globalValue)",
|
|
21
|
+
"(LOWER(locals_company_information_for_the_table.code) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.name) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.address) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.partner_name) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.partner_surname) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.partner_full_name) LIKE :globalValue OR locals_company_information_for_the_table.partner_full_name LIKE :globalValue)",
|
|
21
22
|
{ globalValue },
|
|
22
23
|
);
|
|
23
24
|
}
|
|
@@ -252,16 +253,20 @@ export async function getLocalsCompanyInformationTable(
|
|
|
252
253
|
|
|
253
254
|
// DOC: Si quieres ver la consulta generada, puedes descomentar las siguientes líneas:
|
|
254
255
|
// console.log("Query:", queryBuilder.getQuery());
|
|
255
|
-
|
|
256
|
+
console.log("Query:", queryBuilder.getQueryAndParameters());
|
|
256
257
|
|
|
257
258
|
return {
|
|
258
259
|
data,
|
|
259
260
|
totalRecords,
|
|
261
|
+
query: queryBuilder.getQueryAndParameters(),
|
|
260
262
|
};
|
|
261
263
|
} catch (error) {
|
|
264
|
+
console.log(error, "error por acá");
|
|
265
|
+
|
|
262
266
|
return {
|
|
263
267
|
data: [],
|
|
264
268
|
totalRecords: 0,
|
|
269
|
+
query: null,
|
|
265
270
|
};
|
|
266
271
|
}
|
|
267
272
|
}
|