Parcourir la source

修改platform page

lyhzzz il y a 3 ans
Parent
commit
e990d4bf38
19 fichiers modifiés avec 107 ajouts et 359 suppressions
  1. 4 11
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/goods/mapper/ICameraDetailMapper.java
  2. 7 25
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/goods/service/impl/CameraDetailServiceImpl.java
  3. 3 5
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/order/mapper/IExpansionOrderMapper.java
  4. 3 2
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/order/mapper/IInvoiceMapper.java
  5. 2 2
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/order/mapper/IOrderMapper.java
  6. 6 11
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/order/mapper/IVirtualOrderMapper.java
  7. 2 8
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/order/service/impl/ExpansionOrderServiceImpl.java
  8. 4 9
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/order/service/impl/InvoiceServiceImpl.java
  9. 2 8
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/order/service/impl/OrderServiceImpl.java
  10. 6 18
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/order/service/impl/VirtualOrderServiceImpl.java
  11. 6 0
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/test/TestSendController.java
  12. 2 2
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/mapper/IUserMapper.java
  13. 2 8
      4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/service/impl/UserServiceImpl.java
  14. 21 78
      4dkankan-center-platform/src/main/resources/mapper/goods/CameraDetailMapper.xml
  15. 8 24
      4dkankan-center-platform/src/main/resources/mapper/order/ExpansionOrderMapper.xml
  16. 3 22
      4dkankan-center-platform/src/main/resources/mapper/order/InvoiceMapper.xml
  17. 2 43
      4dkankan-center-platform/src/main/resources/mapper/order/OrderMapper.xml
  18. 22 65
      4dkankan-center-platform/src/main/resources/mapper/order/VirtualOrderMapper.xml
  19. 2 18
      4dkankan-center-platform/src/main/resources/mapper/user/UserMapper.xml

+ 4 - 11
4dkankan-center-platform/src/main/java/com/fdkankan/platform/goods/mapper/ICameraDetailMapper.java

@@ -1,6 +1,7 @@
 package com.fdkankan.platform.goods.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fdkankan.platform.goods.entity.CameraDetail;
 import com.fdkankan.platform.goods.entity.CameraDetailNumEntity;
 import com.fdkankan.platform.user.request.RequestCamera;
@@ -34,18 +35,10 @@ public interface ICameraDetailMapper extends BaseMapper<CameraDetail> {
     @Select(" SELECT sum(balance) FROM t_camera_detail WHERE user_id = #{userId} AND REC_STATUS = 'A' ")
     long getSumBalanceByUserId(@Param("userId") Long userId);
 
-    List<ResponseCamera> queryListByParams(@Param("searchKey") String searchKey, @Param("type") Integer type,
-                                           @Param("startDate") String startDate, @Param("endDate") String endDate,
-                                           @Param("start") int start, @Param("pageSize") int pageSize, @Param("orderBy") String orderBy);
+    List<ResponseCamera> queryListByParams(Page<ResponseCamera> page, @Param("param")RequestCamera param);
 
-    Integer queryCountByParams(@Param("searchKey") String searchKey, @Param("type") Integer type,
-                               @Param("startDate") String startDate, @Param("endDate") String endDate);
+    List<ResponseCamera> queryCompanyCameraListByParams(Page<ResponseCamera> page, @Param("param")RequestCamera param);
 
-    List<ResponseCamera> queryCompanyCameraListByParams(@Param("searchKey") String searchKey, @Param("userName") String userName,
-                                                        @Param("start")int start, @Param("pageSize")int pageSize, @Param("orderBy")String orderBy);
-    Integer queryCompanyCameraCountByParams(@Param("searchKey")String searchKey, @Param("userName")String userName);
 
-    Integer cameraCount(@Param("param")RequestCamera param);
-
-    List<ResponseCamera> cameraList(@Param("param")RequestCamera param, @Param("start")Integer start, @Param("pageSize")int pageSize, @Param("orderBy")String orderBy);
+    List<ResponseCamera> cameraList(Page<ResponseCamera> page, @Param("param")RequestCamera param);
 }

+ 7 - 25
4dkankan-center-platform/src/main/java/com/fdkankan/platform/goods/service/impl/CameraDetailServiceImpl.java

@@ -438,14 +438,8 @@ public class CameraDetailServiceImpl extends ServiceImpl<ICameraDetailMapper, Ca
     @Override
     public Page<ResponseCamera> queryListByParams(RequestCamera param) {
         Page<ResponseCamera> pageVo = new Page<ResponseCamera>(param.getPageNum(), param.getPageSize());
-        Integer start = (param.getPageNum() -1 )* param.getPageSize();
-        Integer count = cameraDetailMapper.queryCountByParams(param.getSearchKey(),param.getType(),param.getStartDate(),param.getEndDate());
-        if(count <= 0){
-            return pageVo;
-        }
-        List<ResponseCamera> result = cameraDetailMapper.queryListByParams(param.getSearchKey(),param.getType(),param.getStartDate(),param.getEndDate(),
-                start,param.getPageSize(),"t.id desc");
-        pageVo.setTotal(count);
+        param.setOrderBy("t.id desc");
+        List<ResponseCamera> result = cameraDetailMapper.queryListByParams(pageVo,param);
         pageVo.setRecords(result);
         return pageVo;
     }
