后端
ChannelController.java
@PreAuthorize("hasPermission('tienchin:channel:edit')") @GetMapping("/{channelId}") AjaxResult getInfo(@PathVariable Long channelId) { return AjaxResult.success(iChannelService.getById(channelId)); }
ActivityController.java
/** * 根据活动ID查询一个具体的活动信息 * * @param activityId 活动ID * @return {@link AjaxResult} */ @PreAuthorize("hasPermission('tienchin:activity:edit')") @GetMapping("/{activityId}") AjaxResult getInfo(@PathVariable Long activityId) { return AjaxResult.success(iActivityService.getActivityById(activityId)); }
IActivityService.java
/** * 根据活动ID查询一个具体的活动信息 * * @param activityId 活动ID * @return {@link ActivityVO} */ ActivityVO getActivityById(Long activityId);
ActivityServiceImpl.java
@Override public ActivityVO getActivityById(Long activityId) { Activity activity = getById(activityId); ActivityVO activityVO = new ActivityVO(); BeanUtils.copyProperties(activity, activityVO); return activityVO; }
<select id="selectActivityList" resultType="top.it6666.activity.domain.vo.ActivityVO"> SELECT ta.*, tc.channel_name FROM tienchin_activity ta, tienchin_channel tc WHERE ta.channel_id = tc.channel_id AND ta.del_flag = 0 AND tc.del_flag = 0 <if test="activityName != null and activityName != ''"> AND ta.activity_name LIKE CONCAT('%', #{activityName}, '%') </if> <if test="channelId != null"> AND tc.channel_id = #{channelId} </if> <if test="activityStatus != null"> AND ta.activity_status = #{activityStatus} </if> <if test="activityType != null"> AND ta.activity_type = #{activityType} </if> </select>