订单表转jpa
package com.example.demo.repository;
import com.example.demo.dataobject.OrderMaster;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
public interface OrderMasterRepository extends JpaRepository<OrderMaster,String> {
//以分页的形式查询订单order_master表里面数据 通过openid
Page<OrderMaster> findByBuyerOpenid(String buyerOpenid, Pageable pageable);
}
详情表转JPA
package com.example.demo.repository;
import com.example.demo.dataobject.OrderDetail;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
public interface OrderDetailRepository extends JpaRepository<OrderDetail,String> {
//通过订单id 查询表里面的数据
List<OrderDetail> findByOrderId(String orderId);
}
网友评论