@@ -453,29 +447,17 @@ public class CameraDetailServiceImpl extends ServiceImpl<ICameraDetailMapper, Ca
     @Override
     public Page<ResponseCamera>  queryCompanyCameraListByParams(RequestCamera param) {
         Page<ResponseCamera> pageVo = new Page<>(param.getPageNum(), param.getPageSize());
-        Integer start = (param.getPageNum() -1 )* param.getPageSize();
-        Integer count = cameraDetailMapper.queryCompanyCameraCountByParams(param.getSearchKey(),param.getUserName());
-        if(count <= 0){
-            return pageVo;
-        }
-        List<ResponseCamera> result = cameraDetailMapper.queryCompanyCameraListByParams(param.getSearchKey(),param.getUserName(),
-                start,param.getPageSize(),"a.create_time desc");
-        pageVo.setTotal(count);
+        param.setOrderBy("a.create_time desc");
+        List<ResponseCamera> result = cameraDetailMapper.queryCompanyCameraListByParams(pageVo,param);
         pageVo.setRecords(result);
         return pageVo;
     }
 
     @Override
     public Page<ResponseCamera> cameraList(RequestCamera param) {
-        Page<ResponseCamera> pageVo = new Page<>(param.getPageNum(), param.getPageSize());
-        Integer start = (param.getPageNum() -1 )* param.getPageSize();
-        Integer count = cameraDetailMapper.cameraCount(param);
-        if(count <= 0){
-            return pageVo;
-        }
-        List<ResponseCamera> result = cameraDetailMapper.cameraList(param,
-                start,param.getPageSize(),"a.create_time desc");
-        pageVo.setTotal(count);
+        Page<ResponseCamera> pageVo = new Page<>(param.getPageNum(),param.getPageSize());
+        param.setOrderBy("a.create_time desc");
+        List<ResponseCamera> result = cameraDetailMapper.cameraList(pageVo,param);
         pageVo.setRecords(result);
         return pageVo;
     }

+ 3 - 5
4dkankan-center-platform/src/main/java/com/fdkankan/platform/order/mapper/IExpansionOrderMapper.java

@@ -1,8 +1,10 @@
 package com.fdkankan.platform.order.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fdkankan.platform.order.entity.ExpansionOrder;
 import com.fdkankan.platform.order.vo.ResponseExpansionOrder;
+import com.fdkankan.platform.user.request.RequestCamera;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -19,10 +21,6 @@ import java.util.List;
 @Mapper
 public interface IExpansionOrderMapper extends BaseMapper<ExpansionOrder> {
 
-    List<ResponseExpansionOrder> getExpansionListByParam(@Param("userId")Long userId, @Param("childName")String childName,
-                                                         @Param("cameraId")Long cameraId, @Param("start")Integer start,
-                                                         @Param("pageSize")Integer pageSize, @Param("orderBy")String orderBy);
-    Integer getExpansionCountByParam(@Param("userId")Long userId,@Param("childName")String childName,
-                                  @Param("cameraId")Long cameraId);
+    List<ResponseExpansionOrder> getExpansionListByParam(Page<ResponseExpansionOrder>page, @Param("param") RequestCamera param);
 
 }

+ 3 - 2
4dkankan-center-platform/src/main/java/com/fdkankan/platform/order/mapper/IInvoiceMapper.java

@@ -1,8 +1,10 @@
 package com.fdkankan.platform.order.mapper;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fdkankan.platform.order.entity.Invoice;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fdkankan.platform.user.request.RequestTrade;
+import com.fdkankan.platform.user.vo.ResponseInvoice;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -19,7 +21,6 @@ import java.util.List;
 @Mapper
 public interface IInvoiceMapper extends BaseMapper<Invoice> {
 
-    List<Invoice> getListByParam(@Param("param") RequestTrade param,@Param("start")Integer start,@Param("pageSize") Integer pageSize,@Param("orderBy") String orderBy);
+    List<Invoice> getListByParam(Page<ResponseInvoice> page, @Param("param") RequestTrade param);
 
-    Integer getCountByParam(@Param("param")RequestTrade param);
 }

+ 2 - 2
4dkankan-center-platform/src/main/java/com/fdkankan/platform/order/mapper/IOrderMapper.java

@@ -1,6 +1,7 @@
 package com.fdkankan.platform.order.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fdkankan.platform.order.entity.Order;
 import com.fdkankan.platform.user.request.RequestOrder;
 import com.fdkankan.platform.user.vo.ResponseOrder;
@@ -49,7 +50,6 @@ public interface IOrderMapper extends BaseMapper<Order> {
     @Select(" SELECT order_time as orderTime, count(id) as orderCount, finish_time FROM t_order WHERE (DATE_SUB(CURDATE(), INTERVAL 12 DAY) <=date(order_time)) AND REC_STATUS = 'A' AND payment_status = 'paid' group by day(order_time) ")
     List<ResponseOrder> queryTrendOrder();
 
-    Integer getCountByParam(RequestOrder param);
 
-    List<ResponseOrder> getListByParam(@Param("param") RequestOrder param, @Param("start") Integer start, @Param("pageSize") Integer pageSize, @Param("orderBy") String orderBy);
+    List<ResponseOrder> getListByParam(Page<ResponseOrder> page, @Param("param") RequestOrder param);
 }

+ 6 - 11
4dkankan-center-platform/src/main/java/com/fdkankan/platform/order/mapper/IVirtualOrderMapper.java

@@ -1,8 +1,11 @@
 package com.fdkankan.platform.order.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fdkankan.platform.order.entity.VirtualOrder;
