Massive progress, following sorting the data import problem
This commit is contained in:
parent
acfaf985fa
commit
88468461fd
40 changed files with 201 additions and 229 deletions
|
|
@ -1,7 +1,7 @@
|
|||
------------------------------------------------------------------------
|
||||
-- File queries.sql
|
||||
--
|
||||
-- autogenerated by adl.to-hugsql-queries at 2018-06-19T18:51:50.013Z
|
||||
-- autogenerated by adl.to-hugsql-queries at 2018-06-29T10:10:58.177Z
|
||||
--
|
||||
-- See [Application Description
|
||||
-- Language](https://github.com/simon-brooke/adl).
|
||||
|
|
@ -728,15 +728,15 @@ ORDER BY lv_visits.address_id,
|
|||
-- :name search-strings-address :? :1
|
||||
-- :doc selects existing address records having any string field matching the parameter of the same name by substring match
|
||||
SELECT * FROM lv_addresses
|
||||
WHERE
|
||||
address LIKE '%params.address%'
|
||||
OR postcode = params.postcode
|
||||
OR phone LIKE '%params.phone%'
|
||||
OR district_id = params.district_id
|
||||
OR latitude = params.latitude
|
||||
OR longitude = params.longitude
|
||||
OR locality = params.locality
|
||||
OR id = params.id
|
||||
WHERE false
|
||||
--~ (if (:address params) "OR address LIKE '%:address%'")
|
||||
--~ (if (:postcode params) "OR postcode LIKE '%:postcode%'")
|
||||
--~ (if (:phone params) "OR phone LIKE '%:phone%'")
|
||||
--~ (if (:district_id params) "OR district_id = :district_id")
|
||||
--~ (if (:latitude params) "OR latitude = :latitude")
|
||||
--~ (if (:longitude params) "OR longitude = :longitude")
|
||||
--~ (if (:locality params) "OR locality = :locality")
|
||||
--~ (if (:id params) "OR id = :id")
|
||||
ORDER BY lv_addresses.address,
|
||||
lv_addresses.postcode,
|
||||
lv_addresses.id
|
||||
|
|
@ -746,24 +746,24 @@ ORDER BY lv_addresses.address,
|
|||
-- :name search-strings-authority :? :1
|
||||
-- :doc selects existing authority records having any string field matching the parameter of the same name by substring match
|
||||
SELECT * FROM lv_authorities
|
||||
WHERE
|
||||
id LIKE '%params.id%'
|
||||
WHERE false
|
||||
--~ (if (:id params) "OR id LIKE '%:id%'")
|
||||
--~ (if (:offset params) "OFFSET :offset ")
|
||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
||||
|
||||
-- :name search-strings-canvasser :? :1
|
||||
-- :doc selects existing canvasser records having any string field matching the parameter of the same name by substring match
|
||||
SELECT * FROM lv_canvassers
|
||||
WHERE
|
||||
username LIKE '%params.username%'
|
||||
OR fullname LIKE '%params.fullname%'
|
||||
OR elector_id = params.elector_id
|
||||
OR address_id = params.address_id
|
||||
OR phone LIKE '%params.phone%'
|
||||
OR email LIKE '%params.email%'
|
||||
OR authority_id = params.authority_id
|
||||
OR authorised = params.authorised
|
||||
OR id = params.id
|
||||
WHERE false
|
||||
--~ (if (:username params) "OR username LIKE '%:username%'")
|
||||
--~ (if (:fullname params) "OR fullname LIKE '%:fullname%'")
|
||||
--~ (if (:elector_id params) "OR elector_id = :elector_id")
|
||||
--~ (if (:address_id params) "OR address_id = :address_id")
|
||||
--~ (if (:phone params) "OR phone LIKE '%:phone%'")
|
||||
--~ (if (:email params) "OR email LIKE '%:email%'")
|
||||
--~ (if (:authority_id params) "OR authority_id = :authority_id")
|
||||
--~ (if (:authorised params) "OR authorised = :authorised")
|
||||
--~ (if (:id params) "OR id = :id")
|
||||
ORDER BY lv_canvassers.username,
|
||||
lv_canvassers.fullname,
|
||||
lv_canvassers.email,
|
||||
|
|
@ -774,9 +774,9 @@ ORDER BY lv_canvassers.username,
|
|||
-- :name search-strings-district :? :1
|
||||
-- :doc selects existing district records having any string field matching the parameter of the same name by substring match
|
||||
SELECT * FROM lv_districts
|
||||
WHERE
|
||||
name LIKE '%params.name%'
|
||||
OR id = params.id
|
||||
WHERE false
|
||||
--~ (if (:name params) "OR name LIKE '%:name%'")
|
||||
--~ (if (:id params) "OR id = :id")
|
||||
ORDER BY lv_districts.name,
|
||||
lv_districts.id
|
||||
--~ (if (:offset params) "OFFSET :offset ")
|
||||
|
|
@ -785,10 +785,10 @@ ORDER BY lv_districts.name,
|
|||
-- :name search-strings-dwelling :? :1
|
||||
-- :doc selects existing dwelling records having any string field matching the parameter of the same name by substring match
|
||||
SELECT * FROM lv_dwellings
|
||||
WHERE
|
||||
address_id = params.address_id
|
||||
OR sub_address LIKE '%params.sub-address%'
|
||||
OR id = params.id
|
||||
WHERE false
|
||||
--~ (if (:address_id params) "OR address_id = :address_id")
|
||||
--~ (if (:sub-address params) "OR sub_address LIKE '%:sub-address%'")
|
||||
--~ (if (:id params) "OR id = :id")
|
||||
ORDER BY lv_dwellings.address_id,
|
||||
lv_dwellings.sub_address,
|
||||
lv_dwellings.id
|
||||
|
|
@ -798,13 +798,13 @@ ORDER BY lv_dwellings.address_id,
|
|||
-- :name search-strings-elector :? :1
|
||||
-- :doc selects existing elector records having any string field matching the parameter of the same name by substring match
|
||||
SELECT * FROM lv_electors
|
||||
WHERE
|
||||
name LIKE '%params.name%'
|
||||
OR dwelling_id = params.dwelling_id
|
||||
OR phone LIKE '%params.phone%'
|
||||
OR email LIKE '%params.email%'
|
||||
OR gender = params.gender
|
||||
OR id = params.id
|
||||
WHERE false
|
||||
--~ (if (:name params) "OR name LIKE '%:name%'")
|
||||
--~ (if (:dwelling_id params) "OR dwelling_id = :dwelling_id")
|
||||
--~ (if (:phone params) "OR phone LIKE '%:phone%'")
|
||||
--~ (if (:email params) "OR email LIKE '%:email%'")
|
||||
--~ (if (:gender params) "OR gender = :gender")
|
||||
--~ (if (:id params) "OR id = :id")
|
||||
ORDER BY lv_electors.name,
|
||||
lv_electors.phone,
|
||||
lv_electors.email,
|
||||
|
|
@ -816,13 +816,13 @@ ORDER BY lv_electors.name,
|
|||
-- :name search-strings-followupaction :? :1
|
||||
-- :doc selects existing followupaction records having any string field matching the parameter of the same name by substring match
|
||||
SELECT * FROM lv_followupactions
|
||||
WHERE
|
||||
request_id = params.request_id
|
||||
OR actor = params.actor
|
||||
OR date = 'params.date'
|
||||
OR notes LIKE '%params.notes%'
|
||||
OR closed = params.closed
|
||||
OR id = params.id
|
||||
WHERE false
|
||||
--~ (if (:request_id params) "OR request_id = :request_id")
|
||||
--~ (if (:actor params) "OR actor = :actor")
|
||||
--~ (if (:date params) "OR date = ':date'")
|
||||
--~ (if (:notes params) "OR notes LIKE '%:notes%'")
|
||||
--~ (if (:closed params) "OR closed = :closed")
|
||||
--~ (if (:id params) "OR id = :id")
|
||||
ORDER BY lv_followupactions.date,
|
||||
lv_followupactions.notes,
|
||||
lv_followupactions.id
|
||||
|
|
@ -832,20 +832,20 @@ ORDER BY lv_followupactions.date,
|
|||
-- :name search-strings-followupmethod :? :1
|
||||
-- :doc selects existing followupmethod records having any string field matching the parameter of the same name by substring match
|
||||
SELECT * FROM lv_followupmethods
|
||||
WHERE
|
||||
id LIKE '%params.id%'
|
||||
WHERE false
|
||||
--~ (if (:id params) "OR id LIKE '%:id%'")
|
||||
--~ (if (:offset params) "OFFSET :offset ")
|
||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
||||
|
||||
-- :name search-strings-followuprequest :? :1
|
||||
-- :doc selects existing followuprequest records having any string field matching the parameter of the same name by substring match
|
||||
SELECT * FROM lv_followuprequests
|
||||
WHERE
|
||||
elector_id = params.elector_id
|
||||
OR visit_id = params.visit_id
|
||||
OR issue_id = params.issue_id
|
||||
OR method_id = params.method_id
|
||||
OR id = params.id
|
||||
WHERE false
|
||||
--~ (if (:elector_id params) "OR elector_id = :elector_id")
|
||||
--~ (if (:visit_id params) "OR visit_id = :visit_id")
|
||||
--~ (if (:issue_id params) "OR issue_id = :issue_id")
|
||||
--~ (if (:method_id params) "OR method_id = :method_id")
|
||||
--~ (if (:id params) "OR id = :id")
|
||||
ORDER BY lv_followuprequests.elector_id,
|
||||
lv_followuprequests.visit_id,
|
||||
lv_followuprequests.issue_id,
|
||||
|
|
@ -856,46 +856,46 @@ ORDER BY lv_followuprequests.elector_id,
|
|||
-- :name search-strings-gender :? :1
|
||||
-- :doc selects existing gender records having any string field matching the parameter of the same name by substring match
|
||||
SELECT * FROM lv_genders
|
||||
WHERE
|
||||
id LIKE '%params.id%'
|
||||
WHERE false
|
||||
--~ (if (:id params) "OR id LIKE '%:id%'")
|
||||
--~ (if (:offset params) "OFFSET :offset ")
|
||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
||||
|
||||
-- :name search-strings-intention :? :1
|
||||
-- :doc selects existing intention records having any string field matching the parameter of the same name by substring match
|
||||
SELECT * FROM lv_intentions
|
||||
WHERE
|
||||
visit_id = params.visit_id
|
||||
OR elector_id = params.elector_id
|
||||
OR option_id = params.option_id
|
||||
OR Id = params.Id
|
||||
WHERE false
|
||||
--~ (if (:visit_id params) "OR visit_id = :visit_id")
|
||||
--~ (if (:elector_id params) "OR elector_id = :elector_id")
|
||||
--~ (if (:option_id params) "OR option_id = :option_id")
|
||||
--~ (if (:Id params) "OR Id = :Id")
|
||||
--~ (if (:offset params) "OFFSET :offset ")
|
||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
||||
|
||||
-- :name search-strings-issue :? :1
|
||||
-- :doc selects existing issue records having any string field matching the parameter of the same name by substring match
|
||||
SELECT * FROM lv_issues
|
||||
WHERE
|
||||
url LIKE '%params.url%'
|
||||
OR current = params.current
|
||||
OR id LIKE '%params.id%'
|
||||
WHERE false
|
||||
--~ (if (:url params) "OR url LIKE '%:url%'")
|
||||
--~ (if (:current params) "OR current = :current")
|
||||
--~ (if (:id params) "OR id LIKE '%:id%'")
|
||||
--~ (if (:offset params) "OFFSET :offset ")
|
||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
||||
|
||||
-- :name search-strings-option :? :1
|
||||
-- :doc selects existing option records having any string field matching the parameter of the same name by substring match
|
||||
SELECT * FROM lv_options
|
||||
WHERE
|
||||
id LIKE '%params.id%'
|
||||
WHERE false
|
||||
--~ (if (:id params) "OR id LIKE '%:id%'")
|
||||
--~ (if (:offset params) "OFFSET :offset ")
|
||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
||||
|
||||
-- :name search-strings-role :? :1
|
||||
-- :doc selects existing role records having any string field matching the parameter of the same name by substring match
|
||||
SELECT * FROM lv_roles
|
||||
WHERE
|
||||
name LIKE '%params.name%'
|
||||
OR id = params.id
|
||||
WHERE false
|
||||
--~ (if (:name params) "OR name LIKE '%:name%'")
|
||||
--~ (if (:id params) "OR id = :id")
|
||||
ORDER BY lv_roles.name,
|
||||
lv_roles.id
|
||||
--~ (if (:offset params) "OFFSET :offset ")
|
||||
|
|
@ -904,12 +904,12 @@ ORDER BY lv_roles.name,
|
|||
-- :name search-strings-team :? :1
|
||||
-- :doc selects existing team records having any string field matching the parameter of the same name by substring match
|
||||
SELECT * FROM lv_teams
|
||||
WHERE
|
||||
name LIKE '%params.name%'
|
||||
OR district_id = params.district_id
|
||||
OR latitude = params.latitude
|
||||
OR longitude = params.longitude
|
||||
OR id = params.id
|
||||
WHERE false
|
||||
--~ (if (:name params) "OR name LIKE '%:name%'")
|
||||
--~ (if (:district_id params) "OR district_id = :district_id")
|
||||
--~ (if (:latitude params) "OR latitude = :latitude")
|
||||
--~ (if (:longitude params) "OR longitude = :longitude")
|
||||
--~ (if (:id params) "OR id = :id")
|
||||
ORDER BY lv_teams.name,
|
||||
lv_teams.id
|
||||
--~ (if (:offset params) "OFFSET :offset ")
|
||||
|
|
@ -918,11 +918,11 @@ ORDER BY lv_teams.name,
|
|||
-- :name search-strings-visit :? :1
|
||||
-- :doc selects existing visit records having any string field matching the parameter of the same name by substring match
|
||||
SELECT * FROM lv_visits
|
||||
WHERE
|
||||
address_id = params.address_id
|
||||
OR canvasser_id = params.canvasser_id
|
||||
OR date = 'params.date'
|
||||
OR id = params.id
|
||||
WHERE false
|
||||
--~ (if (:address_id params) "OR address_id = :address_id")
|
||||
--~ (if (:canvasser_id params) "OR canvasser_id = :canvasser_id")
|
||||
--~ (if (:date params) "OR date = ':date'")
|
||||
--~ (if (:id params) "OR id = :id")
|
||||
ORDER BY lv_visits.address_id,
|
||||
lv_visits.date,
|
||||
lv_visits.id
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
--
|
||||
-- auto-generated by [Application Description Language framework]
|
||||
--
|
||||
-- (https://github.com/simon-brooke/adl) at 20180619T185151.055Z
|
||||
-- (https://github.com/simon-brooke/adl) at 20180629T101059.126Z
|
||||
--
|
||||
--
|
||||
-- A web-app intended to be used by canvassers campaigning for a
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue