|
|
@@ -7,7 +7,7 @@
|
|
|
<result column="name" jdbcType="VARCHAR" property="name" />
|
|
|
<result column="description" jdbcType="VARCHAR" property="description" />
|
|
|
<result column="course_id" jdbcType="INTEGER" property="courseId" />
|
|
|
- <result column="user_id" jdbcType="INTEGER" property="userId" />
|
|
|
+ <result column="valid_user_id" jdbcType="INTEGER" property="validUserId" />
|
|
|
<result column="threshold" jdbcType="INTEGER" property="threshold" />
|
|
|
<result column="discount" jdbcType="DOUBLE" property="discount" />
|
|
|
<result column="cut_down" jdbcType="INTEGER" property="cutDown" />
|
|
|
@@ -22,12 +22,12 @@
|
|
|
</delete>
|
|
|
<insert id="insert" parameterType="cn.seecoder.courselearning.po.Coupon" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into coupon (id, type, name,
|
|
|
- description, course_id, user_id,
|
|
|
+ description, course_id, valid_user_id,
|
|
|
threshold, discount, cut_down,
|
|
|
start_time, end_time, effective,
|
|
|
sharable)
|
|
|
values (#{id,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
|
|
|
- #{description,jdbcType=VARCHAR}, #{courseId,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER},
|
|
|
+ #{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},
|
|
|
#{sharable,jdbcType=BIT})
|
|
|
@@ -38,7 +38,7 @@
|
|
|
name = #{name,jdbcType=VARCHAR},
|
|
|
description = #{description,jdbcType=VARCHAR},
|
|
|
course_id = #{courseId,jdbcType=INTEGER},
|
|
|
- user_id = #{userId,jdbcType=INTEGER},
|
|
|
+ valid_user_id = #{validUserId,jdbcType=INTEGER},
|
|
|
threshold = #{threshold,jdbcType=INTEGER},
|
|
|
discount = #{discount,jdbcType=DOUBLE},
|
|
|
cut_down = #{cutDown,jdbcType=INTEGER},
|
|
|
@@ -49,32 +49,32 @@
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
- select id, type, name, description, course_id, user_id, threshold, discount, cut_down,
|
|
|
+ select id, type, name, description, course_id, valid_user_id, threshold, discount, cut_down,
|
|
|
start_time, end_time, effective, sharable
|
|
|
from coupon
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
<select id="selectAll" resultMap="BaseResultMap">
|
|
|
- select id, type, name, description, course_id, user_id, threshold, discount, cut_down,
|
|
|
+ select id, type, name, description, course_id, valid_user_id, threshold, discount, cut_down,
|
|
|
start_time, end_time, effective, sharable
|
|
|
from coupon
|
|
|
</select>
|
|
|
<!-- <select id="selectAllCourseCoupon" parameterType="java.lang.Integer" resultMap="BaseResultMap">-->
|
|
|
-<!-- select id, type, name, description, course_id, user_id, threshold, discount, cut_down,-->
|
|
|
+<!-- 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 user_id = -1-->
|
|
|
+<!-- 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, user_id, threshold, discount, cut_down,
|
|
|
+ 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 = #{courseId,jdbcType=INTEGER} and user_id = #{userId,jdbcType=INTEGER}
|
|
|
+ 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, user_id, threshold, discount, cut_down,
|
|
|
+ select id, type, name, description, course_id, valid_user_id, threshold, discount, cut_down,
|
|
|
start_time, end_time, effective, sharable
|
|
|
from coupon
|
|
|
- where user_id = #{userId,jdbcType=INTEGER}
|
|
|
+ where valid_user_id = #{validUserId,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
</mapper>
|