package rspdb import ( "context" "database/sql" "fmt" "git.espin.casa/albert/cml04-gdm-int/pkg/api" _ "github.com/microsoft/go-mssqldb" ) var ( BreakDownRollDataQuery string = `SELECT BD_ROLL_SET_DATE, BD_ROLL_SET_ID, BD_TOP_ROLL_NUMBER, BD_BOT_ROLL_NUMBER, BD_ROLL_MATERIAL, BD_ROLL_INSTALL_POS, BD_ROLL_SET_TYPE, BD_ROLL_DIAM_NOM_ACT_TOP, BD_ROLL_DIAM_NOM_ACT_BOT, BD_ROLL_NOMINAL_GAP, BD_ROLL_GROOVES, BD_ROLL_GROOVE_WIDTH0, BD_ROLL_GROOVE_WIDTH1, BD_ROLL_GROOVE_WIDTH2, BD_ROLL_GROOVE_WIDTH3, BD_ROLL_GROOVE_WIDTH4, BD_ROLL_GROOVE_WIDTH5, BD_ROLL_GROOVE_WIDTH6, BD_ROLL_GROOVE_WIDTH7, BD_ROLL_GROOVE_WIDTH8, BD_ROLL_GROOVE_WIDTH9, BD_ROLL_GROOVE_STIFFNESS_TOP0, BD_ROLL_GROOVE_STIFFNESS_TOP1, BD_ROLL_GROOVE_STIFFNESS_TOP2, BD_ROLL_GROOVE_STIFFNESS_TOP3, BD_ROLL_GROOVE_STIFFNESS_TOP4, BD_ROLL_GROOVE_STIFFNESS_TOP5, BD_ROLL_GROOVE_STIFFNESS_TOP6, BD_ROLL_GROOVE_STIFFNESS_TOP7, BD_ROLL_GROOVE_STIFFNESS_TOP8, BD_ROLL_GROOVE_STIFFNESS_TOP9, BD_ROLL_GROOVE_STIFFNESS_BOT0, BD_ROLL_GROOVE_STIFFNESS_BOT1, BD_ROLL_GROOVE_STIFFNESS_BOT2, BD_ROLL_GROOVE_STIFFNESS_BOT3, BD_ROLL_GROOVE_STIFFNESS_BOT4, BD_ROLL_GROOVE_STIFFNESS_BOT5, BD_ROLL_GROOVE_STIFFNESS_BOT6, BD_ROLL_GROOVE_STIFFNESS_BOT7, BD_ROLL_GROOVE_STIFFNESS_BOT8, BD_ROLL_GROOVE_STIFFNESS_BOT9, BD_ROLL_GROOVE_POS0, BD_ROLL_GROOVE_POS1, BD_ROLL_GROOVE_POS2, BD_ROLL_GROOVE_POS3, BD_ROLL_GROOVE_POS4, BD_ROLL_GROOVE_POS5, BD_ROLL_GROOVE_POS6, BD_ROLL_GROOVE_POS7, BD_ROLL_GROOVE_POS8, BD_ROLL_GROOVE_POS9, BD_ROLL_GROOVE_SHARP0, BD_ROLL_GROOVE_SHARP1, BD_ROLL_GROOVE_SHARP2, BD_ROLL_GROOVE_SHARP3, BD_ROLL_GROOVE_SHARP4, BD_ROLL_GROOVE_SHARP5, BD_ROLL_GROOVE_SHARP6, BD_ROLL_GROOVE_SHARP7, BD_ROLL_GROOVE_SHARP8, BD_ROLL_GROOVE_SHARP9, BD_ROLL_GROOVE_DEPTH0, BD_ROLL_GROOVE_DEPTH1, BD_ROLL_GROOVE_DEPTH2, BD_ROLL_GROOVE_DEPTH3, BD_ROLL_GROOVE_DEPTH4, BD_ROLL_GROOVE_DEPTH5, BD_ROLL_GROOVE_DEPTH6, BD_ROLL_GROOVE_DEPTH7, BD_ROLL_GROOVE_DEPTH8, BD_ROLL_GROOVE_DEPTH9, BD_ROLL_ASSEMBLY_STATUS, BD_NO_OF_FIN_SEC, BD_INIT_SEC0, BD_INIT_SEC1, BD_INIT_SEC2, BD_INIT_SEC3, BD_INIT_SEC4, BD_FIN_SEC0, BD_FIN_SEC1, BD_FIN_SEC2, BD_FIN_SEC3, BD_FIN_SEC4, BD_ROLL_ACTUAL_SHIMPS_TOP, BD_ROLL_ACTUAL_SHIMPS_BOT, BD_TONNAGE_ACCUM0, BD_TONNAGE_ACCUM1, BD_TONNAGE_ACCUM2, BD_TONNAGE_ACCUM3, BD_TONNAGE_ACCUM4, BD_TONNAGE_ACCUM5, BD_TONNAGE_ACCUM6, BD_TONNAGE_ACCUM7, BD_TONNAGE_ACCUM8, BD_TONNAGE_ACCUM9, BD_ROLL_ID, BD_DEL_FLAG, BD_ROLL_SET_ID_OLD, BD_FIN_SEC5, BD_FIN_SEC6, BD_FIN_SEC7, BD_FIN_SEC8, BD_FIN_SEC9, BD_FIN_SEC10, BD_FIN_SEC11, BD_FIN_SEC12, BD_FIN_SEC13, BD_FIN_SEC14, BD_FIN_SEC15, BD_FIN_SEC16, BD_FIN_SEC17, BD_FIN_SEC18, BD_FIN_SEC19, OLD_FLAG, ALTURA_BARRON_SALIDA, ALTURA_BARRON_ENTRADA, FAMILIA, CORRECCION, ESTADO_REGISTRO, FECHA_REGISTRO, FECHA_ENVIO FROM gdm_rspid_BD WHERE BD_ROLL_ID = '%s'` UniversalRoughingDataQuery string = `SELECT UR_ROLL_SET_DATE, UR_ROLL_SET_ID, UR_ROLL_SET_ID_HROLLS, UR_HTO_ROLL_NUMBER, UR_HBO_ROLL_NUMBER, UR_ROLL_INSTALL_POS, UR_ROLL_SET_TYPE, UR_TONNAGE_ACCUM0, UR_TONNAGE_ACCUM1, UR_TONNAGE_ACCUM2, UR_TONNAGE_ACCUM3, UR_TONNAGE_ACCUM4, UR_TONNAGE_ACCUM5, UR_TONNAGE_ACCUM6, UR_TONNAGE_ACCUM7, UR_TONNAGE_ACCUM8, UR_TONNAGE_ACCUM9, UR_CHANGE_SLEEVE_LENGTH, UR_CHANGE_SLEEVE_DEPTH, UR_ROLL_ASSEMBLY_STATUS, UR_NO_OF_FIN_SEC, UR_INIT_SEC0, UR_INIT_SEC1, UR_INIT_SEC2, UR_INIT_SEC3, UR_INIT_SEC4, UR_FIN_SEC0, UR_FIN_SEC1, UR_FIN_SEC2, UR_FIN_SEC3, UR_FIN_SEC4, UR_ROLL_MATERIAL_H, UR_ROLL_DIAM_ACT_HBO, UR_ROLL_DIAM_ACT_HTP, UR_H_NOMGAP, UR_ACTUAL_SHIMPS_HBO, UR_ACTUAL_SHIMPS_HTP, UR_ROLL_BARREL_WIDTH_HBO, UR_ROLL_BARREL_WIDTH_HTP, UR_ROLL_CHAM_WIDTH_HBO, UR_ROLL_CHAM_WIDTH_HTP, UR_ROLL_ANGLE_HBO, UR_ROLL_ANGLE_HTB, UR_ROLL_SET_ID_VROLLS, UR_VDS_ROLL_NUMBER, UR_VOS_ROLL_NUMBER, UR_ROLL_MATERIAL_V, UR_ROLL_DIAM_ACT_VDS, UR_ROLL_DIAM_ACT_VOS, UR_ROLL_ANGLE_VDS, UR_ROLL_ANGLE_VOS, UR_PASSLINE_OFFSET, UR_ACTUAL_SHIMPS_VDS_1, UR_ACTUAL_SHIMPS_VDS_2, UR_ACTUAL_SHIMPS_VOS_1, UR_ACTUAL_SHIMPS_VOS_2, UR_PIN_V_CHOCK, UR_ROLL_GROOVES, UR_ROLL_GROOVE_WIDTH0, UR_ROLL_GROOVE_WIDTH1, UR_ROLL_GROOVE_WIDTH2, UR_ROLL_GROOVE_WIDTH3, UR_ROLL_GROOVE_WIDTH4, UR_ROLL_GROOVE_WIDTH5, UR_ROLL_GROOVE_WIDTH6, UR_ROLL_GROOVE_WIDTH7, UR_ROLL_GROOVE_WIDTH8, UR_ROLL_GROOVE_WIDTH9, UR_ROLL_GROOVE_STIFFNESS_TOP0, UR_ROLL_GROOVE_STIFFNESS_TOP1, UR_ROLL_GROOVE_STIFFNESS_TOP2, UR_ROLL_GROOVE_STIFFNESS_TOP3, UR_ROLL_GROOVE_STIFFNESS_TOP4, UR_ROLL_GROOVE_STIFFNESS_TOP5, UR_ROLL_GROOVE_STIFFNESS_TOP6, UR_ROLL_GROOVE_STIFFNESS_TOP7, UR_ROLL_GROOVE_STIFFNESS_TOP8, UR_ROLL_GROOVE_STIFFNESS_TOP9, UR_ROLL_GROOVE_STIFFNESS_BOT0, UR_ROLL_GROOVE_STIFFNESS_BOT1, UR_ROLL_GROOVE_STIFFNESS_BOT2, UR_ROLL_GROOVE_STIFFNESS_BOT3, UR_ROLL_GROOVE_STIFFNESS_BOT4, UR_ROLL_GROOVE_STIFFNESS_BOT5, UR_ROLL_GROOVE_STIFFNESS_BOT6, UR_ROLL_GROOVE_STIFFNESS_BOT7, UR_ROLL_GROOVE_STIFFNESS_BOT8, UR_ROLL_GROOVE_STIFFNESS_BOT9, UR_ROLL_GROOVE_POS0, UR_ROLL_GROOVE_POS1, UR_ROLL_GROOVE_POS2, UR_ROLL_GROOVE_POS3, UR_ROLL_GROOVE_POS4, UR_ROLL_GROOVE_POS5, UR_ROLL_GROOVE_POS6, UR_ROLL_GROOVE_POS7, UR_ROLL_GROOVE_POS8, UR_ROLL_GROOVE_POS9, UR_ROLL_GROOVE_SHARP0, UR_ROLL_GROOVE_SHARP1, UR_ROLL_GROOVE_SHARP2, UR_ROLL_GROOVE_SHARP3, UR_ROLL_GROOVE_SHARP4, UR_ROLL_GROOVE_SHARP5, UR_ROLL_GROOVE_SHARP6, UR_ROLL_GROOVE_SHARP7, UR_ROLL_GROOVE_SHARP8, UR_ROLL_GROOVE_SHARP9,ISNULL(UR_ROLL_THRUST_PLATE,0), UR_ROLL_ID, UR_DEL_FLAG, UR_ROLL_SET_ID_OLD, TOP_SHAFT_UR, BOT_SHAFT_UR, UR_FIN_SEC5, UR_FIN_SEC6, UR_FIN_SEC7, UR_FIN_SEC8, UR_FIN_SEC9, UR_FIN_SEC10, UR_FIN_SEC11, UR_FIN_SEC12, UR_FIN_SEC13, UR_FIN_SEC14, UR_FIN_SEC15, UR_FIN_SEC16, UR_FIN_SEC17, UR_FIN_SEC18, UR_FIN_SEC19, OLD_FLAG, ISNULL(AMPUESA_CORTA,0), ESTADO_REGISTRO, FECHA_REGISTRO, FECHA_ENVIO FROM gdm_rspid_UR WHERE UR_ROLL_ID = '%s'` EdgerDataQuery string = `SELECT ED_ROLL_SET_DATE, ED_ROLL_SET_ID, ED_TOP_ROLL_NUMBER, ED_BOT_ROLL_NUMBER, ED_ROLL_MATERIAL, ED_ROLL_INSTALL_POS, ED_ROLL_SET_TYPE, ED_ROLL_DIAM_NOM_HTP, ED_ROLL_DIAM_NOM_HBO, ED_ROLL_NOMINAL_GAP, ED_ROLL_ASSEMBLY_STATUS, ED_NO_OF_FIN_SEC, ED_INIT_SEC0, ED_INIT_SEC1, ED_INIT_SEC2, ED_INIT_SEC3, ED_INIT_SEC4, ED_FIN_SEC0, ED_FIN_SEC1, ED_FIN_SEC2, ED_FIN_SEC3, ED_FIN_SEC4, ED_ROLL_NO_OF_GROOVES, ED_ROLL_GROOVE_STIFF_TOP0, ED_ROLL_GROOVE_STIFF_TOP1, ED_ROLL_GROOVE_STIFF_TOP2, ED_ROLL_GROOVE_STIFF_TOP3, ED_ROLL_GROOVE_STIFF_TOP4, ED_ROLL_GROOVE_STIFF_TOP5, ED_ROLL_GROOVE_STIFF_TOP6, ED_ROLL_GROOVE_STIFF_TOP7, ED_ROLL_GROOVE_STIFF_TOP8, ED_ROLL_GROOVE_STIFF_TOP9, ED_ROLL_GROOVE_STIFF_BOT0, ED_ROLL_GROOVE_STIFF_BOT1, ED_ROLL_GROOVE_STIFF_BOT2, ED_ROLL_GROOVE_STIFF_BOT3, ED_ROLL_GROOVE_STIFF_BOT4, ED_ROLL_GROOVE_STIFF_BOT5, ED_ROLL_GROOVE_STIFF_BOT6, ED_ROLL_GROOVE_STIFF_BOT7, ED_ROLL_GROOVE_STIFF_BOT8, ED_ROLL_GROOVE_STIFF_BOT9, ED_ROLL_GROOVE_POS0, ED_ROLL_GROOVE_POS1, ED_ROLL_GROOVE_POS2, ED_ROLL_GROOVE_POS3, ED_ROLL_GROOVE_POS4, ED_ROLL_GROOVE_POS5, ED_ROLL_GROOVE_POS6, ED_ROLL_GROOVE_POS7, ED_ROLL_GROOVE_POS8, ED_ROLL_GROOVE_POS9, ED_ACTUAL_SHIMPS_HBO, ED_ACTUAL_SHIMPS_HTP, ED_CHANGE_SLEEVE_LENGTH, ED_CHANGE_SLEEVE_DEPTH, ED_TONNAGE_ACCUM0, ED_TONNAGE_ACCUM1, ED_TONNAGE_ACCUM2, ED_TONNAGE_ACCUM3, ED_TONNAGE_ACCUM4, ED_TONNAGE_ACCUM5, ED_TONNAGE_ACCUM6, ED_TONNAGE_ACCUM7, ED_TONNAGE_ACCUM8, ED_TONNAGE_ACCUM9, ED_ROLL_FLANGE_DIAM_TOP0, ED_ROLL_FLANGE_DIAM_TOP1, ED_ROLL_FLANGE_DIAM_TOP2, ED_ROLL_FLANGE_DIAM_TOP3, ED_ROLL_FLANGE_DIAM_TOP4, ED_ROLL_FLANGE_DIAM_TOP5, ED_ROLL_FLANGE_DIAM_TOP6, ED_ROLL_FLANGE_DIAM_TOP7, ED_ROLL_FLANGE_DIAM_TOP8, ED_ROLL_FLANGE_DIAM_TOP9, ED_ROLL_FLANGE_DIAM_BOT0, ED_ROLL_FLANGE_DIAM_BOT1, ED_ROLL_FLANGE_DIAM_BOT2, ED_ROLL_FLANGE_DIAM_BOT3, ED_ROLL_FLANGE_DIAM_BOT4, ED_ROLL_FLANGE_DIAM_BOT5, ED_ROLL_FLANGE_DIAM_BOT6, ED_ROLL_FLANGE_DIAM_BOT7, ED_ROLL_FLANGE_DIAM_BOT8, ED_ROLL_FLANGE_DIAM_BOT9, ED_ROLL_WEB_DIAM_TOP0, ED_ROLL_WEB_DIAM_TOP1, ED_ROLL_WEB_DIAM_TOP2, ED_ROLL_WEB_DIAM_TOP3, ED_ROLL_WEB_DIAM_TOP4, ED_ROLL_WEB_DIAM_TOP5, ED_ROLL_WEB_DIAM_TOP6, ED_ROLL_WEB_DIAM_TOP7, ED_ROLL_WEB_DIAM_TOP8, ED_ROLL_WEB_DIAM_TOP9, ED_ROLL_WEB_DIAM_BOT0, ED_ROLL_WEB_DIAM_BOT1, ED_ROLL_WEB_DIAM_BOT2, ED_ROLL_WEB_DIAM_BOT3, ED_ROLL_WEB_DIAM_BOT4, ED_ROLL_WEB_DIAM_BOT5, ED_ROLL_WEB_DIAM_BOT6, ED_ROLL_WEB_DIAM_BOT7, ED_ROLL_WEB_DIAM_BOT8, ED_ROLL_WEB_DIAM_BOT9, ED_ROLL_CHAM_WIDTH_TOP0, ED_ROLL_CHAM_WIDTH_TOP1, ED_ROLL_CHAM_WIDTH_TOP2, ED_ROLL_CHAM_WIDTH_TOP3, ED_ROLL_CHAM_WIDTH_TOP4, ED_ROLL_CHAM_WIDTH_TOP5, ED_ROLL_CHAM_WIDTH_TOP6, ED_ROLL_CHAM_WIDTH_TOP7, ED_ROLL_CHAM_WIDTH_TOP8, ED_ROLL_CHAM_WIDTH_TOP9, ED_ROLL_CHAM_WIDTH_BOT0, ED_ROLL_CHAM_WIDTH_BOT1, ED_ROLL_CHAM_WIDTH_BOT2, ED_ROLL_CHAM_WIDTH_BOT3, ED_ROLL_CHAM_WIDTH_BOT4, ED_ROLL_CHAM_WIDTH_BOT5, ED_ROLL_CHAM_WIDTH_BOT6, ED_ROLL_CHAM_WIDTH_BOT7, ED_ROLL_CHAM_WIDTH_BOT8, ED_ROLL_CHAM_WIDTH_BOT9, ED_ROLL_ANGLE_FLANGE_FACE0, ED_ROLL_ANGLE_FLANGE_FACE1, ED_ROLL_ANGLE_FLANGE_FACE2, ED_ROLL_ANGLE_FLANGE_FACE3, ED_ROLL_ANGLE_FLANGE_FACE4, ED_ROLL_ANGLE_FLANGE_FACE5, ED_ROLL_ANGLE_FLANGE_FACE6, ED_ROLL_ANGLE_FLANGE_FACE7, ED_ROLL_ANGLE_FLANGE_FACE8, ED_ROLL_ANGLE_FLANGE_FACE9, ED_ROLL_ROOT_RADIUS0, ED_ROLL_ROOT_RADIUS1, ED_ROLL_ROOT_RADIUS2, ED_ROLL_ROOT_RADIUS3, ED_ROLL_ROOT_RADIUS4, ED_ROLL_ROOT_RADIUS5, ED_ROLL_ROOT_RADIUS6, ED_ROLL_ROOT_RADIUS7, ED_ROLL_ROOT_RADIUS8, ED_ROLL_ROOT_RADIUS9, ED_PASSLINE_OFFSET, ED_D_ROLL_GROOVE_SHARP0, ED_D_ROLL_GROOVE_SHARP1, ED_D_ROLL_GROOVE_SHARP2, ED_D_ROLL_GROOVE_SHARP3, ED_D_ROLL_GROOVE_SHARP4, ED_D_ROLL_GROOVE_SHARP5, ED_D_ROLL_GROOVE_SHARP6, ED_D_ROLL_GROOVE_SHARP7, ED_D_ROLL_GROOVE_SHARP8, ED_D_ROLL_GROOVE_SHARP9, ED_D_ROLL_GROOVE_WIDTH0, ED_D_ROLL_GROOVE_WIDTH1, ED_D_ROLL_GROOVE_WIDTH2, ED_D_ROLL_GROOVE_WIDTH3, ED_D_ROLL_GROOVE_WIDTH4, ED_D_ROLL_GROOVE_WIDTH5, ED_D_ROLL_GROOVE_WIDTH6, ED_D_ROLL_GROOVE_WIDTH7, ED_D_ROLL_GROOVE_WIDTH8, ED_D_ROLL_GROOVE_WIDTH9, ED_ROLL_ID, ED_DEL_FLAG, ED_ROLL_SET_ID_OLD, ED_FIN_SEC5, ED_FIN_SEC6, ED_FIN_SEC7, ED_FIN_SEC8, ED_FIN_SEC9, ED_FIN_SEC10, ED_FIN_SEC11, ED_FIN_SEC12, ED_FIN_SEC13, ED_FIN_SEC14, ED_FIN_SEC15, ED_FIN_SEC16, ED_FIN_SEC17, ED_FIN_SEC18, ED_FIN_SEC19, OLD_FLAG, ESTADO_REGISTRO, FECHA_REGISTRO, FECHA_ENVIO FROM gdm_rspid_EDG WHERE ED_ROLL_ID = '%s'` UniversalFinishingDataQuery string = `SELECT UF_ROLL_SET_DATE, UF_ROLL_SET_ID, UF_ROLL_SET_ID_HROLLS, UF_HTO_ROLL_NUMBER, UF_HBO_ROLL_NUMBER, UF_ROLL_INSTALL_POS, UF_ROLL_SET_TYPE, UF_TONNAGE_ACCUM0, UF_TONNAGE_ACCUM1, UF_TONNAGE_ACCUM2, UF_TONNAGE_ACCUM3, UF_TONNAGE_ACCUM4, UF_TONNAGE_ACCUM5, UF_TONNAGE_ACCUM6, UF_TONNAGE_ACCUM7, UF_TONNAGE_ACCUM8, UF_TONNAGE_ACCUM9, UF_CHANGE_SLEEVE_LENGTH, UF_CHANGE_SLEEVE_DEPTH, UF_ROLL_ASSEMBLY_STATUS, UF_NO_OF_FIN_SEC, UF_INIT_SEC0, UF_INIT_SEC1, UF_INIT_SEC2, UF_INIT_SEC3, UF_INIT_SEC4, UF_FIN_SEC0, UF_FIN_SEC1, UF_FIN_SEC2, UF_FIN_SEC3, UF_FIN_SEC4, UF_ROLL_MATERIAL_H, UF_ROLL_DIAM_ACT_HBO, UF_ROLL_DIAM_ACT_HTP, UF_H_NOMGAP, UF_ACTUAL_SHIMPS_HBO, UF_ACTUAL_SHIMPS_HTP, UF_ROLL_BARREL_WIDTH_HBO, UF_ROLL_BARREL_WIDTH_HTP, UF_ROLL_CHAM_WIDTH_HBO, UF_ROLL_CHAM_WIDTH_HTP, UF_ROLL_ANGLE_HBO, UF_ROLL_ANGLE_HTB, UF_ROLL_SET_ID_VROLLS, UF_VDS_ROLL_NUMBER, UF_VOS_ROLL_NUMBER, UF_ROLL_MATERIAL_V, UF_ROLL_DIAM_ACT_VDS, UF_ROLL_DIAM_ACT_VOS, UF_ROLL_ANGLE_VDS, UF_ROLL_ANGLE_VOS, UF_PASSLINE_OFFSET, UF_ACTUAL_SHIMPS_VDS_1, UF_ACTUAL_SHIMPS_VDS_2, UF_ACTUAL_SHIMPS_VOS_1, UF_ACTUAL_SHIMPS_VOS_2, UF_PIN_V_CHOCK, UF_ROLL_GROOVES, UF_ROLL_GROOVE_WIDTH0, UF_ROLL_GROOVE_WIDTH1, UF_ROLL_GROOVE_WIDTH2, UF_ROLL_GROOVE_WIDTH3, UF_ROLL_GROOVE_WIDTH4, UF_ROLL_GROOVE_WIDTH5, UF_ROLL_GROOVE_WIDTH6, UF_ROLL_GROOVE_WIDTH7, UF_ROLL_GROOVE_WIDTH8, UF_ROLL_GROOVE_WIDTH9, UF_ROLL_GROOVE_STIFFNESS_TOP0, UF_ROLL_GROOVE_STIFFNESS_TOP1, UF_ROLL_GROOVE_STIFFNESS_TOP2, UF_ROLL_GROOVE_STIFFNESS_TOP3, UF_ROLL_GROOVE_STIFFNESS_TOP4, UF_ROLL_GROOVE_STIFFNESS_TOP5, UF_ROLL_GROOVE_STIFFNESS_TOP6, UF_ROLL_GROOVE_STIFFNESS_TOP7, UF_ROLL_GROOVE_STIFFNESS_TOP8, UF_ROLL_GROOVE_STIFFNESS_TOP9, UF_ROLL_GROOVE_STIFFNESS_BOT0, UF_ROLL_GROOVE_STIFFNESS_BOT1, UF_ROLL_GROOVE_STIFFNESS_BOT2, UF_ROLL_GROOVE_STIFFNESS_BOT3, UF_ROLL_GROOVE_STIFFNESS_BOT4, UF_ROLL_GROOVE_STIFFNESS_BOT5, UF_ROLL_GROOVE_STIFFNESS_BOT6, UF_ROLL_GROOVE_STIFFNESS_BOT7, UF_ROLL_GROOVE_STIFFNESS_BOT8, UF_ROLL_GROOVE_STIFFNESS_BOT9, UF_ROLL_GROOVE_POS0, UF_ROLL_GROOVE_POS1, UF_ROLL_GROOVE_POS2, UF_ROLL_GROOVE_POS3, UF_ROLL_GROOVE_POS4, UF_ROLL_GROOVE_POS5, UF_ROLL_GROOVE_POS6, UF_ROLL_GROOVE_POS7, UF_ROLL_GROOVE_POS8, UF_ROLL_GROOVE_POS9, UF_ROLL_GROOVE_SHARP0, UF_ROLL_GROOVE_SHARP1, UF_ROLL_GROOVE_SHARP2, UF_ROLL_GROOVE_SHARP3, UF_ROLL_GROOVE_SHARP4, UF_ROLL_GROOVE_SHARP5, UF_ROLL_GROOVE_SHARP6, UF_ROLL_GROOVE_SHARP7, UF_ROLL_GROOVE_SHARP8, UF_ROLL_GROOVE_SHARP9,ISNULL(UF_ROLL_THRUST_PLATE,0), UF_ROLL_ID, UF_DEL_FLAG, UF_ROLL_SET_ID_OLD, TOP_SHAFT_UF, BOT_SHAFT_UF, UF_FIN_SEC5, UF_FIN_SEC6, UF_FIN_SEC7, UF_FIN_SEC8, UF_FIN_SEC9, UF_FIN_SEC10, UF_FIN_SEC11, UF_FIN_SEC12, UF_FIN_SEC13, UF_FIN_SEC14, UF_FIN_SEC15, UF_FIN_SEC16, UF_FIN_SEC17, UF_FIN_SEC18, UF_FIN_SEC19, OLD_FLAG, ISNULL(AMPUESA_CORTA,0), ESTADO_REGISTRO, FECHA_REGISTRO, FECHA_ENVIO FROM gdm_rspid_UF WHERE UF_ROLL_ID = '%s'` ) type RspDB struct { conn *sql.DB } type RspDBConfig struct { Host string Port int User string Pwd string Dbname string } func RspDBDefaultConfig() *RspDBConfig { return &RspDBConfig{ Host: "10.6.4.113", Port: 1433, User: "sa", Pwd: "mapex@123", Dbname: "mapexbp_celsa4", } } func (r *RspDB) Close() error { return r.conn.Close() } func (r *RspDB) GetBreakDownRollData(ctx context.Context, bdRollId string) (*api.BdRollData, error) { // data rolling var holder bdData := &api.BdRollData{} // create sql statement query := fmt.Sprintf(BreakDownRollDataQuery, bdRollId) // execute sql row := r.conn.QueryRowContext(ctx, query) if row.Err() != nil { return nil, row.Err() } if err := row.Scan( &bdData.BdRollSetDate, &bdData.BdRollSetId, &bdData.BdTopRollNumber, &bdData.BdBotRollNumber, &bdData.BdRollMaterial, &bdData.BdRollInstallPos, &bdData.BdRollSetType, &bdData.BdRollDiamNomActTop, &bdData.BdRollDiamNomActBot, &bdData.BdRollNominalGap, &bdData.BdRollGrooves, &bdData.BdRollGrooveWidth0, &bdData.BdRollGrooveWidth1, &bdData.BdRollGrooveWidth2, &bdData.BdRollGrooveWidth3, &bdData.BdRollGrooveWidth4, &bdData.BdRollGrooveWidth5, &bdData.BdRollGrooveWidth6, &bdData.BdRollGrooveWidth7, &bdData.BdRollGrooveWidth8, &bdData.BdRollGrooveWidth9, &bdData.BdRollGrooveStiffnessTop0, &bdData.BdRollGrooveStiffnessTop1, &bdData.BdRollGrooveStiffnessTop2, &bdData.BdRollGrooveStiffnessTop3, &bdData.BdRollGrooveStiffnessTop4, &bdData.BdRollGrooveStiffnessTop5, &bdData.BdRollGrooveStiffnessTop6, &bdData.BdRollGrooveStiffnessTop7, &bdData.BdRollGrooveStiffnessTop8, &bdData.BdRollGrooveStiffnessTop9, &bdData.BdRollGrooveStiffnessBot0, &bdData.BdRollGrooveStiffnessBot1, &bdData.BdRollGrooveStiffnessBot2, &bdData.BdRollGrooveStiffnessBot3, &bdData.BdRollGrooveStiffnessBot4, &bdData.BdRollGrooveStiffnessBot5, &bdData.BdRollGrooveStiffnessBot6, &bdData.BdRollGrooveStiffnessBot7, &bdData.BdRollGrooveStiffnessBot8, &bdData.BdRollGrooveStiffnessBot9, &bdData.BdRollGroovePos0, &bdData.BdRollGroovePos1, &bdData.BdRollGroovePos2, &bdData.BdRollGroovePos3, &bdData.BdRollGroovePos4, &bdData.BdRollGroovePos5, &bdData.BdRollGroovePos6, &bdData.BdRollGroovePos7, &bdData.BdRollGroovePos8, &bdData.BdRollGroovePos9, &bdData.BdRollGrooveSharp0, &bdData.BdRollGrooveSharp1, &bdData.BdRollGrooveSharp2, &bdData.BdRollGrooveSharp3, &bdData.BdRollGrooveSharp4, &bdData.BdRollGrooveSharp5, &bdData.BdRollGrooveSharp6, &bdData.BdRollGrooveSharp7, &bdData.BdRollGrooveSharp8, &bdData.BdRollGrooveSharp9, &bdData.BdRollGrooveDepth0, &bdData.BdRollGrooveDepth1, &bdData.BdRollGrooveDepth2, &bdData.BdRollGrooveDepth3, &bdData.BdRollGrooveDepth4, &bdData.BdRollGrooveDepth5, &bdData.BdRollGrooveDepth6, &bdData.BdRollGrooveDepth7, &bdData.BdRollGrooveDepth8, &bdData.BdRollGrooveDepth9, &bdData.BdRollAssemblyStatus, &bdData.BdNoOfFinSec, &bdData.BdInitSec0, &bdData.BdInitSec1, &bdData.BdInitSec2, &bdData.BdInitSec3, &bdData.BdInitSec4, &bdData.BdFinSec0, &bdData.BdFinSec1, &bdData.BdFinSec2, &bdData.BdFinSec3, &bdData.BdFinSec4, &bdData.BdRollActualShimpsTop, &bdData.BdRollActualShimpsBot, &bdData.BdTonnageAccum0, &bdData.BdTonnageAccum1, &bdData.BdTonnageAccum2, &bdData.BdTonnageAccum3, &bdData.BdTonnageAccum4, &bdData.BdTonnageAccum5, &bdData.BdTonnageAccum6, &bdData.BdTonnageAccum7, &bdData.BdTonnageAccum8, &bdData.BdTonnageAccum9, &bdData.BdRollId, &bdData.BdDelFlag, &bdData.BdRollSetIdOld, &bdData.BdFinSec5, &bdData.BdFinSec6, &bdData.BdFinSec7, &bdData.BdFinSec8, &bdData.BdFinSec9, &bdData.BdFinSec10, &bdData.BdFinSec11, &bdData.BdFinSec12, &bdData.BdFinSec13, &bdData.BdFinSec14, &bdData.BdFinSec15, &bdData.BdFinSec16, &bdData.BdFinSec17, &bdData.BdFinSec18, &bdData.BdFinSec19, &bdData.OldFlag, &bdData.AlturaBarronSalida, &bdData.AlturaBarronEntrada, &bdData.Familia, &bdData.Correccion, &bdData.EstadoRegistro, &bdData.FechaRegistro, &bdData.FechaEnvio); err != nil { return nil, err } return bdData, nil } func (r *RspDB) GetUniversalRoughingRollData(ctx context.Context, urRollId string) (*api.UrRollData, error) { // data rolling var holder urData := &api.UrRollData{} // create sql statement sql := fmt.Sprintf(UniversalRoughingDataQuery, urRollId) // execute query row := r.conn.QueryRowContext(ctx, sql) if row.Err() != nil { return nil, row.Err() } // scan over row data if err := row.Scan( &urData.UrRollSetDate, &urData.UrRollSetId, &urData.UrRollSetIdHrolls, &urData.UrHtoRollNumber, &urData.UrHboRollNumber, &urData.UrRollInstallPos, &urData.UrRollSetType, &urData.UrTonnageAccum0, &urData.UrTonnageAccum1, &urData.UrTonnageAccum2, &urData.UrTonnageAccum3, &urData.UrTonnageAccum4, &urData.UrTonnageAccum5, &urData.UrTonnageAccum6, &urData.UrTonnageAccum7, &urData.UrTonnageAccum8, &urData.UrTonnageAccum9, &urData.UrChangeSleeveLength, &urData.UrChangeSleeveDepth, &urData.UrRollAssemblyStatus, &urData.UrNoOfFinSec, &urData.UrInitSec0, &urData.UrInitSec1, &urData.UrInitSec2, &urData.UrInitSec3, &urData.UrInitSec4, &urData.UrFinSec0, &urData.UrFinSec1, &urData.UrFinSec2, &urData.UrFinSec3, &urData.UrFinSec4, &urData.UrRollMaterialH, &urData.UrRollDiamActHbo, &urData.UrRollDiamActHtp, &urData.UrHNomgap, &urData.UrActualShimpsHbo, &urData.UrActualShimpsHtp, &urData.UrRollBarrelWidthHbo, &urData.UrRollBarrelWidthHtp, &urData.UrRollChamWidthHbo, &urData.UrRollChamWidthHtp, &urData.UrRollAngleHbo, &urData.UrRollAngleHtb, &urData.UrRollSetIdVrolls, &urData.UrVdsRollNumber, &urData.UrVosRollNumber, &urData.UrRollMaterialV, &urData.UrRollDiamActVds, &urData.UrRollDiamActVos, &urData.UrRollAngleVds, &urData.UrRollAngleVos, &urData.UrPasslineOffset, &urData.UrActualShimpsVds_1, &urData.UrActualShimpsVds_2, &urData.UrActualShimpsVos_1, &urData.UrActualShimpsVos_2, &urData.UrPinVChock, &urData.UrRollGrooves, &urData.UrRollGrooveWidth0, &urData.UrRollGrooveWidth1, &urData.UrRollGrooveWidth2, &urData.UrRollGrooveWidth3, &urData.UrRollGrooveWidth4, &urData.UrRollGrooveWidth5, &urData.UrRollGrooveWidth6, &urData.UrRollGrooveWidth7, &urData.UrRollGrooveWidth8, &urData.UrRollGrooveWidth9, &urData.UrRollGrooveStiffnessTop0, &urData.UrRollGrooveStiffnessTop1, &urData.UrRollGrooveStiffnessTop2, &urData.UrRollGrooveStiffnessTop3, &urData.UrRollGrooveStiffnessTop4, &urData.UrRollGrooveStiffnessTop5, &urData.UrRollGrooveStiffnessTop6, &urData.UrRollGrooveStiffnessTop7, &urData.UrRollGrooveStiffnessTop8, &urData.UrRollGrooveStiffnessTop9, &urData.UrRollGrooveStiffnessBot0, &urData.UrRollGrooveStiffnessBot1, &urData.UrRollGrooveStiffnessBot2, &urData.UrRollGrooveStiffnessBot3, &urData.UrRollGrooveStiffnessBot4, &urData.UrRollGrooveStiffnessBot5, &urData.UrRollGrooveStiffnessBot6, &urData.UrRollGrooveStiffnessBot7, &urData.UrRollGrooveStiffnessBot8, &urData.UrRollGrooveStiffnessBot9, &urData.UrRollGroovePos0, &urData.UrRollGroovePos1, &urData.UrRollGroovePos2, &urData.UrRollGroovePos3, &urData.UrRollGroovePos4, &urData.UrRollGroovePos5, &urData.UrRollGroovePos6, &urData.UrRollGroovePos7, &urData.UrRollGroovePos8, &urData.UrRollGroovePos9, &urData.UrRollGrooveSharp0, &urData.UrRollGrooveSharp1, &urData.UrRollGrooveSharp2, &urData.UrRollGrooveSharp3, &urData.UrRollGrooveSharp4, &urData.UrRollGrooveSharp5, &urData.UrRollGrooveSharp6, &urData.UrRollGrooveSharp7, &urData.UrRollGrooveSharp8, &urData.UrRollGrooveSharp9, &urData.UrRollThrustPlate, &urData.UrRollId, &urData.UrDelFlag, &urData.UrRollSetIdOld, &urData.TopShaftUr, &urData.BotShaftUr, &urData.UrFinSec5, &urData.UrFinSec6, &urData.UrFinSec7, &urData.UrFinSec8, &urData.UrFinSec9, &urData.UrFinSec10, &urData.UrFinSec11, &urData.UrFinSec12, &urData.UrFinSec13, &urData.UrFinSec14, &urData.UrFinSec15, &urData.UrFinSec16, &urData.UrFinSec17, &urData.UrFinSec18, &urData.UrFinSec19, &urData.OldFlag, &urData.AmpuesaCorta, &urData.EstadoRegistro, &urData.FechaRegistro, &urData.FechaEnvio); err != nil { return nil, err } return urData, nil } func (r *RspDB) GetEdgerRollData(ctx context.Context, edRollId string) (*api.EdRollData, error) { // data rolling var holder edData := &api.EdRollData{} // create sql statement sql := fmt.Sprintf(EdgerDataQuery, edRollId) // execute query row := r.conn.QueryRowContext(ctx, sql) if row.Err() != nil { return nil, row.Err() } // scan over row data if err := row.Scan( &edData.EdRollSetDate, &edData.EdRollSetId, &edData.EdTopRollNumber, &edData.EdBotRollNumber, &edData.EdRollMaterial, &edData.EdRollInstallPos, &edData.EdRollSetType, &edData.EdRollDiamNomHtp, &edData.EdRollDiamNomHbo, &edData.EdRollNominalGap, &edData.EdRollAssemblyStatus, &edData.EdNoOfFinSec, &edData.EdInitSec0, &edData.EdInitSec1, &edData.EdInitSec2, &edData.EdInitSec3, &edData.EdInitSec4, &edData.EdFinSec0, &edData.EdFinSec1, &edData.EdFinSec2, &edData.EdFinSec3, &edData.EdFinSec4, &edData.EdRollNoOfGrooves, &edData.EdRollGrooveStiffTop0, &edData.EdRollGrooveStiffTop1, &edData.EdRollGrooveStiffTop2, &edData.EdRollGrooveStiffTop3, &edData.EdRollGrooveStiffTop4, &edData.EdRollGrooveStiffTop5, &edData.EdRollGrooveStiffTop6, &edData.EdRollGrooveStiffTop7, &edData.EdRollGrooveStiffTop8, &edData.EdRollGrooveStiffTop9, &edData.EdRollGrooveStiffBot0, &edData.EdRollGrooveStiffBot1, &edData.EdRollGrooveStiffBot2, &edData.EdRollGrooveStiffBot3, &edData.EdRollGrooveStiffBot4, &edData.EdRollGrooveStiffBot5, &edData.EdRollGrooveStiffBot6, &edData.EdRollGrooveStiffBot7, &edData.EdRollGrooveStiffBot8, &edData.EdRollGrooveStiffBot9, &edData.EdRollGroovePos0, &edData.EdRollGroovePos1, &edData.EdRollGroovePos2, &edData.EdRollGroovePos3, &edData.EdRollGroovePos4, &edData.EdRollGroovePos5, &edData.EdRollGroovePos6, &edData.EdRollGroovePos7, &edData.EdRollGroovePos8, &edData.EdRollGroovePos9, &edData.EdActualShimpsHbo, &edData.EdActualShimpsHtp, &edData.EdChangeSleeveLength, &edData.EdChangeSleeveDepth, &edData.EdTonnageAccum0, &edData.EdTonnageAccum1, &edData.EdTonnageAccum2, &edData.EdTonnageAccum3, &edData.EdTonnageAccum4, &edData.EdTonnageAccum5, &edData.EdTonnageAccum6, &edData.EdTonnageAccum7, &edData.EdTonnageAccum8, &edData.EdTonnageAccum9, &edData.EdRollFlangeDiamTop0, &edData.EdRollFlangeDiamTop1, &edData.EdRollFlangeDiamTop2, &edData.EdRollFlangeDiamTop3, &edData.EdRollFlangeDiamTop4, &edData.EdRollFlangeDiamTop5, &edData.EdRollFlangeDiamTop6, &edData.EdRollFlangeDiamTop7, &edData.EdRollFlangeDiamTop8, &edData.EdRollFlangeDiamTop9, &edData.EdRollFlangeDiamBot0, &edData.EdRollFlangeDiamBot1, &edData.EdRollFlangeDiamBot2, &edData.EdRollFlangeDiamBot3, &edData.EdRollFlangeDiamBot4, &edData.EdRollFlangeDiamBot5, &edData.EdRollFlangeDiamBot6, &edData.EdRollFlangeDiamBot7, &edData.EdRollFlangeDiamBot8, &edData.EdRollFlangeDiamBot9, &edData.EdRollWebDiamTop0, &edData.EdRollWebDiamTop1, &edData.EdRollWebDiamTop2, &edData.EdRollWebDiamTop3, &edData.EdRollWebDiamTop4, &edData.EdRollWebDiamTop5, &edData.EdRollWebDiamTop6, &edData.EdRollWebDiamTop7, &edData.EdRollWebDiamTop8, &edData.EdRollWebDiamTop9, &edData.EdRollWebDiamBot0, &edData.EdRollWebDiamBot1, &edData.EdRollWebDiamBot2, &edData.EdRollWebDiamBot3, &edData.EdRollWebDiamBot4, &edData.EdRollWebDiamBot5, &edData.EdRollWebDiamBot6, &edData.EdRollWebDiamBot7, &edData.EdRollWebDiamBot8, &edData.EdRollWebDiamBot9, &edData.EdRollChamWidthTop0, &edData.EdRollChamWidthTop1, &edData.EdRollChamWidthTop2, &edData.EdRollChamWidthTop3, &edData.EdRollChamWidthTop4, &edData.EdRollChamWidthTop5, &edData.EdRollChamWidthTop6, &edData.EdRollChamWidthTop7, &edData.EdRollChamWidthTop8, &edData.EdRollChamWidthTop9, &edData.EdRollChamWidthBot0, &edData.EdRollChamWidthBot1, &edData.EdRollChamWidthBot2, &edData.EdRollChamWidthBot3, &edData.EdRollChamWidthBot4, &edData.EdRollChamWidthBot5, &edData.EdRollChamWidthBot6, &edData.EdRollChamWidthBot7, &edData.EdRollChamWidthBot8, &edData.EdRollChamWidthBot9, &edData.EdRollAngleFlangeFace0, &edData.EdRollAngleFlangeFace1, &edData.EdRollAngleFlangeFace2, &edData.EdRollAngleFlangeFace3, &edData.EdRollAngleFlangeFace4, &edData.EdRollAngleFlangeFace5, &edData.EdRollAngleFlangeFace6, &edData.EdRollAngleFlangeFace7, &edData.EdRollAngleFlangeFace8, &edData.EdRollAngleFlangeFace9, &edData.EdRollRootRadius0, &edData.EdRollRootRadius1, &edData.EdRollRootRadius2, &edData.EdRollRootRadius3, &edData.EdRollRootRadius4, &edData.EdRollRootRadius5, &edData.EdRollRootRadius6, &edData.EdRollRootRadius7, &edData.EdRollRootRadius8, &edData.EdRollRootRadius9, &edData.EdPasslineOffset, &edData.EdDRollGrooveSharp0, &edData.EdDRollGrooveSharp1, &edData.EdDRollGrooveSharp2, &edData.EdDRollGrooveSharp3, &edData.EdDRollGrooveSharp4, &edData.EdDRollGrooveSharp5, &edData.EdDRollGrooveSharp6, &edData.EdDRollGrooveSharp7, &edData.EdDRollGrooveSharp8, &edData.EdDRollGrooveSharp9, &edData.EdDRollGrooveWidth0, &edData.EdDRollGrooveWidth1, &edData.EdDRollGrooveWidth2, &edData.EdDRollGrooveWidth3, &edData.EdDRollGrooveWidth4, &edData.EdDRollGrooveWidth5, &edData.EdDRollGrooveWidth6, &edData.EdDRollGrooveWidth7, &edData.EdDRollGrooveWidth8, &edData.EdDRollGrooveWidth9, &edData.EdRollId, &edData.EdDelFlag, &edData.EdRollSetIdOld, &edData.EdFinSec5, &edData.EdFinSec6, &edData.EdFinSec7, &edData.EdFinSec8, &edData.EdFinSec9, &edData.EdFinSec10, &edData.EdFinSec11, &edData.EdFinSec12, &edData.EdFinSec13, &edData.EdFinSec14, &edData.EdFinSec15, &edData.EdFinSec16, &edData.EdFinSec17, &edData.EdFinSec18, &edData.EdFinSec19, &edData.OldFlag, &edData.EstadoRegistro, &edData.FechaRegistro, &edData.FechaEnvio); err != nil { return nil, err } return edData, nil } func (r *RspDB) GetUniversalFinishingRollData(ctx context.Context, ufRollId string) (*api.UfRollData, error) { // data rolling var holder ufData := &api.UfRollData{} // create sql statement sql := fmt.Sprintf(UniversalFinishingDataQuery, ufRollId) // execute query row := r.conn.QueryRowContext(ctx, sql) if row.Err() != nil { return nil, row.Err() } // scan over row data if err := row.Scan( &ufData.UfRollSetDate, &ufData.UfRollSetId, &ufData.UfRollSetIdHrolls, &ufData.UfHtoRollNumber, &ufData.UfHboRollNumber, &ufData.UfRollInstallPos, &ufData.UfRollSetType, &ufData.UfTonnageAccum0, &ufData.UfTonnageAccum1, &ufData.UfTonnageAccum2, &ufData.UfTonnageAccum3, &ufData.UfTonnageAccum4, &ufData.UfTonnageAccum5, &ufData.UfTonnageAccum6, &ufData.UfTonnageAccum7, &ufData.UfTonnageAccum8, &ufData.UfTonnageAccum9, &ufData.UfChangeSleeveLength, &ufData.UfChangeSleeveDepth, &ufData.UfRollAssemblyStatus, &ufData.UfNoOfFinSec, &ufData.UfInitSec0, &ufData.UfInitSec1, &ufData.UfInitSec2, &ufData.UfInitSec3, &ufData.UfInitSec4, &ufData.UfFinSec0, &ufData.UfFinSec1, &ufData.UfFinSec2, &ufData.UfFinSec3, &ufData.UfFinSec4, &ufData.UfRollMaterialH, &ufData.UfRollDiamActHbo, &ufData.UfRollDiamActHtp, &ufData.UfHNomgap, &ufData.UfActualShimpsHbo, &ufData.UfActualShimpsHtp, &ufData.UfRollBarrelWidthHbo, &ufData.UfRollBarrelWidthHtp, &ufData.UfRollChamWidthHbo, &ufData.UfRollChamWidthHtp, &ufData.UfRollAngleHbo, &ufData.UfRollAngleHtb, &ufData.UfRollSetIdVrolls, &ufData.UfVdsRollNumber, &ufData.UfVosRollNumber, &ufData.UfRollMaterialV, &ufData.UfRollDiamActVds, &ufData.UfRollDiamActVos, &ufData.UfRollAngleVds, &ufData.UfRollAngleVos, &ufData.UfPasslineOffset, &ufData.UfActualShimpsVds_1, &ufData.UfActualShimpsVds_2, &ufData.UfActualShimpsVos_1, &ufData.UfActualShimpsVos_2, &ufData.UfPinVChock, &ufData.UfRollGrooves, &ufData.UfRollGrooveWidth0, &ufData.UfRollGrooveWidth1, &ufData.UfRollGrooveWidth2, &ufData.UfRollGrooveWidth3, &ufData.UfRollGrooveWidth4, &ufData.UfRollGrooveWidth5, &ufData.UfRollGrooveWidth6, &ufData.UfRollGrooveWidth7, &ufData.UfRollGrooveWidth8, &ufData.UfRollGrooveWidth9, &ufData.UfRollGrooveStiffnessTop0, &ufData.UfRollGrooveStiffnessTop1, &ufData.UfRollGrooveStiffnessTop2, &ufData.UfRollGrooveStiffnessTop3, &ufData.UfRollGrooveStiffnessTop4, &ufData.UfRollGrooveStiffnessTop5, &ufData.UfRollGrooveStiffnessTop6, &ufData.UfRollGrooveStiffnessTop7, &ufData.UfRollGrooveStiffnessTop8, &ufData.UfRollGrooveStiffnessTop9, &ufData.UfRollGrooveStiffnessBot0, &ufData.UfRollGrooveStiffnessBot1, &ufData.UfRollGrooveStiffnessBot2, &ufData.UfRollGrooveStiffnessBot3, &ufData.UfRollGrooveStiffnessBot4, &ufData.UfRollGrooveStiffnessBot5, &ufData.UfRollGrooveStiffnessBot6, &ufData.UfRollGrooveStiffnessBot7, &ufData.UfRollGrooveStiffnessBot8, &ufData.UfRollGrooveStiffnessBot9, &ufData.UfRollGroovePos0, &ufData.UfRollGroovePos1, &ufData.UfRollGroovePos2, &ufData.UfRollGroovePos3, &ufData.UfRollGroovePos4, &ufData.UfRollGroovePos5, &ufData.UfRollGroovePos6, &ufData.UfRollGroovePos7, &ufData.UfRollGroovePos8, &ufData.UfRollGroovePos9, &ufData.UfRollGrooveSharp0, &ufData.UfRollGrooveSharp1, &ufData.UfRollGrooveSharp2, &ufData.UfRollGrooveSharp3, &ufData.UfRollGrooveSharp4, &ufData.UfRollGrooveSharp5, &ufData.UfRollGrooveSharp6, &ufData.UfRollGrooveSharp7, &ufData.UfRollGrooveSharp8, &ufData.UfRollGrooveSharp9, &ufData.UfRollThrustPlate, &ufData.UfRollId, &ufData.UfDelFlag, &ufData.UfRollSetIdOld, &ufData.TopShaftUf, &ufData.BotShaftUf, &ufData.UfFinSec5, &ufData.UfFinSec6, &ufData.UfFinSec7, &ufData.UfFinSec8, &ufData.UfFinSec9, &ufData.UfFinSec10, &ufData.UfFinSec11, &ufData.UfFinSec12, &ufData.UfFinSec13, &ufData.UfFinSec14, &ufData.UfFinSec15, &ufData.UfFinSec16, &ufData.UfFinSec17, &ufData.UfFinSec18, &ufData.UfFinSec19, &ufData.OldFlag, &ufData.AmpuesaCorta, &ufData.EstadoRegistro, &ufData.FechaRegistro, &ufData.FechaEnvio); err != nil { return nil, err } return ufData, nil } func NewRspDB(cfg *RspDBConfig) (*RspDB, error) { connString := fmt.Sprintf("server=%s;user id=%s;password=%s;port=%d;database=%s", cfg.Host, cfg.User, cfg.Pwd, cfg.Port, cfg.Dbname) conn, err := sql.Open("mssql", connString) return &RspDB{ conn: conn, }, err }