课程自动复制

This commit is contained in:
limqhz
2022-02-08 23:17:22 +08:00
parent 083d4ebf80
commit a2adc8b62f
11 changed files with 130 additions and 5 deletions

View File

@@ -157,4 +157,6 @@ public interface VenueLessonMapper {
List<VenueLesson> getCopyLesson(@Param("venueId") Integer venueId,@Param("date") Date date);
void copyImg(@Param("id") Integer id,@Param("nId") Integer nId);
List<VenueLesson> findAllForCopy(@Param("leftTime") String leftTime, @Param("rightTime") String rightTime);
}

View File

@@ -156,4 +156,11 @@ public class DateUtilCard {
return calendar.getTime(); //这个时间就是日期往后推一天的结果
}
public static Date addDays(Date date,int days){
Calendar calendar = new GregorianCalendar();
calendar.setTime(date);
calendar.add(calendar.DATE,days); //把日期往后增加一天,整数 往后推,负数往前移动
return calendar.getTime(); //这个时间就是日期往后推一天的结果
}
}

View File

@@ -290,6 +290,15 @@ public class VenueLessonService extends BaseServiceImpl {
return pagination;
}
/**
* 查询场馆课程
*
* @return 需要拷贝的场馆课程
*/
public List<VenueLesson> findAllForCopy(String leftTime, String rightTime) {
return venueLessonMapper.findAllForCopy(leftTime, rightTime);
}
/**
* 查看教练有多少课程
* @param id

View File

@@ -670,4 +670,19 @@
)
</update>
<select id="findAllForCopy" resultMap="VenueLessonMap">
SELECT
<include refid="Field"></include>
FROM
<include refid="tableName"></include>
WHERE
deleted = 0
<if test="leftTime != null">
and date &gt;= #{leftTime}
</if>
<if test="rightTime != null">
and date &lt;= #{rightTime}
</if>
</select>
</mapper>

View File

@@ -30,6 +30,8 @@
<result column="deleted" property="deleted"/>
<result column="limit_day" property="limitDay"/>
<result column="limit_week" property="limitWeek"/>
<result column="copy_week" property="copyWeek"/>
<result column="copy_time" property="copyTime"/>
</resultMap>
<resultMap id="VenueDtoMap" type="com.sv.dto.api.VenueDTO">
@@ -54,6 +56,8 @@
<result column="deleted" property="deleted"/>
<result column="limit_day" property="limitDay"/>
<result column="limit_week" property="limitWeek"/>
<result column="copy_week" property="copyWeek"/>
<result column="copy_time" property="copyTime"/>
<result column="code_url" property="codeUrl"></result>
<association property="cards" select="com.sv.mapper.VenueCardMapper.findByVenueId"
column="{venueId = id,venueType=type}"></association>
@@ -111,7 +115,9 @@
code_url,
deleted,
limit_day,
limit_week
limit_week,
copy_week,
copy_time
</sql>
<!-- 字段值 -->
@@ -137,6 +143,8 @@
#{deleted, jdbcType=TINYINT}
#{limit_day, jdbcType=TINYINT}
#{limit_week, jdbcType=TINYINT}
#{copy_week, jdbcType=TINYINT}
#{copy_time, jdbcType=TIMESTAMP}
</sql>
<!-- 查询全部记录 -->
@@ -265,6 +273,12 @@
<if test="limitWeek != null">
limit_week,
</if>
<if test="copyWeek != null">
copy_week,
</if>
<if test="copyTime != null">
copy_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@@ -345,6 +359,12 @@
<if test="limitWeek != null">
#{limitWeek},
</if>
<if test="copyWeek != null">
#{copyWeek},
</if>
<if test="copyTime != null">
#{copyTime},
</if>
</trim>
</insert>
@@ -456,6 +476,12 @@
<if test="limitWeek != null">
limit_week = #{limitWeek},
</if>
<if test="copyWeek != null">
copy_week = #{copyWeek},
</if>
<if test="copyTime != null">
copy_time = #{copyTime},
</if>
</set>
WHERE id = #{id}
</update>
@@ -493,7 +519,9 @@
latitude,
card_content,
limit_day,
limit_week
limit_week,
copy_week,
copy_time
FROM
sv_venue
WHERE