Skip to content

Instantly share code, notes, and snippets.

@kei0425
Created March 12, 2020 06:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kei0425/9ff73c92a9db4aa859e03288083e2f12 to your computer and use it in GitHub Desktop.
Save kei0425/9ff73c92a9db4aa859e03288083e2f12 to your computer and use it in GitHub Desktop.
val toDataPathMap = getFacilityInfoMap(
FacilityExchangeTable
.innerJoin(
otherTable = RoomExchangeTable,
onColumn = { FacilityExchangeTable.facilityId },
otherColumn = { RoomExchangeTable.facilityId })
.innerJoin(
otherTable = RiyosyaFcHeyaIdRelTable,
onColumn = { RoomExchangeTable.fcHeyaId },
otherColumn = { RiyosyaFcHeyaIdRelTable.fcHeyaId })
.innerJoin(
otherTable = RoundVitalTable,
onColumn = { RiyosyaFcHeyaIdRelTable.riyosyaCode },
otherColumn = { RoundVitalTable.riyosyaCode })
.slice(
FacilityExchangeTable.facilityId, FacilityExchangeTable.toDataPath, RoundVitalTable.riyosyaCode
).select {
(RoomExchangeTable.enable eq true)
}.withDistinct().orderBy(FacilityExchangeTable.toDataPath to SortOrder.ASC).map {
mutableMapOf(
"facility_id" to it[FacilityExchangeTable.facilityId],
"to_data_path" to it[FacilityExchangeTable.toDataPath],
"riyosya_code" to it[RoundVitalTable.riyosyaCode]
)
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment