game-api/ff-game/src/main/resources/mapper/game/GameExchangeMoneyMapper.xml

413 lines
14 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.ff.game.mapper.GameExchangeMoneyMapper">
<resultMap type="GameExchangeMoney" id="GameExchangeMoneyResult">
<result property="id" column="id"/>
<result property="tenantKey" column="tenant_key"/>
<result property="orderId" column="order_id"/>
<result property="currencyCode" column="currency_code"/>
<result property="transactionId" column="transaction_id"/>
<result property="memberId" column="member_id"/>
<result property="platformCode" column="platform_code"/>
<result property="balance" column="balance"/>
<result property="quota" column="quota"/>
<result property="coinBefore" column="coin_before"/>
<result property="coinAfter" column="coin_after"/>
<result property="currencyBefore" column="currency_before"/>
<result property="currencyAfter" column="currency_after"/>
<result property="exchangeType" column="exchange_type"/>
<result property="status" column="status"/>
<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>
<resultMap type="com.ff.game.dto.GameExchangeMoneyDTO" id="GameExchangeMoneyDTOResult">
<result property="id" column="id"/>
<result property="tenantKey" column="tenant_key"/>
<result property="orderId" column="order_id"/>
<result property="currencyCode" column="currency_code"/>
<result property="transactionId" column="transaction_id"/>
<result property="memberId" column="member_id"/>
<result property="platformCode" column="platform_code"/>
<result property="balance" column="balance"/>
<result property="quota" column="quota"/>
<result property="coinBefore" column="coin_before"/>
<result property="coinAfter" column="coin_after"/>
<result property="currencyBefore" column="currency_before"/>
<result property="currencyAfter" column="currency_after"/>
<result property="exchangeType" column="exchange_type"/>
<result property="status" column="status"/>
<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="memberAccount" column="member_account"/>
<result property="gameAccount" column="game_account"/>
</resultMap>
<sql id="selectGameExchangeMoneyVo">
select id,
tenant_key,
order_id,
currency_code,
transaction_id,
member_id,
platform_code,
balance,
quota,
coin_before,
coin_after,
currency_before,
currency_after,
exchange_type,
status,
create_by,
create_time,
update_by,
update_time
from ff_game_exchange_money
</sql>
<select id="selectGameExchangeMoneyList" parameterType="GameExchangeMoney" resultMap="GameExchangeMoneyResult">
<include refid="selectGameExchangeMoneyVo"/>
<where>
<if test="tenantKey != null and tenantKey != ''">
and tenant_key = #{tenantKey}
</if>
<if test="orderId != null and orderId != ''">
and order_id = #{orderId}
</if>
<if test="currencyCode != null and currencyCode != ''">
and currency_code = #{currencyCode}
</if>
<if test="transactionId != null and transactionId != ''">
and transaction_id = #{transactionId}
</if>
<if test="memberId != null ">
and member_id = #{memberId}
</if>
<if test="platformCode != null and platformCode != ''">
and platform_code = #{platformCode}
</if>
<if test="balance != null ">
and balance = #{balance}
</if>
<if test="quota != null ">
and quota = #{quota}
</if>
<if test="coinBefore != null ">
and coin_before = #{coinBefore}
</if>
<if test="coinAfter != null ">
and coin_after = #{coinAfter}
</if>
<if test="currencyBefore != null ">
and currency_before = #{currencyBefore}
</if>
<if test="currencyAfter != null ">
and currency_after = #{currencyAfter}
</if>
<if test="exchangeType != null ">
and exchange_type = #{exchangeType}
</if>
<if test="status != null ">
and status = #{status}
</if>
<if test="params.beginTime != null">
AND create_time &gt;= #{params.beginTime}
</if>
<if test="params.endTime != null">
AND create_time &lt;= #{params.endTime}
</if>
</where>
</select>
<select id="selectGameExchangeMoneyDTOList" parameterType="com.ff.game.dto.GameExchangeMoneyDTO"
resultMap="GameExchangeMoneyDTOResult">
select e.id,
e.tenant_key,
e.currency_code,
e.transaction_id,
e.member_id,
e.platform_code,
e.balance,
e.quota,
e.coin_before,
e.coin_after,
e.currency_before,
e.currency_after,
e.exchange_type,
e.status,
e.order_id,
e.create_by,
e.create_time,
e.update_by,
e.update_time,
m.member_account,
m.game_account
from ff_game_exchange_money e
inner join ff_member m on e.member_id = m.id
<where>
<if test="tenantKey != null and tenantKey != ''">
and e.tenant_key = #{tenantKey}
</if>
<if test="orderId != null and orderId != ''">
and e.order_id = #{orderId}
</if>
<if test="currencyCode != null and currencyCode != ''">
and e.currency_code = #{currencyCode}
</if>
<if test="transactionId != null and transactionId != ''">
and e.transaction_id = #{transactionId}
</if>
<if test="memberId != null ">
and e.member_id = #{memberId}
</if>
<if test="platformCode != null and platformCode != ''">
and e.platform_code = #{platformCode}
</if>
<if test="balance != null ">
and e.balance = #{balance}
</if>
<if test="quota != null ">
and e.quota = #{quota}
</if>
<if test="coinBefore != null ">
and e.coin_before = #{coinBefore}
</if>
<if test="coinAfter != null ">
and e.coin_after = #{coinAfter}
</if>
<if test="currencyBefore != null ">
and e.currency_before = #{currencyBefore}
</if>
<if test="currencyAfter != null ">
and e.currency_after = #{currencyAfter}
</if>
<if test="exchangeType != null ">
and e.exchange_type = #{exchangeType}
</if>
<if test="status != null ">
and e.status = #{status}
</if>
<if test="params.beginTime != null">
AND e.create_time &gt;= #{params.beginTime}
</if>
<if test="params.endTime != null">
AND e.create_time &lt;= #{params.endTime}
</if>
<if test="memberAccount != null and memberAccount != ''">
AND m.member_account &lt;= #{memberAccount}
</if>
</where>
</select>
<select id="selectGameExchangeMoneyById" parameterType="Long" resultMap="GameExchangeMoneyResult">
<include refid="selectGameExchangeMoneyVo"/>
where id = #{id}
</select>
<insert id="insertGameExchangeMoney" parameterType="GameExchangeMoney" useGeneratedKeys="true" keyProperty="id">
insert into ff_game_exchange_money
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="tenantKey != null">
tenant_key,
</if>
<if test="currencyCode != null">
currency_code,
</if>
<if test="orderId != null">
order_id,
</if>
<if test="transactionId != null">
transaction_id,
</if>
<if test="memberId != null">
member_id,
</if>
<if test="platformCode != null">
platform_code,
</if>
<if test="balance != null">
balance,
</if>
<if test="quota != null">
quota,
</if>
<if test="coinBefore != null">
coin_before,
</if>
<if test="coinAfter != null">
coin_after,
</if>
<if test="currencyBefore != null">
currency_before,
</if>
<if test="currencyAfter != null">
currency_after,
</if>
<if test="exchangeType != null">
exchange_type,
</if>
<if test="status != null">
status,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id},
</if>
<if test="tenantKey != null">
#{tenantKey},
</if>
<if test="currencyCode != null">
#{currencyCode},
</if>
<if test="orderId != null">
#{orderId},
</if>
<if test="transactionId != null">
#{transactionId},
</if>
<if test="memberId != null">
#{memberId},
</if>
<if test="platformCode != null">
#{platformCode},
</if>
<if test="balance != null">
#{balance},
</if>
<if test="quota != null">
#{quota},
</if>
<if test="coinBefore != null">
#{coinBefore},
</if>
<if test="coinAfter != null">
#{coinAfter},
</if>
<if test="currencyBefore != null">
#{currencyBefore},
</if>
<if test="currencyAfter != null">
#{currencyAfter},
</if>
<if test="exchangeType != null">
#{exchangeType},
</if>
<if test="status != null">
#{status},
</if>
<if test="createBy != null">
#{createBy},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateBy != null">
#{updateBy},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
</trim>
</insert>
<update id="updateGameExchangeMoney" parameterType="GameExchangeMoney">
update ff_game_exchange_money
<trim prefix="SET" suffixOverrides=",">
<if test="tenantKey != null">
tenant_key = #{tenantKey},
</if>
<if test="currencyCode != null">
currency_code = #{currencyCode},
</if>
<if test="orderId != null">
order_id = #{orderId},
</if>
<if test="transactionId != null">
transaction_id = #{transactionId},
</if>
<if test="memberId != null">
member_id = #{memberId},
</if>
<if test="platformCode != null">
platform_code = #{platformCode},
</if>
<if test="balance != null">
balance = #{balance},
</if>
<if test="quota != null">
quota = #{quota},
</if>
<if test="coinBefore != null">
coin_before = #{coinBefore},
</if>
<if test="coinAfter != null">
coin_after = #{coinAfter},
</if>
<if test="currencyBefore != null">
currency_before = #{currencyBefore},
</if>
<if test="currencyAfter != null">
currency_after = #{currencyAfter},
</if>
<if test="exchangeType != null">
exchange_type = #{exchangeType},
</if>
<if test="status != null">
status = #{status},
</if>
<if test="createBy != null">
create_by = #{createBy},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateBy != null">
update_by = #{updateBy},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteGameExchangeMoneyById" parameterType="Long">
delete
from ff_game_exchange_money
where id = #{id}
</delete>
<delete id="deleteGameExchangeMoneyByIds" parameterType="String">
delete from ff_game_exchange_money where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>