|
|
|
|
|
|
|
<!DOCTYPE html>
|
|
<html id="htmlId">
|
|
<head>
|
|
<title>Coverage Report > OrderMapper</title>
|
|
<style type="text/css">
|
|
@import "../../css/coverage.css";
|
|
@import "../../css/idea.min.css";
|
|
</style>
|
|
<script type="text/javascript" src="../../js/highlight.min.js"></script>
|
|
<script type="text/javascript" src="../../js/highlightjs-line-numbers.min.js"></script>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="content">
|
|
<div class="breadCrumbs">
|
|
Current scope: <a href="../../index.html">all classes</a>
|
|
<span class="separator">|</span>
|
|
<a href="../index.html">cn.edu.ecnu.stu.bookstore.mapper</a>
|
|
</div>
|
|
|
|
<h1>Coverage Summary for Class: OrderMapper (cn.edu.ecnu.stu.bookstore.mapper)</h1>
|
|
|
|
<table class="coverageStats">
|
|
<tr>
|
|
<th class="name">Class</th>
|
|
</tr>
|
|
<tr>
|
|
<td class="name">OrderMapper</td>
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<br/>
|
|
<br/>
|
|
|
|
|
|
<pre>
|
|
<code class="sourceCode" id="sourceCode"> package cn.edu.ecnu.stu.bookstore.mapper;
|
|
|
|
import cn.edu.ecnu.stu.bookstore.pojo.Book;
|
|
import cn.edu.ecnu.stu.bookstore.pojo.Order;
|
|
import cn.edu.ecnu.stu.bookstore.pojo.OrderStatus;
|
|
import org.apache.ibatis.annotations.*;
|
|
|
|
import java.math.BigDecimal;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
@Mapper
|
|
public interface OrderMapper {
|
|
|
|
@Insert("insert into t_order(order_id, buyer_id, from_address, to_address, price, status, store_id) values " +
|
|
"(#{order.orderId}, #{order.buyerId}, #{order.fromAddress}, #{order.toAddress}, #{order.price}, #{order.status.value}, " +
|
|
"#{order.storeId})")
|
|
int insert(@Param("order")Order order);
|
|
|
|
int insertOrderBook(@Param("orderId") String orderId, @Param("books") List<Map<String, Object>> books);
|
|
|
|
@Update("update t_order set status = #{status.value} where order_id = #{orderId}")
|
|
void updateOrderStatus(@Param("orderId") String orderId, @Param("status") OrderStatus status);
|
|
|
|
List<Order> select(@Param("buyerId") Integer buyerId, @Param("status") OrderStatus status);
|
|
|
|
Order selectById(@Param("orderId") String orderId);
|
|
|
|
@Select("select count(*) from t_order where buyer_id = #{buyerId} and order_id = #{orderId}")
|
|
int checkOrder(@Param("orderId") String orderId, @Param("buyerId") Integer buyerId);
|
|
|
|
int selectStatus(@Param("orderId") String orderId);
|
|
}
|
|
</code>
|
|
</pre>
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
(function() {
|
|
var msie = false, msie9 = false;
|
|
/*@cc_on
|
|
msie = true;
|
|
@if (@_jscript_version >= 9)
|
|
msie9 = true;
|
|
@end
|
|
@*/
|
|
|
|
if (!msie || msie && msie9) {
|
|
hljs.highlightAll()
|
|
hljs.initLineNumbersOnLoad();
|
|
}
|
|
})();
|
|
</script>
|
|
|
|
<div class="footer">
|
|
|
|
<div style="float:right;">generated on 2023-12-12 18:32</div>
|
|
</div>
|
|
</body>
|
|
</html>
|