클린파킹 테스트 자료 생성시 cp_match 테이블 자료 생성되도록 수정

main
이범준 1 month ago
parent 3bd611beba
commit de88ef62c2

@ -260,6 +260,22 @@ public class CpController extends AbstractController {
}
strSQL = new StringBuffer();
strSQL.append("SELECT MAX(MC_CODE) FROM CP_MATCH ");
ps = conn.prepareStatement(strSQL.toString());
rs = ps.executeQuery();
String nextMatchKey = "";
if(rs.next()) {
String maxMatchKey = rs.getString(1);
if(maxMatchKey == null || maxMatchKey.equals("")) {
nextMatchKey = "1";
} else {
nextMatchKey = Integer.toString(Integer.parseInt(maxMatchKey)+1);
}
} else {
nextMatchKey = "1";
}
strSQL = new StringBuffer();
strSQL.append("INSERT INTO CP_OWNER ");
@ -345,6 +361,18 @@ public class CpController extends AbstractController {
//ps.setString
ps.executeUpdate();
strSQL = new StringBuffer();
strSQL.append("INSERT INTO CP_MATCH (MC_CODE, MC_MMCODE, MC_LVY_KEY)"
+" VALUES ("
+"'"+nextMatchKey+"',"
+"'"+nextMainKey+"',"
+"'"+nextMainKey.substring(5)+"'"
+")"
);
ps = conn.prepareStatement(strSQL.toString());
//ps.setString
ps.executeUpdate();
conn.commit();
ps.close();

Loading…
Cancel
Save