|
|
|
@ -38,7 +38,7 @@ public class ToolDaoImpl implements ToolDao { |
|
|
|
sql.append("SELECT site, tool_id, tool_description toolDesc, c_tool_type toolType, c_calendar_id calendarId, c_sched_capacity schedCapacity,"); |
|
|
|
sql.append(" c_calibration_control calibrationControl, c_calibration_time calibrationTime, c_alternate_tool_id alternateToolId, c_last_used lastUsed,"); |
|
|
|
sql.append(" dbo.getToolInfoDesc(site, c_alternate_tool_id) alternateToolDesc, dbo.getToolTypeDesc(c_tool_type) toolTypeDesc,"); |
|
|
|
sql.append(" c_state state, c_property_no propertyNo,"); |
|
|
|
sql.append(" c_state state, c_property_no propertyNo, created_by, create_date, updated_by, updated_date,"); |
|
|
|
sql.append(" c_enabled_for_control_plan_db enabledForControlPlanDb, c_note_text noteText, ifs_row_id, ifs_row_version"); |
|
|
|
sql.append(" FROM tool_header th WHERE 1 = 1"); |
|
|
|
//判断查询的条件 |
|
|
|
@ -92,7 +92,7 @@ public class ToolDaoImpl implements ToolDao { |
|
|
|
sql.append(" c_note_text noteText, c_tool_discrimination toolDiscrimination, c_tool_linearity toolLinearity, c_tool_repeatability toolRepeatability,"); |
|
|
|
//后续添加的字段 |
|
|
|
sql.append(" c_next_calibration_date nextCalibrationDate, '' toolResourceId, '' toolResourceDesc, dbo.get_workCenter_desc(site, work_center_no) normalWorkCenterDesc,"); |
|
|
|
sql.append(" c_property_no propertyNo,"); |
|
|
|
sql.append(" c_property_no propertyNo, created_by, created_date, updated_by, updated_date,"); |
|
|
|
sql.append(" c_state state, dbo.getProductionLineDesc(site, c_normal_production_line) normalProductionLineDesc, '' toolResourceId, '' toolResourceDesc,"); |
|
|
|
sql.append(" c_tool_bias toolBias, c_tool_stability toolStability, c_tool_reproducibility toolReproducibility"); |
|
|
|
sql.append(" FROM tool_detail td"); |
|
|
|
@ -106,7 +106,7 @@ public class ToolDaoImpl implements ToolDao { |
|
|
|
public List<IfsToolInstanceDateData> getToolInstanceDates(String site, String toolId, String toolInstance) { |
|
|
|
StringBuilder sql = new StringBuilder(); |
|
|
|
Map<String, Object> paramMap = new HashMap<String, Object>(); |
|
|
|
sql.append("SELECT id, site, tool_id, tool_instance, begin_date, end_date,"); |
|
|
|
sql.append("SELECT id, site, tool_id, tool_instance, begin_date, end_date, created_by, created_date, updated_by, updated_date,"); |
|
|
|
sql.append(" ifs_row_id, ifs_row_version FROM tool_detail_phase_date thd"); |
|
|
|
sql.append(" WHERE thd.site = :site AND thd.tool_id = :toolId AND thd.tool_instance = :toolInstance"); |
|
|
|
paramMap.put("site", site); |
|
|
|
@ -144,11 +144,11 @@ public class ToolDaoImpl implements ToolDao { |
|
|
|
public void insertToolInfo(IfsTool inData) { |
|
|
|
StringBuilder sql = new StringBuilder(); |
|
|
|
sql.append("INSERT INTO tool_header(site, tool_id, tool_description, c_tool_type, c_calendar_id, c_sched_capacity,"); |
|
|
|
sql.append(" c_calibration_control, c_calibration_time, c_alternate_tool_id, c_last_used, c_enabled_for_control_plan_db, c_note_text, create_date,"); |
|
|
|
sql.append(" created_by, c_state, c_property_no, ifs_row_id, ifs_row_version)"); |
|
|
|
sql.append(" c_calibration_control, c_calibration_time, c_alternate_tool_id, c_last_used, c_enabled_for_control_plan_db, c_note_text,"); |
|
|
|
sql.append(" created_by, create_date, c_state, c_property_no, ifs_row_id, ifs_row_version)"); |
|
|
|
sql.append("VALUES(:site, :toolId, :toolDesc, :toolType, :calendarId, :schedCapacity,"); |
|
|
|
sql.append(" :calibrationControl, :calibrationTime, :alternateToolId, :lastUsed, :enabledForControlPlanDb, :noteText, :createDate,"); |
|
|
|
sql.append(" :username, :state, :propertyNo, :ifsRowId, :ifsRowVersion)"); |
|
|
|
sql.append(" :calibrationControl, :calibrationTime, :alternateToolId, :lastUsed, :enabledForControlPlanDb, :noteText,"); |
|
|
|
sql.append(" :username, :createDate, :state, :propertyNo, :ifsRowId, :ifsRowVersion)"); |
|
|
|
parameterJdbcTemplate.update(sql.toString(), new BeanPropertySqlParameterSource(inData)); |
|
|
|
} |
|
|
|
|
|
|
|
@ -157,6 +157,7 @@ public class ToolDaoImpl implements ToolDao { |
|
|
|
StringBuilder sql = new StringBuilder(); |
|
|
|
sql.append("UPDATE tool_header SET tool_description = :toolDesc, c_tool_type = :toolType, c_calendar_id = :calendarId,"); |
|
|
|
sql.append(" c_sched_capacity = :schedCapacity, c_calibration_control = :calibrationControl, c_calibration_time = :calibrationTime, c_alternate_tool_id = :alternateToolId,"); |
|
|
|
sql.append(" updated_by = :username, updated_date = :updatedDate,"); |
|
|
|
sql.append(" c_property_no = :propertyNo, ifs_row_id = :ifsRowId, ifs_row_version = :ifsRowVersion,"); |
|
|
|
sql.append(" c_last_used = :lastUsed, last_update_by = :username, c_enabled_for_control_plan_db = :enabledForControlPlanDb, c_note_text = :noteText"); |
|
|
|
sql.append(" WHERE site = :site AND tool_id = :toolId"); |
|
|
|
@ -176,9 +177,11 @@ public class ToolDaoImpl implements ToolDao { |
|
|
|
StringBuilder sql = new StringBuilder(); |
|
|
|
sql.append("INSERT INTO tool_detail(site, tool_id, tool_instance_id, work_center_no, c_desc, c_last_calibration_date,"); |
|
|
|
sql.append(" c_object_id, c_normal_production_line, c_note_text, c_tool_discrimination, c_tool_linearity, c_tool_repeatability, c_tool_bias, c_tool_stability,"); |
|
|
|
sql.append(" created_by, created_date,"); |
|
|
|
sql.append(" c_tool_reproducibility, c_next_calibration_date, c_state, c_property_no, ifs_row_id, ifs_row_version)"); |
|
|
|
sql.append(" VALUES(:site, :toolId, :toolInstance, :normalWorkCenterNo, :description, :lastCalibrationDate,"); |
|
|
|
sql.append(" :objectId, :normalProductionLine, :noteText, :toolDiscrimination, :toolLinearity, :toolRepeatability, :toolBias, :toolStability,"); |
|
|
|
sql.append(" :username, :createdDate,"); |
|
|
|
sql.append(" :toolReproducibility, :nextCalibrationDate, :state, :propertyNo, :ifsRowId, :ifsRowVersion)"); |
|
|
|
parameterJdbcTemplate.update(sql.toString(), new BeanPropertySqlParameterSource(inData)); |
|
|
|
} |
|
|
|
@ -190,6 +193,7 @@ public class ToolDaoImpl implements ToolDao { |
|
|
|
sql.append(" c_next_calibration_date = :nextCalibrationDate, c_state = :state,"); |
|
|
|
sql.append(" c_object_id = :objectId, c_normal_production_line = :normalProductionLine, c_note_text = :noteText, c_tool_discrimination = :toolDiscrimination,"); |
|
|
|
sql.append(" c_tool_linearity = :toolLinearity, c_tool_repeatability = :toolRepeatability, c_tool_bias = :toolBias,"); |
|
|
|
sql.append(" updated_by = :username, updated_date = :updatedDate,"); |
|
|
|
sql.append(" c_property_no = :propertyNo, ifs_row_id = :ifsRowId, ifs_row_version = :ifsRowVersion,"); |
|
|
|
sql.append(" c_tool_stability = :toolStability, c_tool_reproducibility = :toolReproducibility"); |
|
|
|
sql.append(" WHERE site = :site AND tool_id = :toolId AND tool_instance_id = :toolInstance"); |
|
|
|
@ -209,8 +213,10 @@ public class ToolDaoImpl implements ToolDao { |
|
|
|
StringBuilder sql = new StringBuilder(); |
|
|
|
KeyHolder keyHolder = new GeneratedKeyHolder(); |
|
|
|
sql.append("INSERT INTO tool_detail_phase_date(site, tool_id, tool_instance, begin_date, end_date, ifs_row_id,"); |
|
|
|
sql.append(" created_by, created_date,"); |
|
|
|
sql.append(" ifs_row_version)"); |
|
|
|
sql.append(" VALUES(:site, :toolId, :toolInstance, :beginDate, :endDate, :ifsRowId,"); |
|
|
|
sql.append(" :username, :createdDate,"); |
|
|
|
sql.append(" :ifsRowVersion)"); |
|
|
|
parameterJdbcTemplate.update(sql.toString(), new BeanPropertySqlParameterSource(inData), keyHolder); |
|
|
|
return keyHolder.getKey().intValue(); |
|
|
|
@ -219,7 +225,8 @@ public class ToolDaoImpl implements ToolDao { |
|
|
|
@Override |
|
|
|
public int updateToolInstanceDate(IfsToolInstanceDate inData) { |
|
|
|
StringBuilder sql = new StringBuilder(); |
|
|
|
sql.append("UPDATE tool_detail_phase_date SET end_date = :endDate, ifs_row_id = :ifsRowId, ifs_row_version = :ifsRowVersion"); |
|
|
|
sql.append("UPDATE tool_detail_phase_date SET end_date = :endDate, ifs_row_id = :ifsRowId, ifs_row_version = :ifsRowVersion,"); |
|
|
|
sql.append(" updated_by = :username, updated_date = :updatedDate"); |
|
|
|
sql.append(" WHERE id = :id"); |
|
|
|
return parameterJdbcTemplate.update(sql.toString(), new BeanPropertySqlParameterSource(inData)); |
|
|
|
} |
|
|
|
|