Paramétrisation nom table dans les requêtes
This commit is contained in:
parent
a2c343956c
commit
71646c9dcd
6 changed files with 31 additions and 23 deletions
|
|
@ -34,14 +34,15 @@
|
|||
|
||||
{{#select
|
||||
json_extract(mvt.document, '$.amount') - IFNULL(SUM(json_extract(mvt2.document, '$.amount')), 0) AS exterieur
|
||||
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 mvt.key = :mvt_key
|
||||
GROUP by mvt.key
|
||||
;
|
||||
!table=$module.table
|
||||
!op = $operations
|
||||
:mvt_key = $_GET.key
|
||||
}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue