30 lines
1.4 KiB
XML
30 lines
1.4 KiB
XML
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||
|
|
"https://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||
|
|
<mapper namespace="com.sb.web.billing.mapper.IapPurchaseMapper">
|
||
|
|
|
||
|
|
<resultMap id="iapResultMap" type="com.sb.web.billing.domain.IapPurchase">
|
||
|
|
<id property="id" column="id"/>
|
||
|
|
<result property="memberId" column="member_id"/>
|
||
|
|
<result property="platform" column="platform"/>
|
||
|
|
<result property="productId" column="product_id"/>
|
||
|
|
<result property="purchaseToken" column="purchase_token"/>
|
||
|
|
<result property="orderId" column="order_id"/>
|
||
|
|
<result property="status" column="status"/>
|
||
|
|
<result property="expiresAt" column="expires_at"/>
|
||
|
|
<result property="createdAt" column="created_at"/>
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<insert id="insert" parameterType="com.sb.web.billing.domain.IapPurchase"
|
||
|
|
useGeneratedKeys="true" keyProperty="id">
|
||
|
|
INSERT INTO iap_purchase (member_id, platform, product_id, purchase_token, order_id, status, expires_at, created_at)
|
||
|
|
VALUES (#{memberId}, #{platform}, #{productId}, #{purchaseToken}, #{orderId}, #{status}, #{expiresAt}, NOW())
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<select id="findByToken" resultMap="iapResultMap">
|
||
|
|
SELECT id, member_id, platform, product_id, purchase_token, order_id, status, expires_at, created_at
|
||
|
|
FROM iap_purchase WHERE purchase_token = #{purchaseToken}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
</mapper>
|