# -*- coding: utf8 -*-
SQL = """
select SQL_CALC_FOUND_ROWS *,
    (select count(1) FROM af3_delo D where D.OPIS = O.OPIS_ID) AS count_delo,
    (select count(1) FROM `list_nagrada` ln where ln.OPIS_ID=O.OPIS_ID) AS NL,
    (select count(1) FROM `digital_image` dim where type_image='opis' AND dim.OPIS_ID=O.OPIS_ID) AS CDIM,
    (select count(1) FROM `digital_image` dim where type_image='delo' AND dim.OPIS_ID=O.OPIS_ID) AS CDDIM,
    (select count(1) FROM `af3_delo_volontirs` D where D.OPIS =O.OPIS_ID) AS volont_cnt
from `afweb_opis` as O
    %(where)s
    limit %(offset)d,%(limit)d ;
"""
FOUND_ROWS = True
ROOT = "list_opis"
ROOT_PREFIX = "<show_fond><row /></show_fond>"
ROOT_POSTFIX= None
XSL_TEMPLATE = "data/af-web.xsl"
EVENT = None
WHERE = ("FOND_ID", "G15","G7", "G19" )
PARAM = ("G15", )
TITLE="Список описей"
MESSAGE="нет описей по вашему запросу"
ORDER = None
