Class BackofficeSubsystemRepository

java.lang.Object
es.kukenan.smartfi.microservice.contracts.repository.BackofficeSubsystemRepository

@Component public class BackofficeSubsystemRepository extends Object
Repository that holds the queries to retrieve BackofficeSubsystems.
  • Field Details

    • PATTERN

      private static final String PATTERN
      Pattern to replace in the query.
      See Also:
    • PARAM

      private static final String PARAM
      Param to add in the query.
      See Also:
    • SEPARATOR

      private static final String SEPARATOR
      Params query separator.
      See Also:
    • START_CHARACTER

      private static final String START_CHARACTER
      Params clause start character.
      See Also:
    • FINISH_CHARACTER

      private static final String FINISH_CHARACTER
      Params clause finish character.
      See Also:
    • FIND_BY_USERID_AND_CONTRACTID

      private static final String FIND_BY_USERID_AND_CONTRACTID
      Query to find all subsystems that have, at least, one product registered, grouping by back office and filtering by user.
      See Also:
    • EXISTS_CONTRACT_NULL

      private static final String EXISTS_CONTRACT_NULL
      Query to exists contract is null in product table.
      See Also:
    • FIND_BY_SUBSYSTEMS

      private static final String FIND_BY_SUBSYSTEMS
      Query to find all subsystems that have, at least, one product registered, ordering by back office and filtering by subtypes.
      See Also:
    • FIND_BY_TYPE

      private static final String FIND_BY_TYPE
      Query to find all subsystems that have, at least, one product registered, ordering by back office and filtering by types.
      See Also:
    • jdbcTemplate

      @Autowired private org.springframework.jdbc.core.JdbcTemplate jdbcTemplate
      JdbcTemplate to query the database.
  • Constructor Details

    • BackofficeSubsystemRepository

      public BackofficeSubsystemRepository()
  • Method Details

    • findByUserIdAndContractId

      public List<BackofficeSubsystems> findByUserIdAndContractId(String userId, String contractId)
      Find all subsystems that have, at least, one product registered, grouping by back office and filtering by user.
      Parameters:
      userId - user identifier.
      contractId - contract identifier.
      Returns:
      back office subsystems.
    • existsContractIsNull

      public List<BackofficeSubsystems> existsContractIsNull(String userId)
      Find all subsystems that have, at least, one product registered, grouping by back office and filtering by user.
      Parameters:
      userId - user identifier.
      Returns:
      back office subsystems.
    • findBySubtypes

      public List<BackofficeSubsystems> findBySubtypes(List<Integer> subtypes)
      Find all subsystems that have, at least, one product registered, grouping by back office and filtering by subtypes.
      Parameters:
      subtypes - subtypes list to filter.
      Returns:
      back office subsystems.
    • findByType

      public List<BackofficeSubsystems> findByType(Integer typeId)
      Find all subsystems that have, at least, one product registered, grouping by back office and filtering by type.
      Parameters:
      typeId - type to filter.
      Returns:
      back office subsystems.
    • createRealParamsNumber

      private String createRealParamsNumber(List<Integer> params)