fix(优惠券中心):新增携程优惠券独立微服务模块
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
server:
|
||||
port: 8082
|
||||
servlet:
|
||||
context-path: /coupon-center
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: coupon-center
|
||||
profiles:
|
||||
active: dev
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/coupon_center?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: 123456
|
||||
jackson:
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
time-zone: GMT+8
|
||||
default-property-inclusion: non_null
|
||||
|
||||
# 携程API配置
|
||||
ctrip:
|
||||
aes:
|
||||
key: your-aes-key-here-16chars
|
||||
iv: your-aes-iv-here-16chars
|
||||
md5:
|
||||
secret: your-md5-secret-here
|
||||
api:
|
||||
timeout: 30000
|
||||
retry-times: 3
|
||||
base-url: https://api.ctrip.com
|
||||
|
||||
# MyBatis Plus配置
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath*:mapper/*.xml
|
||||
type-aliases-package: com.central.coupon.entity
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true
|
||||
cache-enabled: false
|
||||
global-config:
|
||||
db-config:
|
||||
id-type: auto
|
||||
logic-delete-field: deleted
|
||||
logic-delete-value: 1
|
||||
logic-not-delete-value: 0
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
level:
|
||||
com.central.coupon: debug
|
||||
org.springframework.web: debug
|
||||
pattern:
|
||||
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
|
||||
file: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
|
||||
file:
|
||||
name: logs/coupon-center.log
|
||||
|
||||
# 开发环境配置
|
||||
---
|
||||
spring:
|
||||
config:
|
||||
activate:
|
||||
on-profile: dev
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/coupon_center_dev?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
|
||||
# 生产环境配置
|
||||
---
|
||||
spring:
|
||||
config:
|
||||
activate:
|
||||
on-profile: prod
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/coupon_center_prod?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
profiles:
|
||||
active: prod
|
||||
|
||||
logging:
|
||||
level:
|
||||
com.central.coupon: info
|
||||
org.springframework.web: warn
|
||||
@@ -0,0 +1,15 @@
|
||||
server:
|
||||
port: 8002
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: coupon-center
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
ip: 81.70.164.178
|
||||
# cloud:
|
||||
# nacos:
|
||||
# discovery:
|
||||
# metadata:
|
||||
# version: zlt
|
||||
@@ -0,0 +1,122 @@
|
||||
<?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.coupon.mapper.CouponMapper">
|
||||
|
||||
<!-- 结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="com.central.coupon.entity.Coupon">
|
||||
<id column="id" property="id" jdbcType="BIGINT"/>
|
||||
<result column="coupon_no" property="couponNo" jdbcType="VARCHAR"/>
|
||||
<result column="coupon_name" property="couponName" jdbcType="VARCHAR"/>
|
||||
<result column="coupon_type" property="couponType" jdbcType="INTEGER"/>
|
||||
<result column="amount" property="amount" jdbcType="DECIMAL"/>
|
||||
<result column="min_amount" property="minAmount" jdbcType="DECIMAL"/>
|
||||
<result column="discount_rate" property="discountRate" jdbcType="INTEGER"/>
|
||||
<result column="status" property="status" jdbcType="INTEGER"/>
|
||||
<result column="user_phone" property="userPhone" jdbcType="VARCHAR"/>
|
||||
<result column="user_id" property="userId" jdbcType="BIGINT"/>
|
||||
<result column="source" property="source" jdbcType="INTEGER"/>
|
||||
<result column="ctrip_coupon_id" property="ctripCouponId" jdbcType="VARCHAR"/>
|
||||
<result column="valid_start_time" property="validStartTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="valid_end_time" property="validEndTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="used_time" property="usedTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="used_order_no" property="usedOrderNo" jdbcType="VARCHAR"/>
|
||||
<result column="cancel_time" property="cancelTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="create_by" property="createBy" jdbcType="VARCHAR"/>
|
||||
<result column="update_by" property="updateBy" jdbcType="VARCHAR"/>
|
||||
<result column="remark" property="remark" jdbcType="VARCHAR"/>
|
||||
<result column="tenant_id" property="tenantId" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, coupon_no, coupon_name, coupon_type, amount, min_amount, discount_rate,
|
||||
status, user_phone, user_id, source, ctrip_coupon_id, valid_start_time, valid_end_time,
|
||||
used_time, used_order_no, cancel_time, create_time, update_time, create_by, update_by, remark, tenant_id
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询优惠券列表 -->
|
||||
<select id="selectCouponPage" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM t_coupon
|
||||
<where>
|
||||
<if test="coupon.couponName != null and coupon.couponName != ''">
|
||||
AND coupon_name LIKE CONCAT('%', #{coupon.couponName}, '%')
|
||||
</if>
|
||||
<if test="coupon.userPhone != null and coupon.userPhone != ''">
|
||||
AND user_phone = #{coupon.userPhone}
|
||||
</if>
|
||||
<if test="coupon.status != null">
|
||||
AND status = #{coupon.status}
|
||||
</if>
|
||||
<if test="coupon.source != null">
|
||||
AND source = #{coupon.source}
|
||||
</if>
|
||||
<if test="coupon.couponType != null">
|
||||
AND coupon_type = #{coupon.couponType}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据手机号查询用户优惠券 -->
|
||||
<select id="selectByUserPhone" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM t_coupon
|
||||
WHERE user_phone = #{userPhone}
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据手机号查询可用优惠券 -->
|
||||
<select id="selectAvailableByUserPhone" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM t_coupon
|
||||
WHERE user_phone = #{userPhone}
|
||||
AND status = 0
|
||||
AND valid_start_time <= NOW()
|
||||
AND valid_end_time >= NOW()
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据携程优惠券ID查询 -->
|
||||
<select id="selectByCtripCouponId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM t_coupon
|
||||
WHERE ctrip_coupon_id = #{ctripCouponId}
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<!-- 根据订单号查询使用的优惠券 -->
|
||||
<select id="selectByUsedOrderNo" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM t_coupon
|
||||
WHERE used_order_no = #{usedOrderNo}
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<!-- 更新优惠券状态为已使用 -->
|
||||
<update id="updateCouponUsed">
|
||||
UPDATE t_coupon
|
||||
SET status = 1,
|
||||
used_time = NOW(),
|
||||
used_order_no = #{usedOrderNo},
|
||||
update_time = NOW()
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 批量更新过期优惠券状态 -->
|
||||
<update id="updateExpiredCoupons">
|
||||
UPDATE t_coupon
|
||||
SET status = 2,
|
||||
update_time = NOW()
|
||||
WHERE status = 0
|
||||
AND valid_end_time < NOW()
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?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.CtripConsumedMapper">
|
||||
|
||||
<!-- 结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="com.central.order.entity.CtripConsumed">
|
||||
<id column="id" property="id" jdbcType="BIGINT"/>
|
||||
<result column="ota_order_id" property="otaOrderId" jdbcType="VARCHAR"/>
|
||||
<result column="supplier_order_id" property="supplierOrderId" jdbcType="VARCHAR"/>
|
||||
<result column="sequence_id" property="sequenceId" jdbcType="VARCHAR"/>
|
||||
<result column="item_id" property="itemId" jdbcType="VARCHAR"/>
|
||||
<result column="use_start_date" property="useStartDate" jdbcType="VARCHAR"/>
|
||||
<result column="use_end_date" property="useEndDate" jdbcType="VARCHAR"/>
|
||||
<result column="quantity" property="quantity" jdbcType="INTEGER"/>
|
||||
<result column="use_quantity" property="useQuantity" jdbcType="INTEGER"/>
|
||||
<result column="lost_amount" property="lostAmount" jdbcType="DECIMAL"/>
|
||||
<result column="lost_amount_currency" property="lostAmountCurrency" jdbcType="VARCHAR"/>
|
||||
<result column="remark" property="remark" jdbcType="VARCHAR"/>
|
||||
<result column="status" property="status" jdbcType="INTEGER"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="create_by" property="createBy" jdbcType="VARCHAR"/>
|
||||
<result column="update_by" property="updateBy" jdbcType="VARCHAR"/>
|
||||
<result column="remark_detail" property="remarkDetail" jdbcType="VARCHAR"/>
|
||||
<result column="tenant_id" property="tenantId" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, ota_order_id, supplier_order_id, sequence_id, item_id, use_start_date, use_end_date,
|
||||
quantity, use_quantity, lost_amount, lost_amount_currency, remark, status,
|
||||
create_time, update_time, create_by, update_by, remark_detail, tenant_id
|
||||
</sql>
|
||||
|
||||
<!-- 根据携程订单号查询核销信息 -->
|
||||
<select id="selectByOtaOrderId" parameterType="string" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM t_ctrip_consumed
|
||||
WHERE ota_order_id = #{otaOrderId,jdbcType=VARCHAR}
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据供应商订单号查询核销信息 -->
|
||||
<select id="selectBySupplierOrderId" parameterType="string" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM t_ctrip_consumed
|
||||
WHERE supplier_order_id = #{supplierOrderId,jdbcType=VARCHAR}
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据供应商批次流水号查询核销信息 -->
|
||||
<select id="selectBySequenceId" parameterType="string" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM t_ctrip_consumed
|
||||
WHERE sequence_id = #{sequenceId,jdbcType=VARCHAR}
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?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.CtripConsumedPassengerMapper">
|
||||
|
||||
<!-- 结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="com.central.order.entity.CtripConsumedPassenger">
|
||||
<id column="id" property="id" jdbcType="BIGINT"/>
|
||||
<result column="consumed_id" property="consumedId" jdbcType="BIGINT"/>
|
||||
<result column="passenger_id" property="passengerId" jdbcType="VARCHAR"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="create_by" property="createBy" jdbcType="VARCHAR"/>
|
||||
<result column="update_by" property="updateBy" jdbcType="VARCHAR"/>
|
||||
<result column="remark" property="remark" jdbcType="VARCHAR"/>
|
||||
<result column="tenant_id" property="tenantId" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, consumed_id, passenger_id, create_time, update_time, create_by, update_by, remark, tenant_id
|
||||
</sql>
|
||||
|
||||
<!-- 根据核销ID查询乘客列表 -->
|
||||
<select id="selectByConsumedId" parameterType="long" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM t_ctrip_consumed_passenger
|
||||
WHERE consumed_id = #{consumedId,jdbcType=BIGINT}
|
||||
ORDER BY create_time ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?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.CtripConsumedVoucherMapper">
|
||||
|
||||
<!-- 结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="com.central.order.entity.CtripConsumedVoucher">
|
||||
<id column="id" property="id" jdbcType="BIGINT"/>
|
||||
<result column="consumed_id" property="consumedId" jdbcType="BIGINT"/>
|
||||
<result column="voucher_id" property="voucherId" jdbcType="VARCHAR"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="create_by" property="createBy" jdbcType="VARCHAR"/>
|
||||
<result column="update_by" property="updateBy" jdbcType="VARCHAR"/>
|
||||
<result column="remark" property="remark" jdbcType="VARCHAR"/>
|
||||
<result column="tenant_id" property="tenantId" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, consumed_id, voucher_id, create_time, update_time, create_by, update_by, remark, tenant_id
|
||||
</sql>
|
||||
|
||||
<!-- 根据核销ID查询凭证列表 -->
|
||||
<select id="selectByConsumedId" parameterType="long" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM t_ctrip_consumed_voucher
|
||||
WHERE consumed_id = #{consumedId,jdbcType=BIGINT}
|
||||
ORDER BY create_time ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?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.CtripOrderItemMapper">
|
||||
|
||||
<!-- 根据订单ID查询订单项列表 -->
|
||||
<select id="selectByOrderId" resultType="com.central.order.entity.CtripOrderItem">
|
||||
SELECT
|
||||
id,
|
||||
order_id,
|
||||
item_id,
|
||||
plu,
|
||||
use_start_date,
|
||||
use_end_date,
|
||||
price,
|
||||
sale_price,
|
||||
quantity,
|
||||
create_time,
|
||||
update_time,
|
||||
create_by,
|
||||
update_by,
|
||||
remark,
|
||||
tenant_id
|
||||
FROM t_ctrip_order_item
|
||||
WHERE order_id = #{orderId}
|
||||
ORDER BY id ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?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.CtripOrderMapper">
|
||||
|
||||
<!-- 根据携程订单号查询订单 -->
|
||||
<select id="selectByOtaOrderId" resultType="com.central.order.entity.CtripOrder">
|
||||
SELECT
|
||||
id,
|
||||
ota_order_id,
|
||||
supplier_order_id,
|
||||
sequence_id,
|
||||
confirm_type,
|
||||
order_last_confirm_time,
|
||||
status,
|
||||
create_time,
|
||||
update_time,
|
||||
create_by,
|
||||
update_by,
|
||||
remark,
|
||||
tenant_id
|
||||
FROM t_ctrip_order
|
||||
WHERE ota_order_id = #{otaOrderId}
|
||||
</select>
|
||||
|
||||
<!-- 根据供应商订单号查询订单 -->
|
||||
<select id="selectBySupplierOrderId" resultType="com.central.order.entity.CtripOrder">
|
||||
SELECT
|
||||
id,
|
||||
ota_order_id,
|
||||
supplier_order_id,
|
||||
sequence_id,
|
||||
confirm_type,
|
||||
order_last_confirm_time,
|
||||
status,
|
||||
create_time,
|
||||
update_time,
|
||||
create_by,
|
||||
update_by,
|
||||
remark,
|
||||
tenant_id
|
||||
FROM t_ctrip_order
|
||||
WHERE supplier_order_id = #{supplierOrderId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?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.CtripPassengerMapper">
|
||||
|
||||
<!-- 根据订单项ID查询乘客列表 -->
|
||||
<select id="selectByOrderItemId" resultType="com.central.order.entity.CtripPassenger">
|
||||
SELECT
|
||||
id,
|
||||
order_item_id,
|
||||
passenger_id,
|
||||
name,
|
||||
mobile,
|
||||
card_type,
|
||||
card_no,
|
||||
age_type,
|
||||
gender,
|
||||
create_time,
|
||||
update_time,
|
||||
create_by,
|
||||
update_by,
|
||||
remark,
|
||||
tenant_id
|
||||
FROM t_ctrip_passenger
|
||||
WHERE order_item_id = #{orderItemId}
|
||||
ORDER BY id ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?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.CtripRefundItemMapper">
|
||||
|
||||
<!-- 结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="com.central.order.entity.CtripRefundItem">
|
||||
<id column="id" property="id" jdbcType="BIGINT"/>
|
||||
<result column="refund_id" property="refundId" jdbcType="BIGINT"/>
|
||||
<result column="item_id" property="itemId" jdbcType="VARCHAR"/>
|
||||
<result column="plu" property="plu" jdbcType="VARCHAR"/>
|
||||
<result column="amount" property="amount" jdbcType="DECIMAL"/>
|
||||
<result column="amount_currency" property="amountCurrency" jdbcType="VARCHAR"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="create_by" property="createBy" jdbcType="VARCHAR"/>
|
||||
<result column="update_by" property="updateBy" jdbcType="VARCHAR"/>
|
||||
<result column="remark" property="remark" jdbcType="VARCHAR"/>
|
||||
<result column="tenant_id" property="tenantId" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, refund_id, item_id, plu, amount, amount_currency,
|
||||
create_time, update_time, create_by, update_by, remark, tenant_id
|
||||
</sql>
|
||||
|
||||
<!-- 根据退款ID查询退款项列表 -->
|
||||
<select id="selectByRefundId" parameterType="long" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM t_ctrip_refund_item
|
||||
WHERE refund_id = #{refundId,jdbcType=BIGINT}
|
||||
ORDER BY create_time ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,59 @@
|
||||
<?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.CtripRefundMapper">
|
||||
|
||||
<!-- 结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="com.central.order.entity.CtripRefund">
|
||||
<id column="id" property="id" jdbcType="BIGINT"/>
|
||||
<result column="ota_order_id" property="otaOrderId" jdbcType="VARCHAR"/>
|
||||
<result column="supplier_order_id" property="supplierOrderId" jdbcType="VARCHAR"/>
|
||||
<result column="sequence_id" property="sequenceId" jdbcType="VARCHAR"/>
|
||||
<result column="total_amount" property="totalAmount" jdbcType="DECIMAL"/>
|
||||
<result column="total_amount_currency" property="totalAmountCurrency" jdbcType="VARCHAR"/>
|
||||
<result column="last_confirm_time" property="lastConfirmTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="status" property="status" jdbcType="INTEGER"/>
|
||||
<result column="confirm_result_code" property="confirmResultCode" jdbcType="VARCHAR"/>
|
||||
<result column="confirm_result_message" property="confirmResultMessage" jdbcType="VARCHAR"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="create_by" property="createBy" jdbcType="VARCHAR"/>
|
||||
<result column="update_by" property="updateBy" jdbcType="VARCHAR"/>
|
||||
<result column="remark" property="remark" jdbcType="VARCHAR"/>
|
||||
<result column="tenant_id" property="tenantId" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, ota_order_id, supplier_order_id, sequence_id, total_amount, total_amount_currency,
|
||||
last_confirm_time, status, confirm_result_code, confirm_result_message,
|
||||
create_time, update_time, create_by, update_by, remark, tenant_id
|
||||
</sql>
|
||||
|
||||
<!-- 根据携程订单号查询退款信息 -->
|
||||
<select id="selectByOtaOrderId" parameterType="string" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM t_ctrip_refund
|
||||
WHERE ota_order_id = #{otaOrderId,jdbcType=VARCHAR}
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据供应商订单号查询退款信息 -->
|
||||
<select id="selectBySupplierOrderId" parameterType="string" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM t_ctrip_refund
|
||||
WHERE supplier_order_id = #{supplierOrderId,jdbcType=VARCHAR}
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据携程批次流水号查询退款信息 -->
|
||||
<select id="selectBySequenceId" parameterType="string" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM t_ctrip_refund
|
||||
WHERE sequence_id = #{sequenceId,jdbcType=VARCHAR}
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user