필수 검색 조건

- path: properties/active
  blocks:
  - type: query
    resource: mysql.qa
    sqlType: select
    sql: >
      SELECT * 
      FROM properties 
      WHERE name = :name
      ORDER BY id ASC 
      LIMIT 100
    ***params:
    - key: name***

Screen Shot 2022-04-01 at 6.22.46 PM.png

필수 조건 여러개

- path: properties/active
  blocks:
  - type: query
    resource: mysql.qa
    sqlType: select
    sql: >
      SELECT * 
      FROM properties 
      WHERE name = :name
         OR id = :id
      ORDER BY id ASC 
      LIMIT 100
    ***params:
    - key: name
      label: 업체명
    - key: id
      label: 업체번호
      format: number***

Screen Shot 2022-04-01 at 6.24.53 PM.png

조건을 입력해야 검색하기

기본은 전체 보기, 조건 둘중 하나라도 해당되면 표시

- path: properties/active
  blocks:
  - type: query
    resource: mysql.qa
    sqlType: select
    sql: >
      SELECT * 
      FROM properties 
      WHERE (LENGTH(:name) = 0 OR name = :name)
         OR (LENGTH(:id) = 0 OR id = :id)
      ORDER BY id ASC 
      LIMIT 100
    params:
    - key: name
      label: 업체명
    - key: id
      label: 업체번호
      format: number

기본은 모두 표시, 조건 모두 일치해야 표시

- path: properties/active
  blocks:
  - type: query
    resource: mysql.qa
    sqlType: select
    sql: >
      SELECT * 
      FROM properties 
      WHERE 1=1 
        AND (LENGTH(:name) = 0 OR name = :name)
        AND (LENGTH(:id) = 0 OR id = :id)
      ORDER BY id ASC 
      LIMIT 100
    params:
    - key: name
      label: 업체명
    - key: id
      label: 업체번호
      format: number