- 添加修改金额
- 添加备注 - 添加取消订单操作
This commit is contained in:
@@ -10,7 +10,7 @@ spring:
|
||||
mybatis:
|
||||
config-location: classpath:mybatis-config.xml
|
||||
mapper-locations: classpath:mapper/*.xml
|
||||
type-aliases-package: cn.iocoder.mall.order.dataobject
|
||||
type-aliases-package: cn.iocoder.mall.order.biz.dataobject
|
||||
|
||||
# dubbo
|
||||
dubbo:
|
||||
@@ -22,9 +22,10 @@ dubbo:
|
||||
port: -1
|
||||
name: dubbo
|
||||
scan:
|
||||
base-packages: cn.iocoder.mall.order.service
|
||||
base-packages: cn.iocoder.mall.order.biz.service
|
||||
|
||||
# logging
|
||||
logging:
|
||||
level:
|
||||
cn.iocoder.mall.order.dao: debug
|
||||
# dao 开启 debug 模式 mybatis 输入 sql
|
||||
cn.iocoder.mall.order.biz.dao: debug
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<?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="cn.iocoder.mall.order.biz.dao.OrderCancelMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id, order_id, order_no, reason, other_reason,
|
||||
create_time, update_time
|
||||
</sql>
|
||||
|
||||
<!--
|
||||
插入数据
|
||||
-->
|
||||
<insert id="insert" parameterType="OrderCancelDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
||||
INSERT INTO `order_cancel` (
|
||||
order_id, order_no, reason, other_reason,
|
||||
create_time, update_time
|
||||
) VALUES (
|
||||
#{orderId}, #{orderNo}, #{reason}, #{otherReason},
|
||||
#{createTime}, #{updateTime}
|
||||
)
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?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="cn.iocoder.mall.order.dao.OrderItemMapper">
|
||||
<mapper namespace="cn.iocoder.mall.order.biz.dao.OrderItemMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id, order_id, order_no, sku_id, sku_name, sku_image, quantity, price, pay_amount,
|
||||
@@ -106,10 +106,19 @@
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!--
|
||||
查询 - 根据 orderId 下的 item
|
||||
-->
|
||||
<select id="selectByOrderIdAndDeleted" resultType="cn.iocoder.mall.order.dataobject.OrderItemDO">
|
||||
<!--
|
||||
更新 - 根据 orderId
|
||||
-->
|
||||
<update id="updateByOrderId">
|
||||
UPDATE `order_item`
|
||||
<include refid="updateFieldSql" />
|
||||
WHERE order_id = #{orderId}
|
||||
</update>
|
||||
|
||||
<!--
|
||||
查询 - 根据 orderId 下的 item
|
||||
-->
|
||||
<select id="selectByOrderIdAndDeleted" resultType="cn.iocoder.mall.order.biz.dataobject.OrderItemDO">
|
||||
SELECT * FROM `order_item`
|
||||
WHERE 1=1
|
||||
<if test="deleted">
|
||||
@@ -123,7 +132,7 @@
|
||||
<!--
|
||||
查询 - 根据 orderIds 和 status
|
||||
-->
|
||||
<select id="selectByOrderIdsAndDeleted" resultType="cn.iocoder.mall.order.dataobject.OrderItemDO">
|
||||
<select id="selectByOrderIdsAndDeleted" resultType="cn.iocoder.mall.order.biz.dataobject.OrderItemDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM `order_item`
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?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="cn.iocoder.mall.order.dao.OrderLogisticsMapper">
|
||||
<mapper namespace="cn.iocoder.mall.order.biz.dao.OrderLogisticsMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id, area_no, `name`, mobile, address, logistics_no, create_time, update_time
|
||||
@@ -53,7 +53,7 @@
|
||||
<!--
|
||||
查询 - 根据 orderId
|
||||
-->
|
||||
<select id="selectByIds" resultType="cn.iocoder.mall.order.dataobject.OrderLogisticsDO">
|
||||
<select id="selectByIds" resultType="cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM `order_logistics`
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?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="cn.iocoder.mall.order.dao.OrderMapper">
|
||||
<mapper namespace="cn.iocoder.mall.order.biz.dao.OrderMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id, user_id, order_logistics_id, order_no, pay_amount, payment_time,
|
||||
@@ -39,7 +39,7 @@
|
||||
<if test="payAmount != null">
|
||||
, pay_amount = #{payAmount}
|
||||
</if>
|
||||
-- time
|
||||
|
||||
<if test="paymentTime != null">
|
||||
, payment_time = #{paymentTime}
|
||||
</if>
|
||||
@@ -55,7 +55,7 @@
|
||||
<if test="hasReturnExchange != null">
|
||||
, has_return_exchange = #{hasReturnExchange}
|
||||
</if>
|
||||
-- other
|
||||
|
||||
<if test="status != null">
|
||||
, status = #{status}
|
||||
</if>
|
||||
@@ -86,7 +86,7 @@
|
||||
<!--
|
||||
查询 - 根据id 查询
|
||||
-->
|
||||
<select id="selectById" resultType="cn.iocoder.mall.order.dataobject.OrderDO">
|
||||
<select id="selectById" resultType="cn.iocoder.mall.order.biz.dataobject.OrderDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM `order`
|
||||
@@ -94,26 +94,30 @@
|
||||
</select>
|
||||
|
||||
<!--
|
||||
查询条件
|
||||
查询条件 注意:条件顺序,避免不能使用索引
|
||||
-->
|
||||
<sql id="selectWhere">
|
||||
<if test="id != null">
|
||||
AND `id` = #{id}
|
||||
<if test="status != null">
|
||||
AND `status` = #{status}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
AND `user_id` = #{userId}
|
||||
</if>
|
||||
<if test="orderLogisticsId != null">
|
||||
AND `order_logistics_id` = #{orderLogisticsId}
|
||||
<if test="id != null">
|
||||
AND `id` = #{id}
|
||||
</if>
|
||||
<if test="orderNo != null">
|
||||
AND `order_no` = #{orderNo}
|
||||
</if>
|
||||
<if test="orderLogisticsId != null">
|
||||
AND `order_logistics_id` = #{orderLogisticsId}
|
||||
</if>
|
||||
<if test="hasReturnExchange != null">
|
||||
AND `has_return_exchange` = #{hasReturnExchange}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND `status` = #{status}
|
||||
<if test="startCreateTime != null and endCreateTime != null">
|
||||
AND `create_time` >= #{startCreateTime}
|
||||
AND `create_time` <= #{endCreateTime}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
@@ -131,7 +135,7 @@
|
||||
<!--
|
||||
查询 - 后台分页page
|
||||
-->
|
||||
<select id="selectPage" resultType="cn.iocoder.mall.order.dataobject.OrderDO">
|
||||
<select id="selectPage" resultType="cn.iocoder.mall.order.biz.dataobject.OrderDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM `order`
|
||||
|
||||
Reference in New Issue
Block a user