XH-Power-Cloud/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcUserAccountStatementMapper.xml

118 lines
4.6 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.XhpcUserAccountStatementMapper">
<resultMap type="com.xhpc.payment.domain.XhpcUserAccountStatement" id="XhpcUserAccountStatementResult">
<result column="user_account_statement_id" property="userAccountStatementId"/>
<result column="user_id" property="userId"/>
<result column="amount" property="amount"/>
<result column="charge_order_id" property="chargeOrderId"/>
<result column="recharge_order_id" property="rechargeOrderId"/>
<result column="refund_order_id" property="refundOrderId"/>
<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.XhpcUserAccountStatement" useGeneratedKeys="true"
keyProperty="userAccountStatementId">
INSERT INTO xhpc_user_account_statement
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="null != userId and '' != userId">
user_id,
</if>
<if test="null != amount and '' != amount">
amount,
</if>
<if test="null != chargeOrderId and '' != chargeOrderId">
charge_order_id,
</if>
<if test="null != rechargeOrderId and '' != rechargeOrderId">
recharge_order_id,
</if>
<if test="null != refundOrderId and '' != refundOrderId">
refund_order_id,
</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 != userId and '' != userId">
#{userId},
</if>
<if test="null != amount and '' != amount">
#{amount},
</if>
<if test="null != chargeOrderId and '' != chargeOrderId">
#{chargeOrderId},
</if>
<if test="null != rechargeOrderId and '' != rechargeOrderId">
#{rechargeOrderId},
</if>
<if test="null != refundOrderId and '' != refundOrderId">
#{refundOrderId},
</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>
<select id="list" parameterType="java.lang.Long" resultType="java.util.Map">
select xro.refund_order_id refundOrderId ,
xro.`status`,xdb.dict_value statusName,
xra.remark,xra.create_time createTime
from xhpc_refund_audit xra
LEFT JOIN xhpc_refund_order xro on xra.refund_order_id = xro.refund_order_id
LEFT JOIN xhpc_dict_biz xdb on xdb.`code` = 'refund_order_status' and xdb.dict_key = xro.`status`
where xra.del_flag = 0
<if test="refundOrderId != null and refundOrderId != ''">
and xro.refund_order_id = #{refundOrderId}
</if>
ORDER BY xra.create_time DESC
</select>
</mapper>