|
|
@@ -13,8 +13,8 @@
|
|
|
<result column="cut_down" jdbcType="INTEGER" property="cutDown" />
|
|
|
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
|
|
|
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
|
|
|
- <result column="effective" jdbcType="BIT" property="effective" />
|
|
|
- <result column="sharable" jdbcType="BIT" property="sharable" />
|
|
|
+ <result column="is_valid" jdbcType="BIT" property="valid" />
|
|
|
+ <result column="is_sharable" jdbcType="BIT" property="sharable" />
|
|
|
</resultMap>
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
delete from coupon
|
|
|
@@ -24,12 +24,12 @@
|
|
|
insert into coupon (id, type, name,
|
|
|
description, course_id, valid_user_id,
|
|
|
threshold, discount, cut_down,
|
|
|
- start_time, end_time, effective,
|
|
|
- sharable)
|
|
|
+ start_time, end_time, is_valid,
|
|
|
+ is_sharable)
|
|
|
values (#{id,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
|
|
|
#{description,jdbcType=VARCHAR}, #{courseId,jdbcType=INTEGER}, #{validUserId,jdbcType=INTEGER},
|
|
|
#{threshold,jdbcType=INTEGER}, #{discount,jdbcType=DOUBLE}, #{cutDown,jdbcType=INTEGER},
|
|
|
- #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{effective,jdbcType=BIT},
|
|
|
+ #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{valid,jdbcType=BIT},
|
|
|
#{sharable,jdbcType=BIT})
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKey" parameterType="cn.seecoder.courselearning.po.Coupon">
|
|
|
@@ -44,36 +44,30 @@
|
|
|
cut_down = #{cutDown,jdbcType=INTEGER},
|
|
|
start_time = #{startTime,jdbcType=TIMESTAMP},
|
|
|
end_time = #{endTime,jdbcType=TIMESTAMP},
|
|
|
- effective = #{effective,jdbcType=BIT},
|
|
|
- sharable = #{sharable,jdbcType=BIT}
|
|
|
+ is_valid = #{valid,jdbcType=BIT},
|
|
|
+ is_sharable = #{sharable,jdbcType=BIT}
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
select id, type, name, description, course_id, valid_user_id, threshold, discount, cut_down,
|
|
|
- start_time, end_time, effective, sharable
|
|
|
+ start_time, end_time, is_valid, is_sharable
|
|
|
from coupon
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
<select id="selectAll" resultMap="BaseResultMap">
|
|
|
select id, type, name, description, course_id, valid_user_id, threshold, discount, cut_down,
|
|
|
- start_time, end_time, effective, sharable
|
|
|
+ start_time, end_time, is_valid, is_sharable
|
|
|
from coupon
|
|
|
</select>
|
|
|
-<!-- <select id="selectAllCourseCoupon" parameterType="java.lang.Integer" resultMap="BaseResultMap">-->
|
|
|
-<!-- select id, type, name, description, course_id, valid_user_id, threshold, discount, cut_down,-->
|
|
|
-<!-- start_time, end_time, effective, sharable-->
|
|
|
-<!-- from coupon-->
|
|
|
-<!-- where (course_id = -1 or course_id = #{courseId,jdbcType=INTEGER}) and valid_user_id = -1-->
|
|
|
-<!-- </select>-->
|
|
|
<select id="selectByCourseIdAndUserId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
select id, type, name, description, course_id, valid_user_id, threshold, discount, cut_down,
|
|
|
- start_time, end_time, effective, sharable
|
|
|
+ start_time, end_time, is_valid, is_sharable
|
|
|
from coupon
|
|
|
where course_id = #{courseId,jdbcType=INTEGER} and valid_user_id = #{validUserId,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
<select id="selectByUserId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
select id, type, name, description, course_id, valid_user_id, threshold, discount, cut_down,
|
|
|
- start_time, end_time, effective, sharable
|
|
|
+ start_time, end_time, is_valid, is_sharable
|
|
|
from coupon
|
|
|
where valid_user_id = #{validUserId,jdbcType=INTEGER}
|
|
|
</select>
|