7 changed files with 82 additions and 1 deletions
@ -0,0 +1,33 @@ |
|||||||
|
package demo.pengbaohao.controller; |
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.jdbc.core.JdbcTemplate; |
||||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||||
|
import org.springframework.web.bind.annotation.RestController; |
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest; |
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
@RestController |
||||||
|
public class debit { |
||||||
|
@Autowired |
||||||
|
private JdbcTemplate jdbcTemplate; |
||||||
|
|
||||||
|
@RequestMapping("/qrydebitR") |
||||||
|
public List<Map<String,Object>> qrydebit(HttpServletRequest request) { |
||||||
|
|
||||||
|
//第一步,取下前端的字段
|
||||||
|
String debitNo=request.getParameter("debitNo");//贷款号
|
||||||
|
String cerNo=request.getParameter("cerNo");//贷款人证件号码
|
||||||
|
|
||||||
|
//第二步 写sql
|
||||||
|
String sql ="select * from debit where debitNo ='"+debitNo+"' and cerNo= '"+cerNo+"'"; |
||||||
|
|
||||||
|
//第三步 执行sql
|
||||||
|
List<Map<String,Object>> list=jdbcTemplate.queryForList(sql); |
||||||
|
|
||||||
|
//返回
|
||||||
|
return list; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,40 @@ |
|||||||
|
package demo.pengbaohao.controller; |
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.jdbc.core.JdbcTemplate; |
||||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||||
|
import org.springframework.web.bind.annotation.RestController; |
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest; |
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
@RestController |
||||||
|
public class login { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private JdbcTemplate jdbcTemplate; |
||||||
|
|
||||||
|
@RequestMapping("/staffloginR") |
||||||
|
public String getAllNewTableData(HttpServletRequest request) { |
||||||
|
|
||||||
|
String staffNo=request.getParameter("staffNo"); |
||||||
|
String password=request.getParameter("password");//前端送过来的密码
|
||||||
|
|
||||||
|
String sql ="select password from staff where staffNo ='"+staffNo+"'"; |
||||||
|
|
||||||
|
List<Map<String,Object>> list=jdbcTemplate.queryForList(sql); |
||||||
|
|
||||||
|
String result=""; |
||||||
|
if(list==null||list.size()==0){ |
||||||
|
result="0";//0表示不通过
|
||||||
|
} |
||||||
|
if(password.equals(list.get(0).get("password"))){ |
||||||
|
result="1";//1表示通过
|
||||||
|
}else { |
||||||
|
result="0";//0表示不通过
|
||||||
|
} |
||||||
|
return result; |
||||||
|
} |
||||||
|
|
||||||
|
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue