diff --git a/demo/src/test/java/com/example/demo/Dao/paymentMapper.java b/demo/src/main/java/com/example/demo/Dao/paymentMapper.java similarity index 92% rename from demo/src/test/java/com/example/demo/Dao/paymentMapper.java rename to demo/src/main/java/com/example/demo/Dao/paymentMapper.java index 940f988..40fb777 100644 --- a/demo/src/test/java/com/example/demo/Dao/paymentMapper.java +++ b/demo/src/main/java/com/example/demo/Dao/paymentMapper.java @@ -1,7 +1,6 @@ package com.example.demo.Dao; import com.example.demo.bean.Repayment; -import com.example.demo.bean.Transaction; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; diff --git a/demo/src/main/java/com/example/demo/Dao/productHistroyMapper.java b/demo/src/main/java/com/example/demo/Dao/productHistroyMapper.java index 18f6b7c..ffe7cc4 100644 --- a/demo/src/main/java/com/example/demo/Dao/productHistroyMapper.java +++ b/demo/src/main/java/com/example/demo/Dao/productHistroyMapper.java @@ -17,7 +17,7 @@ public interface productHistroyMapper { public List select(); @Insert("insert into productHistroy(productNum, productName, category, " + - "intrate, bankNum, productDescription, uploadTime, deleteTime, alterTime)" + + "intrate, bankNum, productDescription, uploadTime, deleteTime, alterTime,managerNum)" + " values (#{productNum},#{productName},#{category},#{intrate},#{bankNum}," + "#{productDescription},#{uploadTime},#{deleteTime},#{alterTime})") public void addProductHistroy(ProductHistroy productHistroys); diff --git a/demo/src/main/java/com/example/demo/Dao/productMapper.java b/demo/src/main/java/com/example/demo/Dao/productMapper.java index 514e642..b0708e3 100644 --- a/demo/src/main/java/com/example/demo/Dao/productMapper.java +++ b/demo/src/main/java/com/example/demo/Dao/productMapper.java @@ -7,20 +7,11 @@ import java.util.List; @Mapper public interface productMapper { - @Select("select * from product where productName like '%#{productName}%'") - public List findByNameLike(String productName); - - @Select("select * from product where productName = #{category}") - public List findByCategory(String category); - - @Select("select * from product where intrate = #{intrate} order by intrate ASC") - public List 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); + public Product selectProductByProductName(long productName); @Select("select * from product") public List select(); diff --git a/demo/src/main/java/com/example/demo/Dao/transMapper.java b/demo/src/main/java/com/example/demo/Dao/transMapper.java index 7c414ca..327e996 100644 --- a/demo/src/main/java/com/example/demo/Dao/transMapper.java +++ b/demo/src/main/java/com/example/demo/Dao/transMapper.java @@ -19,12 +19,11 @@ public interface transMapper { "#{note},#{checkNum})") public void addTransaction(Transaction transactions); - @Update("update audit set transactionNum=#{transactionNum},payer=#{payer}" + + @Update("update transaction 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); - + @Delete("delete from transaction where transactionNum=#{transactionNum}") + public void deleteTransaction(int transactionNum); } diff --git a/demo/src/main/java/com/example/demo/Dao/usageDateMapper.java b/demo/src/main/java/com/example/demo/Dao/usageDateMapper.java index 159968c..ae239f8 100644 --- a/demo/src/main/java/com/example/demo/Dao/usageDateMapper.java +++ b/demo/src/main/java/com/example/demo/Dao/usageDateMapper.java @@ -14,9 +14,6 @@ public interface usageDateMapper { @Select("select * from usagedate") public List select(); - @Select("select productNum from usageDate group by productNum order by count(productNum) DESC") - public List selectByCount(); - @Insert("insert into usagedate(checkNum, productNum, userNum," + " bankAccount, bankNum, year, amount, startTime)" + " values (#{checkNum},#{productNum},#{userNum},#{bankAccount},#{bankNum}," + 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 a3d1cff..1b96851 100644 --- a/demo/src/main/java/com/example/demo/Dao/userMapper.java +++ b/demo/src/main/java/com/example/demo/Dao/userMapper.java @@ -10,12 +10,6 @@ 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 select(); diff --git a/demo/src/main/java/com/example/demo/bean/Repayment.java b/demo/src/main/java/com/example/demo/bean/Repayment.java new file mode 100644 index 0000000..b830553 --- /dev/null +++ b/demo/src/main/java/com/example/demo/bean/Repayment.java @@ -0,0 +1,30 @@ +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 Repayment { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private long checkNum; + private double repAmount; + private double repSum; + + public double getRepAmount() { + return 0; + } + + public void setRepAmount(double repamount) { + } + + public void setRepSum(double pay) { + } +} diff --git a/demo/src/main/java/com/example/demo/bean/UsageDate.java b/demo/src/main/java/com/example/demo/bean/UsageDate.java index 6ee1c70..a9d8b98 100644 --- a/demo/src/main/java/com/example/demo/bean/UsageDate.java +++ b/demo/src/main/java/com/example/demo/bean/UsageDate.java @@ -26,6 +26,7 @@ public class UsageDate { public UsageDate(){}; private int equation; +<<<<<<< HEAD public int getYear() { return 0; } @@ -35,6 +36,17 @@ public class UsageDate { } public double getAmount() { +======= + public double getAmount() { + return amount; + } + + public int getYear() { + return year; + } + + public long getProductNum() { +>>>>>>> origin/master return 0; } diff --git a/demo/src/main/java/com/example/demo/bean/User.java b/demo/src/main/java/com/example/demo/bean/User.java index 693cd47..4b22407 100644 --- a/demo/src/main/java/com/example/demo/bean/User.java +++ b/demo/src/main/java/com/example/demo/bean/User.java @@ -27,12 +27,4 @@ public class User { public User(){}; - - public String getUserPwd() { - return userPwd; - } - - public void setUserPwd(String userPwd) { - this.userPwd = userPwd; - } } diff --git a/demo/src/main/java/com/example/demo/bean/UserBankIdentify.java b/demo/src/main/java/com/example/demo/bean/UserBankIdentify.java index e829523..6889b3b 100644 --- a/demo/src/main/java/com/example/demo/bean/UserBankIdentify.java +++ b/demo/src/main/java/com/example/demo/bean/UserBankIdentify.java @@ -1,7 +1,7 @@ package com.example.demo.bean; -import lombok.Getter; import lombok.Setter; +import lombok.Getter; import javax.persistence.Entity; import javax.persistence.GeneratedValue; diff --git a/demo/src/test/java/com/example/demo/circulator/service/CirService.java b/demo/src/main/java/com/example/demo/circulator/service/CirService.java similarity index 87% rename from demo/src/test/java/com/example/demo/circulator/service/CirService.java rename to demo/src/main/java/com/example/demo/circulator/service/CirService.java index c3be9ef..c84f43b 100644 --- a/demo/src/test/java/com/example/demo/circulator/service/CirService.java +++ b/demo/src/main/java/com/example/demo/circulator/service/CirService.java @@ -1,6 +1,5 @@ package com.example.demo.circulator.service; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; import javax.annotation.PostConstruct; diff --git a/demo/src/test/java/com/example/demo/circulator/service/EPAIR_CirService.java b/demo/src/main/java/com/example/demo/circulator/service/EPAIR_CirService.java similarity index 98% rename from demo/src/test/java/com/example/demo/circulator/service/EPAIR_CirService.java rename to demo/src/main/java/com/example/demo/circulator/service/EPAIR_CirService.java index 3efb4d4..a14339f 100644 --- a/demo/src/test/java/com/example/demo/circulator/service/EPAIR_CirService.java +++ b/demo/src/main/java/com/example/demo/circulator/service/EPAIR_CirService.java @@ -7,8 +7,6 @@ import com.example.demo.bean.UsageDate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; -import javax.annotation.PostConstruct; - public class EPAIR_CirService extends CirService{ @Autowired private usageDateMapper usageDateMapper; diff --git a/demo/src/test/java/com/example/demo/circulator/service/EPR_CirService.java b/demo/src/main/java/com/example/demo/circulator/service/EPR_CirService.java similarity index 98% rename from demo/src/test/java/com/example/demo/circulator/service/EPR_CirService.java rename to demo/src/main/java/com/example/demo/circulator/service/EPR_CirService.java index a44fce8..2ad0c38 100644 --- a/demo/src/test/java/com/example/demo/circulator/service/EPR_CirService.java +++ b/demo/src/main/java/com/example/demo/circulator/service/EPR_CirService.java @@ -9,8 +9,6 @@ import com.example.demo.bean.UsageDate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; -import javax.annotation.PostConstruct; - public class EPR_CirService extends CirService{ @Autowired private usageDateMapper usageDateMapper; diff --git a/demo/src/test/java/com/example/demo/circulator/service/PayCirService.java b/demo/src/main/java/com/example/demo/circulator/service/PayCirService.java similarity index 89% rename from demo/src/test/java/com/example/demo/circulator/service/PayCirService.java rename to demo/src/main/java/com/example/demo/circulator/service/PayCirService.java index f656029..af88ae7 100644 --- a/demo/src/test/java/com/example/demo/circulator/service/PayCirService.java +++ b/demo/src/main/java/com/example/demo/circulator/service/PayCirService.java @@ -16,7 +16,7 @@ public class PayCirService { try{ Repayment repayment = paymentMapper.selectPepaymentBycheckNum(checkNum); UsageDate usageDate= usageDateMapper.selectUsageDateByCheckNum(checkNum); - double rep_amount = repayment.getRepAmount(); + double repamount = repayment.getRepAmount(); long userNum = usageDate.getUserNum(); int bankNum = usageDate.getBankNum(); double amount = usageDate.getAmount(); @@ -25,8 +25,8 @@ public class PayCirService { Transaction transaction = new Transaction(checkNum,userNum,bankNum,pay); transMapper.addTransaction(transaction); - rep_amount = pay - amount/(year*12); - repayment.setRepAmount(rep_amount); + repamount = pay - amount/(year*12); + repayment.setRepAmount(repamount); repayment.setRepSum(pay); paymentMapper.updateRepayment(repayment); return 1; diff --git a/demo/src/test/java/com/example/demo/circulator/service/controller/NextCirController.java b/demo/src/main/java/com/example/demo/circulator/service/controller/NextCirController.java similarity index 100% rename from demo/src/test/java/com/example/demo/circulator/service/controller/NextCirController.java rename to demo/src/main/java/com/example/demo/circulator/service/controller/NextCirController.java diff --git a/demo/src/test/java/com/example/demo/circulator/service/controller/PayCirController.java b/demo/src/main/java/com/example/demo/circulator/service/controller/PayCirController.java similarity index 100% rename from demo/src/test/java/com/example/demo/circulator/service/controller/PayCirController.java rename to demo/src/main/java/com/example/demo/circulator/service/controller/PayCirController.java diff --git a/demo/src/test/java/com/example/demo/circulator/service/controller/SumCirController.java b/demo/src/main/java/com/example/demo/circulator/service/controller/SumCirController.java similarity index 100% rename from demo/src/test/java/com/example/demo/circulator/service/controller/SumCirController.java rename to demo/src/main/java/com/example/demo/circulator/service/controller/SumCirController.java diff --git a/demo/src/test/java/com/example/demo/productService/controller/addController.java b/demo/src/main/java/com/example/demo/productService/controller/addController.java similarity index 96% rename from demo/src/test/java/com/example/demo/productService/controller/addController.java rename to demo/src/main/java/com/example/demo/productService/controller/addController.java index 01e1734..f36dc97 100644 --- a/demo/src/test/java/com/example/demo/productService/controller/addController.java +++ b/demo/src/main/java/com/example/demo/productService/controller/addController.java @@ -2,12 +2,13 @@ package com.example.demo.productService.controller; import com.example.demo.bean.Product; import com.example.demo.productService.tools.addPro; +import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; + import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.PrintWriter; -import org.springframework.stereotype.Controller; @Controller public class addController extends HttpServlet { @@ -25,7 +26,7 @@ public class addController extends HttpServlet { product.setProductDescription(request.getParameter("description")); product.setPictureAddress(request.getParameter("address")); int result= addPro.add(product); - response.setContentType("text/html;charset=utf-8"); + response.setContentType("text/hmtl;charset=utf-8"); writer=response.getWriter(); if(result==1){ writer.write("增加成功"); diff --git a/demo/src/test/java/com/example/demo/productService/controller/deleteController.java b/demo/src/main/java/com/example/demo/productService/controller/deleteController.java similarity index 100% rename from demo/src/test/java/com/example/demo/productService/controller/deleteController.java rename to demo/src/main/java/com/example/demo/productService/controller/deleteController.java diff --git a/demo/src/test/java/com/example/demo/productService/controller/updateController.java b/demo/src/main/java/com/example/demo/productService/controller/updateController.java similarity index 100% rename from demo/src/test/java/com/example/demo/productService/controller/updateController.java rename to demo/src/main/java/com/example/demo/productService/controller/updateController.java diff --git a/demo/src/test/java/com/example/demo/productService/tools/addPro.java b/demo/src/main/java/com/example/demo/productService/tools/addPro.java similarity index 100% rename from demo/src/test/java/com/example/demo/productService/tools/addPro.java rename to demo/src/main/java/com/example/demo/productService/tools/addPro.java diff --git a/demo/src/test/java/com/example/demo/productService/tools/deletePro.java b/demo/src/main/java/com/example/demo/productService/tools/deletePro.java similarity index 95% rename from demo/src/test/java/com/example/demo/productService/tools/deletePro.java rename to demo/src/main/java/com/example/demo/productService/tools/deletePro.java index 886e14c..5489d67 100644 --- a/demo/src/test/java/com/example/demo/productService/tools/deletePro.java +++ b/demo/src/main/java/com/example/demo/productService/tools/deletePro.java @@ -1,7 +1,6 @@ package com.example.demo.productService.tools; import com.example.demo.Dao.productHistroyMapper; -import com.example.demo.bean.Product; import com.example.demo.bean.ProductHistroy; public class deletePro { diff --git a/demo/src/test/java/com/example/demo/productService/tools/nowTime.java b/demo/src/main/java/com/example/demo/productService/tools/nowTime.java similarity index 100% rename from demo/src/test/java/com/example/demo/productService/tools/nowTime.java rename to demo/src/main/java/com/example/demo/productService/tools/nowTime.java index 92065f9..8629762 100644 --- a/demo/src/test/java/com/example/demo/productService/tools/nowTime.java +++ b/demo/src/main/java/com/example/demo/productService/tools/nowTime.java @@ -1,8 +1,8 @@ package com.example.demo.productService.tools; -import java.util.Date; import java.text.SimpleDateFormat; +import java.util.Date; public class nowTime{ diff --git a/demo/src/test/java/com/example/demo/productService/tools/updatePro.java b/demo/src/main/java/com/example/demo/productService/tools/updatePro.java similarity index 100% rename from demo/src/test/java/com/example/demo/productService/tools/updatePro.java rename to demo/src/main/java/com/example/demo/productService/tools/updatePro.java diff --git a/demo/src/main/java/com/example/demo/searchService/controller/SearchServiceController.java b/demo/src/main/java/com/example/demo/searchService/controller/SearchServiceController.java new file mode 100644 index 0000000..a646364 --- /dev/null +++ b/demo/src/main/java/com/example/demo/searchService/controller/SearchServiceController.java @@ -0,0 +1,18 @@ +package com.example.demo.searchService.controller; + +import com.example.demo.bean.Product; +import com.example.demo.searchService.service.impl.ProductSearchServiceImpl; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; + +import java.util.List; + + +public class SearchServiceController { + ProductSearchServiceImpl productSearchService = new ProductSearchServiceImpl(); + //模糊查询 + @GetMapping("/findByNameLike/{productName}") + public List findByNameLike(@PathVariable(value = "productName") String productName){ + return productSearchService.findByNameLike(productName); + } +} diff --git a/demo/src/main/java/com/example/demo/searchService/repository/ProductRepository.java b/demo/src/main/java/com/example/demo/searchService/repository/ProductRepository.java new file mode 100644 index 0000000..933e60a --- /dev/null +++ b/demo/src/main/java/com/example/demo/searchService/repository/ProductRepository.java @@ -0,0 +1,15 @@ +package com.example.demo.searchService.repository; + +import com.example.demo.bean.Product; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; + +import java.util.List; + +public interface ProductRepository extends JpaRepository, JpaSpecificationExecutor { + @Query("select p.productName from Product p where p.productName like CONCAT('%',:productName,'%')") + List findByNameLike(@Param("productName") String productName); + +} diff --git a/demo/src/test/java/com/example/demo/searchService/service/ProductSearchService.java b/demo/src/main/java/com/example/demo/searchService/service/ProductSearchService.java similarity index 60% rename from demo/src/test/java/com/example/demo/searchService/service/ProductSearchService.java rename to demo/src/main/java/com/example/demo/searchService/service/ProductSearchService.java index c61a057..124d4cc 100644 --- a/demo/src/test/java/com/example/demo/searchService/service/ProductSearchService.java +++ b/demo/src/main/java/com/example/demo/searchService/service/ProductSearchService.java @@ -6,10 +6,4 @@ import java.util.List; public interface ProductSearchService { List findByNameLike(String productName); - - List findByCategory(String category); - - List findByIntrate(float intrate); - - List findByCount(); } diff --git a/demo/src/main/java/com/example/demo/searchService/service/impl/ProductSearchServiceImpl.java b/demo/src/main/java/com/example/demo/searchService/service/impl/ProductSearchServiceImpl.java new file mode 100644 index 0000000..bd757b4 --- /dev/null +++ b/demo/src/main/java/com/example/demo/searchService/service/impl/ProductSearchServiceImpl.java @@ -0,0 +1,171 @@ +package com.example.demo.searchService.service.impl; + +import com.example.demo.bean.Product; +import com.example.demo.searchService.repository.ProductRepository; +import com.example.demo.searchService.service.ProductSearchService; +import org.springframework.data.domain.Example; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.data.jpa.domain.Specification; + +import java.util.List; +import java.util.Optional; + +public class ProductSearchServiceImpl implements ProductSearchService { + ProductRepository productRepository = new ProductRepository() { + @Override + public List findByNameLike(String productName) { + return null; + } + + @Override + public List findAll() { + return null; + } + + @Override + public List findAll(Sort sort) { + return null; + } + + @Override + public List findAllById(Iterable iterable) { + return null; + } + + @Override + public List saveAll(Iterable iterable) { + return null; + } + + @Override + public void flush() { + + } + + @Override + public S saveAndFlush(S s) { + return null; + } + + @Override + public void deleteInBatch(Iterable iterable) { + + } + + @Override + public void deleteAllInBatch() { + + } + + @Override + public Product getOne(Integer integer) { + return null; + } + + @Override + public List findAll(Example example) { + return null; + } + + @Override + public List findAll(Example example, Sort sort) { + return null; + } + + @Override + public Optional findOne(Specification specification) { + return Optional.empty(); + } + + @Override + public List findAll(Specification specification) { + return null; + } + + @Override + public Page findAll(Specification specification, Pageable pageable) { + return null; + } + + @Override + public List findAll(Specification specification, Sort sort) { + return null; + } + + @Override + public long count(Specification specification) { + return 0; + } + + @Override + public Page findAll(Pageable pageable) { + return null; + } + + @Override + public S save(S s) { + return null; + } + + @Override + public Optional findById(Integer integer) { + return Optional.empty(); + } + + @Override + public boolean existsById(Integer integer) { + return false; + } + + @Override + public long count() { + return 0; + } + + @Override + public void deleteById(Integer integer) { + + } + + @Override + public void delete(Product product) { + + } + + @Override + public void deleteAll(Iterable iterable) { + + } + + @Override + public void deleteAll() { + + } + + @Override + public Optional findOne(Example example) { + return Optional.empty(); + } + + @Override + public Page findAll(Example example, Pageable pageable) { + return null; + } + + @Override + public long count(Example example) { + return 0; + } + + @Override + public boolean exists(Example example) { + return false; + } + }; + public List findByNameLike(String productName){ + List list = productRepository.findByNameLike(productName); + return list; + } +} diff --git a/demo/src/test/java/com/example/demo/Dao/auditMapper.java b/demo/src/test/java/com/example/demo/Dao/auditMapper.java deleted file mode 100644 index 236d723..0000000 --- a/demo/src/test/java/com/example/demo/Dao/auditMapper.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.example.demo.Dao; - -import com.example.demo.bean.Audit; -import org.apache.ibatis.annotations.Delete; -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 auditMapper { - @Select("select * from audit where checkNum = #{checkNum}") - public Audit selectAudioByCheckNum(long checkNum); - - @Select("select * from audit") - public List 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); -} diff --git a/demo/src/test/java/com/example/demo/Dao/bankMapper.java b/demo/src/test/java/com/example/demo/Dao/bankMapper.java deleted file mode 100644 index 2c89c79..0000000 --- a/demo/src/test/java/com/example/demo/Dao/bankMapper.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.example.demo.Dao; - -import com.example.demo.bean.Bank; -import org.apache.ibatis.annotations.*; - -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 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); -} diff --git a/demo/src/test/java/com/example/demo/Dao/managerMapper.java b/demo/src/test/java/com/example/demo/Dao/managerMapper.java deleted file mode 100644 index a890941..0000000 --- a/demo/src/test/java/com/example/demo/Dao/managerMapper.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.example.demo.Dao; - -import com.example.demo.bean.Manager; -import org.apache.ibatis.annotations.*; - -import java.util.List; - -@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); - -} diff --git a/demo/src/test/java/com/example/demo/Dao/productHistroyMapper.java b/demo/src/test/java/com/example/demo/Dao/productHistroyMapper.java deleted file mode 100644 index d0fbb2c..0000000 --- a/demo/src/test/java/com/example/demo/Dao/productHistroyMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.example.demo.Dao; - - -import com.example.demo.bean.ProductHistroy; -import org.apache.ibatis.annotations.*; - -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 select(); - - @Insert("insert into productHistroy(productNum, productName, category, " + - "intrate, bankNum, productDescription, uploadTime, deleteTime, alterTime,managerNum)" + - " 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); -} diff --git a/demo/src/test/java/com/example/demo/Dao/productMapper.java b/demo/src/test/java/com/example/demo/Dao/productMapper.java deleted file mode 100644 index 514e642..0000000 --- a/demo/src/test/java/com/example/demo/Dao/productMapper.java +++ /dev/null @@ -1,42 +0,0 @@ -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 findByNameLike(String productName); - - @Select("select * from product where productName = #{category}") - public List findByCategory(String category); - - @Select("select * from product where intrate = #{intrate} order by intrate ASC") - public List 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 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); -} diff --git a/demo/src/test/java/com/example/demo/Dao/transMapper.java b/demo/src/test/java/com/example/demo/Dao/transMapper.java deleted file mode 100644 index 327e996..0000000 --- a/demo/src/test/java/com/example/demo/Dao/transMapper.java +++ /dev/null @@ -1,29 +0,0 @@ -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 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 transaction set transactionNum=#{transactionNum},payer=#{payer}" + - ",payee=#{payee},transactionTime=#{transactionTime},transactionAmount=#{transactionAmount}," + - "note=#{note}") - public void updateTransaction(Transaction transactions); - - @Delete("delete from transaction where transactionNum=#{transactionNum}") - public void deleteTransaction(int transactionNum); -} diff --git a/demo/src/test/java/com/example/demo/Dao/usageDateMapper.java b/demo/src/test/java/com/example/demo/Dao/usageDateMapper.java deleted file mode 100644 index 159968c..0000000 --- a/demo/src/test/java/com/example/demo/Dao/usageDateMapper.java +++ /dev/null @@ -1,34 +0,0 @@ -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 select(); - - @Select("select productNum from usageDate group by productNum order by count(productNum) DESC") - public List 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); - -} diff --git a/demo/src/test/java/com/example/demo/Dao/userBankIdentify.java b/demo/src/test/java/com/example/demo/Dao/userBankIdentify.java deleted file mode 100644 index fabaf77..0000000 --- a/demo/src/test/java/com/example/demo/Dao/userBankIdentify.java +++ /dev/null @@ -1,26 +0,0 @@ -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 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); -} diff --git a/demo/src/test/java/com/example/demo/Dao/userMapper.java b/demo/src/test/java/com/example/demo/Dao/userMapper.java deleted file mode 100644 index 1b96851..0000000 --- a/demo/src/test/java/com/example/demo/Dao/userMapper.java +++ /dev/null @@ -1,30 +0,0 @@ -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 * from user") - public List 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); -} diff --git a/demo/src/test/java/com/example/demo/bean/Audit.java b/demo/src/test/java/com/example/demo/bean/Audit.java deleted file mode 100644 index 93ad821..0000000 --- a/demo/src/test/java/com/example/demo/bean/Audit.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.example.demo.bean; - - -import lombok.Getter; -import lombok.Setter; - -import javax.persistence.*; - -@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(){}; -} diff --git a/demo/src/test/java/com/example/demo/bean/Bank.java b/demo/src/test/java/com/example/demo/bean/Bank.java deleted file mode 100644 index 4a7bcd9..0000000 --- a/demo/src/test/java/com/example/demo/bean/Bank.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.example.demo.bean; - - -import lombok.Getter; -import lombok.Setter; - -import javax.persistence.*; - -@Getter -@Setter -@Entity -public class Bank { - private int bankNum; - private String bankName; - private String contact;//联系方式 - - - public Bank(){}; -} diff --git a/demo/src/test/java/com/example/demo/bean/Manager.java b/demo/src/test/java/com/example/demo/bean/Manager.java deleted file mode 100644 index 67eb681..0000000 --- a/demo/src/test/java/com/example/demo/bean/Manager.java +++ /dev/null @@ -1,33 +0,0 @@ -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; - } -} diff --git a/demo/src/test/java/com/example/demo/bean/Product.java b/demo/src/test/java/com/example/demo/bean/Product.java deleted file mode 100644 index 7f6722b..0000000 --- a/demo/src/test/java/com/example/demo/bean/Product.java +++ /dev/null @@ -1,83 +0,0 @@ -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; - } -} - diff --git a/demo/src/test/java/com/example/demo/bean/ProductHistroy.java b/demo/src/test/java/com/example/demo/bean/ProductHistroy.java deleted file mode 100644 index 3b0e8c4..0000000 --- a/demo/src/test/java/com/example/demo/bean/ProductHistroy.java +++ /dev/null @@ -1,111 +0,0 @@ -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; - } -} diff --git a/demo/src/test/java/com/example/demo/bean/Repayment.java b/demo/src/test/java/com/example/demo/bean/Repayment.java deleted file mode 100644 index 0e9ed17..0000000 --- a/demo/src/test/java/com/example/demo/bean/Repayment.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.example.demo.bean; - -import lombok.Getter; -import lombok.Setter; - -import javax.persistence.Entity; - -@Getter -@Setter -@Entity -public class Repayment { - private long checkNum; - private double repAmount; - private double repSum; - -} diff --git a/demo/src/test/java/com/example/demo/bean/Transaction.java b/demo/src/test/java/com/example/demo/bean/Transaction.java deleted file mode 100644 index 6126220..0000000 --- a/demo/src/test/java/com/example/demo/bean/Transaction.java +++ /dev/null @@ -1,33 +0,0 @@ -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; - - } -} diff --git a/demo/src/test/java/com/example/demo/bean/UsageDate.java b/demo/src/test/java/com/example/demo/bean/UsageDate.java deleted file mode 100644 index 3f4744b..0000000 --- a/demo/src/test/java/com/example/demo/bean/UsageDate.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.example.demo.bean; - -import lombok.Getter; -import lombok.Setter; - -import javax.persistence.Entity; - -@Getter -@Setter -@Entity -public class UsageDate { - 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; - -} diff --git a/demo/src/test/java/com/example/demo/bean/User.java b/demo/src/test/java/com/example/demo/bean/User.java deleted file mode 100644 index 4b22407..0000000 --- a/demo/src/test/java/com/example/demo/bean/User.java +++ /dev/null @@ -1,30 +0,0 @@ -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(){}; -} diff --git a/demo/src/test/java/com/example/demo/bean/UserBankIdentify.java b/demo/src/test/java/com/example/demo/bean/UserBankIdentify.java deleted file mode 100644 index 5eeac50..0000000 --- a/demo/src/test/java/com/example/demo/bean/UserBankIdentify.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.example.demo.bean; - -import lombok.Getter; - -import javax.persistence.Entity; - -@Getter -@Entity -public class UserBankIdentify { - private String userName; - private String bankAccount; - private short bankAccountIdentify; - -} diff --git a/demo/src/test/java/com/example/demo/searchService/controller/SearchServiceController.java b/demo/src/test/java/com/example/demo/searchService/controller/SearchServiceController.java deleted file mode 100644 index dd65378..0000000 --- a/demo/src/test/java/com/example/demo/searchService/controller/SearchServiceController.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.example.demo.searchService.controller; - - -import com.example.demo.bean.Product; -import com.example.demo.searchService.service.ProductSearchService; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.List; - -@Controller -public class SearchServiceController { - private ProductSearchService productSearchService; - @RequestMapping("/search") - public List productSearch(HttpServletRequest request, HttpServletResponse response){ - List list = new ArrayList(); - String productName = request.getParameter("productName"); - String category = request.getParameter("category"); - float intrate = Integer.parseInt(request.getParameter("intrate")); - if(productName!=null){ - list = productSearchService.findByNameLike(productName); - //按关键字搜索 - }else if(category!=null){ - list = productSearchService.findByCategory(category); - //按产品类别搜索 - }else if(intrate!=0){ - list = productSearchService.findByIntrate(intrate); - //按利率排序由低到高 - }else{ - list = productSearchService.findByCount(); - //默认按产品热度由高到低排序 - } - return list; - } -} diff --git a/demo/src/test/java/com/example/demo/searchService/service/impl/ProductSearchServiceImpl.java b/demo/src/test/java/com/example/demo/searchService/service/impl/ProductSearchServiceImpl.java deleted file mode 100644 index 965dcc1..0000000 --- a/demo/src/test/java/com/example/demo/searchService/service/impl/ProductSearchServiceImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.example.demo.searchService.service.impl; - -import com.example.demo.Dao.productMapper; -import com.example.demo.Dao.usageDateMapper; -import com.example.demo.bean.Product; -import com.example.demo.searchService.service.ProductSearchService; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.ArrayList; -import java.util.List; - -public class ProductSearchServiceImpl implements ProductSearchService { - @Autowired - productMapper productMapper; - usageDateMapper usageDateMapper; - Product product; - @Override - public List findByNameLike(String productName){ - return productMapper.findByNameLike(productName); - } - - @Override - public List findByCategory(String category){ - return productMapper.findByCategory(category); - } - - @Override - public List findByIntrate(float intrate){ - return productMapper.findByIntrate(intrate); - } - - @Override - public List findByCount(){ - List productList = new ArrayList(); - List listusage = usageDateMapper.selectByCount(); - int[] arr = listusage.stream().mapToInt(Integer::valueOf).toArray(); - for(int i=0;i