+import com.fdkankan.platform.user.request.RequestCamera;
 import com.fdkankan.platform.user.request.RequestTrade;
+import com.fdkankan.platform.user.request.RequestVirtualOrder;
 import com.fdkankan.platform.user.vo.ResponseVirtualOrder;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -22,15 +25,9 @@ import java.util.List;
 @Mapper
 public interface IVirtualOrderMapper extends BaseMapper<VirtualOrder> {
 
-    List<ResponseVirtualOrder> getChargeListByParam(@Param("userId")Long userId, @Param("status")String status, @Param("childName")String childName,
-                                                    @Param("cameraId")Long cameraId, @Param("start")Integer start,
-                                                    @Param("pageSize")Integer pageSize, @Param("orderBy")String orderBy);
+    List<ResponseVirtualOrder> getChargeListByParam(Page<ResponseVirtualOrder> page,@Param("param") RequestVirtualOrder param);
 
-    Integer getChargeCountByParam(@Param("userId")Long userId,@Param("status")String status,@Param("childName")String childName,
-                                                    @Param("cameraId")Long cameraId);
-
-    List<VirtualOrder> getAllByParam(@Param("startDate")String startDate, @Param("endDate")String endDate,
-                                     @Param("childName")String childName, @Param("type")Integer type,@Param("orderBy")String orderBy);
+    List<VirtualOrder> getAllByParam(@Param("param")RequestCamera param);
 
     @Select(" SELECT IFNULL(SUM(v.amount),0) FROM t_virtual_order v LEFT JOIN t_camera c on v.camera_id = c.id  WHERE c.id = #{cameraId} and pay_status = 1 and status = #{status} ")
     Integer queryRechargeByCameraIdAndStatus(@Param("cameraId") Long cameraId, @Param("status") int status);
@@ -57,7 +54,5 @@ public interface IVirtualOrderMapper extends BaseMapper<VirtualOrder> {
     @Select(" SELECT trade_time as tradeTime, count(id) as orderCount FROM t_virtual_order WHERE (DATE_SUB(CURDATE(), INTERVAL 12 DAY) <=date(trade_time)) AND REC_STATUS = 'A' AND pay_status = 1 AND status = #{status} group by day(create_time) ")
     List<ResponseVirtualOrder> queryTrendRechargeOrder(@Param("status")int status);
 
-    Integer getCountByParam(@Param("param") RequestTrade param);
-
-    List<ResponseVirtualOrder> getListByParam(@Param("param")RequestTrade param, @Param("start")Integer start, @Param("pageSize")Integer pageSize,@Param("orderBy") String orderBy);
+    List<ResponseVirtualOrder> getListByParam(Page<ResponseVirtualOrder> page, @Param("param")RequestTrade param);
 }

+ 2 - 8
4dkankan-center-platform/src/main/java/com/fdkankan/platform/order/service/impl/ExpansionOrderServiceImpl.java

@@ -64,14 +64,8 @@ public class ExpansionOrderServiceImpl extends ServiceImpl<IExpansionOrderMapper
     @Override
     public Page<ResponseExpansionOrder> getExpansionListByParam(RequestCamera param) {
         Page<ResponseExpansionOrder> pageVo = new Page<>(param.getPageNum(),param.getPageSize());
-        Integer start = (param.getPageNum() -1 ) * param.getPageSize();
-        Integer count = this.expansionOrderMapper.getExpansionCountByParam(param.getUserId(), param.getChildName(), param.getCameraId());
-        if(count<=0){
-            return pageVo;
-        }
-        String orderBy = " o.trade_time desc";
-        List<ResponseExpansionOrder> list = this.expansionOrderMapper.getExpansionListByParam(param.getUserId(), param.getChildName(), param.getCameraId(), start, param.getPageSize(),orderBy);
-        pageVo.setTotal(count);
+        param.setOrderBy(" o.trade_time desc");
+        List<ResponseExpansionOrder> list = this.expansionOrderMapper.getExpansionListByParam(pageVo,param);
         pageVo.setRecords(list);
         return pageVo;
     }

+ 4 - 9
4dkankan-center-platform/src/main/java/com/fdkankan/platform/order/service/impl/InvoiceServiceImpl.java

@@ -386,21 +386,16 @@ public class InvoiceServiceImpl extends ServiceImpl<IInvoiceMapper, Invoice> imp
 
     @Override
     public List<Invoice> getListByParam(RequestTrade trade) {
-        return invoiceMapper.getListByParam(trade,null,null,"create_time desc");
+        trade.setOrderBy("create_time desc");
+        return invoiceMapper.getListByParam(null,trade);
     }
 
     @Override
     public Page<ResponseInvoice> getPageByParam(RequestTrade param) {
         Page<ResponseInvoice> pageVo = new Page<>(param.getPageNum(), param.getPageSize());
-        Integer start = (param.getPageNum() -1 )* param.getPageSize();
-        Integer count = invoiceMapper.getCountByParam(param);
-        if(count <= 0){
-            return pageVo;
-        }
-        List<Invoice> list = invoiceMapper.getListByParam(param,
-                start,param.getPageSize(),"create_time desc");
+        param.setOrderBy("create_time desc");
+        List<Invoice> list = invoiceMapper.getListByParam(pageVo,param);
         List<ResponseInvoice> result = this.convert(list);
-        pageVo.setTotal(count);
         pageVo.setRecords(result);
         return pageVo;
     }

+ 2 - 8
4dkankan-center-platform/src/main/java/com/fdkankan/platform/order/service/impl/OrderServiceImpl.java

@@ -532,14 +532,8 @@ public class OrderServiceImpl extends ServiceImpl<IOrderMapper, Order> implement
     @Override
     public Page<ResponseOrder> getPageVoByParam(RequestOrder param) {
         Page<ResponseOrder> pageVo = new Page<>(param.getPageNum(), param.getPageSize());
-        Integer start = (param.getPageNum() -1 )* param.getPageSize();
-        Integer count = orderMapper.getCountByParam(param);
-        if(count <= 0){
-            return pageVo;
-        }
-        List<ResponseOrder> result = orderMapper.getListByParam(param,
-                start,param.getPageSize(),"order_time desc");
-        pageVo.setTotal(count);
+        param.setOrderBy("order_time desc");
+        List<ResponseOrder> result = orderMapper.getListByParam(pageVo,param);
         pageVo.setRecords(result);
         return pageVo;
     }

+ 6 - 18
4dkankan-center-platform/src/main/java/com/fdkankan/platform/order/service/impl/VirtualOrderServiceImpl.java

@@ -250,15 +250,8 @@ public class VirtualOrderServiceImpl extends ServiceImpl<IVirtualOrderMapper, Vi
             param.setUserId(ssouser.getId());
         }
         Page<ResponseVirtualOrder> pageVo = new Page<>(param.getPageNum(), param.getPageSize());
