Paramétrisation nom table dans les requêtes
This commit is contained in:
parent
1b1680af5c
commit
b14463ecf2
6 changed files with 32 additions and 24 deletions
|
|
@ -158,14 +158,15 @@
|
|||
{{#select
|
||||
mvt.key AS mvt_key,
|
||||
json_extract(mvt.document, '$.amount') - IFNULL(SUM(json_extract(mvt2.document, '$.amount')), 0) AS reste
|
||||
FROM {!$module.table} AS mvt
|
||||
LEFT JOIN {!$module.table} AS link ON mvt.key = json_extract(link.document, '$.temp_key')
|
||||
LEFT JOIN {!$module.table} AS mvt2 ON mvt2.key = json_extract(link.document, '$.return')
|
||||
FROM !table AS mvt
|
||||
LEFT JOIN !table AS link ON mvt.key = json_extract(link.document, '$.temp_key')
|
||||
LEFT JOIN !table AS mvt2 ON mvt2.key = json_extract(link.document, '$.return')
|
||||
WHERE
|
||||
json_extract(mvt.document, '$.operation') IN !op
|
||||
AND json_extract(mvt.document, '$.equipment') = :eqpmt_key
|
||||
GROUP by mvt.key
|
||||
;
|
||||
!table=$module.table
|
||||
!op = $output_ops
|
||||
:eqpmt_key = $_GET.key
|
||||
}}
|
||||
|
|
@ -181,14 +182,15 @@
|
|||
{{#select
|
||||
mvt.key AS mvt_key,
|
||||
json_extract(mvt.document, '$.amount') - IFNULL(SUM(json_extract(mvt2.document, '$.amount')), 0) AS present
|
||||
FROM {!$module.table} AS mvt
|
||||
LEFT JOIN {!$module.table} AS link ON mvt.key = json_extract(link.document, '$.temp_key')
|
||||
LEFT JOIN {!$module.table} AS mvt2 ON mvt2.key = json_extract(link.document, '$.return')
|
||||
FROM !table AS mvt
|
||||
LEFT JOIN !table AS link ON mvt.key = json_extract(link.document, '$.temp_key')
|
||||
LEFT JOIN !table AS mvt2 ON mvt2.key = json_extract(link.document, '$.return')
|
||||
WHERE
|
||||
json_extract(mvt.document, '$.operation') IN !op
|
||||
AND json_extract(mvt.document, '$.equipment') = :eqpmt_key
|
||||
GROUP by mvt.key
|
||||
;
|
||||
!table=$module.table
|
||||
!op = $input_ops
|
||||
:eqpmt_key = $_GET.key
|
||||
}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue