提交代码

dev-discount
胡锐 3 years ago
parent 6ce150439e
commit d993484392
  1. 70
      hai-cweb/src/main/java/com/cweb/controller/HighActivityController.java
  2. 19
      hai-service/src/main/java/com/hai/dao/HighActivityAwardActualPrizeMapper.java
  3. 14
      hai-service/src/main/java/com/hai/dao/HighActivityAwardActualPrizeSqlProvider.java
  4. 23
      hai-service/src/main/java/com/hai/dao/HighActivityAwardMapper.java
  5. 14
      hai-service/src/main/java/com/hai/dao/HighActivityAwardSqlProvider.java
  6. 30
      hai-service/src/main/java/com/hai/dao/HighActivityInfoMapperExt.java
  7. 25
      hai-service/src/main/java/com/hai/dao/HighActivityPrizeMapper.java
  8. 14
      hai-service/src/main/java/com/hai/dao/HighActivityPrizeSqlProvider.java
  9. 16
      hai-service/src/main/java/com/hai/entity/HighActivityAward.java
  10. 16
      hai-service/src/main/java/com/hai/entity/HighActivityAwardActualPrize.java
  11. 60
      hai-service/src/main/java/com/hai/entity/HighActivityAwardActualPrizeExample.java
  12. 70
      hai-service/src/main/java/com/hai/entity/HighActivityAwardExample.java
  13. 18
      hai-service/src/main/java/com/hai/entity/HighActivityPrize.java
  14. 70
      hai-service/src/main/java/com/hai/entity/HighActivityPrizeExample.java
  15. 22
      hai-service/src/main/java/com/hai/service/HighActivityAwardService.java
  16. 7
      hai-service/src/main/java/com/hai/service/HighActivityInfoService.java
  17. 24
      hai-service/src/main/java/com/hai/service/impl/HighActivityAwardServiceImpl.java
  18. 5
      hai-service/src/main/java/com/hai/service/impl/HighActivityInfoServiceImpl.java

