adjust defaults
parent
72d83f433a
commit
d55f4e127b
|
|
@ -3,7 +3,7 @@ interface WhereClauseReturn {
|
|||
sqlWhereClause: string;
|
||||
sqlParameters: unknown[];
|
||||
}
|
||||
export declare function getLotNameWhereClause(lotName: string | undefined, lotNameSearchType: LotNameSearchType | undefined, lotsTableAlias?: string): WhereClauseReturn;
|
||||
export declare function getLotNameWhereClause(lotName?: string, lotNameSearchType?: LotNameSearchType, lotsTableAlias?: string): WhereClauseReturn;
|
||||
type OccupancyTime = '' | 'current' | 'past' | 'future';
|
||||
export declare function getOccupancyTimeWhereClause(occupancyTime: OccupancyTime | undefined, lotOccupanciesTableAlias?: string): WhereClauseReturn;
|
||||
export declare function getOccupantNameWhereClause(occupantName?: string, tableAlias?: string): WhereClauseReturn;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { dateToInteger } from '@cityssm/utils-datetime';
|
||||
export function getLotNameWhereClause(lotName = '', lotNameSearchType, lotsTableAlias = 'l') {
|
||||
export function getLotNameWhereClause(lotName = '', lotNameSearchType = '', lotsTableAlias = 'l') {
|
||||
let sqlWhereClause = '';
|
||||
const sqlParameters = [];
|
||||
if (lotName !== '') {
|
||||
switch (lotNameSearchType) {
|
||||
switch (lotNameSearchType ?? '') {
|
||||
case 'startsWith': {
|
||||
sqlWhereClause += ` and ${lotsTableAlias}.lotName like ? || '%'`;
|
||||
sqlParameters.push(lotName);
|
||||
|
|
|
|||
|
|
@ -9,14 +9,14 @@ interface WhereClauseReturn {
|
|||
|
||||
export function getLotNameWhereClause(
|
||||
lotName = '',
|
||||
lotNameSearchType: LotNameSearchType | undefined,
|
||||
lotNameSearchType: LotNameSearchType = '',
|
||||
lotsTableAlias = 'l'
|
||||
): WhereClauseReturn {
|
||||
let sqlWhereClause = ''
|
||||
const sqlParameters: unknown[] = []
|
||||
|
||||
if (lotName !== '') {
|
||||
switch (lotNameSearchType) {
|
||||
switch (lotNameSearchType ?? '') {
|
||||
case 'startsWith': {
|
||||
sqlWhereClause += ` and ${lotsTableAlias}.lotName like ? || '%'`
|
||||
sqlParameters.push(lotName)
|
||||
|
|
|
|||
Loading…
Reference in New Issue