-        Integer start = (param.getPageNum() -1) * param.getPageSize();
-        Integer count =  virtualOrderMapper.getChargeCountByParam(param.getUserId(),param.getStatus(),param.getChildName(),param.getCameraId());
-        if(count<=0){
-            return pageVo;
-        }
-        String orderBy = "o.trade_time desc";
-        List<ResponseVirtualOrder> orders =  virtualOrderMapper.getChargeListByParam(param.getUserId(),param.getStatus(),param.getChildName(),param.getCameraId(),start,param.getPageSize(),orderBy);
-
-        pageVo.setTotal(count);
+        param.setOrderBy( "o.trade_time desc");
+        List<ResponseVirtualOrder> orders =  virtualOrderMapper.getChargeListByParam(pageVo,param);
         pageVo.setRecords(orders);
         return pageVo;
     }
@@ -311,7 +304,8 @@ public class VirtualOrderServiceImpl extends ServiceImpl<IVirtualOrderMapper, Vi
 
     @Override
     public List<VirtualOrder> getAllByParam(RequestCamera param) {
-        return  this.virtualOrderMapper.getAllByParam(param.getStartDate(), param.getEndDate(), param.getChildName(), param.getType(), "trade_time desc");
+        param.setOrderBy("trade_time desc");
+        return  this.virtualOrderMapper.getAllByParam(param);
     }
 
     @Override
@@ -447,14 +441,8 @@ public class VirtualOrderServiceImpl extends ServiceImpl<IVirtualOrderMapper, Vi
     @Override
     public Page<ResponseVirtualOrder> getPageVoByParam(RequestTrade param) {
         Page<ResponseVirtualOrder> pageVo = new Page<>(param.getPageNum(), param.getPageSize());
-        Integer start = (param.getPageNum() -1 )* param.getPageSize();
-        Integer count = virtualOrderMapper.getCountByParam(param);
-        if(count <= 0){
-            return pageVo;
-        }
-        List<ResponseVirtualOrder> result = virtualOrderMapper.getListByParam(param,
-                start,param.getPageSize(),"trade_time desc");
-        pageVo.setTotal(count);
+        param.setOrderBy("trade_time desc");
+        List<ResponseVirtualOrder> result = virtualOrderMapper.getListByParam(pageVo,param);
         pageVo.setRecords(result);
         return pageVo;
     }

+ 6 - 0
4dkankan-center-platform/src/main/java/com/fdkankan/platform/test/TestSendController.java

@@ -3,6 +3,8 @@ package com.fdkankan.platform.test;
 import com.fdkankan.common.constant.TbStatus;
 import com.fdkankan.platform.agent.entity.Agent;
 import com.fdkankan.platform.agent.service.IAgentService;
