需求一:对每天的课设置预约次数的限制
需求二:对每周的预约次数进行次数限制 需求三:所有课程48小时内不能取消预约设置可配置
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
<result column="deleted" property="deleted"/>
|
||||
<result column="note" property="note"/>
|
||||
<result column="type" property="type"></result>
|
||||
<result column="order_limit" property="orderLimit"></result>
|
||||
</resultMap>
|
||||
<resultMap id="VenueLessonOrderDtoMap" type="com.sv.dto.api.VenueLessonDTO" extends="VenueLessonMap">
|
||||
<result column="address" property="address"/>
|
||||
@@ -70,7 +71,8 @@
|
||||
deleted,
|
||||
note,
|
||||
status,
|
||||
type
|
||||
type,
|
||||
order_limit
|
||||
</sql>
|
||||
|
||||
<!-- 字段值 -->
|
||||
@@ -96,6 +98,7 @@
|
||||
#{deleted, jdbcType=TINYINT},
|
||||
#{note, jdbcType=VARCHAR},
|
||||
#{status, jdbcType=INTEGER}
|
||||
#{orderLimit, jdbcType=INTEGER}
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部记录 -->
|
||||
@@ -177,6 +180,9 @@
|
||||
<if test="deleted != null">
|
||||
deleted,
|
||||
</if>
|
||||
<if test="orderLimit != null">
|
||||
order_limit,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
@@ -242,6 +248,9 @@
|
||||
<if test="deleted != null">
|
||||
#{deleted},
|
||||
</if>
|
||||
<if test="orderLimit != null">
|
||||
#{orderLimit},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -333,6 +342,9 @@
|
||||
<if test="note != null">
|
||||
note = #{note},
|
||||
</if>
|
||||
<if test="orderLimit != null">
|
||||
order_limit = #{orderLimit},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
@@ -487,6 +499,7 @@
|
||||
ve.latitude,
|
||||
ve.longitude,
|
||||
le.type,
|
||||
le.order_limit,
|
||||
ve.`name` AS venueName
|
||||
FROM
|
||||
sv_venue_lesson AS le
|
||||
@@ -508,7 +521,8 @@
|
||||
vl.price,
|
||||
vl.num,
|
||||
vl.sale_num,
|
||||
vl.note
|
||||
vl.note,
|
||||
vl.order_limit
|
||||
FROM
|
||||
sv_venue_lesson AS vl
|
||||
LEFT JOIN sv_venue AS ue ON vl.venue_id = ue.id
|
||||
|
||||
@@ -344,4 +344,40 @@
|
||||
lesson_id = #{venueId}
|
||||
AND deleted = 0
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
<select id="countFreeWeekLimit" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT(0)
|
||||
FROM
|
||||
sv_member_lesson_ticket t,sv_venue_lesson a
|
||||
WHERE
|
||||
t.lesson_id = a.id
|
||||
AND t.venue_id = #{venueId}
|
||||
AND a.type = 1
|
||||
AND t.deleted = 0
|
||||
AND t.status in (0,1,3)
|
||||
AND t.member_id = #{memberId}
|
||||
AND (CASE WHEN DAYNAME(CURDATE())='Sunday'
|
||||
THEN DATE_SUB(CURDATE(),INTERVAL 6 DAY)
|
||||
ELSE DATE_SUB(CURDATE(),INTERVAL DAYOFWEEK(CURDATE())-2 DAY) END) <![CDATA[ <= ]]> DATE(t.created_time)
|
||||
AND (CASE WHEN DAYNAME(CURDATE())='Sunday'
|
||||
THEN CURDATE()
|
||||
ELSE DATE_ADD(CURDATE(),INTERVAL 8-DAYOFWEEK(CURDATE()) DAY) END) <![CDATA[ >= ]]> DATE(t.created_time);
|
||||
</select>
|
||||
|
||||
<select id="countFreeDayLimit" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT(0)
|
||||
FROM
|
||||
sv_member_lesson_ticket t,sv_venue_lesson a
|
||||
WHERE
|
||||
t.lesson_id = a.id
|
||||
AND t.venue_id = #{venueId}
|
||||
AND a.type = 1
|
||||
AND t.deleted = 0
|
||||
AND t.status in (0,1,3)
|
||||
AND t.member_id = #{memberId}
|
||||
AND CURDATE() <![CDATA[ <= ]]> DATE(t.created_time)
|
||||
AND CURDATE() <![CDATA[ >= ]]> DATE(t.created_time);
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
<result column="modified_time" property="modifiedTime"/>
|
||||
<result column="code_url" property="codeUrl"></result>
|
||||
<result column="deleted" property="deleted"/>
|
||||
<result column="limit_day" property="limitDay"/>
|
||||
<result column="limit_week" property="limitWeek"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="VenueDtoMap" type="com.sv.dto.api.VenueDTO">
|
||||
@@ -50,6 +52,8 @@
|
||||
<result column="created_time" property="createdTime"/>
|
||||
<result column="modified_time" property="modifiedTime"/>
|
||||
<result column="deleted" property="deleted"/>
|
||||
<result column="limit_day" property="limitDay"/>
|
||||
<result column="limit_week" property="limitWeek"/>
|
||||
<result column="code_url" property="codeUrl"></result>
|
||||
<association property="cards" select="com.sv.mapper.VenueCardMapper.findByVenueId"
|
||||
column="{venueId = id,venueType=type}"></association>
|
||||
@@ -105,7 +109,9 @@
|
||||
created_time,
|
||||
modified_time,
|
||||
code_url,
|
||||
deleted
|
||||
deleted,
|
||||
limit_day,
|
||||
limit_week
|
||||
</sql>
|
||||
|
||||
<!-- 字段值 -->
|
||||
@@ -129,6 +135,8 @@
|
||||
#{createdTime, jdbcType=TIMESTAMP},
|
||||
#{modifiedTime, jdbcType=TIMESTAMP},
|
||||
#{deleted, jdbcType=TINYINT}
|
||||
#{limit_day, jdbcType=TINYINT}
|
||||
#{limit_week, jdbcType=TINYINT}
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部记录 -->
|
||||
@@ -251,6 +259,12 @@
|
||||
<if test="deleted != null">
|
||||
deleted,
|
||||
</if>
|
||||
<if test="limitDay != null">
|
||||
limit_day,
|
||||
</if>
|
||||
<if test="limitWeek != null">
|
||||
limit_week,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
@@ -325,6 +339,12 @@
|
||||
<if test="deleted != null">
|
||||
#{deleted},
|
||||
</if>
|
||||
<if test="limitDay != null">
|
||||
#{limitDay},
|
||||
</if>
|
||||
<if test="limitWeek != null">
|
||||
#{limitWeek},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -430,6 +450,12 @@
|
||||
<if test="codeUrl != null">
|
||||
code_url = #{codeUrl},
|
||||
</if>
|
||||
<if test="limitDay != null">
|
||||
limit_day = #{limitDay},
|
||||
</if>
|
||||
<if test="limitWeek != null">
|
||||
limit_week = #{limitWeek},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
@@ -465,7 +491,9 @@
|
||||
description,
|
||||
longitude,
|
||||
latitude,
|
||||
card_content
|
||||
card_content,
|
||||
limit_day,
|
||||
limit_week
|
||||
FROM
|
||||
sv_venue
|
||||
WHERE
|
||||
@@ -535,4 +563,4 @@
|
||||
<delete id="deleteMember">
|
||||
delete from sv_venue_member where member_id = #{memberId} and venue_id = #{venueId}
|
||||
</delete>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user