add active mieters request
This commit is contained in:
23
Mieter.py
23
Mieter.py
@ -21,6 +21,29 @@ SELECT m.id as id,
|
||||
w.id = m.wohnung
|
||||
""", [], "Mieter")
|
||||
|
||||
def get_mieters_active():
|
||||
return getMany("""
|
||||
SELECT m.id as id,
|
||||
o.id as objekt,
|
||||
w.id as wohnung,
|
||||
w.shortname as wohnung_shortname,
|
||||
o.shortname as objekt_shortname,
|
||||
COALESCE(m.anrede, '-') as anrede,
|
||||
COALESCE(m.vorname, '-') as vorname,
|
||||
m.nachname as nachname,
|
||||
COALESCE(m.strasse, '-') as strasse,
|
||||
COALESCE(m.plz, '-') as plz,
|
||||
COALESCE(m.ort, '-') as ort,
|
||||
COALESCE(m.telefon, '-') as telefon,
|
||||
m.einzug as einzug,
|
||||
COALESCE(m.auszug, '-') as auszug
|
||||
FROM wohnung w, objekt o, mieter m
|
||||
WHERE o.id = w.objekt AND
|
||||
w.id = m.wohnung AND
|
||||
m.einzug <= curdate() and
|
||||
(m.auszug is null or m.auszug > curdate())
|
||||
""", [], "Mieter")
|
||||
|
||||
def get_mieter(id=None):
|
||||
return getOne("""
|
||||
SELECT m.id as id,
|
||||
|
Reference in New Issue
Block a user