44 lines
1.9 KiB
XML
44 lines
1.9 KiB
XML
<?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.CtripRefundItemMapper">
|
|
|
|
<!-- 结果映射 -->
|
|
<resultMap id="BaseResultMap" type="com.central.coupon.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="refund_amount" property="refundAmount" jdbcType="DECIMAL"/>
|
|
<result column="currency" property="currency" jdbcType="VARCHAR"/>
|
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
|
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
|
<result column="deleted" property="deleted" jdbcType="INTEGER"/>
|
|
</resultMap>
|
|
|
|
<!-- 基础字段 -->
|
|
<sql id="Base_Column_List">
|
|
id, refund_id, item_id, plu, refund_amount, currency,
|
|
create_time, update_time, deleted
|
|
</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}
|
|
AND (deleted = 0 OR deleted IS NULL)
|
|
ORDER BY create_time ASC
|
|
</select>
|
|
|
|
<!-- 根据订单项编号查询退款项 -->
|
|
<select id="selectByItemId" parameterType="string" resultMap="BaseResultMap">
|
|
SELECT
|
|
<include refid="Base_Column_List"/>
|
|
FROM t_ctrip_refund_item
|
|
WHERE item_id = #{itemId,jdbcType=VARCHAR}
|
|
AND (deleted = 0 OR deleted IS NULL)
|
|
ORDER BY create_time ASC
|
|
</select>
|
|
|
|
</mapper> |