package com.kamco.cd.kamcoback.postgres.repository.scene;

import com.kamco.cd.kamcoback.postgres.entity.MapInkx5kEntity;
import com.kamco.cd.kamcoback.postgres.entity.QMapInkx5kEntity;
import com.querydsl.jpa.impl.JPAQueryFactory;
import java.util.List;
import org.springframework.data.jpa.repository.support.QuerydslRepositorySupport;

public class MapInkx5kRepositoryImpl extends QuerydslRepositorySupport
    implements MapInkx5kRepositoryCustom {

  private final JPAQueryFactory queryFactory;

  public MapInkx5kRepositoryImpl(JPAQueryFactory queryFactory) {
    super(MapInkx5kEntity.class);
    this.queryFactory = queryFactory;
  }

  public List<MapInkx5kEntity> listGetScenes5k(List<String> codes) {
    QMapInkx5kEntity map5k = QMapInkx5kEntity.mapInkx5kEntity;

    return queryFactory
        .selectFrom(map5k)
        .where(map5k.mapidcdNo.in(codes))
        .orderBy(map5k.mapidcdNo.asc())
        .fetch();
  }
}
