182 lines
8.1 KiB
XML
Raw Normal View History

<?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.xhpc.payment.mapper.XhpcRefundOrderMapper">
<resultMap type="com.xhpc.payment.domain.XhpcRefundOrder" id="XhpcRefundOrderResult">
<result column="refund_order_id" property="refundOrderId"/>
<result column="refund_order_number" property="refundOrderNumber"/>
<result column="user_id" property="userId"/>
2021-07-28 18:33:37 +08:00
<result column="open_id" property="openId"/>
<result column="alipay_id" property="alipayId"/>
<result column="amount" property="amount"/>
<result column="type" property="type"/>
<result column="examine_status" property="examineStatus"/>
<result column="status" property="status"/>
<result column="del_flag" property="delFlag"/>
<result column="create_time" property="createTime"/>
<result column="create_by" property="createBy"/>
<result column="update_time" property="updateTime"/>
<result column="update_by" property="updateBy"/>
<result column="remark" property="remark"/>
</resultMap>
<insert id="insert" parameterType="com.xhpc.payment.domain.XhpcRefundOrder" useGeneratedKeys="true"
keyProperty="refundOrderId">
INSERT INTO xhpc_recharge_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="null != refundOrderNumber and '' != refundOrderNumber">
refund_order_number,
</if>
<if test="null != userId and '' != userId">
user_id,
</if>
2021-07-28 18:33:37 +08:00
<if test="null != openId and '' != openId">
open_id,
</if>
2021-07-28 18:33:37 +08:00
<if test="null != alipayId and '' != alipayId">
alipay_id,
</if>
<if test="null != amount and '' != amount">
amount,
</if>
<if test="null != type and '' != type">
type,
</if>
<if test="null != examineStatus and '' != examineStatus">
examine_status,
</if>
<if test="null != status and '' != status">
status,
</if>
<if test="null != delFlag and '' != delFlag">
del_flag,
</if>
<if test="null != createTime">
create_time,
</if>
<if test="null != createBy and '' != createBy">
create_by,
</if>
<if test="null != updateTime">
update_time,
</if>
<if test="null != updateBy and '' != updateBy">
update_by,
</if>
<if test="null != remark and '' != remark">
remark
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="null != refundOrderNumber and '' != refundOrderNumber">
#{refundOrderNumber},
</if>
<if test="null != userId and '' != userId">
#{userId},
</if>
2021-07-28 18:33:37 +08:00
<if test="null != openId and '' != openId">
#{openId},
</if>
2021-07-28 18:33:37 +08:00
<if test="null != alipayId and '' != alipayId">
#{alipayId},
</if>
<if test="null != amount and '' != amount">
#{amount},
</if>
<if test="null != type and '' != type">
#{type},
</if>
<if test="null != examineStatus and '' != examineStatus">
#{examineStatus},
</if>
<if test="null != status and '' != status">
#{status},
</if>
<if test="null != delFlag and '' != delFlag">
#{delFlag},
</if>
<if test="null != createTime">
#{createTime},
</if>
<if test="null != createBy and '' != createBy">
#{createBy},
</if>
<if test="null != updateTime">
#{updateTime},
</if>
<if test="null != updateBy and '' != updateBy">
#{updateBy},
</if>
<if test="null != remark and '' != remark">
#{remark}
</if>
</trim>
</insert>
<update id="update" parameterType="com.xhpc.payment.domain.XhpcRefundOrder">
UPDATE xhpc_recharge_order
<set>
<if test="null != refundOrderNumber and '' != refundOrderNumber">refund_order_number =
#{refundOrderNumber},
</if>
<if test="null != userId and '' != userId">user_id = #{userId},</if>
2021-07-28 18:33:37 +08:00
<if test="null != openId and '' != openId">open_id = #{openId},</if>
<if test="null != alipayId and '' != alipayId">alipay_id = #{alipayId},</if>
<if test="null != amount ">amount = #{amount},</if>
<if test="null != type ">type = #{type},</if>
<if test="null != examineStatus ">examine_status = #{examineStatus},</if>
<if test="null != status">status = #{status},</if>
<if test="null != delFlag and '' != delFlag">del_flag = #{delFlag},</if>
<if test="null != createTime">create_time = #{createTime},</if>
<if test="null != createBy and '' != createBy">create_by = #{createBy},</if>
<if test="null != updateTime">update_time = #{updateTime},</if>
<if test="null != updateBy and '' != updateBy">update_by = #{updateBy},</if>
<if test="null != remark and '' != remark">remark = #{remark}</if>
</set>
WHERE refund_order_id = #{refundOrderId}
</update>
<select id="info" parameterType="java.lang.Long" resultType="java.util.Map">
select xro.refund_order_id refundOrderId ,xro.refund_order_number refundOrderNumber,
2021-07-28 18:33:37 +08:00
xro.alipay_id alipayId ,xro.open_id openId,xro.user_id userId,xro.amount,
xro.type,xro.examine_status examineStatus,xro.`status`,xro.create_time createTime,xau.phone,
sdd.dict_label statusName,sdds.dict_label examineStatusName
from xhpc_refund_order xro
LEFT JOIN xhpc_app_user xau on xau.app_user_id = xro.user_id
LEFT JOIN sys_dict_data sdd on sdd.`dict_type` = 'refund_order_status' and sdd.dict_value = xro.`status`
LEFT JOIN sys_dict_data sdds on sdds.`dict_type` = 'refund_examine_status' and sdds.dict_value = xro.examine_status
where xro.del_flag = 0 and xro.refund_order_id = #{refundOrderId}
</select>
<select id="page" parameterType="java.lang.String" resultType="java.util.Map">
select xro.refund_order_id refundOrderId ,xro.refund_order_number refundOrderNumber,
2021-07-28 18:33:37 +08:00
xro.alipay_id alipayId ,xro.open_id openId,xro.user_id userId,xro.amount,
xro.type,xro.examine_status examineStatus,xro.`status`,xro.create_time createTime,
xau.phone,sdd.dict_label statusName,sdds.dict_label examineStatusName
from xhpc_refund_order xro
LEFT JOIN xhpc_app_user xau on xau.app_user_id = xro.user_id
LEFT JOIN sys_dict_data sdd on sdd.`dict_type` = 'refund_order_status' and sdd.dict_value = xro.`status`
LEFT JOIN sys_dict_data sdds on sdds.`dict_type` = 'refund_examine_status' and sdds.dict_value =
xro.examine_status
where xro.del_flag = 0
<if test="phone != null and phone != ''">
and xau.phone like concat(concat('%', #{phone}), '%')
</if>
<if test="refundOrderNumber != null and refundOrderNumber != ''">
and xro.refund_order_number like concat(concat('%', #{refundOrderNumber}), '%')
</if>
<if test="status != null and status != ''">
and xro.status like concat(concat('%', #{status}), '%')
</if>
<if test="createTimeStart != null and createTimeStart != ''"><!-- 开始时间检索 -->
AND xro.create_time &gt;= #{createTimeStart}
</if>
<if test="createTimeEnd != null and createTimeEnd != ''"><!-- 结束时间检索 -->
AND xro.create_time &lt;= #{createTimeEnd}
</if>
ORDER BY xro.create_time DESC
</select>
</mapper>