6 changed files with 165 additions and 12 deletions
@ -1,11 +1,53 @@ |
|||
package cn.chjyj.szwh.mapper; |
|||
|
|||
import cn.chjyj.szwh.bean.Order; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import javax.annotation.security.PermitAll; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 订单信息 |
|||
*/ |
|||
@Component |
|||
public interface OrderMapper { |
|||
/** |
|||
* 分页查询订单 |
|||
* @param startrs |
|||
* @param pageSize |
|||
* @return |
|||
*/ |
|||
List<Order> getAllOrderList(@Param("startRs") int startrs,@Param("pageSize") int pageSize); |
|||
/** |
|||
* 根据条件查询订单列表 |
|||
* @param qumap |
|||
* @return |
|||
*/ |
|||
List<Order> getOrderList(@Param("map") Map<String,Object> qumap, |
|||
@Param("startRs")Integer starrs, |
|||
@Param("pageSize") Integer pagesize |
|||
); |
|||
|
|||
/** |
|||
* 根据编号查询订单信息 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
Order getOrderById(Integer id); |
|||
|
|||
/** |
|||
* 根据订单号 |
|||
* @param batchcode |
|||
* @return |
|||
*/ |
|||
Order getOrderByBatchcode(String batchcode); |
|||
|
|||
/** |
|||
* 更新订单状态 |
|||
* @param order |
|||
* @return |
|||
*/ |
|||
int updateOrderStatus(Order order); |
|||
} |
|||
|
|||
@ -0,0 +1,12 @@ |
|||
package cn.chjyj.szwh.service; |
|||
|
|||
import cn.chjyj.szwh.bean.Order; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 订单service接口 |
|||
*/ |
|||
public interface OrderService { |
|||
public List<Order> getOrderList(); |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
package cn.chjyj.szwh.service.impl; |
|||
|
|||
import cn.chjyj.szwh.bean.Order; |
|||
import cn.chjyj.szwh.service.OrderService; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 订单服务实现 |
|||
*/ |
|||
@Service |
|||
public class OrderServiceImpl implements OrderService { |
|||
@Override |
|||
public List<Order> getOrderList() { |
|||
return null; |
|||
} |
|||
} |
|||
@ -0,0 +1,56 @@ |
|||
package cn.chjyj.szwh.mapper; |
|||
|
|||
import cn.chjyj.szwh.bean.Order; |
|||
import org.junit.Test; |
|||
import org.junit.runner.RunWith; |
|||
import org.mockito.internal.matchers.Or; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.boot.test.context.SpringBootTest; |
|||
import org.springframework.test.context.junit4.SpringRunner; |
|||
|
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
import static org.junit.Assert.*; |
|||
|
|||
@SpringBootTest |
|||
@RunWith(SpringRunner.class) |
|||
public class OrderMapperTest { |
|||
@Autowired |
|||
private OrderMapper orderMapper; |
|||
|
|||
@Test |
|||
public void getAllOrderList() { |
|||
int startrs=0; |
|||
int pagesize=20; |
|||
List<Order> olist = orderMapper.getAllOrderList(startrs,pagesize); |
|||
System.out.println(olist.size()); |
|||
} |
|||
|
|||
@Test |
|||
public void getOrderList() { |
|||
// 查询条件
|
|||
Map<String,Object> wcon=new HashMap<>(); |
|||
wcon.put("buy_islicode","999998-000000001923-9"); |
|||
wcon.put("status",5); |
|||
|
|||
int starrs=0; |
|||
int pagesize=10; |
|||
//
|
|||
List<Order> lolist = orderMapper.getOrderList(wcon,starrs,pagesize); |
|||
System.out.println(lolist.size()); |
|||
} |
|||
|
|||
@Test |
|||
public void getOrderById() { |
|||
} |
|||
|
|||
@Test |
|||
public void getOrderByBatchcode() { |
|||
} |
|||
|
|||
@Test |
|||
public void updateOrderStatus() { |
|||
} |
|||
} |
|||
Loading…
Reference in new issue