From 635bbb8f3bb22ba9e076a91a93783e7dfff6f2f6 Mon Sep 17 00:00:00 2001 From: Aokiso <1010390029@qq.com> Date: Wed, 16 Jan 2019 11:13:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/example/demo/Dao/userMapper.java | 19 +++++++++++-------- .../controller/bankCardController.java | 5 +++++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/demo/src/main/java/com/example/demo/Dao/userMapper.java b/demo/src/main/java/com/example/demo/Dao/userMapper.java index 7b19424..9fa0c49 100644 --- a/demo/src/main/java/com/example/demo/Dao/userMapper.java +++ b/demo/src/main/java/com/example/demo/Dao/userMapper.java @@ -34,12 +34,15 @@ public interface userMapper { "#{telephoneNum},#{address},#{isIdentify},#{registerTime})") public void addUser(User user); - @Update("update user set userNum=#{userNum},userName=#{userName}" + - ",userPwd=#{userPwd},userRight=#{userRight}," + - "telephoneNum=#{telephoneNum},address=#{address}," + - "isIdentify=#{isIdentify},registerTime=#{registerTime}where userNum=#{userNum}") - public void updateUser(User user); - - @Delete("delete from user where userNum=#{userNum}") - public void deleteUser(long userNum); + @Update("update user set isIdentify=#{isIdentify} where userNum=#{userNum}") + public void updateIsId(long userNum); + +// @Update("update user set userNum=#{userNum},userName=#{userName}" + +// ",userPwd=#{userPwd},userRight=#{userRight}," + +// "telephoneNum=#{telephoneNum},address=#{address}," + +// "isIdentify=#{isIdentify},registerTime=#{registerTime}where userNum=#{userNum}") +// public void updateUser(User user); +// +// @Delete("delete from user where userNum=#{userNum}") +// public void deleteUser(long userNum); } diff --git a/demo/src/main/java/com/example/demo/register/controller/bankCardController.java b/demo/src/main/java/com/example/demo/register/controller/bankCardController.java index 8ba7aa2..cf1bcf5 100644 --- a/demo/src/main/java/com/example/demo/register/controller/bankCardController.java +++ b/demo/src/main/java/com/example/demo/register/controller/bankCardController.java @@ -1,9 +1,11 @@ package com.example.demo.register.controller; +import com.example.demo.Dao.userMapper; import com.example.demo.bean.User; import com.example.demo.bean.UserBankIdentify; import com.example.demo.register.identify; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @@ -17,6 +19,8 @@ import java.io.IOException; public class bankCardController extends HttpServlet { private identify identify=new identify(); + @Autowired + private userMapper userMapper; @RequestMapping("/binding")//卡号绑定界面 public void doPost(HttpServletResponse response, HttpServletRequest request)throws IOException { @@ -34,6 +38,7 @@ public class bankCardController extends HttpServlet { userBankIdentify.setUserNum(num); userBankIdentify.setBankAccountIdentify(result); identify.identify(userBankIdentify); + userMapper.updateIsId(user.getUserNum()); }catch (Exception e){ e.printStackTrace(); }