zzy90 2 kuukautta sitten
vanhempi
commit
9a6ff8e208

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

@@ -7,7 +7,6 @@ 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;
@@ -24,7 +23,10 @@ public class BiddingInfoController {
     public List<BiddingInfoVO> QueryAll() {
         return biddingInfoService.queryAllBiddingInfo();
     }
-
+    @RequestMapping("QueryByCondition")
+    public List<BiddingInfoVO> QueryByCondition(@RequestBody BiddingInfoVO biddingInfoVO) {
+        return biddingInfoService.queryByCondition(biddingInfoVO);
+    }
     @RequestMapping("QueryMultCondition")
     public List<BiddingInfoVO> QueryMultCondition(BiddingInfoVO biddingInfoVO) {
         return biddingInfoService.queryBiddingInfoByMultCondition(biddingInfoVO);

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

@@ -11,7 +11,7 @@ public interface BiddingInfoMapper {
     List<BiddingInfoVO> queryBiddingInfoById(BiddingInfoVO biddingInfoVO);
 
     List<BiddingInfoVO> queryAllBiddingInfo();
-
+    List<BiddingInfoVO> queryByCondition(BiddingInfoVO biddingInfoVO);
     List<BiddingInfoVO> queryBiddingInfoByMultCondition(BiddingInfoVO biddingInfoVO);
 
     void deleteBiddingInfoById(BiddingInfoVO biddingInfoVO);

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

@@ -12,6 +12,6 @@ public interface BiddingInfoService {
     List<BiddingInfoVO> queryAllBiddingInfo();
 
     List<BiddingInfoVO> queryBiddingInfoByMultCondition(BiddingInfoVO biddingInfoVO);
-
+List<BiddingInfoVO> queryByCondition(BiddingInfoVO biddingInfoVO);
     void deleteBiddingInfoById(BiddingInfoVO biddingInfoVO);
 }

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

@@ -5,6 +5,7 @@ import org.ajnb.vo.BiddingInfoVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Collections;
 import java.util.List;
 
 @Service
@@ -34,6 +35,11 @@ public class BiddingInfoServiceImpl implements BiddingInfoService {
     }
 
     @Override
+    public List<BiddingInfoVO> queryByCondition(BiddingInfoVO biddingInfoVO) {
+        return biddingInfoMapper.queryByCondition(biddingInfoVO);
+    }
+
+    @Override
     public void deleteBiddingInfoById(BiddingInfoVO biddingInfoVO) {
         biddingInfoMapper.deleteBiddingInfoById(biddingInfoVO);
     }

+ 39 - 3
src/main/resources/mapper/BiddingInfo.xml

@@ -42,7 +42,8 @@
         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});
+        #{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}
@@ -59,7 +60,8 @@
                 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})
+                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}
@@ -73,7 +75,41 @@
         </where>
 
     </select>
-
+    <select id="queryByCondition" resultMap="rm">
+        select
+        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
+        from BiddingInfo
+        <where>
+            <if test="title != null">title like CONCAT('%', #{title}, '%')</if>
+            <if test="bidding_start_time != null">and bidding_start_time >= #{bidding_start_time}</if>
+            <if test="bidding_end_time != null">and bidding_end_time &lt;= #{bidding_end_time}</if>
+            <if test="invoice_type != null">and invoice_type = #{invoice_type}</if>
+            <if test="payment_time != null">and payment_time = #{payment_time}</if>
+            <if test="bidding_status != null">and bidding_status = #{bidding_status}</if>
+        </where>
+    </select>
     <delete id="deleteBiddingInfoById" parameterMap="pm">
         delete from BiddingInfo where id = #{id}
     </delete>

+ 1 - 1
src/main/resources/mapper/Rules.xml

@@ -3,7 +3,7 @@
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.ajnb.mapper.RulesMapper">
-    <parameterMap id="pm" type="org.ajnb.vo.RulesVO"></parameterMap>
+    <parameterMap id="pm" type="org.ajnb.vo.RulesVO"/>
     <resultMap id="rm" type="org.ajnb.vo.RulesVO">
         <result column="id" property="id"/>
         <result column="name" property="name"/>