wzj-boot/ruoyi-modules/ruoyi-order/src/main/resources/mapper/WechatPaymentHistoryMapper.xml
2025-06-09 11:41:28 +08:00

91 lines
4.7 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.wzj.soopin.order.mapper.WechatPaymentHistoryMapper">
<resultMap type="WechatPaymentHistory" id="OmsWechatPaymentHistoryResult">
<result property="id" column="id"/>
<result property="paymentId" column="payment_id"/>
<result property="memberId" column="member_id"/>
<result property="openid" column="openid"/>
<result property="realName" column="real_name"/>
<result property="title" column="title"/>
<result property="orderId" column="order_id"/>
<result property="money" column="money"/>
<result property="opType" column="op_type"/>
<result property="paymentStatus" column="payment_status"/>
<result property="remark" column="remark"/>
<result property="attach" column="attach"/>
<result property="responseBody" column="response_body"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectOmsWechatPaymentHistoryVo">
select id, payment_id, member_id, openid, real_name, title, order_id, money, op_type, payment_status, remark, attach, response_body, create_by, create_time, update_by, update_time from oms_wechat_payment_history
</sql>
<select id="selectByEntity" parameterType="WechatPaymentHistory" resultMap="OmsWechatPaymentHistoryResult">
<include refid="selectOmsWechatPaymentHistoryVo"/>
<where>
<if test="paymentId != null and paymentId != ''"> and payment_id = #{paymentId}</if>
<if test="memberId != null "> and member_id = #{memberId}</if>
<if test="openid != null and openid != ''"> and openid = #{openid}</if>
<if test="realName != null and realName != ''"> and real_name like concat('%', #{realName}, '%')</if>
<if test="title != null and title != ''"> and title = #{title}</if>
<if test="orderId != null "> and order_id = #{orderId}</if>
<if test="money != null "> and money = #{money}</if>
<if test="opType != null "> and op_type = #{opType}</if>
<if test="paymentStatus != null "> and payment_status = #{paymentStatus}</if>
<if test="attach != null and attach != ''"> and attach = #{attach}</if>
<if test="responseBody != null and responseBody != ''"> and response_body = #{responseBody}</if>
</where>
</select>
<select id="selectWechatPaymentHistory" parameterType="WechatPaymentHistory" resultMap="OmsWechatPaymentHistoryResult">
SELECT * FROM oms_wechat_payment_history
<where>
<if test="query.paymentId != null and query.paymentId != ''">
AND payment_id LIKE CONCAT('%', #{query.paymentId}, '%')
</if>
<if test="query.memberId != null">
AND member_id LIKE CONCAT('%', CAST(#{query.memberId} AS CHAR), '%')
</if>
<if test="query.openid != null and query.openid != ''">
AND openid LIKE CONCAT('%', #{query.openid}, '%')
</if>
<if test="query.realNameLike != null and query.realNameLike != ''">
AND real_name LIKE CONCAT('%', #{query.realNameLike}, '%')
</if>
<if test="query.title != null and query.title != ''">
AND title LIKE CONCAT('%', #{query.title}, '%')
</if>
<if test="query.orderId != null">
AND order_id LIKE CONCAT('%', CAST(#{query.orderId} AS CHAR), '%')
</if>
<if test="query.money != null">
AND money = #{query.money}
</if>
<if test="query.opType != null">
AND op_type = #{query.opType}
</if>
<if test="query.paymentStatus != null">
AND payment_status = #{query.paymentStatus}
</if>
<if test="query.attach != null and query.attach != ''">
AND attach LIKE CONCAT('%', #{query.attach}, '%')
</if>
<if test="query.responseBody != null and query.responseBody != ''">
AND response_body LIKE CONCAT('%', #{query.responseBody}, '%')
</if>
</where>
</select>
</mapper>