+import com.fdkankan.platform.order.service.IInvoiceService;
+import com.fdkankan.platform.user.request.RequestTrade;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -16,6 +18,9 @@ public class TestSendController {
     @Autowired
     private IAgentService agentService;
 
+    @Autowired
+    private IInvoiceService invoiceService;
+
     @RequestMapping("/test")
     private void sentTest(){
         Agent cameraEntity = new Agent();
@@ -25,5 +30,6 @@ public class TestSendController {
     }
     @RequestMapping("/test1")
     private void sentTest1(){
+        invoiceService.getListByParam(new RequestTrade());
     }
 }

+ 2 - 2
4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/mapper/IUserMapper.java

@@ -1,5 +1,6 @@
 package com.fdkankan.platform.user.mapper;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fdkankan.platform.user.entity.User;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fdkankan.platform.user.request.RequestUser;
@@ -20,7 +21,6 @@ import java.util.List;
 @Mapper
 public interface IUserMapper extends BaseMapper<User> {
 
-    Integer getCountByParam(@Param("param") RequestUser param);
 
-    List<ResponseUser> getListByParam(@Param("param")RequestUser param, @Param("start")Integer start, @Param("pageSize")Integer pageSize, @Param("orderBy")String orderBy);
+    List<ResponseUser> getListByParam(Page<ResponseUser> page, @Param("param")RequestUser param);
 }

+ 2 - 8
4dkankan-center-platform/src/main/java/com/fdkankan/platform/user/service/impl/UserServiceImpl.java

@@ -510,14 +510,8 @@ public class UserServiceImpl extends ServiceImpl<IUserMapper, User> implements I
     @Override
     public Page<ResponseUser> getPageByParam(RequestUser param) {
         Page<ResponseUser> pageVo = new Page<>(param.getPageNum(), param.getPageSize());
-        Integer start = (param.getPageNum() -1 )* param.getPageSize();
-        Integer count = userMapper.getCountByParam(param);
-        if(count <= 0){
-            return pageVo;
-        }
-        List<ResponseUser> result = userMapper.getListByParam(param,
-                start,param.getPageSize(),"u.register_time desc");
-        pageVo.setTotal(count);
+        param.setOrderBy("u.register_time desc");
+        List<ResponseUser> result = userMapper.getListByParam( pageVo,param);
         pageVo.setRecords(result);
         return pageVo;
     }

+ 21 - 78
4dkankan-center-platform/src/main/resources/mapper/goods/CameraDetailMapper.xml

@@ -15,84 +15,48 @@
         LEFT JOIN t_order o on o.id = co.order_id
         LEFT JOIN t_company com ON com.id = i.company_id
         WHERE 1 = 1
-        <if test=" searchKey != null and searchKey !='' " >
-            and (t.child_name like concat('%',#{searchKey},'%') or u.user_name  like CONCAT('%', #{searchKey},'%'))
+        <if test=" param.searchKey != null and param.searchKey !='' " >
+            and (t.child_name like concat('%',#{param.searchKey},'%') or u.user_name  like CONCAT('%', #{param.searchKey},'%'))
         </if>
-        <if test=" type != null and type !='' and type == 1" >
-            and (t.create_time &gt;= #{startDate} or t.create_time &lt;= #{endDate})
+        <if test=" param.type != null and param.type !='' and param.type == 1" >
+            and (t.create_time &gt;= #{param.startDate} or t.create_time &lt;= #{param.endDate})
         </if>
-        <if test=" type != null and type !='' and type == 2" >
-            and (co.create_time &gt;= #{startDate} or co.create_time &lt;= #{endDate})
+        <if test=" param.type != null and param.type !='' and param.type == 2" >
+            and (co.create_time &gt;= #{param.startDate} or co.create_time &lt;= #{param.endDate})
         </if>
-        <if test=" type != null and type !='' and type == 3" >
-            and (ct.activated_time &gt;= #{startDate} or t.activated_time &lt;= #{endDate})
+        <if test=" param.type != null and param.type !='' and param.type == 3" >
+            and (ct.activated_time &gt;= #{param.startDate} or t.activated_time &lt;= #{param.endDate})
         </if>
-        <if test="orderBy != null">
-            order by ${orderBy}
-        </if>
-        <if test="start != null and pageSize!=null">
-            limit ${start}, ${pageSize}
+        <if test="param.orderBy != null">
+            order by ${param.orderBy}
         </if>
     </select>
 
 
-    <select id="queryCountByParams" resultType="integer">
-        SELECT count(*) from t_camera t
-        INNER JOIN t_camera_detail i ON t.id = i.camera_id
-        INNER JOIN t_goods g on g.id = i.goods_id
-        LEFT JOIN t_user u ON i.user_id = u.id
-        LEFT JOIN t_camera_out co on t.id = co.camera_id
-        LEFT JOIN t_order o on o.id = co.order_id
-        LEFT JOIN t_company com ON com.id = i.company_id
-        WHERE 1 = 1
-        <if test=" searchKey != null and searchKey !='' " >
-            and (t.child_name like concat('%',#{searchKey},'%') or u.user_name  like CONCAT('%', #{searchKey},'%'))
-        </if>
-        <if test=" type != null and type !='' and type == 1" >
-            and (t.create_time &gt;= #{startDate} or t.create_time &lt;= #{endDate})
-        </if>
-        <if test=" type != null and type !='' and type == 2" >
-            and (co.create_time &gt;= #{startDate} or co.create_time &lt;= #{endDate})
-        </if>
-        <if test=" type != null and type !='' and type == 3" >
-            and (ct.activated_time &gt;= #{startDate} or t.activated_time &lt;= #{endDate})
-        </if>
-    </select>
-
     <select id="queryCompanyCameraListByParams" resultType="com.fdkankan.platform.user.vo.ResponseCamera">
         SELECT a.id, a.child_name, a.sn_code, a.rec_status, a.create_time, b.address,
         e.user_name FROM `t_camera` a LEFT JOIN `t_camera_detail` b ON a.id = b.camera_id
         LEFT JOIN `t_company` c ON b.company_id = c.id
         LEFT JOIN `t_manager` d ON c.manager_id = d.id
         LEFT JOIN `t_user` e ON b.user_id = e.id WHERE d.username = #{userName}
-        <if test=" searchKey != null and searchKey !='' " >
-            and a.child_name like concat('%',#{searchKey},'%')
-        </if>
-        <if test="orderBy != null">
-            order by ${orderBy}
+        <if test=" param.searchKey != null and param.searchKey !='' " >
+            and a.child_name like concat('%',#{param.searchKey},'%')
         </if>
-        <if test="start != null and pageSize!=null">
-            limit ${start}, ${pageSize}
+        <if test="param.orderBy != null">
+            order by ${param.orderBy}
         </if>
+<!--        <if test="start != null and pageSize!=null">-->
+<!--            limit ${start}, ${pageSize}-->
+<!--        </if>-->
     </select>
 
 
-    <select id="queryCompanyCameraCountByParams" resultType="integer">
-        SELECT count(*) FROM `t_camera` a LEFT JOIN `t_camera_detail` b ON a.id = b.camera_id
-        LEFT JOIN `t_company` c ON b.company_id = c.id
-        LEFT JOIN `t_manager` d ON c.manager_id = d.id
-        LEFT JOIN `t_user` e ON b.user_id = e.id WHERE d.username = #{userName}
-        <if test=" searchKey != null and searchKey !='' " >
-            and a.child_name like concat('%',#{searchKey},'%')
-        </if>
-    </select>
-
     <select id="cameraList" resultType="com.fdkankan.platform.user.vo.ResponseCamera">
-        SELECT a.id, a.sn_code as snCode, a.activated_time as activatedTime, b.own, b.type,
+        SELECT a.id, a.sn_code as snCode, a.activated_time as activatedTime, b.own, b.camera_type as  cameraType,
         b.agent_framework_id as agentFrameworkId, b.camera_id as cameraId, b.total_space as totalSpace,
         b.used_space as usedSpace, b.user_id as userId
         FROM t_camera a LEFT JOIN t_camera_detail b on a.id = b.camera_id
-        WHERE a.rec_status = 'A'
+        WHERE a.tb_status = 0
         <if test=" param.snCode != null and param.snCode !='' " >
             and a.sn_code = #{param.snCode}
         </if>
@@ -105,30 +69,9 @@
         <if test=" param.cameraId != null and param.cameraId !='' " >
             and b.camera_id = #{param.cameraId}
         </if>
-        <if test="orderBy != null">
-            order by ${orderBy}
-        </if>
-        <if test="start != null and pageSize!=null">
-            limit ${start}, ${pageSize}
+        <if test="param.orderBy != null">
+            order by ${param.orderBy}
         </if>
     </select>
 
-
-    <select id="cameraCount" resultType="integer">
-        SELECT count(*)
-        FROM t_camera a LEFT JOIN t_camera_detail b on a.id = b.camera_id
-        WHERE a.rec_status = 'A'
-        <if test=" param.snCode != null and param.snCode !='' " >
-            and a.sn_code = #{param.snCode}
-        </if>
-        <if test=" param.own != null and param.own !='' " >
-            and b.own = #{param.own}
-        </if>
-        <if test=" param.agentFrameworkId != null and param.agentFrameworkId !='' " >
-            and b.agent_framework_id = #{param.agentFrameworkId}
-        </if>
-        <if test=" param.cameraId != null and param.cameraId !='' " >
-            and b.camera_id = #{param.cameraId}
-        </if>
-    </select>
 </mapper>

+ 8 - 24
4dkankan-center-platform/src/main/resources/mapper/order/ExpansionOrderMapper.xml

@@ -7,36 +7,20 @@
         LEFT JOIN t_camera_space c on o.order_sn = c.order_sn
         LEFT JOIN t_camera t on o.camera_id = t.id
         WHERE o.pay_status = 1 AND o.rec_status = 'A'
-        <if test=" userId != null and userId !='' " >
-            and o.user_id = ${userId}
+        <if test=" userId != null and  param.userId !='' " >
+            and o.user_id = ${ param.userId}
         </if>
-        <if test=" childName != null and childName !='' " >
-            and c.child_name like concat('%',#{childName},'%')
+        <if test=" param.childName != null and  param.childName !='' " >
+            and c.child_name like concat('%',#{ param.childName},'%')
         </if>
-        <if test=" cameraId != null and cameraId !='' " >
-            and o.camera_id = ${cameraId}
+        <if test="  param.cameraId != null and  param.cameraId !='' " >
+            and o.camera_id = ${ param.cameraId}
         </if>
-        <if test="orderBy != null">
-            order by ${orderBy}
-        </if>
-        <if test="start != null and pageSize!=null">
-            limit ${start}, ${pageSize}
+        <if test=" param.orderBy != null">
+            order by ${ param.orderBy}
         </if>
 
     </select>
 
-    <select id="getExpansionCountByParam" resultType="integer">
-        select count(*) from t_expansion_order o
-        WHERE o.pay_status = 1 AND o.rec_status = 'A'
-        <if test=" userId != null and userId !='' " >
-            and o.user_id = ${userId}
-        </if>
-        <if test=" childName != null and childName !='' " >
-            and c.child_name like concat('%',#{childName},'%')
-        </if>
-        <if test=" cameraId != null and cameraId !='' " >
-            and o.camera_id = ${cameraId}
-        </if>
-    </select>
 
 </mapper>

+ 3 - 22
4dkankan-center-platform/src/main/resources/mapper/order/InvoiceMapper.xml

@@ -7,7 +7,7 @@
         <if test="param.searchKey != null and param.searchKey !='' " >
         LEFT JOIN t_user u on i.user_id = u.id  LEFT JOIN t_order o on i.order_id = o.id
         </if>
-        WHERE i.rec_status = 'A' AND i.consume_type = 1 AND c.child_name IS NOT NULL
+        WHERE   i.consume_type = 1 AND c.child_name IS NOT NULL
         <if test="param.searchKey != null and param.searchKey !='' " >
         AND ((u.user_name like CONCAT('%',#{param.searchKey},'%')) or (o.order_sn like CONCAT('%',#{param.searchKey},'%')))
         </if>
@@ -17,28 +17,9 @@
         <if test=" param.endDate != null and param.endDate !='' " >
          and i.create_time &lt;= ${param.endDate} '23:59:59'
         </if>
-        <if test="orderBy != null">
-            order by ${orderBy}
-        </if>
-        <if test="start != null and pageSize !=null">
-            limit ${start}, ${pageSize}
+        <if test="param.orderBy != null">
+            order by ${param.orderBy}
         </if>
     </select>
 
-    <select id="getCountByParam"  resultType="integer">
-        SELECT count(*) FROM t_invoice i LEFT JOIN t_camera c on i.camera_id = c.id
-        <if test="param.searchKey != null and param.searchKey !='' " >
-            LEFT JOIN t_user u on i.user_id = u.id  LEFT JOIN t_order o on i.order_id = o.id
-        </if>
-        WHERE i.rec_status = 'A' AND i.consume_type = 1 AND c.child_name IS NOT NULL
-        <if test="param.searchKey != null and param.searchKey !='' " >
-            AND ((u.user_name like CONCAT('%',#{param.searchKey},'%')) or (o.order_sn like CONCAT('%',#{param.searchKey},'%')))
-        </if>
-        <if test="param.startDate != null and param.startDate !='' " >
-            and i.create_time &gt;= ${param.startDate} '00:00:00'
-        </if>
-        <if test=" param.endDate != null and param.endDate !='' " >
-            and i.create_time &lt;= ${param.endDate} '23:59:59'
-        </if>
-    </select>
 </mapper>

+ 2 - 43
4dkankan-center-platform/src/main/resources/mapper/order/OrderMapper.xml

@@ -41,51 +41,10 @@
             and o.order_status = 'completed'
         </if>
 
-        <if test="orderBy != null">
-            order by ${orderBy}
-        </if>
-        <if test="start != null and pageSize!=null">
-            limit ${start}, ${pageSize}
+        <if test="param.orderBy != null">
+            order by ${param.orderBy}
         </if>
     </select>
 
 
-    <select id="getCountByParam" resultType="integer">
-        SELECT count(*) FROM  t_order o
-        LEFT JOIN t_user u on o.user_id = u.id
-        <if test=" param.expressNum != null and param.expressNum !='' " >
-            LEFT JOIN t_order_item oi on oi.order_id = o.id
-        </if>
-        where o.rec_status = 'A'
-        <if test=" param.phoneNum != null and param.phoneNum !='' " >
-            and u.user_name like concat('%',#{param.phoneNum},'%')
-        </if>
-        <if test=" param.expressNum != null and param.expressNum !='' " >
-            and oi.express_num like concat('%',#{param.expressNum},'%')
-        </if>
-        <if test=" param.orderSn != null and param.orderSn !='' " >
-            and o.orderSn like concat('%',#{param.orderSn},'%')
-        </if>
-        <if test=" param.tradeNum != null and param.tradeNum !='' " >
-            and o.tradeNum like concat('%',#{param.tradeNum},'%')
-        </if>
-        <if test="param.startDate != null and param.startDate !='' " >
-            and o.order_time &gt;= ${param.startDate} '00:00:00'
-        </if>
-        <if test=" param.endDate != null and param.endDate !='' " >
-            and o.order_time &lt;= ${param.endDate} '23:59:59'
-        </if>
-        <if test=" param.type != null and param.type !='' and param.type == 0" >
-            and o.payment_status = 'unpaid'
-        </if>
-        <if test=" param.type != null and param.type !='' and param.type == 1" >
-            and o.shipping_status = 'unshipped' and o.payment_status = 'paid'
-        </if>
-        <if test=" param.type != null and param.type !='' and param.type == 2" >
-            and o.shipping_status = 'shipped'
-        </if>
-        <if test=" param.type != null and param.type !='' and param.type == 3" >
-            and o.order_status = 'completed'
-        </if>
-    </select>
 </mapper>

+ 22 - 65
4dkankan-center-platform/src/main/resources/mapper/order/VirtualOrderMapper.xml

@@ -5,66 +5,47 @@
     <select id="getAllByParam" resultType="com.fdkankan.platform.order.entity.VirtualOrder">
         select t.status, t.points, t.amount from t_virtual_order t left join t_camera d on t.camera_id = d.id
         where t.rec_status = 'A' and t.pay_status = 1
-        <if test="startDate != null and startDate !='' " >
-            and t.trade_time &gt;= ${startDate}
+        <if test="param.startDate != null and param.startDate !='' " >
+            and t.trade_time &gt;= ${param.startDate}
         </if>
-        <if test=" endDate != null and endDate !='' " >
-            and t.trade_time &lt;= ${endDate}
+        <if test=" param.endDate != null and param.endDate !='' " >
+            and t.trade_time &lt;= ${param.endDate}
         </if>
-        <if test=" childName != null and childName !='' " >
-            and c.child_name like concat('%',#{childName},'%')
+        <if test=" param.childName != null and param.childName !='' " >
+            and c.child_name like concat('%',#{param.childName},'%')
         </if>
-        <if test=" type != null and type !='' " >
-            and and t.status  = ${type}
+        <if test=" param.type != null and param.type !='' " >
+            and and t.status  = ${param.type}
         </if>
-        <if test="orderBy != null">
-            order by ${orderBy}
+        <if test="param.orderBy != null">
+            order by ${param.orderBy}
         </if>
-        <if test="start != null and pageSize !=null">
-            limit ${start}, ${pageSize}
+        <if test="param.start != null and param.pageSize !=null">
+            limit ${param.start}, ${param.pageSize}
         </if>
     </select>
 
     <select id="getChargeListByParam" resultType="com.fdkankan.platform.user.vo.ResponseVirtualOrder">
         SELECT o.id, o.order_sn, o.points, c.child_name, o.pay_type, o.body, o.trade_time, o.status from t_virtual_order o
         LEFT JOIN t_camera c on o.camera_id = c.id  WHERE o.rec_status = 'A' and o.pay_status = 1   and o.pay_type = 0
-        <if test=" userId != null and userId !='' " >
-            and o.user_id = ${userId}
+        <if test=" param.userId != null and param.userId !='' " >
+            and o.user_id = ${param.userId}
         </if>
-        <if test=" status != null and status !='' " >
-            and o.status = ${status}
+        <if test=" param.status != null and param.status !='' " >
+            and o.status = ${param.status}
         </if>
-        <if test=" childName != null and childName !='' " >
-            and c.child_name like concat('%',#{childName},'%')
+        <if test=" param.childName != null and param.childName !='' " >
+            and c.child_name like concat('%',#{param.childName},'%')
         </if>
-        <if test=" cameraId != null and cameraId !='' " >
-            and o.camera_id = ${cameraId}
+        <if test=" param.cameraId != null and param.cameraId !='' " >
+            and o.camera_id = ${param.cameraId}
         </if>
-        <if test="orderBy != null">
-            order by ${orderBy}
-        </if>
-        <if test="start != null and pageSize !=null">
-            limit ${start}, ${pageSize}
+        <if test="param.orderBy != null">
+            order by ${param.orderBy}
         </if>
     </select>
 
 
-    <select id="getChargeCountByParam" resultType="integer">
-        SELECT count(*) from t_virtual_order o WHERE o.rec_status = 'A' and o.pay_status = 1   and o.pay_type = 0
-        <if test=" userId != null and userId !='' " >
-            and o.user_id = ${userId}
-        </if>
-        <if test=" status != null and status !='' " >
-            and o.status = ${status}
-        </if>
-        <if test=" childName != null and childName !='' " >
-            and c.child_name like concat('%',#{childName},'%')
-        </if>
-        <if test=" cameraId != null and cameraId !='' " >
-            and o.camera_id = ${cameraId}
-        </if>
-    </select>
-
     <select id="getListByParam" resultType="com.fdkankan.platform.user.vo.ResponseVirtualOrder">
         SELECT o.* FROM t_virtual_order o
         <if test=" param.searchKey != null and param.searchKey !='' " >
@@ -98,28 +79,4 @@
     </select>
 
 
-    <select id="getCountByParam" resultType="integer">
-        SELECT count(*) FROM t_virtual_order o
-        <if test=" param.searchKey != null and param.searchKey !='' " >
-            LEFT JOIN t_user u on o.user_id = u.id
-            LEFT JOIN t_camera c on o.camera_id = c.id
-        </if>
-        where o.rec_status = 'A' and o.pay_status = 1
-        <if test=" param.type != null and param.type =1 " >
-            and ((o.status = 0) or (o.status = 1) or (o.status = -2))
-        </if>
-        <if test=" param.type != null and param.type = 2 " >
-            and o.status = -1
-        </if>
-        <if test=" param.searchKey != null and param.searchKey !='' " >
-            and ((u.user_name like CONCAT('%',#{param.searchKey},'%')) or (c.child_name like CONCAT('%',#{param.searchKey},'%')) or (o.order_sn like CONCAT('%',#{param.searchKey},'%')))
-        </if>
-
-        <if test="param.startDate != null and param.startDate !='' " >
-            and o.trade_time &gt;= ${param.startDate} '00:00:00'
-        </if>
-        <if test=" param.endDate != null and param.endDate !='' " >
-            and o.trade_time &lt;= ${param.endDate} '23:59:59'
-        </if>
-    </select>
 </mapper>

+ 2 - 18
4dkankan-center-platform/src/main/resources/mapper/user/UserMapper.xml

@@ -15,25 +15,9 @@
         <if test=" param.endDate != null and param.endDate !='' " >
             and  u.register_time &lt;= ${param.endDate} '23:59:59'
         </if>
-        <if test="orderBy != null">
-            order by ${orderBy}
-        </if>
-        <if test="start != null and pageSize!=null">
-            limit ${start}, ${pageSize}
+        <if test="param.orderBy != null">
+            order by ${param.orderBy}
         </if>
     </select>
 
-
-    <select id="getCountByParam" resultType="integer">
-        SELECT count(*) FROM t_user u WHERE u.rec_status = 'A'
-        <if test=" param.searchKey != null and param.searchKey !='' " >
-            and u.user_name like concat('%',#{param.searchKey},'%')
-        </if>
-        <if test="param.startDate != null and param.startDate !='' " >
-            and  u.register_time &gt;= ${param.startDate} '00:00:00'
-        </if>
-        <if test=" param.endDate != null and param.endDate !='' " >
-            and  u.register_time &lt;= ${param.endDate} '23:59:59'
-        </if>
-    </select>
 </mapper>