AJNB 2 months ago
parent
commit
16d2eb5f8b

+ 32 - 0
src/main/java/org/ajnb/controller/BiddingInfoController.java

@@ -0,0 +1,32 @@
+package org.ajnb.controller;
+
+import org.ajnb.service.BiddingInfoService;
+import org.ajnb.vo.BiddingInfoVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("BiddingInfo")
+public class BiddingInfoController {
+
+    @Autowired
+    private BiddingInfoService biddingInfoService;
+
+    @RequestMapping("QueryAll")
+    public List<BiddingInfoVO> QueryAll(){
+        return biddingInfoService.queryAllBiddingInfo();
+    }
+
+    @RequestMapping("QueryMultCondition")
+    public List<BiddingInfoVO> QueryMultCondition(BiddingInfoVO biddingInfoVO){
+        return biddingInfoService.queryBiddingInfoByMultCondition(biddingInfoVO);
+    }
+
+    @RequestMapping("DeleteById")
+    public void DeleteById(BiddingInfoVO biddingInfoVO){
+        biddingInfoService.deleteBiddingInfoById(biddingInfoVO);
+    }
+}

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

@@ -7,5 +7,11 @@ import java.util.List;
 
 @Mapper
 public interface BiddingInfoMapper {
-    public List<BiddingInfoVO> queryBiddingInfoById(BiddingInfoVO biddingInfoVO);
+    List<BiddingInfoVO> queryBiddingInfoById(BiddingInfoVO biddingInfoVO);
+
+    List<BiddingInfoVO> queryAllBiddingInfo();
+
+    List<BiddingInfoVO> queryBiddingInfoByMultCondition(BiddingInfoVO biddingInfoVO);
+
+    void deleteBiddingInfoById(BiddingInfoVO biddingInfoVO);
 }

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

@@ -6,5 +6,11 @@ import java.util.List;
 
 
 public interface BiddingInfoService {
-    public List<BiddingInfoVO> queryBiddingInfoById(BiddingInfoVO biddingInfoVO);
+    List<BiddingInfoVO> queryBiddingInfoById(BiddingInfoVO biddingInfoVO);
+
+    List<BiddingInfoVO> queryAllBiddingInfo();
+
+    List<BiddingInfoVO> queryBiddingInfoByMultCondition(BiddingInfoVO biddingInfoVO);
+
+    void deleteBiddingInfoById(BiddingInfoVO biddingInfoVO);
 }

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

@@ -17,4 +17,19 @@ public class BiddingInfoServiceImpl implements BiddingInfoService {
     public List<BiddingInfoVO> queryBiddingInfoById(BiddingInfoVO biddingInfoVO) {
         return biddingInfoMapper.queryBiddingInfoById(biddingInfoVO);
     }
+
+    @Override
+    public List<BiddingInfoVO> queryAllBiddingInfo() {
+        return biddingInfoMapper.queryAllBiddingInfo();
+    }
+
+    @Override
+    public List<BiddingInfoVO> queryBiddingInfoByMultCondition(BiddingInfoVO biddingInfoVO) {
+        return biddingInfoMapper.queryBiddingInfoByMultCondition(biddingInfoVO);
+    }
+
+    @Override
+    public void deleteBiddingInfoById(BiddingInfoVO biddingInfoVO) {
+        biddingInfoMapper.deleteBiddingInfoById(biddingInfoVO);
+    }
 }

+ 4 - 0
src/main/java/org/ajnb/vo/BiddingInfoVO.java

@@ -44,4 +44,8 @@ public class BiddingInfoVO {
     private String create_time;
 
     private String creator;
+
+    private Integer rest_time;
+
+    private String bidding_status;
 }

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

@@ -5,13 +5,45 @@
 
 <mapper namespace="org.ajnb.mapper.BiddingInfoMapper">
 
-    <parameterMap id="pm" type="org.ajnb.vo.BiddingInfoVO"></parameterMap>
-    <resultMap id="rm" type="org.ajnb.vo.BiddingInfoVO"></resultMap>
+    <parameterMap id="pm" type="org.ajnb.vo.BiddingInfoVO">
+
+    </parameterMap>
+    <resultMap id="rm" type="org.ajnb.vo.BiddingInfoVO">
+
+    </resultMap>
 
     <select id="queryBiddingInfoById" resultMap="rm">
         select * from BiddingInfo where id = #{id}
     </select>
 
+    <select id="queryAllBiddingInfo" resultMap="rm">
+        select * from BiddingInfo
+    </select>
+
+    <select id="queryBiddingInfoByMultCondition" resultMap="rm">
+        select * from BiddingInfo
+        <where>
+            <if test="title != null and title != ''">
+                title LIKE CONCAT('%', #{title}, '%')
+            </if>
+            <if test="bidding_start_time != null and bidding_end_time != null and bidding_start_time != '' and bidding_end_time != ''">
+                and (Date(bidding_start_time) >= #{bidding_start_time} and Date(bidding_end_time) &lt;= #{bidding_end_time})
+            </if>
+            <if test="invoice_type != null and invoice_type != ''">
+                and invoice_type = #{invoice_type}
+            </if>
+            <if test="payment_time != null and payment_time != ''">
+                and Date(payment_time) = #{payment_time}
+            </if>
+            <if test="bidding_status != null and bidding_status != ''">
+                and bidding_status = #{bidding_status}
+            </if>
+        </where>
+
+    </select>
 
+    <delete id="deleteBiddingInfoById" parameterMap="pm">
+        delete from BiddingInfo where id = #{id}
+    </delete>
 
 </mapper>