不要怂,就是干,撸起袖子干!

Commit f2bcc282 by Lemon

PGSQL query template sharing

1 parent a7d6a4e3
Showing with 1 additions and 3 deletions
...@@ -258,9 +258,9 @@ module.exports = (function() { ...@@ -258,9 +258,9 @@ module.exports = (function() {
optAttributes = optAttributes.concat(attributes) optAttributes = optAttributes.concat(attributes)
if (!include.association.connectorDAO) {
var joinQuery = ' LEFT OUTER JOIN <%= table %> AS <%= as %> ON <%= tableLeft %>.<%= attrLeft %> = <%= tableRight %>.<%= attrRight %>' var joinQuery = ' LEFT OUTER JOIN <%= table %> AS <%= as %> ON <%= tableLeft %>.<%= attrLeft %> = <%= tableRight %>.<%= attrRight %>'
if (!include.association.connectorDAO) {
query += Utils._.template(joinQuery)({ query += Utils._.template(joinQuery)({
table: this.quoteIdentifiers(include.daoFactory.tableName), table: this.quoteIdentifiers(include.daoFactory.tableName),
as: this.quoteIdentifier(include.as), as: this.quoteIdentifier(include.as),
...@@ -270,8 +270,6 @@ module.exports = (function() { ...@@ -270,8 +270,6 @@ module.exports = (function() {
attrRight: this.quoteIdentifier(include.association.identifier) attrRight: this.quoteIdentifier(include.association.identifier)
}) })
} else { } else {
var joinQueryLeft = ' LEFT OUTER JOIN <%= table %> AS <%= as %> ON <%= tableLeft %>.<%= attrLeft %> = <%= tableRight %>.<%= attrRight %> LEFT OUTER JOIN <%= table %> AS <%= as %> ON <%= tableLeft %>.<%= attrLeft %> = <%= tableRight %>.<%= attrRight %>'
query += Utils._.template(joinQuery)({ query += Utils._.template(joinQuery)({
table: this.quoteIdentifiers(include.association.connectorDAO.tableName), table: this.quoteIdentifiers(include.association.connectorDAO.tableName),
as: this.quoteIdentifier(include.association.connectorDAO.tableName), as: this.quoteIdentifier(include.association.connectorDAO.tableName),
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!