|
@@ -12,6 +12,34 @@
|
|
<result property="isDelete" column="is_delete" jdbcType="INTEGER"/>
|
|
<result property="isDelete" column="is_delete" jdbcType="INTEGER"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <resultMap type="com.ylx.massage.domain.vo.CouponReceiveVo" id="CouponReceiveVoMap">
|
|
|
|
+ <result property="id" column="id" jdbcType="VARCHAR"/>
|
|
|
|
+ <result property="openid" column="openid" jdbcType="VARCHAR"/>
|
|
|
|
+ <result property="couponId" column="coupon_id" jdbcType="VARCHAR"/>
|
|
|
|
+ <result property="expirationTime" column="expiration_time" jdbcType="TIMESTAMP"/>
|
|
|
|
+ <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
|
|
+ <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
|
|
|
+ <result property="isDelete" column="is_delete" jdbcType="INTEGER"/>
|
|
|
|
+ <result property="name" column="name" jdbcType="VARCHAR"/>
|
|
|
|
+ <result property="type" column="type" jdbcType="INTEGER"/>
|
|
|
|
+ <result property="discountType" column="discount_type" jdbcType="INTEGER"/>
|
|
|
|
+ <result property="discountValue" column="discount_value" jdbcType="NUMERIC"/>
|
|
|
|
+ <result property="thresholdAmount" column="threshold_amount" jdbcType="NUMERIC"/>
|
|
|
|
+ <result property="obtainWay" column="obtain_way" jdbcType="INTEGER"/>
|
|
|
|
+ <result property="termDays" column="term_days" jdbcType="INTEGER"/>
|
|
|
|
+ <result property="status" column="status" jdbcType="INTEGER"/>
|
|
|
|
+ <result property="usedNum" column="used_num" jdbcType="INTEGER"/>
|
|
|
|
+ <result property="userLimit" column="user_limit" jdbcType="INTEGER"/>
|
|
|
|
+ <result property="extParam" column="ext_param" jdbcType="VARCHAR"/>
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <sql id="selectCouponReceiveVo">
|
|
|
|
+ a.id, a.openid, a.coupon_id, a.expiration_time, a.create_time, a.update_time, a.is_delete,
|
|
|
|
+ b.name, b.type, b.discount_type, b.discount_value, b.threshold_amount, b.obtain_way, b.term_days, b.status, b.used_num, b.user_limit, b.ext_param
|
|
|
|
+ </sql>
|
|
<!-- 批量插入 -->
|
|
<!-- 批量插入 -->
|
|
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
|
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
|
insert into ry-vue.coupon_receive(openidcoupon_idexpiration_timecreate_timeupdate_timeis_delete)
|
|
insert into ry-vue.coupon_receive(openidcoupon_idexpiration_timecreate_timeupdate_timeis_delete)
|
|
@@ -32,5 +60,15 @@
|
|
values(create_time) update_time = values(update_time) is_delete = values(is_delete)
|
|
values(create_time) update_time = values(update_time) is_delete = values(is_delete)
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
|
|
+ <select id="getByOpenId" resultMap="CouponReceiveVoMap">
|
|
|
|
+ SELECT
|
|
|
|
+ <include refid="selectCouponReceiveVo"/>
|
|
|
|
+ FROM coupon_receive a
|
|
|
|
+ LEFT JOIN coupon b ON a.coupon_id = b.id
|
|
|
|
+ WHERE a.is_delete = 0
|
|
|
|
+ AND b.is_delete = 0
|
|
|
|
+ and a.openid = #{openid}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
</mapper>
|
|
</mapper>
|
|
|
|
|