fixed query
This commit is contained in:
parent
3b89082a92
commit
2cbb4a3a30
|
|
@ -22,7 +22,8 @@ const getReportTypesListQuery = ({ limit, page, ...rest }) =>
|
||||||
const countReportTypesListQuery = rest =>
|
const countReportTypesListQuery = rest =>
|
||||||
_coordinatesSelectQuery()({ count: 'COUNT(DISTINCT(rt.uuid)) AS count' })(rest);
|
_coordinatesSelectQuery()({ count: 'COUNT(DISTINCT(rt.uuid)) AS count' })(rest);
|
||||||
|
|
||||||
const insertReportTypesQuery = () => {
|
const insertReportTypesQuery = (createdBy) => {
|
||||||
|
const createdByCondition = createdBy ? ', :createdBy' : null;
|
||||||
return `
|
return `
|
||||||
INSERT INTO dbmaster.report_types (
|
INSERT INTO dbmaster.report_types (
|
||||||
uuid,
|
uuid,
|
||||||
|
|
@ -33,8 +34,8 @@ const insertReportTypesQuery = () => {
|
||||||
VALUES (
|
VALUES (
|
||||||
:uuid,
|
:uuid,
|
||||||
:name,
|
:name,
|
||||||
:now,
|
:now
|
||||||
:createdBy
|
${createdByCondition}
|
||||||
);
|
);
|
||||||
SELECT * FROM dbmaster.report_types WHERE uuid = :uuid;
|
SELECT * FROM dbmaster.report_types WHERE uuid = :uuid;
|
||||||
`
|
`
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue