ronaldkwandy

Untitled

Aug 14th, 2019
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.13 KB | None | 0 0
  1. package id.co.sofcograha.gajiidapi.domain.hris.payroll.proses.hitungthr.repositories;
  2.  
  3. import javax.annotation.PostConstruct;
  4.  
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.jdbc.core.JdbcTemplate;
  7. import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
  8. import org.springframework.jdbc.core.simple.SimpleJdbcCall;
  9. import org.springframework.stereotype.Repository;
  10.  
  11. @Repository
  12. public class PrsHitungThrRepository {
  13.    
  14.     @Autowired
  15.     private JdbcTemplate jdbcTemplate;
  16.    
  17.     private SimpleJdbcCall simpleJdbcCallHitungThr;
  18.    
  19.     @PostConstruct
  20.     void init() {
  21.         jdbcTemplate.setResultsMapCaseInsensitive(true);
  22.         simpleJdbcCallHitungThr = new SimpleJdbcCall(jdbcTemplate).withFunctionName("spProsesHitungThr");
  23.     }
  24.    
  25.     public Boolean hitungThr(String processStatusId, String username) {
  26.         MapSqlParameterSource params = new MapSqlParameterSource();
  27.         params.addValue("pProcessStatusId", processStatusId);
  28.         params.addValue("pUsername", username);
  29.        
  30.         Boolean isValid = simpleJdbcCallHitungThr.executeFunction(Boolean.class, params);
  31.         return isValid;
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment