28 lines
1.1 KiB
Java
28 lines
1.1 KiB
Java
package com.utopiaindustries.dao.ctp;
|
|
|
|
import com.utopiaindustries.model.ctp.JobCard;
|
|
import org.springframework.jdbc.core.RowMapper;
|
|
|
|
import java.sql.ResultSet;
|
|
import java.sql.SQLException;
|
|
|
|
public class JobCardRowMapper implements RowMapper<JobCard> {
|
|
public JobCard mapRow( ResultSet rs, int rowNum ) throws SQLException {
|
|
JobCard jobCard = new JobCard();
|
|
jobCard.setId( rs.getLong( "id" ) );
|
|
jobCard.setCode( rs.getString("code" ));
|
|
jobCard.setJobOrderId( rs.getLong( "job_order_id" ) );
|
|
if ( rs.getTimestamp( "created_at" ) != null ) {
|
|
jobCard.setCreatedAt( rs.getTimestamp( "created_at" ).toLocalDateTime() );
|
|
}
|
|
jobCard.setCreatedBy( rs.getString( "created_by" ) );
|
|
jobCard.setStatus( rs.getString("status" ));
|
|
jobCard.setInventoryStatus( rs.getString("inventory_status"));
|
|
jobCard.setCustomer( rs.getString("customer") );
|
|
jobCard.setLotNumber( rs.getString("lot_number") );
|
|
jobCard.setPurchaseOrderId( rs.getLong("purchase_order_id") );
|
|
jobCard.setLocationSiteId( rs.getLong("location_site_id" ) );
|
|
jobCard.setDescription( rs.getString("description" ) );
|
|
return jobCard;
|
|
}
|
|
} |