You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
2.7 KiB

<?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.example.demo.mapper.coin.WalletMapper">
<insert id="addUserWalletRecord">
insert into user_wallet_record(jwcode, wallet_id, type, amount, order_code, description, status)
values(#{jwcode}, #{walletId}, #{type}, #{amount}, #{orderCode}, #{description}, 1)
</insert>
<!-- 结果映射 -->
<resultMap id="WalletResult" type="com.example.demo.domain.entity.Wallet">
<id property="id" column="id"/>
<result property="walletName" column="wallet_name"/>
<result property="priority" column="priority"/>
</resultMap>
<resultMap id="UserRegionWalletResult" type="com.example.demo.domain.entity.UserRegionWallet">
<id property="id" column="id"/>
<result property="jwcode" column="jwcode"/>
<result property="walletId" column="wallet_id"/>
<result property="currentPermanentGold" column="current_permanent_gold"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<update id="updateWallet">
update user_region_wallet set current_permanent_gold = #{currentPermanentGold} where jwcode = #{jwcode} and wallet_id = #{walletId}
</update>
<update id="updateWalletRecord">
update user_wallet_record set status = 1 where id = #{id}
</update>
<select id="selectWallet" resultType="com.example.demo.domain.entity.UserRegionWallet">
select jwcode,
wallet_id,
current_permanent_gold
from user_region_wallet where jwcode = #{jwcode} and wallet_id = #{walletId}
</select>
<select id="selectWalletRecord" resultType="com.example.demo.domain.entity.UserWalletRecord">
select jwcode,
wallet_id,
type,
amount,
order_code,
description,
status,
id
from user_wallet_record where jwcode = #{jwcode} and order_code = #{orderCode}
</select>
<select id="MysqlConnection" resultType="com.example.demo.domain.entity.GOrder">
select id,
jwcode,
order_no,
type,
merchant_id,
price,
count,
pay_style
from g_order where id = #{linkId}
</select>
<!-- 查询所有钱包类型 -->
<select id="selectAllWallets" resultMap="WalletResult">
SELECT
id,
wallet_name,
priority
FROM wallet
ORDER BY priority ASC
</select>
</mapper>