/[projects]/dao/FuldDaekningWorker/src/dk/daoas/fulddaekning/Database.java
ViewVC logotype

Diff of /dao/FuldDaekningWorker/src/dk/daoas/fulddaekning/Database.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2230 by torben, Mon Sep 29 18:15:48 2014 UTC revision 2231 by torben, Wed Oct 8 08:44:56 2014 UTC
# Line 85  public class Database { Line 85  public class Database {
85          public Queue<Adresse> hentIkkedaekkedeAdresser(int postnr)  throws SQLException {          public Queue<Adresse> hentIkkedaekkedeAdresser(int postnr)  throws SQLException {
86                  ConcurrentLinkedQueue<Adresse> queue = new ConcurrentLinkedQueue<Adresse>();                  ConcurrentLinkedQueue<Adresse> queue = new ConcurrentLinkedQueue<Adresse>();
87    
88                  String sql = "SELECT id,postnr,adresse,gadeid,husnr,husnrbogstav,latitude,longitude,rute " +                  String sql = "SELECT id,a.postnr,adresse,gadeid,husnr,husnrbogstav,latitude,longitude,rute,p.distributor as ho " +
89                                  "FROM fulddaekning.adressetabel " +                                  "FROM fulddaekning.adressetabel a " +
90                                    "LEFT JOIN bogleveringer.postnummerdistributor p on (a.postnr=p.postnr) " +
91                                  "WHERE rute IS NULL " +  //Ingen dækning                                  "WHERE rute IS NULL " +  //Ingen dækning
92                                  "AND postnr=?  " +                                  "AND a.postnr=?  " +
93                                  "AND latitude IS NOT NULL " +                                  "AND latitude IS NOT NULL " +
94                                  "AND longitude IS NOT NULL " +                                  "AND longitude IS NOT NULL " +
95                                  "AND gadeid IS NOT NULL ";                                  "AND gadeid IS NOT NULL ";
# Line 130  public class Database { Line 131  public class Database {
131          }          }
132    
133          public Adresse[] hentDaekkedeAdresser( BoundingBox bbox) throws SQLException {          public Adresse[] hentDaekkedeAdresser( BoundingBox bbox) throws SQLException {
134                  String sql = "SELECT id,postnr,adresse,gadeid,husnr,husnrbogstav,latitude,longitude,rute " +                  String sql = "SELECT id,a.postnr,adresse,gadeid,husnr,husnrbogstav,latitude,longitude,rute,p.distributor as ho " +
135                                  "FROM fulddaekning.adressetabel " +                                  "FROM fulddaekning.adressetabel a " +
136                                    "LEFT JOIN bogleveringer.postnummerdistributor p on (a.postnr=p.postnr) " +
137                                  "WHERE rute IS NOT NULL " +                                  "WHERE rute IS NOT NULL " +
138                                  "AND latitude BETWEEN ? AND ? " +                                  "AND latitude BETWEEN ? AND ? " +
139                                  "AND longitude BETWEEN ? AND ? " +                                  "AND longitude BETWEEN ? AND ? " +
140                                  "AND distributor = ? ";                                  "AND a.distributor = ? ";
141    
142                  // Forward only + concur_read_only + fetchsize tvinger driver til at hente en række af gangen (bedre performance ved store result sets)                  // Forward only + concur_read_only + fetchsize tvinger driver til at hente en række af gangen (bedre performance ved store result sets)
143                  // Se http://dev.mysql.com/doc/connector-j/en/connector-j-reference-implementation-notes.html                  // Se http://dev.mysql.com/doc/connector-j/en/connector-j-reference-implementation-notes.html
# Line 155  public class Database { Line 157  public class Database {
157                    
158                    
159          public Adresse[] hentAlleDaekkedeAdresser() throws SQLException {          public Adresse[] hentAlleDaekkedeAdresser() throws SQLException {
160                  String sql = "SELECT id,postnr,adresse,gadeid,husnr,husnrbogstav,latitude,longitude,rute " +                  String sql = "SELECT id,a.postnr,adresse,gadeid,husnr,husnrbogstav,latitude,longitude,rute,p.distributor as ho " +
161                                  "FROM fulddaekning.adressetabel " +                                  "FROM fulddaekning.adressetabel a " +
162                                    "LEFT JOIN bogleveringer.postnummerdistributor p on (a.postnr=p.postnr) " +
163                                  "WHERE rute IS NOT NULL " +                                  "WHERE rute IS NOT NULL " +
164                                  "AND latitude IS NOT NULL " +                                  "AND latitude IS NOT NULL " +
165                                  "AND longitude IS NOT NULL " +                                  "AND longitude IS NOT NULL " +
166                                  "AND distributor = ? ";                                  "AND a.distributor = ? ";
167    
168                  // Forward only + concur_read_only + fetchsize tvinger driver til at hente en række af gangen (bedre performance ved store result sets)                  // Forward only + concur_read_only + fetchsize tvinger driver til at hente en række af gangen (bedre performance ved store result sets)
169                  // Se http://dev.mysql.com/doc/connector-j/en/connector-j-reference-implementation-notes.html                  // Se http://dev.mysql.com/doc/connector-j/en/connector-j-reference-implementation-notes.html
# Line 242  public class Database { Line 245  public class Database {
245                          adr.latitude = res.getDouble("latitude");                          adr.latitude = res.getDouble("latitude");
246                          adr.longitude = res.getDouble("longitude");                          adr.longitude = res.getDouble("longitude");
247                          adr.rute = res.getString("rute");                          adr.rute = res.getString("rute");
248                            adr.ho = res.getInt("ho");
249    
250                          list.add(adr);                          list.add(adr);
251    

Legend:
Removed from v.2230  
changed lines
  Added in v.2231

  ViewVC Help
Powered by ViewVC 1.1.20