diff --git a/code/springboot/newBank/src/main/java/demo/zhangjialei/controller/userController.java b/code/springboot/newBank/src/main/java/demo/zhangjialei/controller/userController.java index d096b4e20..64a66c631 100644 --- a/code/springboot/newBank/src/main/java/demo/zhangjialei/controller/userController.java +++ b/code/springboot/newBank/src/main/java/demo/zhangjialei/controller/userController.java @@ -28,13 +28,12 @@ public class userController { // 接收前端字段 String userNo = request.getParameter("userdNo"); // 建立sql查询语句 - String sql = String.format("select * from user u where userNo = %s", userNo); + String sql = String.format("select * from user_info nui where nui.userNo = %s", userNo); // 使用sql语句查询并接收 List> list = jdbcTemplate.queryForList(sql); // 返回查询结果 return list.get(0); // http://127.0.0.1:12709/qryUser?userdNo=0001 - // push_test_03 } @@ -50,7 +49,7 @@ public class userController { String sql_select = String.format("select userNo from userNoMaker"); int No = (int) jdbcTemplate.queryForList(sql_select).get(0).get("userNo"); - String userNo = String.format("%04d", No); + String userNo = String.format("%08d", No); return userNo; // http://localhost:12709/userNoMake @@ -88,7 +87,7 @@ public class userController { // 将数据添加到数据库 String sql = String.format( - "INSERT INTO newbank.user (userNo, passwd, userName, gender, birthday, docType, docNo, tel, addr, createDate) " + + "INSERT INTO newbank.user_info (userNo, passwd, userName, gender, birthday, docType, docNo, tel, addr, createDate) " + "VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s');", userNo, passwd, userName, gender, birthday, docType, docNo, tel, addr, date ); @@ -119,7 +118,7 @@ public class userController { // 更新数据 String sql = String.format( - "update newbank.user set " + + "update newbank.user_info set " + // "passwd = '%s', " + // "userName = '%s', " + // "gender = '%s', " + @@ -148,12 +147,12 @@ public class userController { String userNo = request.getParameter("userdNo"); // 向数据库中查询编号是否存在 - String sql_sel = String.format("select * from user where userNo = %s", userNo); + String sql_sel = String.format("select * from user_info where userNo = %s", userNo); List> sel_res = jdbcTemplate.queryForList(sql_sel); if (sel_res.size() > 0){ // 查询结果大于 1 该如何处置? // 在数据库中删除改客户编号对应数据 - String sql_del = String.format("delete from user where userNo = %s", userNo); + String sql_del = String.format("delete from user_info where userNo = %s", userNo); return jdbcTemplate.update(sql_del); } else { // 编号不存在 返回 0 @@ -171,7 +170,7 @@ public class userController { String passwd_input = request.getParameter("passwd"); // 向数据库中查询编号是否存在 - String sql_sel = String.format("select * from user where userNo = %s", userNo); + String sql_sel = String.format("select * from user_info where userNo = %s", userNo); List> sel_res = jdbcTemplate.queryForList(sql_sel); System.out.println(sel_res); diff --git a/需求分析文档/银行系统需求规格说明书v0.4.docx b/需求分析文档/银行系统需求规格说明书v0.4.docx index fcc8176e1..4ccc59edb 100644 Binary files a/需求分析文档/银行系统需求规格说明书v0.4.docx and b/需求分析文档/银行系统需求规格说明书v0.4.docx differ