feat[文件上传和订单模块功能]:已测试通过
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.central.order.mapper.OrderMapper">
|
||||
<select id="findList" resultType="com.central.order.model.Order">
|
||||
select * from orders t
|
||||
</select>
|
||||
|
||||
<!-- 根据订单状态查询订单列表 -->
|
||||
<select id="getOrdersByStatus" resultMap="OrderResultMap">
|
||||
SELECT * FROM orders WHERE order_status = #{status}
|
||||
</select>
|
||||
<!-- 新增订单 -->
|
||||
<insert id="insertOrder" keyProperty="order_id" useGeneratedKeys="true">
|
||||
INSERT INTO orders (user_id, order_amount, order_status)
|
||||
VALUES (#{userId}, #{orderAmount}, #{orderStatus})
|
||||
</insert>
|
||||
<!-- 根据订单编号查询订单信息 -->
|
||||
<resultMap id="OrderResultMap" type="com.central.order.model.Order"></resultMap>
|
||||
|
||||
<select id="getOrderById" resultMap="OrderResultMap">
|
||||
SELECT * FROM orders WHERE id = #{orderId}
|
||||
</select>
|
||||
<!-- 更新订单状态 -->
|
||||
<update id="updateOrderStatus">
|
||||
UPDATE orders
|
||||
SET order_status = #{newStatus}
|
||||
WHERE id = #{orderId}
|
||||
</update>
|
||||
<!-- 查询所有处于排队状态的订单 -->
|
||||
<select id="getOrdersInQueue" resultType="com.central.order.model.Order">
|
||||
SELECT * FROM orders WHERE order_status = 1
|
||||
</select>
|
||||
|
||||
<!-- 根据店铺编号和创建时间(当天)查询订单数量 -->
|
||||
<select id="findByShopIdAndCreateTimeGreaterThanEqualAndCreateTimeLessThanEqual" resultMap="OrderResultMap">
|
||||
SELECT * FROM orders
|
||||
WHERE tourism_id = #{tourismId}
|
||||
AND create_time >= #{startDate}
|
||||
AND create_time <= #{endDate}
|
||||
</select>
|
||||
|
||||
<!-- 根据订单编号查询订单信息 -->
|
||||
<select id="getOrderByNumber" resultMap="OrderResultMap">
|
||||
SELECT * FROM orders WHERE order_number = #{orderNumber}
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user