Bladeren bron

订单系统——产品申请显示(总条数修改)

wangyu 6 jaren geleden
bovenliggende
commit
414c78aace

+ 1 - 2
diagbotman-service/src/main/java/com/diagbot/facade/ProductOrderFacade.java

@@ -224,10 +224,9 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
 		}
         Page page =new Page();
         page.setRecords(list);
-        productOrderIndex =new ProductOrderIndex();
         page.setCurrent(productOrderVO.getCurrent());
         page.setSize(productOrderVO.getSize());
-        page.setTotal(this.selectAllProductOrder(productOrderIndex).size());
+        page.setTotal(productOrderFacade.selectProductOrderCount(productOrderIndex));
 		return RespDTO.onSuc(page);
 	}
 

+ 8 - 1
diagbotman-service/src/main/java/com/diagbot/mapper/ProductOrderMapper.java

@@ -55,9 +55,16 @@ public interface ProductOrderMapper extends BaseMapper<ProductOrder> {
     int waitExamOrderCou();
 
     /**
-     * @Description: 订单申请查询所有订单信息接口
+     * @Description: 产品申请查询所有订单信息接口
      * @Author: wangyu
      * @Date: 19:39 2018/9/20
      */
     public List<ProductOrderWrapper> selectAllProductOrder(ProductOrderIndex productOrderIndex);
+
+    /**
+     * @Description: 产品申请查询所有订单信息总条数接口
+     * @Author: wangyu
+     * @Date: 19:39 2018/9/20
+     */
+    public int selectProductOrderCount(ProductOrderIndex productOrderIndex);
 }

+ 7 - 0
diagbotman-service/src/main/java/com/diagbot/service/ProductOrderService.java

@@ -30,4 +30,11 @@ public interface ProductOrderService extends IService<ProductOrder> {
      * @Date: 19:39 2018/9/20
      */
     public List<ProductOrderWrapper> selectAllProductOrder(ProductOrderIndex productOrderIndex);
+
+    /**
+     * @Description: 产品申请查询所有订单信息总条数接口
+     * @Author: wangyu
+     * @Date: 19:39 2018/9/20
+     */
+    public int selectProductOrderCount(ProductOrderIndex productOrderIndex);
 }

+ 5 - 0
diagbotman-service/src/main/java/com/diagbot/service/impl/ProductOrderServiceImpl.java

@@ -30,4 +30,9 @@ public class ProductOrderServiceImpl extends ServiceImpl<ProductOrderMapper, Pro
     public List<ProductOrderWrapper> selectAllProductOrder(ProductOrderIndex productOrderIndex) {
         return baseMapper.selectAllProductOrder(productOrderIndex);
     }
+
+    @Override
+    public int selectProductOrderCount(ProductOrderIndex productOrderIndex) {
+        return baseMapper.selectProductOrderCount(productOrderIndex);
+    }
 }

+ 1 - 1
diagbotman-service/src/main/java/com/diagbot/vo/ProductOrderVO.java

@@ -26,7 +26,7 @@ public class ProductOrderVO {
     /**
      * 订单编号
      */
-    private Integer num;
+    private String num;
     /**
      * 机构名称
      */

+ 16 - 1
diagbotman-service/src/main/resources/mapper/ProductOrderMapper.xml

@@ -83,7 +83,7 @@
             parameterType="com.diagbot.entity.ProductOrderIndex">
         SELECT id , `num` , `user_id` , `time` , `audit_status` FROM diag_product_order WHERE is_deleted='N'
         <if test="num != null and num != ''">
-            AND num=#{num}
+            AND num like concat ('%',#{num},'%')
         </if>
         <if test="auditStatus != null and auditStatus != ''">
             AND audit_status=#{auditStatus}
@@ -99,4 +99,19 @@
         </if>
     </select>
 
+    <select id="selectProductOrderCount" parameterType="com.diagbot.entity.ProductOrderIndex" resultType="java.lang.Integer">
+        SELECT COUNT(1) FROM diag_product_order WHERE is_deleted='N'
+        <if test="num != null and num != ''">
+            AND num like concat ('%',#{num},'%')
+        </if>
+        <if test="auditStatus != null and auditStatus != ''">
+            AND audit_status=#{auditStatus}
+        </if>
+        <if test="userId != null and userId.size > 0">
+            AND user_id IN
+            <foreach item="userId" collection="userId" open="(" separator="," close=")">
+                #{userId}
+            </foreach>
+        </if>
+    </select>
 </mapper>