zzy90 2 月之前
父节点
当前提交
2b6f7ba8c7

+ 18 - 4
src/main/java/org/ajnb/controller/BiddingInfoController.java

@@ -1,9 +1,13 @@
 package org.ajnb.controller;
 
 import org.ajnb.service.BiddingInfoService;
+import org.ajnb.service.ClientsService;
 import org.ajnb.vo.BiddingInfoVO;
+import org.ajnb.vo.ClientsVO;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.List;
@@ -14,19 +18,29 @@ public class BiddingInfoController {
 
     @Autowired
     private BiddingInfoService biddingInfoService;
-
+    @Autowired
+    private ClientsService clientsService;
     @RequestMapping("QueryAll")
-    public List<BiddingInfoVO> QueryAll(){
+    public List<BiddingInfoVO> QueryAll() {
         return biddingInfoService.queryAllBiddingInfo();
     }
 
     @RequestMapping("QueryMultCondition")
-    public List<BiddingInfoVO> QueryMultCondition(BiddingInfoVO biddingInfoVO){
+    public List<BiddingInfoVO> QueryMultCondition(BiddingInfoVO biddingInfoVO) {
         return biddingInfoService.queryBiddingInfoByMultCondition(biddingInfoVO);
     }
 
     @RequestMapping("DeleteById")
-    public void DeleteById(BiddingInfoVO biddingInfoVO){
+    public void DeleteById(BiddingInfoVO biddingInfoVO) {
         biddingInfoService.deleteBiddingInfoById(biddingInfoVO);
     }
+
+    @RequestMapping("AddBidding")
+    public void addBiddingInfo(@RequestBody BiddingInfoVO biddingInfoVO) {
+        biddingInfoService.addBiddingInfo(biddingInfoVO);
+    }
+    @RequestMapping("SearchClients")
+    public List<ClientsVO> SearchClients(@RequestBody ClientsVO clientsVO) {
+        return clientsService.queryAllClients(clientsVO);
+    }
 }

+ 1 - 0
src/main/java/org/ajnb/mapper/BiddingInfoMapper.java

@@ -7,6 +7,7 @@ import java.util.List;
 
 @Mapper
 public interface BiddingInfoMapper {
+    public void addBiddingInfo(BiddingInfoVO biddingInfoVO);
     List<BiddingInfoVO> queryBiddingInfoById(BiddingInfoVO biddingInfoVO);
 
     List<BiddingInfoVO> queryAllBiddingInfo();

+ 10 - 0
src/main/java/org/ajnb/mapper/ClientsMapper.java

@@ -0,0 +1,10 @@
+package org.ajnb.mapper;
+
+import org.ajnb.vo.ClientsVO;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+@Mapper
+public interface ClientsMapper {
+    public List<ClientsVO> queryAllClients(ClientsVO clientsVO);
+}

+ 1 - 0
src/main/java/org/ajnb/service/BiddingInfoService.java

@@ -6,6 +6,7 @@ import java.util.List;
 
 
 public interface BiddingInfoService {
+    public void addBiddingInfo(BiddingInfoVO biddingInfoVO);
     List<BiddingInfoVO> queryBiddingInfoById(BiddingInfoVO biddingInfoVO);
 
     List<BiddingInfoVO> queryAllBiddingInfo();

+ 5 - 0
src/main/java/org/ajnb/service/BiddingInfoServiceImpl.java

@@ -14,6 +14,11 @@ public class BiddingInfoServiceImpl implements BiddingInfoService {
     BiddingInfoMapper biddingInfoMapper;
 
     @Override
+    public void addBiddingInfo(BiddingInfoVO biddingInfoVO) {
+        biddingInfoMapper.addBiddingInfo(biddingInfoVO);
+    }
+
+    @Override
     public List<BiddingInfoVO> queryBiddingInfoById(BiddingInfoVO biddingInfoVO) {
         return biddingInfoMapper.queryBiddingInfoById(biddingInfoVO);
     }

+ 9 - 0
src/main/java/org/ajnb/service/ClientsService.java

@@ -0,0 +1,9 @@
+package org.ajnb.service;
+
+import org.ajnb.vo.ClientsVO;
+
+import java.util.List;
+
+public interface ClientsService {
+    public List<ClientsVO> queryAllClients(ClientsVO clientsVO);
+}

+ 19 - 0
src/main/java/org/ajnb/service/ClientsServiceImpl.java

@@ -0,0 +1,19 @@
+package org.ajnb.service;
+
+import org.ajnb.mapper.ClientsMapper;
+import org.ajnb.vo.ClientsVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class ClientsServiceImpl implements ClientsService {
+    @Autowired
+    ClientsMapper clientsMapper;
+
+    @Override
+    public List<ClientsVO> queryAllClients(ClientsVO clientsVO) {
+        return clientsMapper.queryAllClients(clientsVO);
+    }
+}

+ 11 - 24
src/main/java/org/ajnb/vo/BiddingInfoVO.java

@@ -5,47 +5,34 @@ import lombok.Getter;
 import lombok.Setter;
 
 import java.math.BigDecimal;
+import java.sql.Date;
+import java.sql.Timestamp;
+
 @Getter
 @Setter
 public class BiddingInfoVO {
     private Integer id;
-
     private String title;
-
     private String purchase_type;
-
     private BigDecimal purchase_quantity;
-
     private String purchase_unit;
-
-    private String bidding_start_time;
-    private String bidding_end_time;
-
+    private Date bidding_start_time;
+    private Date bidding_end_time;
     private String supply_location;
-
-    private String latest_delivery_time;
-
+    private Date latest_delivery_time;
     private String invoice_type;
-
-    private String payment_time;
-
+    private Date payment_time;
     private String usage_rule;
-
     private Integer rule_id;
-
     private String client_name;
-
     private Integer client_id;
-
     private BigDecimal price_limit_upper;
-
     private BigDecimal price_limit_lower;
-
-    private String create_time;
-
+    private Date create_time;
     private String creator;
-
     private Integer rest_time;
-
     private String bidding_status;
+    private Integer bidding_supplier_id;
+    private String bidding_supplier_name;
+    private BigDecimal bidding_price;
 }

+ 11 - 0
src/main/java/org/ajnb/vo/ClientsVO.java

@@ -0,0 +1,11 @@
+package org.ajnb.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class ClientsVO {
+    private int id;
+    private String name;
+}

+ 34 - 2
src/main/resources/mapper/BiddingInfo.xml

@@ -9,9 +9,41 @@
 
     </parameterMap>
     <resultMap id="rm" type="org.ajnb.vo.BiddingInfoVO">
-
+        <result property="id" column="id"/>
+        <result property="title" column="title"/>
+        <result property="purchase_type" column="purchase_type"/>
+        <result property="purchase_quantity" column="purchase_quantity"/>
+        <result property="purchase_unit" column="purchase_unit"/>
+        <result property="bidding_start_time" column="bidding_start_time"/>
+        <result property="bidding_end_time" column="bidding_end_time"/>
+        <result property="supply_location" column="supply_location"/>
+        <result property="latest_delivery_time" column="latest_delivery_time"/>
+        <result property="invoice_type" column="invoice_type"/>
+        <result property="payment_time" column="payment_time"/>
+        <result property="usage_rule" column="usage_rule"/>
+        <result property="rule_id" column="rule_id"/>
+        <result property="client_name" column="client_name"/>
+        <result property="client_id" column="client_id"/>
+        <result property="price_limit_upper" column="price_limit_upper"/>
+        <result property="price_limit_lower" column="price_limit_lower"/>
+        <result property="create_time" column="create_time"/>
+        <result property="creator" column="creator"/>
+        <result property="rest_time" column="rest_time"/>
+        <result property="bidding_status" column="bidding_status"/>
+        <result property="bidding_supplier_id" column="bidding_supplier_id"/>
+        <result property="bidding_supplier_name" column="bidding_supplier_name"/>
+        <result property="bidding_price" column="bidding_price"/>
     </resultMap>
-
+    <insert id="addBiddingInfo">
+        insert into BiddingInfo (title, purchase_type, purchase_quantity, purchase_unit, bidding_start_time,
+        bidding_end_time, supply_location, latest_delivery_time, invoice_type, payment_time,
+        usage_rule, rule_id, client_name, client_id, price_limit_upper, price_limit_lower, create_time,
+        creator, rest_time, bidding_status, bidding_supplier_id, bidding_supplier_name, bidding_price)
+        values (#{title}, #{purchase_type}, #{purchase_quantity}, #{purchase_unit}, #{bidding_start_time},
+        #{bidding_end_time}, #{supply_location}, #{latest_delivery_time}, #{invoice_type}, #{payment_time},
+        #{usage_rule}, #{rule_id}, #{client_name}, #{client_id}, #{price_limit_upper}, #{price_limit_lower}, NOW(),
+        #{creator}, #{rest_time}, #{bidding_status}, #{bidding_supplier_id}, #{bidding_supplier_name}, #{bidding_price});
+    </insert>
     <select id="queryBiddingInfoById" resultMap="rm">
         select * from BiddingInfo where id = #{id}
     </select>

+ 13 - 0
src/main/resources/mapper/Clients.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.ajnb.mapper.ClientsMapper">
+    <resultMap id="clientsMap" type="org.ajnb.vo.ClientsVO">
+        <result column="id" property="id"/>
+        <result property="name" column="name"/>
+    </resultMap>
+    <select id="queryAllClients" resultMap="clientsMap">
+        select id,name from Clients;
+    </select>
+</mapper>