@ -0,0 +1,70 @@
package com.cweb.controller;
import com.github.pagehelper.PageInfo;
import com.hai.common.utils.CoordCommonUtil;
import com.hai.common.utils.PageUtil;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.HighActivityAward;
import com.hai.entity.HighActivityInfo;
import com.hai.entity.HighGasDiscountOilPrice;
import com.hai.entity.SecRegion;
import com.hai.model.ResponseData;
import com.hai.service.HighActivityAwardService;
import com.hai.service.HighActivityInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
/**
*
* @author hurui
*/
@Controller
@RequestMapping(value = "/activity")
@Api(value = "活动业务接口")
public class HighActivityController {
private static Logger log = LoggerFactory.getLogger(HighActivityController.class);
@Resource
private HighActivityInfoService highActivityInfoService;
@Resource
private HighActivityAwardService highActivityAwardService;
@RequestMapping(value="/getActivityByCoupon",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据卡券查询活动信息")
public ResponseData getActivityByCoupon(@RequestParam(name = "couponId", required = true) Long couponId) {
try {
// 查询活动
Map<String, Object> activity = highActivityInfoService.getNewActivityByCouponId(couponId);
if (activity != null) {
Map<String,Object> map = new HashMap<>();
map.put("activityInfo", activity);
map.put("activityAward", highActivityAwardService.getListByActivityId(MapUtils.getLong(activity, "id")));
return ResponseMsgUtil.success(map);
}
return ResponseMsgUtil.success(null);
} catch (Exception e) {
log.error("HighActivityController -> getActivityByCoupon() error!",e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -40,13 +40,13 @@ public interface HighActivityAwardActualPrizeMapper extends HighActivityAwardAct
@Insert({
"insert into high_activity_award_actual_prize (activity_award_prize_id, activity_award_serial_num_id, ",
"actual_prize_id, `status`, ",
"create_time, ext_1, ",
"ext_2, ext_3)",
"actual_prize_type, actual_prize_id, ",
"`status`, create_time, ",
"ext_1, ext_2, ext_3)",
"values (#{activityAwardPrizeId,jdbcType=BIGINT}, #{activityAwardSerialNumId,jdbcType=BIGINT}, ",
"#{actualPrizeId,jdbcType=BIGINT}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{actualPrizeType,jdbcType=INTEGER}, #{actualPrizeId,jdbcType=BIGINT}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighActivityAwardActualPrize record);
@ -60,6 +60,7 @@ public interface HighActivityAwardActualPrizeMapper extends HighActivityAwardAct
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="activity_award_prize_id", property="activityAwardPrizeId", jdbcType=JdbcType.BIGINT),
@Result(column="activity_award_serial_num_id", property="activityAwardSerialNumId", jdbcType=JdbcType.BIGINT),
@Result(column="actual_prize_type", property="actualPrizeType", jdbcType=JdbcType.INTEGER),
@Result(column="actual_prize_id", property="actualPrizeId", jdbcType=JdbcType.BIGINT),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@ -71,8 +72,8 @@ public interface HighActivityAwardActualPrizeMapper extends HighActivityAwardAct
@Select({
"select",
"id, activity_award_prize_id, activity_award_serial_num_id, actual_prize_id, ",
"`status`, create_time, ext_1, ext_2, ext_3",
"id, activity_award_prize_id, activity_award_serial_num_id, actual_prize_type, ",
"actual_prize_id, `status`, create_time, ext_1, ext_2, ext_3",
"from high_activity_award_actual_prize",
"where id = #{id,jdbcType=BIGINT}"
})
@ -80,6 +81,7 @@ public interface HighActivityAwardActualPrizeMapper extends HighActivityAwardAct
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="activity_award_prize_id", property="activityAwardPrizeId", jdbcType=JdbcType.BIGINT),
@Result(column="activity_award_serial_num_id", property="activityAwardSerialNumId", jdbcType=JdbcType.BIGINT),
@Result(column="actual_prize_type", property="actualPrizeType", jdbcType=JdbcType.INTEGER),
@Result(column="actual_prize_id", property="actualPrizeId", jdbcType=JdbcType.BIGINT),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@ -102,6 +104,7 @@ public interface HighActivityAwardActualPrizeMapper extends HighActivityAwardAct
"update high_activity_award_actual_prize",
"set activity_award_prize_id = #{activityAwardPrizeId,jdbcType=BIGINT},",
"activity_award_serial_num_id = #{activityAwardSerialNumId,jdbcType=BIGINT},",
"actual_prize_type = #{actualPrizeType,jdbcType=INTEGER},",
"actual_prize_id = #{actualPrizeId,jdbcType=BIGINT},",
"`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",

@ -36,6 +36,10 @@ public class HighActivityAwardActualPrizeSqlProvider {
sql.VALUES("activity_award_serial_num_id", "#{activityAwardSerialNumId,jdbcType=BIGINT}");
}
if (record.getActualPrizeType() != null) {
sql.VALUES("actual_prize_type", "#{actualPrizeType,jdbcType=INTEGER}");
}
if (record.getActualPrizeId() != null) {
sql.VALUES("actual_prize_id", "#{actualPrizeId,jdbcType=BIGINT}");
}
@ -72,6 +76,7 @@ public class HighActivityAwardActualPrizeSqlProvider {
}
sql.SELECT("activity_award_prize_id");
sql.SELECT("activity_award_serial_num_id");
sql.SELECT("actual_prize_type");
sql.SELECT("actual_prize_id");
sql.SELECT("`status`");
sql.SELECT("create_time");
@ -107,6 +112,10 @@ public class HighActivityAwardActualPrizeSqlProvider {
sql.SET("activity_award_serial_num_id = #{record.activityAwardSerialNumId,jdbcType=BIGINT}");
}
if (record.getActualPrizeType() != null) {
sql.SET("actual_prize_type = #{record.actualPrizeType,jdbcType=INTEGER}");
}
if (record.getActualPrizeId() != null) {
sql.SET("actual_prize_id = #{record.actualPrizeId,jdbcType=BIGINT}");
}
@ -142,6 +151,7 @@ public class HighActivityAwardActualPrizeSqlProvider {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("activity_award_prize_id = #{record.activityAwardPrizeId,jdbcType=BIGINT}");
sql.SET("activity_award_serial_num_id = #{record.activityAwardSerialNumId,jdbcType=BIGINT}");
sql.SET("actual_prize_type = #{record.actualPrizeType,jdbcType=INTEGER}");
sql.SET("actual_prize_id = #{record.actualPrizeId,jdbcType=BIGINT}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
@ -166,6 +176,10 @@ public class HighActivityAwardActualPrizeSqlProvider {
sql.SET("activity_award_serial_num_id = #{activityAwardSerialNumId,jdbcType=BIGINT}");
}
if (record.getActualPrizeType() != null) {
sql.SET("actual_prize_type = #{actualPrizeType,jdbcType=INTEGER}");
}
if (record.getActualPrizeId() != null) {
sql.SET("actual_prize_id = #{actualPrizeId,jdbcType=BIGINT}");
}

@ -39,14 +39,14 @@ public interface HighActivityAwardMapper extends HighActivityAwardMapperExt {
int deleteByPrimaryKey(Long id);
@Insert({
"insert into high_activity_award (activity_info_id, `name`, ",
"num, `status`, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{activityInfoId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, ",
"#{num,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"insert into high_activity_award (activity_info_id, img, ",
"`name`, num, `status`, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{activityInfoId,jdbcType=BIGINT}, #{img,jdbcType=VARCHAR}, ",
"#{name,jdbcType=VARCHAR}, #{num,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighActivityAward record);
@ -59,6 +59,7 @@ public interface HighActivityAwardMapper extends HighActivityAwardMapperExt {
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="activity_info_id", property="activityInfoId", jdbcType=JdbcType.BIGINT),
@Result(column="img", property="img", jdbcType=JdbcType.VARCHAR),
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
@Result(column="num", property="num", jdbcType=JdbcType.INTEGER),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@ -72,14 +73,15 @@ public interface HighActivityAwardMapper extends HighActivityAwardMapperExt {
@Select({
"select",
"id, activity_info_id, `name`, num, `status`, create_time, update_time, ext_1, ",
"ext_2, ext_3",
"id, activity_info_id, img, `name`, num, `status`, create_time, update_time, ",
"ext_1, ext_2, ext_3",
"from high_activity_award",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="activity_info_id", property="activityInfoId", jdbcType=JdbcType.BIGINT),
@Result(column="img", property="img", jdbcType=JdbcType.VARCHAR),
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
@Result(column="num", property="num", jdbcType=JdbcType.INTEGER),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@ -103,6 +105,7 @@ public interface HighActivityAwardMapper extends HighActivityAwardMapperExt {
@Update({
"update high_activity_award",
"set activity_info_id = #{activityInfoId,jdbcType=BIGINT},",
"img = #{img,jdbcType=VARCHAR},",
"`name` = #{name,jdbcType=VARCHAR},",
"num = #{num,jdbcType=INTEGER},",
"`status` = #{status,jdbcType=INTEGER},",

@ -32,6 +32,10 @@ public class HighActivityAwardSqlProvider {
sql.VALUES("activity_info_id", "#{activityInfoId,jdbcType=BIGINT}");
}
if (record.getImg() != null) {
sql.VALUES("img", "#{img,jdbcType=VARCHAR}");
}
if (record.getName() != null) {
sql.VALUES("`name`", "#{name,jdbcType=VARCHAR}");
}
@ -75,6 +79,7 @@ public class HighActivityAwardSqlProvider {
sql.SELECT("id");
}
sql.SELECT("activity_info_id");
sql.SELECT("img");
sql.SELECT("`name`");
sql.SELECT("num");
sql.SELECT("`status`");
@ -108,6 +113,10 @@ public class HighActivityAwardSqlProvider {
sql.SET("activity_info_id = #{record.activityInfoId,jdbcType=BIGINT}");
}
if (record.getImg() != null) {
sql.SET("img = #{record.img,jdbcType=VARCHAR}");
}
if (record.getName() != null) {
sql.SET("`name` = #{record.name,jdbcType=VARCHAR}");
}
@ -150,6 +159,7 @@ public class HighActivityAwardSqlProvider {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("activity_info_id = #{record.activityInfoId,jdbcType=BIGINT}");
sql.SET("img = #{record.img,jdbcType=VARCHAR}");
sql.SET("`name` = #{record.name,jdbcType=VARCHAR}");
sql.SET("num = #{record.num,jdbcType=INTEGER}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
@ -172,6 +182,10 @@ public class HighActivityAwardSqlProvider {
sql.SET("activity_info_id = #{activityInfoId,jdbcType=BIGINT}");
}
if (record.getImg() != null) {
sql.SET("img = #{img,jdbcType=VARCHAR}");
}
if (record.getName() != null) {
sql.SET("`name` = #{name,jdbcType=VARCHAR}");
}

@ -1,7 +1,35 @@
package com.hai.dao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.Map;
/**
* mapper扩展类
*/
public interface HighActivityInfoMapperExt {
}
@Select(
" SELECT" +
" b.*" +
" FROM" +
" high_activity_partake_rule a," +
" high_activity_info b" +
" WHERE" +
" a.activity_info_id = b.id " +
" AND a.product_type = 1 " +
" AND a.product_id = 23423538 " +
" AND b.`status` = 2" +
" AND NOW() >= b.start_time " +
" AND NOW() <= b.end_time" +
" ORDER BY create_time desc" +
" LIMIT 1"
)
/**
* 根据卡券查询最新一条活动信息
* @param couponId 卡券id
* @return
*/
Map<String,Object> selectNewActivityByCouponId(@Param("couponId") Long couponId);
}

@ -40,15 +40,17 @@ public interface HighActivityPrizeMapper extends HighActivityPrizeMapperExt {
@Insert({
"insert into high_activity_prize (activity_award_id, prize_type, ",
"prize_id, prize_name, ",
"prize_num, `status`, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"prize_id, prize_img, ",
"prize_name, prize_num, ",
"`status`, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{activityAwardId,jdbcType=BIGINT}, #{prizeType,jdbcType=INTEGER}, ",
"#{prizeId,jdbcType=BIGINT}, #{prizeName,jdbcType=VARCHAR}, ",
"#{prizeNum,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{prizeId,jdbcType=BIGINT}, #{prizeImg,jdbcType=VARCHAR}, ",
"#{prizeName,jdbcType=VARCHAR}, #{prizeNum,jdbcType=INTEGER}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighActivityPrize record);
@ -63,6 +65,7 @@ public interface HighActivityPrizeMapper extends HighActivityPrizeMapperExt {
@Result(column="activity_award_id", property="activityAwardId", jdbcType=JdbcType.BIGINT),
@Result(column="prize_type", property="prizeType", jdbcType=JdbcType.INTEGER),
@Result(column="prize_id", property="prizeId", jdbcType=JdbcType.BIGINT),
@Result(column="prize_img", property="prizeImg", jdbcType=JdbcType.VARCHAR),
@Result(column="prize_name", property="prizeName", jdbcType=JdbcType.VARCHAR),
@Result(column="prize_num", property="prizeNum", jdbcType=JdbcType.INTEGER),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@ -76,8 +79,8 @@ public interface HighActivityPrizeMapper extends HighActivityPrizeMapperExt {
@Select({
"select",
"id, activity_award_id, prize_type, prize_id, prize_name, prize_num, `status`, ",
"create_time, update_time, ext_1, ext_2, ext_3",
"id, activity_award_id, prize_type, prize_id, prize_img, prize_name, prize_num, ",
"`status`, create_time, update_time, ext_1, ext_2, ext_3",
"from high_activity_prize",
"where id = #{id,jdbcType=BIGINT}"
})
@ -86,6 +89,7 @@ public interface HighActivityPrizeMapper extends HighActivityPrizeMapperExt {
@Result(column="activity_award_id", property="activityAwardId", jdbcType=JdbcType.BIGINT),
@Result(column="prize_type", property="prizeType", jdbcType=JdbcType.INTEGER),
@Result(column="prize_id", property="prizeId", jdbcType=JdbcType.BIGINT),
@Result(column="prize_img", property="prizeImg", jdbcType=JdbcType.VARCHAR),
@Result(column="prize_name", property="prizeName", jdbcType=JdbcType.VARCHAR),
@Result(column="prize_num", property="prizeNum", jdbcType=JdbcType.INTEGER),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@ -111,6 +115,7 @@ public interface HighActivityPrizeMapper extends HighActivityPrizeMapperExt {
"set activity_award_id = #{activityAwardId,jdbcType=BIGINT},",
"prize_type = #{prizeType,jdbcType=INTEGER},",
"prize_id = #{prizeId,jdbcType=BIGINT},",
"prize_img = #{prizeImg,jdbcType=VARCHAR},",
"prize_name = #{prizeName,jdbcType=VARCHAR},",
"prize_num = #{prizeNum,jdbcType=INTEGER},",
"`status` = #{status,jdbcType=INTEGER},",

@ -40,6 +40,10 @@ public class HighActivityPrizeSqlProvider {
sql.VALUES("prize_id", "#{prizeId,jdbcType=BIGINT}");
}
if (record.getPrizeImg() != null) {
sql.VALUES("prize_img", "#{prizeImg,jdbcType=VARCHAR}");
}
if (record.getPrizeName() != null) {
sql.VALUES("prize_name", "#{prizeName,jdbcType=VARCHAR}");
}
@ -85,6 +89,7 @@ public class HighActivityPrizeSqlProvider {
sql.SELECT("activity_award_id");
sql.SELECT("prize_type");
sql.SELECT("prize_id");
sql.SELECT("prize_img");
sql.SELECT("prize_name");
sql.SELECT("prize_num");
sql.SELECT("`status`");
@ -126,6 +131,10 @@ public class HighActivityPrizeSqlProvider {
sql.SET("prize_id = #{record.prizeId,jdbcType=BIGINT}");
}
if (record.getPrizeImg() != null) {
sql.SET("prize_img = #{record.prizeImg,jdbcType=VARCHAR}");
}
if (record.getPrizeName() != null) {
sql.SET("prize_name = #{record.prizeName,jdbcType=VARCHAR}");
}
@ -170,6 +179,7 @@ public class HighActivityPrizeSqlProvider {
sql.SET("activity_award_id = #{record.activityAwardId,jdbcType=BIGINT}");
sql.SET("prize_type = #{record.prizeType,jdbcType=INTEGER}");
sql.SET("prize_id = #{record.prizeId,jdbcType=BIGINT}");
sql.SET("prize_img = #{record.prizeImg,jdbcType=VARCHAR}");
sql.SET("prize_name = #{record.prizeName,jdbcType=VARCHAR}");
sql.SET("prize_num = #{record.prizeNum,jdbcType=INTEGER}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
@ -200,6 +210,10 @@ public class HighActivityPrizeSqlProvider {
sql.SET("prize_id = #{prizeId,jdbcType=BIGINT}");
}
if (record.getPrizeImg() != null) {
sql.SET("prize_img = #{prizeImg,jdbcType=VARCHAR}");
}
if (record.getPrizeName() != null) {
sql.SET("prize_name = #{prizeName,jdbcType=VARCHAR}");
}

@ -23,6 +23,11 @@ public class HighActivityAward implements Serializable {
*/
private Long activityInfoId;
/**
* 奖励图片
*/
private String img;
/**
* 奖励名称
*/
@ -72,6 +77,14 @@ public class HighActivityAward implements Serializable {
this.activityInfoId = activityInfoId;
}
public String getImg() {
return img;
}
public void setImg(String img) {
this.img = img;
}
public String getName() {
return name;
}
@ -150,6 +163,7 @@ public class HighActivityAward implements Serializable {
HighActivityAward other = (HighActivityAward) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getActivityInfoId() == null ? other.getActivityInfoId() == null : this.getActivityInfoId().equals(other.getActivityInfoId()))
&& (this.getImg() == null ? other.getImg() == null : this.getImg().equals(other.getImg()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
&& (this.getNum() == null ? other.getNum() == null : this.getNum().equals(other.getNum()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
@ -166,6 +180,7 @@ public class HighActivityAward implements Serializable {
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getActivityInfoId() == null) ? 0 : getActivityInfoId().hashCode());
result = prime * result + ((getImg() == null) ? 0 : getImg().hashCode());
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
result = prime * result + ((getNum() == null) ? 0 : getNum().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
@ -185,6 +200,7 @@ public class HighActivityAward implements Serializable {
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", activityInfoId=").append(activityInfoId);
sb.append(", img=").append(img);
sb.append(", name=").append(name);
sb.append(", num=").append(num);
sb.append(", status=").append(status);

@ -28,6 +28,11 @@ public class HighActivityAwardActualPrize implements Serializable {
*/
private Long activityAwardSerialNumId;
/**
* 实际奖品类型 1卡券 2优惠券
*/
private Integer actualPrizeType;
/**
* 实际奖品id 例如奖品为卡券 实际奖品是卡券核销码
*/
@ -75,6 +80,14 @@ public class HighActivityAwardActualPrize implements Serializable {
this.activityAwardSerialNumId = activityAwardSerialNumId;
}
public Integer getActualPrizeType() {
return actualPrizeType;
}
public void setActualPrizeType(Integer actualPrizeType) {
this.actualPrizeType = actualPrizeType;
}
public Long getActualPrizeId() {
return actualPrizeId;
}
@ -138,6 +151,7 @@ public class HighActivityAwardActualPrize implements Serializable {
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getActivityAwardPrizeId() == null ? other.getActivityAwardPrizeId() == null : this.getActivityAwardPrizeId().equals(other.getActivityAwardPrizeId()))
&& (this.getActivityAwardSerialNumId() == null ? other.getActivityAwardSerialNumId() == null : this.getActivityAwardSerialNumId().equals(other.getActivityAwardSerialNumId()))
&& (this.getActualPrizeType() == null ? other.getActualPrizeType() == null : this.getActualPrizeType().equals(other.getActualPrizeType()))
&& (this.getActualPrizeId() == null ? other.getActualPrizeId() == null : this.getActualPrizeId().equals(other.getActualPrizeId()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
@ -153,6 +167,7 @@ public class HighActivityAwardActualPrize implements Serializable {
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getActivityAwardPrizeId() == null) ? 0 : getActivityAwardPrizeId().hashCode());
result = prime * result + ((getActivityAwardSerialNumId() == null) ? 0 : getActivityAwardSerialNumId().hashCode());
result = prime * result + ((getActualPrizeType() == null) ? 0 : getActualPrizeType().hashCode());
result = prime * result + ((getActualPrizeId() == null) ? 0 : getActualPrizeId().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
@ -171,6 +186,7 @@ public class HighActivityAwardActualPrize implements Serializable {
sb.append(", id=").append(id);
sb.append(", activityAwardPrizeId=").append(activityAwardPrizeId);
sb.append(", activityAwardSerialNumId=").append(activityAwardSerialNumId);
sb.append(", actualPrizeType=").append(actualPrizeType);
sb.append(", actualPrizeId=").append(actualPrizeId);
sb.append(", status=").append(status);
sb.append(", createTime=").append(createTime);

@ -305,6 +305,66 @@ public class HighActivityAwardActualPrizeExample {
return (Criteria) this;
}
public Criteria andActualPrizeTypeIsNull() {
addCriterion("actual_prize_type is null");
return (Criteria) this;
}
public Criteria andActualPrizeTypeIsNotNull() {
addCriterion("actual_prize_type is not null");
return (Criteria) this;
}
public Criteria andActualPrizeTypeEqualTo(Integer value) {
addCriterion("actual_prize_type =", value, "actualPrizeType");
return (Criteria) this;
}
public Criteria andActualPrizeTypeNotEqualTo(Integer value) {
addCriterion("actual_prize_type <>", value, "actualPrizeType");
return (Criteria) this;
}
public Criteria andActualPrizeTypeGreaterThan(Integer value) {
addCriterion("actual_prize_type >", value, "actualPrizeType");
return (Criteria) this;
}
public Criteria andActualPrizeTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("actual_prize_type >=", value, "actualPrizeType");
return (Criteria) this;
}
public Criteria andActualPrizeTypeLessThan(Integer value) {
addCriterion("actual_prize_type <", value, "actualPrizeType");
return (Criteria) this;
}
public Criteria andActualPrizeTypeLessThanOrEqualTo(Integer value) {
addCriterion("actual_prize_type <=", value, "actualPrizeType");
return (Criteria) this;
}
public Criteria andActualPrizeTypeIn(List<Integer> values) {
addCriterion("actual_prize_type in", values, "actualPrizeType");
return (Criteria) this;
}
public Criteria andActualPrizeTypeNotIn(List<Integer> values) {
addCriterion("actual_prize_type not in", values, "actualPrizeType");
return (Criteria) this;
}
public Criteria andActualPrizeTypeBetween(Integer value1, Integer value2) {
addCriterion("actual_prize_type between", value1, value2, "actualPrizeType");
return (Criteria) this;
}
public Criteria andActualPrizeTypeNotBetween(Integer value1, Integer value2) {
addCriterion("actual_prize_type not between", value1, value2, "actualPrizeType");
return (Criteria) this;
}
public Criteria andActualPrizeIdIsNull() {
addCriterion("actual_prize_id is null");
return (Criteria) this;

@ -245,6 +245,76 @@ public class HighActivityAwardExample {
return (Criteria) this;
}
public Criteria andImgIsNull() {
addCriterion("img is null");
return (Criteria) this;
}
public Criteria andImgIsNotNull() {
addCriterion("img is not null");
return (Criteria) this;
}
public Criteria andImgEqualTo(String value) {
addCriterion("img =", value, "img");
return (Criteria) this;
}
public Criteria andImgNotEqualTo(String value) {
addCriterion("img <>", value, "img");
return (Criteria) this;
}
public Criteria andImgGreaterThan(String value) {
addCriterion("img >", value, "img");
return (Criteria) this;
}
public Criteria andImgGreaterThanOrEqualTo(String value) {
addCriterion("img >=", value, "img");
return (Criteria) this;
}
public Criteria andImgLessThan(String value) {
addCriterion("img <", value, "img");
return (Criteria) this;
}
public Criteria andImgLessThanOrEqualTo(String value) {
addCriterion("img <=", value, "img");
return (Criteria) this;
}
public Criteria andImgLike(String value) {
addCriterion("img like", value, "img");
return (Criteria) this;
}
public Criteria andImgNotLike(String value) {
addCriterion("img not like", value, "img");
return (Criteria) this;
}
public Criteria andImgIn(List<String> values) {
addCriterion("img in", values, "img");
return (Criteria) this;
}
public Criteria andImgNotIn(List<String> values) {
addCriterion("img not in", values, "img");
return (Criteria) this;
}
public Criteria andImgBetween(String value1, String value2) {
addCriterion("img between", value1, value2, "img");
return (Criteria) this;
}
public Criteria andImgNotBetween(String value1, String value2) {
addCriterion("img not between", value1, value2, "img");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("`name` is null");
return (Criteria) this;

@ -24,7 +24,7 @@ public class HighActivityPrize implements Serializable {
private Long activityAwardId;
/**
* 奖品类型 1:卡券
* 奖品类型 1:卡券 2优惠券
*/
private Integer prizeType;
@ -33,6 +33,11 @@ public class HighActivityPrize implements Serializable {
*/
private Long prizeId;
/**
* 奖品图片
*/
private String prizeImg;
/**
* 奖品名称
*/
@ -98,6 +103,14 @@ public class HighActivityPrize implements Serializable {
this.prizeId = prizeId;
}
public String getPrizeImg() {
return prizeImg;
}
public void setPrizeImg(String prizeImg) {
this.prizeImg = prizeImg;
}
public String getPrizeName() {
return prizeName;
}
@ -178,6 +191,7 @@ public class HighActivityPrize implements Serializable {
&& (this.getActivityAwardId() == null ? other.getActivityAwardId() == null : this.getActivityAwardId().equals(other.getActivityAwardId()))
&& (this.getPrizeType() == null ? other.getPrizeType() == null : this.getPrizeType().equals(other.getPrizeType()))
&& (this.getPrizeId() == null ? other.getPrizeId() == null : this.getPrizeId().equals(other.getPrizeId()))
&& (this.getPrizeImg() == null ? other.getPrizeImg() == null : this.getPrizeImg().equals(other.getPrizeImg()))
&& (this.getPrizeName() == null ? other.getPrizeName() == null : this.getPrizeName().equals(other.getPrizeName()))
&& (this.getPrizeNum() == null ? other.getPrizeNum() == null : this.getPrizeNum().equals(other.getPrizeNum()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
@ -196,6 +210,7 @@ public class HighActivityPrize implements Serializable {
result = prime * result + ((getActivityAwardId() == null) ? 0 : getActivityAwardId().hashCode());
result = prime * result + ((getPrizeType() == null) ? 0 : getPrizeType().hashCode());
result = prime * result + ((getPrizeId() == null) ? 0 : getPrizeId().hashCode());
result = prime * result + ((getPrizeImg() == null) ? 0 : getPrizeImg().hashCode());
result = prime * result + ((getPrizeName() == null) ? 0 : getPrizeName().hashCode());
result = prime * result + ((getPrizeNum() == null) ? 0 : getPrizeNum().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
@ -217,6 +232,7 @@ public class HighActivityPrize implements Serializable {
sb.append(", activityAwardId=").append(activityAwardId);
sb.append(", prizeType=").append(prizeType);
sb.append(", prizeId=").append(prizeId);
sb.append(", prizeImg=").append(prizeImg);
sb.append(", prizeName=").append(prizeName);
sb.append(", prizeNum=").append(prizeNum);
sb.append(", status=").append(status);

@ -365,6 +365,76 @@ public class HighActivityPrizeExample {
return (Criteria) this;
}
public Criteria andPrizeImgIsNull() {
addCriterion("prize_img is null");
return (Criteria) this;
}
public Criteria andPrizeImgIsNotNull() {
addCriterion("prize_img is not null");
return (Criteria) this;
}
public Criteria andPrizeImgEqualTo(String value) {
addCriterion("prize_img =", value, "prizeImg");
return (Criteria) this;
}
public Criteria andPrizeImgNotEqualTo(String value) {
addCriterion("prize_img <>", value, "prizeImg");
return (Criteria) this;
}
public Criteria andPrizeImgGreaterThan(String value) {
addCriterion("prize_img >", value, "prizeImg");
return (Criteria) this;
}
public Criteria andPrizeImgGreaterThanOrEqualTo(String value) {
addCriterion("prize_img >=", value, "prizeImg");
return (Criteria) this;
}
public Criteria andPrizeImgLessThan(String value) {
addCriterion("prize_img <", value, "prizeImg");
return (Criteria) this;
}
public Criteria andPrizeImgLessThanOrEqualTo(String value) {
addCriterion("prize_img <=", value, "prizeImg");
return (Criteria) this;
}
public Criteria andPrizeImgLike(String value) {
addCriterion("prize_img like", value, "prizeImg");
return (Criteria) this;
}
public Criteria andPrizeImgNotLike(String value) {
addCriterion("prize_img not like", value, "prizeImg");
return (Criteria) this;
}
public Criteria andPrizeImgIn(List<String> values) {
addCriterion("prize_img in", values, "prizeImg");
return (Criteria) this;
}
public Criteria andPrizeImgNotIn(List<String> values) {
addCriterion("prize_img not in", values, "prizeImg");
return (Criteria) this;
}
public Criteria andPrizeImgBetween(String value1, String value2) {
addCriterion("prize_img between", value1, value2, "prizeImg");
return (Criteria) this;
}
public Criteria andPrizeImgNotBetween(String value1, String value2) {
addCriterion("prize_img not between", value1, value2, "prizeImg");
return (Criteria) this;
}
public Criteria andPrizeNameIsNull() {
addCriterion("prize_name is null");
return (Criteria) this;

@ -0,0 +1,22 @@
package com.hai.service;
import com.hai.entity.HighActivityAward;
import java.util.List;
/**
* 活动奖励
* @author hurui
*/
public interface HighActivityAwardService {
/**
* 根据活动信息查询
* @param activityId 活动基本信息
* @return
*/
List<HighActivityAward> getListByActivityId(Long activityId);
}

@ -39,4 +39,11 @@ public interface HighActivityInfoService {
*/
List<HighActivityInfo> getList(Map<String, Object> param);
/**
* 根据卡券查询最新一条活动信息
* @param couponId 卡券id
* @return
*/
Map<String, Object> getNewActivityByCouponId(Long couponId);
}

@ -0,0 +1,24 @@
package com.hai.service.impl;
import com.hai.dao.HighActivityAwardMapper;
import com.hai.entity.HighActivityAward;
import com.hai.entity.HighActivityAwardExample;
import com.hai.service.HighActivityAwardService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service("activityAwardService")
public class HighActivityAwardServiceImpl implements HighActivityAwardService {
@Resource
private HighActivityAwardMapper highActivityAwardMapper;
@Override
public List<HighActivityAward> getListByActivityId(Long activityId) {
HighActivityAwardExample example = new HighActivityAwardExample();
example.createCriteria().andActivityInfoIdEqualTo(activityId).andStatusNotEqualTo(0);
return highActivityAwardMapper.selectByExample(example);
}
}

@ -101,4 +101,9 @@ public class HighActivityInfoServiceImpl implements HighActivityInfoService {
example.setOrderByClause("create_time desc");
return highActivityInfoMapper.selectByExample(example);
}
@Override
public Map<String, Object> getNewActivityByCouponId(Long couponId) {
return highActivityInfoMapper.selectNewActivityByCouponId(couponId);
}
}

Loading…
Cancel
Save