# LotStepHistoryInqDAOImpl.java

    package com.mycim.server.wip.dao.impl;

    import com.mycim.framework.jdbc.JdbcTemplate;
    import com.mycim.server.wip.dao.LotStepHistoryInqDAO;
    import com.mycim.server.wip.dao.mapper.LotStepHistoryMapper;
    import com.mycim.valueobject.wip.LotStepHistory;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.stereotype.Repository;

    import java.util.List;

    /**
     * @author finatice.yang
     * @date 2022/1/24
     **/
    @Repository
    public class LotStepHistoryInqDAOImpl implements LotStepHistoryInqDAO {

        @Autowired
        JdbcTemplate jdbcTemplate;

        @Override
        public LotStepHistory getLotStepHistory(Long lotRrn, Long stepSequence) {
            String sql = "SELECT LOT_RRN,STEP_SEQUENCE,FACILITY_RRN,LOT_ID,PRODUCT_RRN,PRODUCT_VERSION,PROCESS_RRN," +
                    "PROCESS_VERSION,PROCESS_STEP_VERSION,PROCESS_STEP_ID_VERSION,OPERATION_RRN,OPERATION_VERSION," +
                    "SUBCONTRACTOR_RRN,STAGE_ID,LAYER_ID,CARRIER_RRN,CARRIER_MAP_RRN,RUN_RRN,EQPT_RRN,RECIPE_STRING," +
                    "RETICLE_RRN,BIN_RRN,MOVE_IN_DCOL_RRN,MOVE_OUT_DCOL_RRN,AD_HOC_DCOL_RRN,REWORK_FLAG,SPLIT_QTY1," +
                    "SPLIT_QTY2,MERGE_QTY1,MERGE_QTY2,LOSS_QTY1,LOSS_QTY2,BONUS_QTY1," +
                    "BONUS_QTY2,SCRAP_QTY1,SCRAP_QTY2,DEFECTIVE_QTY1,DEFECTIVE_QTY2,INTERNAL_REWORK_QTY1," +
                    "INTERNAL_REWORK_QTY2,TRACK_UNIT_FLAG,IN_QTY1,IN_QTY2,OUT_QTY1,OUT_QTY2,MOVE_IN_QTY1," +
                    "MOVE_IN_QTY2,MOVE_OUT_QTY1,MOVE_OUT_QTY2,EXTERNAL_REWORK_QTY1,EXTERNAL_REWORK_QTY2," +
                    "LOAD_POSITION,STEP_TRANS_RRN,CHAMBER_TYPE,OPERATION_SEQ,POLLUTION_LEVEL,ROUTE_SEQ," +
                    "PRODUCT_LAYER,HOT_FLAG,PRIORITY,CREATE_CATEGORY,RECIPE_GROUP_RRN,RECIPE_LOGICAL_RRN," +
                    "RECIPE_GROUP_VERSION,RECIPE_LOGICAL_VERSION,RECIPE_PHYSICAL_ID," +
                    "PARAMETER,PARAMETER_VALUE,OPERATION_DESC,STEP_TYPE,WORK_AREA,FLOW_SEQ,EQPT_GROUP," +
                    "EQPT_GROUP_RRN,PROCESS_LOCATION," +
                    "CUSTOMER_ID,SHIPPING_CODE,OUTER_ORDER_NO,OUT_ORDER_TYPE,RECYCLE_STEP_INFO,RECYCLE_STEP_ID_INFO";
            sql += " FROM LOT_STEP_HISTORY";
            sql += " WHERE LOT_RRN=? AND STEP_SEQUENCE = ?";
            Object[] args = new Object[]{lotRrn, stepSequence};
            return jdbcTemplate.queryForObjectWithNull(sql, args, new LotStepHistoryMapper());
        }

    }