parent
bce56c4e60
commit
96e89d2ef6
@ -0,0 +1,31 @@
|
||||
package com.example.demo.Dao;
|
||||
|
||||
import com.example.demo.bean.Audit;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface auditMapper {
|
||||
@Select("select * from audit where checkNum = #{checkNum}")
|
||||
public Audit selectAudioByCheckNum(long checkNum);
|
||||
|
||||
@Select("select * from audit")
|
||||
public List<Audit> select();
|
||||
|
||||
@Insert("insert into audit(checkNum, userNum, productNum, " +
|
||||
"bankAccount, checkState, contractNum, " +
|
||||
"isSignContract, year, amount, applyTime)" +
|
||||
" values (#{checkNum},#{userNum},#{productNum},#{bankAccount},#{checkState}," +
|
||||
"#{contractNum},#{isSignContract},#{year},#{amount},#{applyTime})")
|
||||
public void addAudit(Audit audits);
|
||||
|
||||
@Update("update audit set checkNum=#{checkNum},userNum=#{userNum}" +
|
||||
",productNum=#{productNum},checkState=#{checkState},contractNum=#{contractNum}," +
|
||||
"isSignContract=#{isSignContract},year=#{year},amount=#{amount}," +
|
||||
"applyTime=#{applyTime}where checkNum=#{checkNum}")
|
||||
public void updateAudit(Audit audits);
|
||||
|
||||
@Delete("delete from audit where checkNum=#{checkNum}")
|
||||
public void deleteAudit(long checkNum);
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.example.demo.Dao;
|
||||
|
||||
import com.example.demo.bean.Bank;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface bankMapper {
|
||||
|
||||
@Select("select * from bank where bankNum = #{bankNum}")
|
||||
public Bank selectBankByBankNum(int bankNum);
|
||||
|
||||
@Select("select * from bank where bankName = #{bankName}")
|
||||
public Bank selectBankByBankName(String bankName);
|
||||
|
||||
@Select("select * from bank")
|
||||
public List<Bank> select();
|
||||
|
||||
@Insert("insert into bank(bankNum, bankName, contact, " +
|
||||
" values (#{bankNum},#{bankName},#{contact},)")
|
||||
public void addBank(Bank banks);
|
||||
|
||||
@Update("update bank set bankNum=#{bankNum},bankName=#{bankName}" +
|
||||
",contact=#{contact} where bankNum=#{bankNum}")
|
||||
public void updateBank(Bank banks);
|
||||
|
||||
// @Delete("delete from bank where bankNum=#{bankNum}")
|
||||
// public void deleteBank(String bankNum);
|
||||
//
|
||||
// @Delete("delete from bank where bankName=#{bankName}")
|
||||
// public void deleteBanks(String bankName);
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.example.demo.Dao;
|
||||
|
||||
import com.example.demo.bean.Manager;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
@Mapper
|
||||
public interface managerMapper {
|
||||
@Select("select * from manager where managerNum = #{managerName}")
|
||||
public Manager selectManagerByManagerName(String managerName);
|
||||
|
||||
@Insert("insert into manager(managerNum, managerName, managerPwd, " +
|
||||
"managerRight, telephoneNum) values (#{managerNum},#{managerName}," +
|
||||
"#{managerPwd},#{managerRight},#{telephoneNum})")
|
||||
public void addManager(Manager managers);
|
||||
|
||||
@Update("update manager set managerNum=#{managerNum},managerName=#{managerName}" +
|
||||
",managerPwd=#{managerPwd},managerRight=#{managerRight},telephoneNum=#{telephoneNum},")
|
||||
public void updateManager(Manager managers);
|
||||
|
||||
// @Delete("delete from manager where managerNum=#{managerNum}")
|
||||
// public void deleteManager(String managerNum);
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.example.demo.Dao;
|
||||
|
||||
|
||||
import com.example.demo.bean.ProductHistroy;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface productHistroyMapper {
|
||||
@Select("select * from producthistroy where productNum = #{productNum}")
|
||||
public ProductHistroy selectAudioByCheckNum(long productNum);
|
||||
|
||||
@Select("select * from producthistroy")
|
||||
public List<ProductHistroy> select();
|
||||
|
||||
@Insert("insert into productHistroy(productNum, productName, category, " +
|
||||
"intrate, bankNum, productDescription, uploadTime, deleteTime, alterTime)" +
|
||||
" values (#{productNum},#{productName},#{category},#{intrate},#{bankNum}," +
|
||||
"#{productDescription},#{uploadTime},#{deleteTime},#{alterTime})")
|
||||
public void addProductHistroy(ProductHistroy productHistroys);
|
||||
|
||||
// @Update("update producthistroy set productNum=#{productNum},productName=#{productName}" +
|
||||
// ",category=#{category},intrate=#{intrate},bankNum=#{bankNum}," +
|
||||
// "productDescription=#{productDescription},uploadTime=#{uploadTime},deleteTime=#{deleteTime}," +
|
||||
// "alterTime=#{alterTime}where productNum=#{productNum}")
|
||||
// public void updateProductHistroy(ProductHistroy productHistroys);
|
||||
|
||||
// @Delete("delete from producthistroy where productNum=#{productNum}")
|
||||
// public void deleteProductHistroy(int productNum);
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.example.demo.Dao;
|
||||
|
||||
import com.example.demo.bean.Product;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface productMapper {
|
||||
@Select("select * from product where productName like '%#{productName}%'")
|
||||
public List<Product> findByNameLike(String productName);
|
||||
|
||||
@Select("select * from product where productName = #{category}")
|
||||
public List<Product> findByCategory(String category);
|
||||
|
||||
@Select("select * from product where intrate = #{intrate} order by intrate ASC")
|
||||
public List<Product> findByIntrate(float intrate);
|
||||
|
||||
@Select("select * from product where productNum = #{productNum}")
|
||||
public Product selectProductByProductNum(long productNum);
|
||||
|
||||
@Select("select * from product where productName = #{productName}")
|
||||
public Product selectProductByProductName(String productName);
|
||||
|
||||
@Select("select * from product")
|
||||
public List<Product> select();
|
||||
|
||||
@Insert("insert into product(productNum, productName, category, intrate, " +
|
||||
"bankNum, productDescription, pictureAddress)" +
|
||||
" values (#{productNum},#{productName},#{category},#{intrate},#{bankNum}," +
|
||||
"#{productDescription},#{pictureAddress})")
|
||||
public void addProduct(Product products);
|
||||
|
||||
@Update("update product set productNum=#{productNum},productName=#{productName}" +
|
||||
",category=#{category},intrate=#{intrate},bankNum=#{bankNum}," +
|
||||
"productDescription=#{productDescription},pictureAddress=#{pictureAddress}")
|
||||
public void updateProduct(Product products);
|
||||
|
||||
|
||||
@Delete("delete from product where productNum=#{productNum}")
|
||||
public void deleteProduct(int productNum);
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.example.demo.Dao;
|
||||
|
||||
import com.example.demo.bean.Transaction;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface transMapper {
|
||||
@Select("select * from transaction where transactionNum = #{transactionNum}")
|
||||
public Transaction selectAudioByCheckNum(long transactionNum);
|
||||
|
||||
@Select("select * from transaction")
|
||||
public List<Transaction> select();
|
||||
|
||||
@Insert("insert into transaction(transactionNum, payer, payee," +
|
||||
" transactionTime, transactionAmount, note,checkNum)" +
|
||||
" values (#{transactionNum},#{payer},#{payee},#{transactionTime},#{transactionAmount}," +
|
||||
"#{note},#{checkNum})")
|
||||
public void addTransaction(Transaction transactions);
|
||||
|
||||
@Update("update audit set transactionNum=#{transactionNum},payer=#{payer}" +
|
||||
",payee=#{payee},transactionTime=#{transactionTime},transactionAmount=#{transactionAmount}," +
|
||||
"note=#{note}")
|
||||
public void updateTransaction(Transaction transactions);
|
||||
|
||||
@Delete("delete from audit where transactionNum=#{transactionNum}")
|
||||
public void deleteTransaction(long transactionNum);
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.example.demo.Dao;
|
||||
|
||||
import com.example.demo.bean.UsageDate;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Mapper
|
||||
public interface usageDateMapper {
|
||||
@Select("select * from usagedate where transactionNum = #{transactionNum}")
|
||||
public UsageDate selectUsageDateByCheckNum(long checkNum);
|
||||
|
||||
@Select("select * from usagedate")
|
||||
public List<UsageDate> select();
|
||||
|
||||
@Select("select productNum from usageDate group by productNum order by count(productNum) DESC")
|
||||
public List<Integer> selectByCount();
|
||||
|
||||
@Insert("insert into usagedate(checkNum, productNum, userNum," +
|
||||
" bankAccount, bankNum, year, amount, startTime)" +
|
||||
" values (#{checkNum},#{productNum},#{userNum},#{bankAccount},#{bankNum}," +
|
||||
"#{year},#{amount},#{startTime})")
|
||||
public void addUsageDate(UsageDate usageDate);
|
||||
|
||||
@Update("update usagedate set checkNum=#{checkNum},productNum=#{productNum}" +
|
||||
",userNum=#{userNum},bankAccount=#{bankAccount},bankNum=#{bankNum}," +
|
||||
"year=#{year},amount=#{amount},startTime=#{startTime}")
|
||||
public void updateUsageDate(UsageDate usageDate);
|
||||
|
||||
@Delete("delete from usagedate where checkNum=#{checkNum}")
|
||||
public void deleteUsageDate(long checkNum);
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.example.demo.Dao;
|
||||
|
||||
import com.example.demo.bean.UserBankIdentify;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface userBankIdentify {
|
||||
@Select("select * from userbankidentify where userName = #{userName}")
|
||||
public UserBankIdentify selectUsageDateByCheckNum(String userName);
|
||||
|
||||
@Select("select * from userBankIdentify")
|
||||
public List<UserBankIdentify> select();
|
||||
|
||||
@Insert("insert into usagedate(userName, bankAccount, bankAccountIdentify)" +
|
||||
" values (#{userName},#{bankAccount},#{bankAccountIdentify})")
|
||||
public void addUserBankIdentify(UserBankIdentify userBankIdentifys);
|
||||
|
||||
@Update("update usagedate set userName=#{userName},bankAccount=#{bankAccount}" +
|
||||
",bankAccountIdentify=#{bankAccountIdentify}")
|
||||
public void updateUserBankIdentify(UserBankIdentify userBankIdentifys);
|
||||
|
||||
@Delete("delete from usagedate where userName=#{userName}")
|
||||
public void deleteUserBankIdentify(String userName);
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.example.demo.Dao;
|
||||
|
||||
import com.example.demo.bean.User;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface userMapper {
|
||||
@Select("select * from user where userNum = #{userNum}")
|
||||
public User selectUserByuserNum(long userNum);
|
||||
|
||||
@Select("select userPwd from user where userName = #{userName}")
|
||||
public String selectuserPwdByuserName(String userName);
|
||||
|
||||
@Select("select * from user where userName = #{userName}")
|
||||
public User selectUserByuserName(String userName);
|
||||
|
||||
@Select("select * from user")
|
||||
public List<User> select();
|
||||
|
||||
@Insert("insert into user(userNum, userName, userPwd, userRight," +
|
||||
" tureName, idNum, telephoneNum, address, isIdentify, registerTime)" +
|
||||
" values (#{userNum},#{userName},#{userPwd},#{userRight},#{tureName}," +
|
||||
"#{idNum},#{telephoneNum},#{address},#{isIdentify},#{registerTime})")
|
||||
public void addUser(User users);
|
||||
|
||||
@Update("update user set userNum=#{userNum},userName=#{userName}" +
|
||||
",userPwd=#{userPwd},userRight=#{userRight},tureName=#{tureName}," +
|
||||
"idNum=#{idNum},telephoneNum=#{telephoneNum},address=#{address}," +
|
||||
"isIdentify=#{isIdentify},registerTime=#{registerTime}where userNum=#{userNum}")
|
||||
public void updateUser(User users);
|
||||
|
||||
@Delete("delete from user where userNum=#{userNum}")
|
||||
public void deleteUser(long userNum);
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.example.demo.bean;
|
||||
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
public class Audit {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private long checkNum;
|
||||
private long userNum;
|
||||
private double amount;
|
||||
private String applyTime;
|
||||
private String bankAccount;
|
||||
private long checkState;
|
||||
private long contractNum;
|
||||
private short isSignContract;
|
||||
private long productNum;
|
||||
private int year;
|
||||
private int equation;
|
||||
|
||||
|
||||
public Audit(){};
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.example.demo.bean;
|
||||
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
public class Bank {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private int bankNum;
|
||||
private String bankName;
|
||||
private String contact;//联系方式
|
||||
|
||||
|
||||
public Bank(){};
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.example.demo.bean;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
public class Manager {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private long managerNum;
|
||||
private String managerName;
|
||||
private String managerPwd;
|
||||
private String managerRight;
|
||||
private String telephoneNum;
|
||||
|
||||
|
||||
public Manager(){};
|
||||
|
||||
public long getManagerNum() {
|
||||
return managerNum;
|
||||
}
|
||||
|
||||
public void setManagerNum(int managerNum) {
|
||||
this.managerNum = managerNum;
|
||||
}
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
package com.example.demo.bean;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
public class Product {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private long productNum;
|
||||
private String productName;
|
||||
private String category;
|
||||
private float intrate;
|
||||
private int bankNum;
|
||||
private String productDescription;
|
||||
private String pictureAddress;
|
||||
|
||||
public Product(){};
|
||||
|
||||
public String getProductName() {
|
||||
return productName;
|
||||
}
|
||||
|
||||
public String getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
public void setCategory(String category) {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public String getPictureAddress() {
|
||||
return pictureAddress;
|
||||
}
|
||||
|
||||
public void setPictureAddress(String pictureAddress) {
|
||||
this.pictureAddress = pictureAddress;
|
||||
}
|
||||
|
||||
public String getProductDescription() {
|
||||
return productDescription;
|
||||
}
|
||||
|
||||
public void setProductDescription(String productDescription) {
|
||||
this.productDescription = productDescription;
|
||||
}
|
||||
|
||||
public int getBankNum() {
|
||||
return bankNum;
|
||||
}
|
||||
|
||||
public void setBankNum(int bankNum) {
|
||||
this.bankNum = bankNum;
|
||||
}
|
||||
|
||||
public float getIntrate() {
|
||||
return intrate;
|
||||
}
|
||||
|
||||
public void setIntrate(float intrate) {
|
||||
this.intrate = intrate;
|
||||
}
|
||||
|
||||
public long getProductNum() {
|
||||
return productNum;
|
||||
}
|
||||
|
||||
public void setProductName(String productName) {
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public void setProductNum(long productNum) {
|
||||
this.productNum = productNum;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,111 @@
|
||||
package com.example.demo.bean;
|
||||
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class ProductHistroy {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private long productNum;
|
||||
private int bankNum;
|
||||
private long managerNum;
|
||||
private String productName;
|
||||
private String category;
|
||||
private float intrate;
|
||||
private String productDescription;
|
||||
private String upLoadTime;
|
||||
private String deleteTime;
|
||||
private String alterTime;
|
||||
|
||||
public ProductHistroy(){};
|
||||
|
||||
public long getManagerNum() {
|
||||
return managerNum;
|
||||
}
|
||||
|
||||
public void setManagerNum(long managerNum) {
|
||||
this.managerNum = managerNum;
|
||||
}
|
||||
|
||||
public long getProductNum() {
|
||||
return productNum;
|
||||
}
|
||||
|
||||
public void setProductNum(long productNum) {
|
||||
this.productNum = productNum;
|
||||
}
|
||||
|
||||
public String getAlterTime() {
|
||||
return alterTime;
|
||||
}
|
||||
|
||||
public void setAlterTime(String alterTime) {
|
||||
this.alterTime = alterTime;
|
||||
}
|
||||
|
||||
|
||||
public String getDeleteTime() {
|
||||
return deleteTime;
|
||||
}
|
||||
|
||||
public void setDeleteTime(String deleteTime) {
|
||||
this.deleteTime = deleteTime;
|
||||
}
|
||||
|
||||
public String getUpLoadTime() {
|
||||
return upLoadTime;
|
||||
}
|
||||
|
||||
public void setUpLoadTime(String upLoadTime) {
|
||||
this.upLoadTime = upLoadTime;
|
||||
}
|
||||
|
||||
public String getProductDescription() {
|
||||
return productDescription;
|
||||
}
|
||||
|
||||
public void setProductDescription(String productDescription) {
|
||||
this.productDescription = productDescription;
|
||||
}
|
||||
|
||||
public float getIntrate() {
|
||||
return intrate;
|
||||
}
|
||||
|
||||
public void setIntrate(float intrate) {
|
||||
this.intrate = intrate;
|
||||
}
|
||||
|
||||
public String getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
public void setCategory(String category) {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public String getProductName() {
|
||||
return productName;
|
||||
}
|
||||
|
||||
public void setProductName(String productName) {
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public int getBankNum() {
|
||||
return bankNum;
|
||||
}
|
||||
|
||||
public void setBankNum(int bankNum) {
|
||||
this.bankNum = bankNum;
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.example.demo.bean;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
public class Transaction {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private long transactionNum;
|
||||
private long payer;
|
||||
private long payee;
|
||||
private float transactionTime;
|
||||
private float transactionAmount;
|
||||
private String note;
|
||||
private long checkNum;
|
||||
|
||||
public Transaction(){};
|
||||
public Transaction(long checkNum,long payer,long payee,double transationAmount){
|
||||
this.checkNum=checkNum;
|
||||
this.payer = payer;
|
||||
this.payee = payee;
|
||||
this.transactionAmount=transactionNum;
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.example.demo.bean;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
public class UsageDate {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private long checkNum;
|
||||
private long productNum;
|
||||
private long userNum;
|
||||
private String bankAccount;
|
||||
private int bankNum;
|
||||
private int year;
|
||||
private float amount;
|
||||
private String startTime;
|
||||
|
||||
public UsageDate(){};
|
||||
private int equation;
|
||||
|
||||
public int getYear() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public long getProductNum() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public double getAmount() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public long getUserNum() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getBankNum() {
|
||||
return 0;
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.example.demo.bean;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
public class User {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private long userNum;
|
||||
private String userName;
|
||||
private String userPwd;
|
||||
private String userRight;
|
||||
private String trueName;
|
||||
private String idNum;
|
||||
private String telephoneNum;
|
||||
private String address;
|
||||
private String isIdentify;
|
||||
private String registerTime;
|
||||
|
||||
|
||||
public User(){};
|
||||
|
||||
public String getUserPwd() {
|
||||
return userPwd;
|
||||
}
|
||||
|
||||
public void setUserPwd(String userPwd) {
|
||||
this.userPwd = userPwd;
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.example.demo.bean;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
public class UserBankIdentify {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private String userName;
|
||||
private String bankAccount;
|
||||
private short bankAccountIdentify;
|
||||
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package com.example.demo.loginService.API;
|
||||
|
||||
import com.example.demo.bean.User;
|
||||
|
||||
public interface UserService {
|
||||
public User selectUserByuserName(String userName);
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.example.demo.loginService.API.impl;
|
||||
|
||||
import com.example.demo.Dao.userMapper;
|
||||
import com.example.demo.bean.User;
|
||||
import com.example.demo.loginService.API.UserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Service("UserServiceImpl")
|
||||
public class UserServiceImpl implements UserService{
|
||||
private userMapper UserMapper;
|
||||
@Transactional(propagation=Propagation.REQUIRED,readOnly = true)
|
||||
public User selectUserByuserName(String userName){
|
||||
return this.UserMapper.selectUserByuserName(userName);
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.example.demo.loginService;
|
||||
|
||||
import com.example.demo.bean.User;
|
||||
import com.example.demo.loginService.API.UserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
||||
@Controller
|
||||
public class UserController extends HttpServlet{
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
@PostMapping("/Login.do")
|
||||
public String doPost1(HttpServletRequest request, HttpServletResponse response){
|
||||
String userName=request.getParameter("userName");
|
||||
String userPwd=request.getParameter("userPwd");
|
||||
User user=this.userService.selectUserByuserName(userName);
|
||||
if(user!=null){
|
||||
if(user.getUserPwd().equals(userPwd)){
|
||||
return "/login1";
|
||||
}
|
||||
else{
|
||||
return "/login2";
|
||||
}
|
||||
}else{
|
||||
return "/login2";
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue