Browse Source

20220316注掉抽奖的mustLogin

master
zhizhi wu 3 years ago
parent
commit
99ae99fa6d
  1. 2
      .idea/inspectionProfiles/Project_Default.xml
  2. 16
      src/main/java/com/ccsens/braintraining/annotation/Login.java
  3. 24
      src/main/java/com/ccsens/braintraining/annotation/MustLogin.java
  4. 2
      src/main/java/com/ccsens/braintraining/api/CarouselController.java
  5. 65
      src/main/java/com/ccsens/braintraining/api/RaffleController.java
  6. 194
      src/main/java/com/ccsens/braintraining/aspect/MustLoginAspect.java
  7. 54
      src/main/java/com/ccsens/braintraining/bean/dto/RaffleDto.java
  8. 150
      src/main/java/com/ccsens/braintraining/bean/po/RaffleActive.java
  9. 951
      src/main/java/com/ccsens/braintraining/bean/po/RaffleActiveExample.java
  10. 161
      src/main/java/com/ccsens/braintraining/bean/po/RafflePrize.java
  11. 1021
      src/main/java/com/ccsens/braintraining/bean/po/RafflePrizeExample.java
  12. 95
      src/main/java/com/ccsens/braintraining/bean/po/RaffleRecord.java
  13. 621
      src/main/java/com/ccsens/braintraining/bean/po/RaffleRecordExample.java
  14. 161
      src/main/java/com/ccsens/braintraining/bean/po/RaffleTask.java
  15. 1011
      src/main/java/com/ccsens/braintraining/bean/po/RaffleTaskExample.java
  16. 106
      src/main/java/com/ccsens/braintraining/bean/po/RaffleTaskParam.java
  17. 701
      src/main/java/com/ccsens/braintraining/bean/po/RaffleTaskParamExample.java
  18. 106
      src/main/java/com/ccsens/braintraining/bean/po/RaffleTimes.java
  19. 681
      src/main/java/com/ccsens/braintraining/bean/po/RaffleTimesExample.java
  20. 139
      src/main/java/com/ccsens/braintraining/bean/po/User.java
  21. 921
      src/main/java/com/ccsens/braintraining/bean/po/UserExample.java
  22. 100
      src/main/java/com/ccsens/braintraining/bean/vo/RaffleVo.java
  23. 40
      src/main/java/com/ccsens/braintraining/bean/vo/UserVo.java
  24. 6
      src/main/java/com/ccsens/braintraining/config/SwaggerConfigure.java
  25. 48
      src/main/java/com/ccsens/braintraining/persist/dao/RaffleDao.java
  26. 30
      src/main/java/com/ccsens/braintraining/persist/mapper/RaffleActiveMapper.java
  27. 30
      src/main/java/com/ccsens/braintraining/persist/mapper/RafflePrizeMapper.java
  28. 30
      src/main/java/com/ccsens/braintraining/persist/mapper/RaffleRecordMapper.java
  29. 30
      src/main/java/com/ccsens/braintraining/persist/mapper/RaffleTaskMapper.java
  30. 30
      src/main/java/com/ccsens/braintraining/persist/mapper/RaffleTaskParamMapper.java
  31. 30
      src/main/java/com/ccsens/braintraining/persist/mapper/RaffleTimesMapper.java
  32. 30
      src/main/java/com/ccsens/braintraining/persist/mapper/UserMapper.java
  33. 35
      src/main/java/com/ccsens/braintraining/service/IRaffleService.java
  34. 111
      src/main/java/com/ccsens/braintraining/service/RaffleService.java
  35. 4
      src/main/java/com/ccsens/braintraining/util/BrainTrainingCodeError.java
  36. 5
      src/main/java/com/ccsens/braintraining/util/BrainTrainingConstant.java
  37. 3
      src/main/resources/application-dev.yml
  38. 2
      src/main/resources/application-prod.yml
  39. 2
      src/main/resources/application-test.yml
  40. 135
      src/main/resources/mapper_dao/RaffleDao.xml
  41. 323
      src/main/resources/mapper_raw/RaffleActiveMapper.xml
  42. 338
      src/main/resources/mapper_raw/RafflePrizeMapper.xml
  43. 243
      src/main/resources/mapper_raw/RaffleRecordMapper.xml
  44. 338
      src/main/resources/mapper_raw/RaffleTaskMapper.xml
  45. 258
      src/main/resources/mapper_raw/RaffleTaskParamMapper.xml
  46. 258
      src/main/resources/mapper_raw/RaffleTimesMapper.xml
  47. 306
      src/main/resources/mapper_raw/UserMapper.xml
  48. 7
      src/main/resources/mbg.xml

2
.idea/inspectionProfiles/Project_Default.xml

@ -30,7 +30,7 @@
<option name="IGNORE_JAVADOC_PERIOD" value="true" />
<option name="IGNORE_DUPLICATED_THROWS" value="false" />
<option name="IGNORE_POINT_TO_ITSELF" value="false" />
<option name="myAdditionalJavadocTags" value="date" />
<option name="myAdditionalJavadocTags" value="date,description:,author:,time:" />
</inspection_tool>
</profile>
</component>

16
src/main/java/com/ccsens/braintraining/annotation/Login.java

@ -0,0 +1,16 @@
package com.ccsens.braintraining.annotation;
import java.lang.annotation.*;
/**
* @description: 用于标识方法需要登录获取userId
* 如果未登录则不设置userId
* @author: wuHuiJuan
* @create: 2019/12/09 09:48
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Login {
}

24
src/main/java/com/ccsens/braintraining/annotation/MustLogin.java

@ -0,0 +1,24 @@
package com.ccsens.braintraining.annotation;
import java.lang.annotation.*;
/**
* @description: 用于标识方法需要登录获取userId
* 如果未登录直接返回用户未登录
* @author: wuHuiJuan
* @create: 2019/12/09 09:48
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface MustLogin {
/**
* -1 不处理
* 0: 数组
* 1List
* 2Set
* 3: Map
* */
byte type() default -1;
}

2
src/main/java/com/ccsens/braintraining/api/CarouselController.java

@ -5,13 +5,11 @@ import com.ccsens.braintraining.service.ICarouselService;
import com.ccsens.util.JsonResponse;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
/**

65
src/main/java/com/ccsens/braintraining/api/RaffleController.java

@ -0,0 +1,65 @@
package com.ccsens.braintraining.api;
import com.ccsens.braintraining.annotation.Login;
import com.ccsens.braintraining.annotation.MustLogin;
import com.ccsens.braintraining.bean.dto.RaffleDto;
import com.ccsens.braintraining.bean.vo.RaffleVo;
import com.ccsens.braintraining.service.IRaffleService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @description:抽奖
* @author: whj
* @time: 2022/3/15 11:22
*/
@Api(tags = "抽奖" )
@RestController
@RequestMapping("/raffle")
@Slf4j
public class RaffleController {
@Resource
private IRaffleService raffleService;
@Login
@ApiOperation(value = "抽奖活动查询")
@RequestMapping(value = "/active", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<RaffleVo.Active> active(@ApiParam @Validated @RequestBody QueryDto<RaffleDto.Equipment> params) {
log.info("抽奖活动查询:{}", params);
RaffleVo.Active active = raffleService.active(params.getParam(), params.getUserId());
log.info("抽奖活动查询结束:{}");
return JsonResponse.newInstance().ok(active);
}
@Login
@ApiOperation(value = "中奖信息")
@RequestMapping(value = "/prizeRecord", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<RaffleVo.PrizeRecord> prizeRecord(@ApiParam @Validated @RequestBody QueryDto<RaffleDto.RecordList> params) {
log.info("中奖信息查询:{}", params);
PageInfo<RaffleVo.PrizeRecord> records = raffleService.prizeRecord(params.getParam(), params.getUserId());
log.info("中奖信息结束:{}");
return JsonResponse.newInstance().ok(records);
}
// @MustLogin
@ApiOperation(value = "抽奖")
@RequestMapping(value = "/draw", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<RaffleVo.Prize> draw(@ApiParam @Validated @RequestBody QueryDto<RaffleDto.ActiveId> params) {
log.info("抽奖:{}", params);
RaffleVo.Prize prize = raffleService.draw(params.getParam(), params.getUserId());
log.info("{}抽奖:{}结束:{}", params.getUserId(), params.getParam().getActiveId(), prize);
return JsonResponse.newInstance().ok(prize);
}
}

194
src/main/java/com/ccsens/braintraining/aspect/MustLoginAspect.java

@ -0,0 +1,194 @@
package com.ccsens.braintraining.aspect;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.braintraining.annotation.MustLogin;
import com.ccsens.braintraining.bean.po.User;
import com.ccsens.braintraining.bean.vo.UserVo;
import com.ccsens.braintraining.persist.mapper.UserMapper;
import com.ccsens.braintraining.util.BrainTrainingConstant;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.RedisUtil;
import com.ccsens.util.WebConstant;
import com.ccsens.util.bean.dto.QueryDto;
import com.ccsens.util.exception.BaseException;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Array;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
/**
* @description:
* @author: whj
* @create: 2022/3/15 17:54
*/
@Order(0)
@Slf4j
@Aspect
@Component
public class MustLoginAspect {
@Value("${url.token}")
private String tokenUrl;
@Resource
private RedisUtil redisUtil;
@Resource
private UserMapper userMapper;
@Pointcut("@annotation(com.ccsens.braintraining.annotation.MustLogin) || @annotation(com.ccsens.braintraining.annotation.Login)")
public void loginAdvice(){}
@Around("loginAdvice()")
public Object around(ProceedingJoinPoint pjp) throws Throwable {
// 获取方法MustLogin注解
Signature signature = pjp.getSignature();
MethodSignature methodSignature = (MethodSignature) signature;
Method targetMethod = methodSignature.getMethod();
MustLogin mustLoginAnnotation = targetMethod.getAnnotation(MustLogin.class);
// 获取request
HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.getRequestAttributes()).getRequest();
// 获取token
final String authHeader = request.getHeader(WebConstant.HEADER_KEY_TOKEN);
log.info("token:{}", authHeader);
if ( mustLoginAnnotation != null && StrUtil.isEmpty(authHeader)) {
throw new BaseException(CodeEnum.NOT_LOGIN);
}
// 若数组等,特殊赋值
Object[] args = pjp.getArgs();
QueryDto dto = args == null || args.length < 1 ? null : (QueryDto) args[0];
fillSpecial(dto, mustLoginAnnotation);
// 根据token用户信息
UserVo.TokenToUserId bean = getUserByToken(authHeader);
// 未获取到用户信息
if (bean == null) {
if (mustLoginAnnotation == null) {
// login 注解
return pjp.proceed();
} else {
// mustLogin
throw new BaseException(CodeEnum.NOT_LOGIN);
}
}
// 封装用户信息
if (dto != null) {
dto.setUserId(bean.getId());
dto.setUserName(bean.getUserName());
dto.setAvatarUrl(bean.getAvatarUrl());
dto.setPhone(bean.getPhone());
dto.setAuthType(bean.getAuthType());
dto.setToken(WebConstant.HEADER_KEY_TOKEN_PREFIX + authHeader);
// 判断该userId是否已经存储
saveUser(bean);
}
return pjp.proceed();
}
/**
* 保存用户信息
* @param bean 用户信息
*/
private void saveUser(UserVo.TokenToUserId bean) {
if (bean == null) {
return;
}
boolean hasUserId = redisUtil.sHasKey(BrainTrainingConstant.User.USER_IDS_KEY, bean.getId());
log.info("{}已经存在:{}", bean.getId(), hasUserId);
if (hasUserId) {
return;
}
User user = userMapper.selectByPrimaryKey(bean.getId());
log.info("根据用户ID:{}查询用户信息:{}", bean.getId(), user);
if (user != null) {
redisUtil.sSet(BrainTrainingConstant.User.USER_IDS_KEY, bean.getId());
return;
}
user = new User();
user.setId(bean.getId());
user.setName(bean.getUserName());
user.setGender(bean.getGender());
user.setAvatarUrl(bean.getAvatarUrl());
user.setCountry(bean.getCountry());
user.setProvince(bean.getProvince());
user.setCity(bean.getCity());
user.setPhone(bean.getPhone());
userMapper.insertSelective(user);
redisUtil.sSet(BrainTrainingConstant.User.USER_IDS_KEY, bean.getId());
}
/**
* 根据token用户对象
* @param authHeader token
* @return 用户信息未登录抛异常
*/
private UserVo.TokenToUserId getUserByToken(String authHeader) {
if (StrUtil.isEmpty(authHeader)) {
return null;
}
//获取userId
JSONObject json = new JSONObject();
json.put("token", authHeader);
log.info("根据token获取userId, 参数:{}", json);
String result = HttpUtil.post(tokenUrl, json.toJSONString());
log.info("根据token获取userId,返回:{}", result);
if (StrUtil.isEmpty(result)) {
return null;
}
JSONObject tokenJson = JSONObject.parseObject(result);
String code = "code";
String data = "data";
if (tokenJson.getIntValue(code) != CodeEnum.SUCCESS.getCode().intValue()
|| StrUtil.isEmpty(tokenJson.getString(data))) {
return null;
}
return JSONObject.parseObject(tokenJson.getString(data), UserVo.TokenToUserId.class);
}
private void fillSpecial(QueryDto dto, MustLogin mustLoginAnnotation) {
if (mustLoginAnnotation == null) {
return;
}
if (dto != null && mustLoginAnnotation.type() > -1) {
switch (mustLoginAnnotation.type()) {
case 0:
Object obj = dto.getParam();
if (obj!= null && !obj.getClass().isArray()) {
Class<?> aClass = dto.getParam().getClass();
Object o = Array.newInstance(aClass, 1);
Array.set(o, 0, dto.getParam());
dto.setParam(o);
}
break;
case 1:
Object obj1 = dto.getParam();
if (obj1!= null && !(obj1 instanceof List)) {
ArrayList arrayList = new ArrayList();
arrayList.add(dto.getParam());
dto.setParam(arrayList);
}
break;
default:
}
}
}
}

54
src/main/java/com/ccsens/braintraining/bean/dto/RaffleDto.java

@ -0,0 +1,54 @@
package com.ccsens.braintraining.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @description:
* @author: whj
* @time: 2022/3/15 11:29
*/
public class RaffleDto {
@Data
@ApiModel("抽奖活动-请求")
public static class Equipment {
@NotNull(message="请输入设备信息")
@ApiModelProperty("设备ID")
private Long equipmentId;
}
@Data
@ApiModel("抽奖活动ID-请求")
public static class ActiveId {
@NotNull(message="请输入抽奖活动信息")
@ApiModelProperty("抽奖ID")
private Long activeId;
@Min(1)
@ApiModelProperty("页码")
private int pageNum = 1;
@Min(1)
@Max(1000)
@ApiModelProperty("每页多少条")
private int pageSize = 20;
}
@Data
@ApiModel("中奖纪录列表-请求")
public static class RecordList {
@NotNull(message="请输入抽奖活动信息")
@ApiModelProperty("抽奖ID")
private Long activeId;
@Min(1)
@ApiModelProperty("页码")
private int pageNum = 1;
@Min(1)
@Max(1000)
@ApiModelProperty("每页多少条")
private int pageSize = 20;
}
}

150
src/main/java/com/ccsens/braintraining/bean/po/RaffleActive.java

@ -0,0 +1,150 @@
package com.ccsens.braintraining.bean.po;
import java.io.Serializable;
import java.util.Date;
public class RaffleActive implements Serializable {
private Long id;
private Long equipmentId;
private String title;
private String subtitle;
private String description;
private Byte freeTimes;
private Long startTime;
private Long endTime;
private Long operator;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getEquipmentId() {
return equipmentId;
}
public void setEquipmentId(Long equipmentId) {
this.equipmentId = equipmentId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title == null ? null : title.trim();
}
public String getSubtitle() {
return subtitle;
}
public void setSubtitle(String subtitle) {
this.subtitle = subtitle == null ? null : subtitle.trim();
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public Byte getFreeTimes() {
return freeTimes;
}
public void setFreeTimes(Byte freeTimes) {
this.freeTimes = freeTimes;
}
public Long getStartTime() {
return startTime;
}
public void setStartTime(Long startTime) {
this.startTime = startTime;
}
public Long getEndTime() {
return endTime;
}
public void setEndTime(Long endTime) {
this.endTime = endTime;
}
public Long getOperator() {
return operator;
}
public void setOperator(Long operator) {
this.operator = operator;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", equipmentId=").append(equipmentId);
sb.append(", title=").append(title);
sb.append(", subtitle=").append(subtitle);
sb.append(", description=").append(description);
sb.append(", freeTimes=").append(freeTimes);
sb.append(", startTime=").append(startTime);
sb.append(", endTime=").append(endTime);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

951
src/main/java/com/ccsens/braintraining/bean/po/RaffleActiveExample.java

@ -0,0 +1,951 @@
package com.ccsens.braintraining.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class RaffleActiveExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public RaffleActiveExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andEquipmentIdIsNull() {
addCriterion("equipment_id is null");
return (Criteria) this;
}
public Criteria andEquipmentIdIsNotNull() {
addCriterion("equipment_id is not null");
return (Criteria) this;
}
public Criteria andEquipmentIdEqualTo(Long value) {
addCriterion("equipment_id =", value, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdNotEqualTo(Long value) {
addCriterion("equipment_id <>", value, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdGreaterThan(Long value) {
addCriterion("equipment_id >", value, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdGreaterThanOrEqualTo(Long value) {
addCriterion("equipment_id >=", value, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdLessThan(Long value) {
addCriterion("equipment_id <", value, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdLessThanOrEqualTo(Long value) {
addCriterion("equipment_id <=", value, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdIn(List<Long> values) {
addCriterion("equipment_id in", values, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdNotIn(List<Long> values) {
addCriterion("equipment_id not in", values, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdBetween(Long value1, Long value2) {
addCriterion("equipment_id between", value1, value2, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdNotBetween(Long value1, Long value2) {
addCriterion("equipment_id not between", value1, value2, "equipmentId");
return (Criteria) this;
}
public Criteria andTitleIsNull() {
addCriterion("title is null");
return (Criteria) this;
}
public Criteria andTitleIsNotNull() {
addCriterion("title is not null");
return (Criteria) this;
}
public Criteria andTitleEqualTo(String value) {
addCriterion("title =", value, "title");
return (Criteria) this;
}
public Criteria andTitleNotEqualTo(String value) {
addCriterion("title <>", value, "title");
return (Criteria) this;
}
public Criteria andTitleGreaterThan(String value) {
addCriterion("title >", value, "title");
return (Criteria) this;
}
public Criteria andTitleGreaterThanOrEqualTo(String value) {
addCriterion("title >=", value, "title");
return (Criteria) this;
}
public Criteria andTitleLessThan(String value) {
addCriterion("title <", value, "title");
return (Criteria) this;
}
public Criteria andTitleLessThanOrEqualTo(String value) {
addCriterion("title <=", value, "title");
return (Criteria) this;
}
public Criteria andTitleLike(String value) {
addCriterion("title like", value, "title");
return (Criteria) this;
}
public Criteria andTitleNotLike(String value) {
addCriterion("title not like", value, "title");
return (Criteria) this;
}
public Criteria andTitleIn(List<String> values) {
addCriterion("title in", values, "title");
return (Criteria) this;
}
public Criteria andTitleNotIn(List<String> values) {
addCriterion("title not in", values, "title");
return (Criteria) this;
}
public Criteria andTitleBetween(String value1, String value2) {
addCriterion("title between", value1, value2, "title");
return (Criteria) this;
}
public Criteria andTitleNotBetween(String value1, String value2) {
addCriterion("title not between", value1, value2, "title");
return (Criteria) this;
}
public Criteria andSubtitleIsNull() {
addCriterion("subtitle is null");
return (Criteria) this;
}
public Criteria andSubtitleIsNotNull() {
addCriterion("subtitle is not null");
return (Criteria) this;
}
public Criteria andSubtitleEqualTo(String value) {
addCriterion("subtitle =", value, "subtitle");
return (Criteria) this;
}
public Criteria andSubtitleNotEqualTo(String value) {
addCriterion("subtitle <>", value, "subtitle");
return (Criteria) this;
}
public Criteria andSubtitleGreaterThan(String value) {
addCriterion("subtitle >", value, "subtitle");
return (Criteria) this;
}
public Criteria andSubtitleGreaterThanOrEqualTo(String value) {
addCriterion("subtitle >=", value, "subtitle");
return (Criteria) this;
}
public Criteria andSubtitleLessThan(String value) {
addCriterion("subtitle <", value, "subtitle");
return (Criteria) this;
}
public Criteria andSubtitleLessThanOrEqualTo(String value) {
addCriterion("subtitle <=", value, "subtitle");
return (Criteria) this;
}
public Criteria andSubtitleLike(String value) {
addCriterion("subtitle like", value, "subtitle");
return (Criteria) this;
}
public Criteria andSubtitleNotLike(String value) {
addCriterion("subtitle not like", value, "subtitle");
return (Criteria) this;
}
public Criteria andSubtitleIn(List<String> values) {
addCriterion("subtitle in", values, "subtitle");
return (Criteria) this;
}
public Criteria andSubtitleNotIn(List<String> values) {
addCriterion("subtitle not in", values, "subtitle");
return (Criteria) this;
}
public Criteria andSubtitleBetween(String value1, String value2) {
addCriterion("subtitle between", value1, value2, "subtitle");
return (Criteria) this;
}
public Criteria andSubtitleNotBetween(String value1, String value2) {
addCriterion("subtitle not between", value1, value2, "subtitle");
return (Criteria) this;
}
public Criteria andDescriptionIsNull() {
addCriterion("description is null");
return (Criteria) this;
}
public Criteria andDescriptionIsNotNull() {
addCriterion("description is not null");
return (Criteria) this;
}
public Criteria andDescriptionEqualTo(String value) {
addCriterion("description =", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionNotEqualTo(String value) {
addCriterion("description <>", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionGreaterThan(String value) {
addCriterion("description >", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionGreaterThanOrEqualTo(String value) {
addCriterion("description >=", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionLessThan(String value) {
addCriterion("description <", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionLessThanOrEqualTo(String value) {
addCriterion("description <=", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionLike(String value) {
addCriterion("description like", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionNotLike(String value) {
addCriterion("description not like", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionIn(List<String> values) {
addCriterion("description in", values, "description");
return (Criteria) this;
}
public Criteria andDescriptionNotIn(List<String> values) {
addCriterion("description not in", values, "description");
return (Criteria) this;
}
public Criteria andDescriptionBetween(String value1, String value2) {
addCriterion("description between", value1, value2, "description");
return (Criteria) this;
}
public Criteria andDescriptionNotBetween(String value1, String value2) {
addCriterion("description not between", value1, value2, "description");
return (Criteria) this;
}
public Criteria andFreeTimesIsNull() {
addCriterion("free_times is null");
return (Criteria) this;
}
public Criteria andFreeTimesIsNotNull() {
addCriterion("free_times is not null");
return (Criteria) this;
}
public Criteria andFreeTimesEqualTo(Byte value) {
addCriterion("free_times =", value, "freeTimes");
return (Criteria) this;
}
public Criteria andFreeTimesNotEqualTo(Byte value) {
addCriterion("free_times <>", value, "freeTimes");
return (Criteria) this;
}
public Criteria andFreeTimesGreaterThan(Byte value) {
addCriterion("free_times >", value, "freeTimes");
return (Criteria) this;
}
public Criteria andFreeTimesGreaterThanOrEqualTo(Byte value) {
addCriterion("free_times >=", value, "freeTimes");
return (Criteria) this;
}
public Criteria andFreeTimesLessThan(Byte value) {
addCriterion("free_times <", value, "freeTimes");
return (Criteria) this;
}
public Criteria andFreeTimesLessThanOrEqualTo(Byte value) {
addCriterion("free_times <=", value, "freeTimes");
return (Criteria) this;
}
public Criteria andFreeTimesIn(List<Byte> values) {
addCriterion("free_times in", values, "freeTimes");
return (Criteria) this;
}
public Criteria andFreeTimesNotIn(List<Byte> values) {
addCriterion("free_times not in", values, "freeTimes");
return (Criteria) this;
}
public Criteria andFreeTimesBetween(Byte value1, Byte value2) {
addCriterion("free_times between", value1, value2, "freeTimes");
return (Criteria) this;
}
public Criteria andFreeTimesNotBetween(Byte value1, Byte value2) {
addCriterion("free_times not between", value1, value2, "freeTimes");
return (Criteria) this;
}
public Criteria andStartTimeIsNull() {
addCriterion("start_time is null");
return (Criteria) this;
}
public Criteria andStartTimeIsNotNull() {
addCriterion("start_time is not null");
return (Criteria) this;
}
public Criteria andStartTimeEqualTo(Long value) {
addCriterion("start_time =", value, "startTime");
return (Criteria) this;
}
public Criteria andStartTimeNotEqualTo(Long value) {
addCriterion("start_time <>", value, "startTime");
return (Criteria) this;
}
public Criteria andStartTimeGreaterThan(Long value) {
addCriterion("start_time >", value, "startTime");
return (Criteria) this;
}
public Criteria andStartTimeGreaterThanOrEqualTo(Long value) {
addCriterion("start_time >=", value, "startTime");
return (Criteria) this;
}
public Criteria andStartTimeLessThan(Long value) {
addCriterion("start_time <", value, "startTime");
return (Criteria) this;
}
public Criteria andStartTimeLessThanOrEqualTo(Long value) {
addCriterion("start_time <=", value, "startTime");
return (Criteria) this;
}
public Criteria andStartTimeIn(List<Long> values) {
addCriterion("start_time in", values, "startTime");
return (Criteria) this;
}
public Criteria andStartTimeNotIn(List<Long> values) {
addCriterion("start_time not in", values, "startTime");
return (Criteria) this;
}
public Criteria andStartTimeBetween(Long value1, Long value2) {
addCriterion("start_time between", value1, value2, "startTime");
return (Criteria) this;
}
public Criteria andStartTimeNotBetween(Long value1, Long value2) {
addCriterion("start_time not between", value1, value2, "startTime");
return (Criteria) this;
}
public Criteria andEndTimeIsNull() {
addCriterion("end_time is null");
return (Criteria) this;
}
public Criteria andEndTimeIsNotNull() {
addCriterion("end_time is not null");
return (Criteria) this;
}
public Criteria andEndTimeEqualTo(Long value) {
addCriterion("end_time =", value, "endTime");
return (Criteria) this;
}
public Criteria andEndTimeNotEqualTo(Long value) {
addCriterion("end_time <>", value, "endTime");
return (Criteria) this;
}
public Criteria andEndTimeGreaterThan(Long value) {
addCriterion("end_time >", value, "endTime");
return (Criteria) this;
}
public Criteria andEndTimeGreaterThanOrEqualTo(Long value) {
addCriterion("end_time >=", value, "endTime");
return (Criteria) this;
}
public Criteria andEndTimeLessThan(Long value) {
addCriterion("end_time <", value, "endTime");
return (Criteria) this;
}
public Criteria andEndTimeLessThanOrEqualTo(Long value) {
addCriterion("end_time <=", value, "endTime");
return (Criteria) this;
}
public Criteria andEndTimeIn(List<Long> values) {
addCriterion("end_time in", values, "endTime");
return (Criteria) this;
}
public Criteria andEndTimeNotIn(List<Long> values) {
addCriterion("end_time not in", values, "endTime");
return (Criteria) this;
}
public Criteria andEndTimeBetween(Long value1, Long value2) {
addCriterion("end_time between", value1, value2, "endTime");
return (Criteria) this;
}
public Criteria andEndTimeNotBetween(Long value1, Long value2) {
addCriterion("end_time not between", value1, value2, "endTime");
return (Criteria) this;
}
public Criteria andOperatorIsNull() {
addCriterion("operator is null");
return (Criteria) this;
}
public Criteria andOperatorIsNotNull() {
addCriterion("operator is not null");
return (Criteria) this;
}
public Criteria andOperatorEqualTo(Long value) {
addCriterion("operator =", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotEqualTo(Long value) {
addCriterion("operator <>", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThan(Long value) {
addCriterion("operator >", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThanOrEqualTo(Long value) {
addCriterion("operator >=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThan(Long value) {
addCriterion("operator <", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThanOrEqualTo(Long value) {
addCriterion("operator <=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorIn(List<Long> values) {
addCriterion("operator in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotIn(List<Long> values) {
addCriterion("operator not in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorBetween(Long value1, Long value2) {
addCriterion("operator between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotBetween(Long value1, Long value2) {
addCriterion("operator not between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

161
src/main/java/com/ccsens/braintraining/bean/po/RafflePrize.java

@ -0,0 +1,161 @@
package com.ccsens.braintraining.bean.po;
import java.io.Serializable;
import java.util.Date;
public class RafflePrize implements Serializable {
private Long id;
private Long activeId;
private String name;
private String icon;
private Integer total;
private Integer remain;
private String description;
private Byte type;
private String param;
private Long operator;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getActiveId() {
return activeId;
}
public void setActiveId(Long activeId) {
this.activeId = activeId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon == null ? null : icon.trim();
}
public Integer getTotal() {
return total;
}
public void setTotal(Integer total) {
this.total = total;
}
public Integer getRemain() {
return remain;
}
public void setRemain(Integer remain) {
this.remain = remain;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public Byte getType() {
return type;
}
public void setType(Byte type) {
this.type = type;
}
public String getParam() {
return param;
}
public void setParam(String param) {
this.param = param == null ? null : param.trim();
}
public Long getOperator() {
return operator;
}
public void setOperator(Long operator) {
this.operator = operator;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", activeId=").append(activeId);
sb.append(", name=").append(name);
sb.append(", icon=").append(icon);
sb.append(", total=").append(total);
sb.append(", remain=").append(remain);
sb.append(", description=").append(description);
sb.append(", type=").append(type);
sb.append(", param=").append(param);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

1021
src/main/java/com/ccsens/braintraining/bean/po/RafflePrizeExample.java

File diff suppressed because it is too large

95
src/main/java/com/ccsens/braintraining/bean/po/RaffleRecord.java

@ -0,0 +1,95 @@
package com.ccsens.braintraining.bean.po;
import java.io.Serializable;
import java.util.Date;
public class RaffleRecord implements Serializable {
private Long id;
private Long prizeId;
private Long userId;
private Long operator;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getPrizeId() {
return prizeId;
}
public void setPrizeId(Long prizeId) {
this.prizeId = prizeId;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getOperator() {
return operator;
}
public void setOperator(Long operator) {
this.operator = operator;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", prizeId=").append(prizeId);
sb.append(", userId=").append(userId);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

621
src/main/java/com/ccsens/braintraining/bean/po/RaffleRecordExample.java

@ -0,0 +1,621 @@
package com.ccsens.braintraining.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class RaffleRecordExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public RaffleRecordExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andPrizeIdIsNull() {
addCriterion("prize_id is null");
return (Criteria) this;
}
public Criteria andPrizeIdIsNotNull() {
addCriterion("prize_id is not null");
return (Criteria) this;
}
public Criteria andPrizeIdEqualTo(Long value) {
addCriterion("prize_id =", value, "prizeId");
return (Criteria) this;
}
public Criteria andPrizeIdNotEqualTo(Long value) {
addCriterion("prize_id <>", value, "prizeId");
return (Criteria) this;
}
public Criteria andPrizeIdGreaterThan(Long value) {
addCriterion("prize_id >", value, "prizeId");
return (Criteria) this;
}
public Criteria andPrizeIdGreaterThanOrEqualTo(Long value) {
addCriterion("prize_id >=", value, "prizeId");
return (Criteria) this;
}
public Criteria andPrizeIdLessThan(Long value) {
addCriterion("prize_id <", value, "prizeId");
return (Criteria) this;
}
public Criteria andPrizeIdLessThanOrEqualTo(Long value) {
addCriterion("prize_id <=", value, "prizeId");
return (Criteria) this;
}
public Criteria andPrizeIdIn(List<Long> values) {
addCriterion("prize_id in", values, "prizeId");
return (Criteria) this;
}
public Criteria andPrizeIdNotIn(List<Long> values) {
addCriterion("prize_id not in", values, "prizeId");
return (Criteria) this;
}
public Criteria andPrizeIdBetween(Long value1, Long value2) {
addCriterion("prize_id between", value1, value2, "prizeId");
return (Criteria) this;
}
public Criteria andPrizeIdNotBetween(Long value1, Long value2) {
addCriterion("prize_id not between", value1, value2, "prizeId");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andOperatorIsNull() {
addCriterion("operator is null");
return (Criteria) this;
}
public Criteria andOperatorIsNotNull() {
addCriterion("operator is not null");
return (Criteria) this;
}
public Criteria andOperatorEqualTo(Long value) {
addCriterion("operator =", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotEqualTo(Long value) {
addCriterion("operator <>", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThan(Long value) {
addCriterion("operator >", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThanOrEqualTo(Long value) {
addCriterion("operator >=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThan(Long value) {
addCriterion("operator <", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThanOrEqualTo(Long value) {
addCriterion("operator <=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorIn(List<Long> values) {
addCriterion("operator in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotIn(List<Long> values) {
addCriterion("operator not in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorBetween(Long value1, Long value2) {
addCriterion("operator between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotBetween(Long value1, Long value2) {
addCriterion("operator not between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

161
src/main/java/com/ccsens/braintraining/bean/po/RaffleTask.java

@ -0,0 +1,161 @@
package com.ccsens.braintraining.bean.po;
import java.io.Serializable;
import java.util.Date;
public class RaffleTask implements Serializable {
private Long id;
private Long activeId;
private String icon;
private String name;
private String description;
private Byte period;
private Integer runTimes;
private Byte type;
private Integer increaseTimes;
private Long operator;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getActiveId() {
return activeId;
}
public void setActiveId(Long activeId) {
this.activeId = activeId;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon == null ? null : icon.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public Byte getPeriod() {
return period;
}
public void setPeriod(Byte period) {
this.period = period;
}
public Integer getRunTimes() {
return runTimes;
}
public void setRunTimes(Integer runTimes) {
this.runTimes = runTimes;
}
public Byte getType() {
return type;
}
public void setType(Byte type) {
this.type = type;
}
public Integer getIncreaseTimes() {
return increaseTimes;
}
public void setIncreaseTimes(Integer increaseTimes) {
this.increaseTimes = increaseTimes;
}
public Long getOperator() {
return operator;
}
public void setOperator(Long operator) {
this.operator = operator;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", activeId=").append(activeId);
sb.append(", icon=").append(icon);
sb.append(", name=").append(name);
sb.append(", description=").append(description);
sb.append(", period=").append(period);
sb.append(", runTimes=").append(runTimes);
sb.append(", type=").append(type);
sb.append(", increaseTimes=").append(increaseTimes);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

1011
src/main/java/com/ccsens/braintraining/bean/po/RaffleTaskExample.java

File diff suppressed because it is too large

106
src/main/java/com/ccsens/braintraining/bean/po/RaffleTaskParam.java

@ -0,0 +1,106 @@
package com.ccsens.braintraining.bean.po;
import java.io.Serializable;
import java.util.Date;
public class RaffleTaskParam implements Serializable {
private Long id;
private Long taskId;
private String keyWord;
private String keyValue;
private Long operator;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getTaskId() {
return taskId;
}
public void setTaskId(Long taskId) {
this.taskId = taskId;
}
public String getKeyWord() {
return keyWord;
}
public void setKeyWord(String keyWord) {
this.keyWord = keyWord == null ? null : keyWord.trim();
}
public String getKeyValue() {
return keyValue;
}
public void setKeyValue(String keyValue) {
this.keyValue = keyValue == null ? null : keyValue.trim();
}
public Long getOperator() {
return operator;
}
public void setOperator(Long operator) {
this.operator = operator;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", taskId=").append(taskId);
sb.append(", keyWord=").append(keyWord);
sb.append(", keyValue=").append(keyValue);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

701
src/main/java/com/ccsens/braintraining/bean/po/RaffleTaskParamExample.java

@ -0,0 +1,701 @@
package com.ccsens.braintraining.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class RaffleTaskParamExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public RaffleTaskParamExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andTaskIdIsNull() {
addCriterion("task_id is null");
return (Criteria) this;
}
public Criteria andTaskIdIsNotNull() {
addCriterion("task_id is not null");
return (Criteria) this;
}
public Criteria andTaskIdEqualTo(Long value) {
addCriterion("task_id =", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdNotEqualTo(Long value) {
addCriterion("task_id <>", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdGreaterThan(Long value) {
addCriterion("task_id >", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdGreaterThanOrEqualTo(Long value) {
addCriterion("task_id >=", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdLessThan(Long value) {
addCriterion("task_id <", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdLessThanOrEqualTo(Long value) {
addCriterion("task_id <=", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdIn(List<Long> values) {
addCriterion("task_id in", values, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdNotIn(List<Long> values) {
addCriterion("task_id not in", values, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdBetween(Long value1, Long value2) {
addCriterion("task_id between", value1, value2, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdNotBetween(Long value1, Long value2) {
addCriterion("task_id not between", value1, value2, "taskId");
return (Criteria) this;
}
public Criteria andKeyWordIsNull() {
addCriterion("key_word is null");
return (Criteria) this;
}
public Criteria andKeyWordIsNotNull() {
addCriterion("key_word is not null");
return (Criteria) this;
}
public Criteria andKeyWordEqualTo(String value) {
addCriterion("key_word =", value, "keyWord");
return (Criteria) this;
}
public Criteria andKeyWordNotEqualTo(String value) {
addCriterion("key_word <>", value, "keyWord");
return (Criteria) this;
}
public Criteria andKeyWordGreaterThan(String value) {
addCriterion("key_word >", value, "keyWord");
return (Criteria) this;
}
public Criteria andKeyWordGreaterThanOrEqualTo(String value) {
addCriterion("key_word >=", value, "keyWord");
return (Criteria) this;
}
public Criteria andKeyWordLessThan(String value) {
addCriterion("key_word <", value, "keyWord");
return (Criteria) this;
}
public Criteria andKeyWordLessThanOrEqualTo(String value) {
addCriterion("key_word <=", value, "keyWord");
return (Criteria) this;
}
public Criteria andKeyWordLike(String value) {
addCriterion("key_word like", value, "keyWord");
return (Criteria) this;
}
public Criteria andKeyWordNotLike(String value) {
addCriterion("key_word not like", value, "keyWord");
return (Criteria) this;
}
public Criteria andKeyWordIn(List<String> values) {
addCriterion("key_word in", values, "keyWord");
return (Criteria) this;
}
public Criteria andKeyWordNotIn(List<String> values) {
addCriterion("key_word not in", values, "keyWord");
return (Criteria) this;
}
public Criteria andKeyWordBetween(String value1, String value2) {
addCriterion("key_word between", value1, value2, "keyWord");
return (Criteria) this;
}
public Criteria andKeyWordNotBetween(String value1, String value2) {
addCriterion("key_word not between", value1, value2, "keyWord");
return (Criteria) this;
}
public Criteria andKeyValueIsNull() {
addCriterion("key_value is null");
return (Criteria) this;
}
public Criteria andKeyValueIsNotNull() {
addCriterion("key_value is not null");
return (Criteria) this;
}
public Criteria andKeyValueEqualTo(String value) {
addCriterion("key_value =", value, "keyValue");
return (Criteria) this;
}
public Criteria andKeyValueNotEqualTo(String value) {
addCriterion("key_value <>", value, "keyValue");
return (Criteria) this;
}
public Criteria andKeyValueGreaterThan(String value) {
addCriterion("key_value >", value, "keyValue");
return (Criteria) this;
}
public Criteria andKeyValueGreaterThanOrEqualTo(String value) {
addCriterion("key_value >=", value, "keyValue");
return (Criteria) this;
}
public Criteria andKeyValueLessThan(String value) {
addCriterion("key_value <", value, "keyValue");
return (Criteria) this;
}
public Criteria andKeyValueLessThanOrEqualTo(String value) {
addCriterion("key_value <=", value, "keyValue");
return (Criteria) this;
}
public Criteria andKeyValueLike(String value) {
addCriterion("key_value like", value, "keyValue");
return (Criteria) this;
}
public Criteria andKeyValueNotLike(String value) {
addCriterion("key_value not like", value, "keyValue");
return (Criteria) this;
}
public Criteria andKeyValueIn(List<String> values) {
addCriterion("key_value in", values, "keyValue");
return (Criteria) this;
}
public Criteria andKeyValueNotIn(List<String> values) {
addCriterion("key_value not in", values, "keyValue");
return (Criteria) this;
}
public Criteria andKeyValueBetween(String value1, String value2) {
addCriterion("key_value between", value1, value2, "keyValue");
return (Criteria) this;
}
public Criteria andKeyValueNotBetween(String value1, String value2) {
addCriterion("key_value not between", value1, value2, "keyValue");
return (Criteria) this;
}
public Criteria andOperatorIsNull() {
addCriterion("operator is null");
return (Criteria) this;
}
public Criteria andOperatorIsNotNull() {
addCriterion("operator is not null");
return (Criteria) this;
}
public Criteria andOperatorEqualTo(Long value) {
addCriterion("operator =", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotEqualTo(Long value) {
addCriterion("operator <>", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThan(Long value) {
addCriterion("operator >", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThanOrEqualTo(Long value) {
addCriterion("operator >=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThan(Long value) {
addCriterion("operator <", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThanOrEqualTo(Long value) {
addCriterion("operator <=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorIn(List<Long> values) {
addCriterion("operator in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotIn(List<Long> values) {
addCriterion("operator not in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorBetween(Long value1, Long value2) {
addCriterion("operator between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotBetween(Long value1, Long value2) {
addCriterion("operator not between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

106
src/main/java/com/ccsens/braintraining/bean/po/RaffleTimes.java

@ -0,0 +1,106 @@
package com.ccsens.braintraining.bean.po;
import java.io.Serializable;
import java.util.Date;
public class RaffleTimes implements Serializable {
private Long id;
private Long taskId;
private Long userId;
private Byte finishType;
private Long operator;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getTaskId() {
return taskId;
}
public void setTaskId(Long taskId) {
this.taskId = taskId;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Byte getFinishType() {
return finishType;
}
public void setFinishType(Byte finishType) {
this.finishType = finishType;
}
public Long getOperator() {
return operator;
}
public void setOperator(Long operator) {
this.operator = operator;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", taskId=").append(taskId);
sb.append(", userId=").append(userId);
sb.append(", finishType=").append(finishType);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

681
src/main/java/com/ccsens/braintraining/bean/po/RaffleTimesExample.java

@ -0,0 +1,681 @@
package com.ccsens.braintraining.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class RaffleTimesExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public RaffleTimesExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andTaskIdIsNull() {
addCriterion("task_id is null");
return (Criteria) this;
}
public Criteria andTaskIdIsNotNull() {
addCriterion("task_id is not null");
return (Criteria) this;
}
public Criteria andTaskIdEqualTo(Long value) {
addCriterion("task_id =", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdNotEqualTo(Long value) {
addCriterion("task_id <>", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdGreaterThan(Long value) {
addCriterion("task_id >", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdGreaterThanOrEqualTo(Long value) {
addCriterion("task_id >=", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdLessThan(Long value) {
addCriterion("task_id <", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdLessThanOrEqualTo(Long value) {
addCriterion("task_id <=", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdIn(List<Long> values) {
addCriterion("task_id in", values, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdNotIn(List<Long> values) {
addCriterion("task_id not in", values, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdBetween(Long value1, Long value2) {
addCriterion("task_id between", value1, value2, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdNotBetween(Long value1, Long value2) {
addCriterion("task_id not between", value1, value2, "taskId");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andFinishTypeIsNull() {
addCriterion("finish_type is null");
return (Criteria) this;
}
public Criteria andFinishTypeIsNotNull() {
addCriterion("finish_type is not null");
return (Criteria) this;
}
public Criteria andFinishTypeEqualTo(Byte value) {
addCriterion("finish_type =", value, "finishType");
return (Criteria) this;
}
public Criteria andFinishTypeNotEqualTo(Byte value) {
addCriterion("finish_type <>", value, "finishType");
return (Criteria) this;
}
public Criteria andFinishTypeGreaterThan(Byte value) {
addCriterion("finish_type >", value, "finishType");
return (Criteria) this;
}
public Criteria andFinishTypeGreaterThanOrEqualTo(Byte value) {
addCriterion("finish_type >=", value, "finishType");
return (Criteria) this;
}
public Criteria andFinishTypeLessThan(Byte value) {
addCriterion("finish_type <", value, "finishType");
return (Criteria) this;
}
public Criteria andFinishTypeLessThanOrEqualTo(Byte value) {
addCriterion("finish_type <=", value, "finishType");
return (Criteria) this;
}
public Criteria andFinishTypeIn(List<Byte> values) {
addCriterion("finish_type in", values, "finishType");
return (Criteria) this;
}
public Criteria andFinishTypeNotIn(List<Byte> values) {
addCriterion("finish_type not in", values, "finishType");
return (Criteria) this;
}
public Criteria andFinishTypeBetween(Byte value1, Byte value2) {
addCriterion("finish_type between", value1, value2, "finishType");
return (Criteria) this;
}
public Criteria andFinishTypeNotBetween(Byte value1, Byte value2) {
addCriterion("finish_type not between", value1, value2, "finishType");
return (Criteria) this;
}
public Criteria andOperatorIsNull() {
addCriterion("operator is null");
return (Criteria) this;
}
public Criteria andOperatorIsNotNull() {
addCriterion("operator is not null");
return (Criteria) this;
}
public Criteria andOperatorEqualTo(Long value) {
addCriterion("operator =", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotEqualTo(Long value) {
addCriterion("operator <>", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThan(Long value) {
addCriterion("operator >", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThanOrEqualTo(Long value) {
addCriterion("operator >=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThan(Long value) {
addCriterion("operator <", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThanOrEqualTo(Long value) {
addCriterion("operator <=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorIn(List<Long> values) {
addCriterion("operator in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotIn(List<Long> values) {
addCriterion("operator not in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorBetween(Long value1, Long value2) {
addCriterion("operator between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotBetween(Long value1, Long value2) {
addCriterion("operator not between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

139
src/main/java/com/ccsens/braintraining/bean/po/User.java

@ -0,0 +1,139 @@
package com.ccsens.braintraining.bean.po;
import java.io.Serializable;
import java.util.Date;
public class User implements Serializable {
private Long id;
private String name;
private Byte gender;
private String avatarUrl;
private String country;
private String province;
private String city;
private String phone;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public Byte getGender() {
return gender;
}
public void setGender(Byte gender) {
this.gender = gender;
}
public String getAvatarUrl() {
return avatarUrl;
}
public void setAvatarUrl(String avatarUrl) {
this.avatarUrl = avatarUrl == null ? null : avatarUrl.trim();
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country == null ? null : country.trim();
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province == null ? null : province.trim();
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city == null ? null : city.trim();
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone == null ? null : phone.trim();
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", name=").append(name);
sb.append(", gender=").append(gender);
sb.append(", avatarUrl=").append(avatarUrl);
sb.append(", country=").append(country);
sb.append(", province=").append(province);
sb.append(", city=").append(city);
sb.append(", phone=").append(phone);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

921
src/main/java/com/ccsens/braintraining/bean/po/UserExample.java

@ -0,0 +1,921 @@
package com.ccsens.braintraining.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class UserExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public UserExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("name is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andGenderIsNull() {
addCriterion("gender is null");
return (Criteria) this;
}
public Criteria andGenderIsNotNull() {
addCriterion("gender is not null");
return (Criteria) this;
}
public Criteria andGenderEqualTo(Byte value) {
addCriterion("gender =", value, "gender");
return (Criteria) this;
}
public Criteria andGenderNotEqualTo(Byte value) {
addCriterion("gender <>", value, "gender");
return (Criteria) this;
}
public Criteria andGenderGreaterThan(Byte value) {
addCriterion("gender >", value, "gender");
return (Criteria) this;
}
public Criteria andGenderGreaterThanOrEqualTo(Byte value) {
addCriterion("gender >=", value, "gender");
return (Criteria) this;
}
public Criteria andGenderLessThan(Byte value) {
addCriterion("gender <", value, "gender");
return (Criteria) this;
}
public Criteria andGenderLessThanOrEqualTo(Byte value) {
addCriterion("gender <=", value, "gender");
return (Criteria) this;
}
public Criteria andGenderIn(List<Byte> values) {
addCriterion("gender in", values, "gender");
return (Criteria) this;
}
public Criteria andGenderNotIn(List<Byte> values) {
addCriterion("gender not in", values, "gender");
return (Criteria) this;
}
public Criteria andGenderBetween(Byte value1, Byte value2) {
addCriterion("gender between", value1, value2, "gender");
return (Criteria) this;
}
public Criteria andGenderNotBetween(Byte value1, Byte value2) {
addCriterion("gender not between", value1, value2, "gender");
return (Criteria) this;
}
public Criteria andAvatarUrlIsNull() {
addCriterion("avatar_url is null");
return (Criteria) this;
}
public Criteria andAvatarUrlIsNotNull() {
addCriterion("avatar_url is not null");
return (Criteria) this;
}
public Criteria andAvatarUrlEqualTo(String value) {
addCriterion("avatar_url =", value, "avatarUrl");
return (Criteria) this;
}
public Criteria andAvatarUrlNotEqualTo(String value) {
addCriterion("avatar_url <>", value, "avatarUrl");
return (Criteria) this;
}
public Criteria andAvatarUrlGreaterThan(String value) {
addCriterion("avatar_url >", value, "avatarUrl");
return (Criteria) this;
}
public Criteria andAvatarUrlGreaterThanOrEqualTo(String value) {
addCriterion("avatar_url >=", value, "avatarUrl");
return (Criteria) this;
}
public Criteria andAvatarUrlLessThan(String value) {
addCriterion("avatar_url <", value, "avatarUrl");
return (Criteria) this;
}
public Criteria andAvatarUrlLessThanOrEqualTo(String value) {
addCriterion("avatar_url <=", value, "avatarUrl");
return (Criteria) this;
}
public Criteria andAvatarUrlLike(String value) {
addCriterion("avatar_url like", value, "avatarUrl");
return (Criteria) this;
}
public Criteria andAvatarUrlNotLike(String value) {
addCriterion("avatar_url not like", value, "avatarUrl");
return (Criteria) this;
}
public Criteria andAvatarUrlIn(List<String> values) {
addCriterion("avatar_url in", values, "avatarUrl");
return (Criteria) this;
}
public Criteria andAvatarUrlNotIn(List<String> values) {
addCriterion("avatar_url not in", values, "avatarUrl");
return (Criteria) this;
}
public Criteria andAvatarUrlBetween(String value1, String value2) {
addCriterion("avatar_url between", value1, value2, "avatarUrl");
return (Criteria) this;
}
public Criteria andAvatarUrlNotBetween(String value1, String value2) {
addCriterion("avatar_url not between", value1, value2, "avatarUrl");
return (Criteria) this;
}
public Criteria andCountryIsNull() {
addCriterion("country is null");
return (Criteria) this;
}
public Criteria andCountryIsNotNull() {
addCriterion("country is not null");
return (Criteria) this;
}
public Criteria andCountryEqualTo(String value) {
addCriterion("country =", value, "country");
return (Criteria) this;
}
public Criteria andCountryNotEqualTo(String value) {
addCriterion("country <>", value, "country");
return (Criteria) this;
}
public Criteria andCountryGreaterThan(String value) {
addCriterion("country >", value, "country");
return (Criteria) this;
}
public Criteria andCountryGreaterThanOrEqualTo(String value) {
addCriterion("country >=", value, "country");
return (Criteria) this;
}
public Criteria andCountryLessThan(String value) {
addCriterion("country <", value, "country");
return (Criteria) this;
}
public Criteria andCountryLessThanOrEqualTo(String value) {
addCriterion("country <=", value, "country");
return (Criteria) this;
}
public Criteria andCountryLike(String value) {
addCriterion("country like", value, "country");
return (Criteria) this;
}
public Criteria andCountryNotLike(String value) {
addCriterion("country not like", value, "country");
return (Criteria) this;
}
public Criteria andCountryIn(List<String> values) {
addCriterion("country in", values, "country");
return (Criteria) this;
}
public Criteria andCountryNotIn(List<String> values) {
addCriterion("country not in", values, "country");
return (Criteria) this;
}
public Criteria andCountryBetween(String value1, String value2) {
addCriterion("country between", value1, value2, "country");
return (Criteria) this;
}
public Criteria andCountryNotBetween(String value1, String value2) {
addCriterion("country not between", value1, value2, "country");
return (Criteria) this;
}
public Criteria andProvinceIsNull() {
addCriterion("province is null");
return (Criteria) this;
}
public Criteria andProvinceIsNotNull() {
addCriterion("province is not null");
return (Criteria) this;
}
public Criteria andProvinceEqualTo(String value) {
addCriterion("province =", value, "province");
return (Criteria) this;
}
public Criteria andProvinceNotEqualTo(String value) {
addCriterion("province <>", value, "province");
return (Criteria) this;
}
public Criteria andProvinceGreaterThan(String value) {
addCriterion("province >", value, "province");
return (Criteria) this;
}
public Criteria andProvinceGreaterThanOrEqualTo(String value) {
addCriterion("province >=", value, "province");
return (Criteria) this;
}
public Criteria andProvinceLessThan(String value) {
addCriterion("province <", value, "province");
return (Criteria) this;
}
public Criteria andProvinceLessThanOrEqualTo(String value) {
addCriterion("province <=", value, "province");
return (Criteria) this;
}
public Criteria andProvinceLike(String value) {
addCriterion("province like", value, "province");
return (Criteria) this;
}
public Criteria andProvinceNotLike(String value) {
addCriterion("province not like", value, "province");
return (Criteria) this;
}
public Criteria andProvinceIn(List<String> values) {
addCriterion("province in", values, "province");
return (Criteria) this;
}
public Criteria andProvinceNotIn(List<String> values) {
addCriterion("province not in", values, "province");
return (Criteria) this;
}
public Criteria andProvinceBetween(String value1, String value2) {
addCriterion("province between", value1, value2, "province");
return (Criteria) this;
}
public Criteria andProvinceNotBetween(String value1, String value2) {
addCriterion("province not between", value1, value2, "province");
return (Criteria) this;
}
public Criteria andCityIsNull() {
addCriterion("city is null");
return (Criteria) this;
}
public Criteria andCityIsNotNull() {
addCriterion("city is not null");
return (Criteria) this;
}
public Criteria andCityEqualTo(String value) {
addCriterion("city =", value, "city");
return (Criteria) this;
}
public Criteria andCityNotEqualTo(String value) {
addCriterion("city <>", value, "city");
return (Criteria) this;
}
public Criteria andCityGreaterThan(String value) {
addCriterion("city >", value, "city");
return (Criteria) this;
}
public Criteria andCityGreaterThanOrEqualTo(String value) {
addCriterion("city >=", value, "city");
return (Criteria) this;
}
public Criteria andCityLessThan(String value) {
addCriterion("city <", value, "city");
return (Criteria) this;
}
public Criteria andCityLessThanOrEqualTo(String value) {
addCriterion("city <=", value, "city");
return (Criteria) this;
}
public Criteria andCityLike(String value) {
addCriterion("city like", value, "city");
return (Criteria) this;
}
public Criteria andCityNotLike(String value) {
addCriterion("city not like", value, "city");
return (Criteria) this;
}
public Criteria andCityIn(List<String> values) {
addCriterion("city in", values, "city");
return (Criteria) this;
}
public Criteria andCityNotIn(List<String> values) {
addCriterion("city not in", values, "city");
return (Criteria) this;
}
public Criteria andCityBetween(String value1, String value2) {
addCriterion("city between", value1, value2, "city");
return (Criteria) this;
}
public Criteria andCityNotBetween(String value1, String value2) {
addCriterion("city not between", value1, value2, "city");
return (Criteria) this;
}
public Criteria andPhoneIsNull() {
addCriterion("phone is null");
return (Criteria) this;
}
public Criteria andPhoneIsNotNull() {
addCriterion("phone is not null");
return (Criteria) this;
}
public Criteria andPhoneEqualTo(String value) {
addCriterion("phone =", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneNotEqualTo(String value) {
addCriterion("phone <>", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneGreaterThan(String value) {
addCriterion("phone >", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneGreaterThanOrEqualTo(String value) {
addCriterion("phone >=", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneLessThan(String value) {
addCriterion("phone <", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneLessThanOrEqualTo(String value) {
addCriterion("phone <=", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneLike(String value) {
addCriterion("phone like", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneNotLike(String value) {
addCriterion("phone not like", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneIn(List<String> values) {
addCriterion("phone in", values, "phone");
return (Criteria) this;
}
public Criteria andPhoneNotIn(List<String> values) {
addCriterion("phone not in", values, "phone");
return (Criteria) this;
}
public Criteria andPhoneBetween(String value1, String value2) {
addCriterion("phone between", value1, value2, "phone");
return (Criteria) this;
}
public Criteria andPhoneNotBetween(String value1, String value2) {
addCriterion("phone not between", value1, value2, "phone");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

100
src/main/java/com/ccsens/braintraining/bean/vo/RaffleVo.java

@ -0,0 +1,100 @@
package com.ccsens.braintraining.bean.vo;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @description:
* @author: whj
* @time: 2022/3/15 11:30
*/
public class RaffleVo {
@Data
@ApiModel("抽奖活动-响应")
public static class Active {
private Intro active;
private List<Prize> prizes;
private List<Task> tasks;
}
@Data
@ApiModel("抽奖活动-活动介绍-响应")
public static class Intro {
@ApiModelProperty("抽奖ID")
private Long activeId;
@ApiModelProperty("标题")
private String title;
@ApiModelProperty("副标题")
private String subtitle;
@ApiModelProperty("免费抽奖次数")
private Byte freeTimes;
@ApiModelProperty("开始时间")
private Long startTime;
@ApiModelProperty("结束时间")
private Long endTime;
}
@Data
@ApiModel("抽奖活动-奖品-响应")
public static class Prize {
@ApiModelProperty("奖品ID")
private Long prizeId;
@ApiModelProperty("奖品名称")
private String name;
@ApiModelProperty("奖品图标")
private String icon;
}
@Data
@ApiModel("抽奖活动-任务-响应")
public static class Task {
@ApiModelProperty("任务ID")
private Long taskId;
@ApiModelProperty("奖品名称")
private String name;
@ApiModelProperty("奖品图标")
private String icon;
@ApiModelProperty("执行类型 0:关注公众号 1:完善信息")
private Byte type;
@ApiModelProperty("完成状态 0:未完成 1:已完成 2:以前完成")
private Byte finishStatus;
}
@Data
@ApiModel("中奖纪录")
public static class PrizeRecord {
@ApiModelProperty("奖品名称")
private String prizeName;
@ApiModelProperty("用户名")
private String userName;
public String getUserName() {
String key = "*";
if (StrUtil.isEmpty(userName)) {
return key;
}
switch (userName.length()) {
case 0: return key;
case 1: return userName + key;
case 2: return userName.substring(0,1) + key;
default: return userName.substring(0,1) + key + userName.substring(userName.length() - 1);
}
}
}
@Data
@ApiModel("剩余奖品-奖品-响应")
public static class PrizeRemain {
@ApiModelProperty("奖品ID")
private Long prizeId;
@ApiModelProperty("奖品名称")
private String name;
@ApiModelProperty("奖品图标")
private String icon;
@ApiModelProperty("剩余数量")
private Integer remain;
}
}

40
src/main/java/com/ccsens/braintraining/bean/vo/UserVo.java

@ -0,0 +1,40 @@
package com.ccsens.braintraining.bean.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @description:
* @author: whj
* @time: 2022/3/15 17:26
*/
public class UserVo {
@Data
@ApiModel("根据token获取用户信息")
public static class TokenToUserId{
@ApiModelProperty("用户id")
private Long id;
@ApiModelProperty("用户名")
private String userName;
@ApiModelProperty("头像")
private String avatarUrl;
@ApiModelProperty("手机号")
private String phone;
@ApiModelProperty("用户类型 0未认证 1已认证")
private byte authType;
@ApiModelProperty("token")
private String token;
@ApiModelProperty("刷新token")
private String refreshToken;
@ApiModelProperty("性别")
private Byte gender;
@ApiModelProperty("国家")
private String country;
@ApiModelProperty("省份")
private String province;
@ApiModelProperty("城市")
private String city;
}
}

6
src/main/java/com/ccsens/braintraining/config/SwaggerConfigure.java

@ -30,17 +30,17 @@ public class SwaggerConfigure {
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors
.basePackage("com.ccsens.datang.api"))
.basePackage("com.ccsens.braintraining.api"))
.build()
.globalOperationParameters(setHeaderToken());
}
private ApiInfo apiInfo() {
return new ApiInfo("Swagger Tall-game",
return new ApiInfo("Swagger BrainTraining",
"This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.",
"1.0.0",
"http://swagger.io/terms/",
"zhangsan",
"wu",
"Apache 2.0",
"http://www.apache.org/licenses/LICENSE-2.0.html"
);

48
src/main/java/com/ccsens/braintraining/persist/dao/RaffleDao.java

@ -0,0 +1,48 @@
package com.ccsens.braintraining.persist.dao;
import com.ccsens.braintraining.bean.vo.RaffleVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author: whj
* @time: 2022/3/15 11:24
*/
public interface RaffleDao {
/**
* 查询设备当前进行的抽奖活动
* @param equipmentId 设备ID
* @param userId 用户ID
* @return 抽奖活动
*/
RaffleVo.Active queryActiveNow(@Param("equipmentId") Long equipmentId, @Param("userId") Long userId);
/**
* 查询活动中奖信息
* @param activeId 活动ID
* @return 中奖信息
*/
List<RaffleVo.PrizeRecord> queryPrizeRecord(@Param("activeId") Long activeId);
/**
* 统计剩余抽奖次数
* @param activeId 活动ID
* @param userId 用户ID
* @return 抽奖次数
*/
Integer countTimes(@Param("activeId") Long activeId, @Param("userId") Long userId);
/**
* 查询剩余的产品
* @param activeId 活动ID
* @return 剩余产品
*/
List<RaffleVo.PrizeRemain> queryRemainPrize(@Param("activeId") Long activeId);
/**
* 奖品的剩余数量减1
* @param prizeId 奖品ID
*/
void decreasePrize(@Param("prizeId") Long prizeId);
}

30
src/main/java/com/ccsens/braintraining/persist/mapper/RaffleActiveMapper.java

@ -0,0 +1,30 @@
package com.ccsens.braintraining.persist.mapper;
import com.ccsens.braintraining.bean.po.RaffleActive;
import com.ccsens.braintraining.bean.po.RaffleActiveExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface RaffleActiveMapper {
long countByExample(RaffleActiveExample example);
int deleteByExample(RaffleActiveExample example);
int deleteByPrimaryKey(Long id);
int insert(RaffleActive record);
int insertSelective(RaffleActive record);
List<RaffleActive> selectByExample(RaffleActiveExample example);
RaffleActive selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") RaffleActive record, @Param("example") RaffleActiveExample example);
int updateByExample(@Param("record") RaffleActive record, @Param("example") RaffleActiveExample example);
int updateByPrimaryKeySelective(RaffleActive record);
int updateByPrimaryKey(RaffleActive record);
}

30
src/main/java/com/ccsens/braintraining/persist/mapper/RafflePrizeMapper.java

@ -0,0 +1,30 @@
package com.ccsens.braintraining.persist.mapper;
import com.ccsens.braintraining.bean.po.RafflePrize;
import com.ccsens.braintraining.bean.po.RafflePrizeExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface RafflePrizeMapper {
long countByExample(RafflePrizeExample example);
int deleteByExample(RafflePrizeExample example);
int deleteByPrimaryKey(Long id);
int insert(RafflePrize record);
int insertSelective(RafflePrize record);
List<RafflePrize> selectByExample(RafflePrizeExample example);
RafflePrize selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") RafflePrize record, @Param("example") RafflePrizeExample example);
int updateByExample(@Param("record") RafflePrize record, @Param("example") RafflePrizeExample example);
int updateByPrimaryKeySelective(RafflePrize record);
int updateByPrimaryKey(RafflePrize record);
}

30
src/main/java/com/ccsens/braintraining/persist/mapper/RaffleRecordMapper.java

@ -0,0 +1,30 @@
package com.ccsens.braintraining.persist.mapper;
import com.ccsens.braintraining.bean.po.RaffleRecord;
import com.ccsens.braintraining.bean.po.RaffleRecordExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface RaffleRecordMapper {
long countByExample(RaffleRecordExample example);
int deleteByExample(RaffleRecordExample example);
int deleteByPrimaryKey(Long id);
int insert(RaffleRecord record);
int insertSelective(RaffleRecord record);
List<RaffleRecord> selectByExample(RaffleRecordExample example);
RaffleRecord selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") RaffleRecord record, @Param("example") RaffleRecordExample example);
int updateByExample(@Param("record") RaffleRecord record, @Param("example") RaffleRecordExample example);
int updateByPrimaryKeySelective(RaffleRecord record);
int updateByPrimaryKey(RaffleRecord record);
}

30
src/main/java/com/ccsens/braintraining/persist/mapper/RaffleTaskMapper.java

@ -0,0 +1,30 @@
package com.ccsens.braintraining.persist.mapper;
import com.ccsens.braintraining.bean.po.RaffleTask;
import com.ccsens.braintraining.bean.po.RaffleTaskExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface RaffleTaskMapper {
long countByExample(RaffleTaskExample example);
int deleteByExample(RaffleTaskExample example);
int deleteByPrimaryKey(Long id);
int insert(RaffleTask record);
int insertSelective(RaffleTask record);
List<RaffleTask> selectByExample(RaffleTaskExample example);
RaffleTask selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") RaffleTask record, @Param("example") RaffleTaskExample example);
int updateByExample(@Param("record") RaffleTask record, @Param("example") RaffleTaskExample example);
int updateByPrimaryKeySelective(RaffleTask record);
int updateByPrimaryKey(RaffleTask record);
}

30
src/main/java/com/ccsens/braintraining/persist/mapper/RaffleTaskParamMapper.java

@ -0,0 +1,30 @@
package com.ccsens.braintraining.persist.mapper;
import com.ccsens.braintraining.bean.po.RaffleTaskParam;
import com.ccsens.braintraining.bean.po.RaffleTaskParamExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface RaffleTaskParamMapper {
long countByExample(RaffleTaskParamExample example);
int deleteByExample(RaffleTaskParamExample example);
int deleteByPrimaryKey(Long id);
int insert(RaffleTaskParam record);
int insertSelective(RaffleTaskParam record);
List<RaffleTaskParam> selectByExample(RaffleTaskParamExample example);
RaffleTaskParam selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") RaffleTaskParam record, @Param("example") RaffleTaskParamExample example);
int updateByExample(@Param("record") RaffleTaskParam record, @Param("example") RaffleTaskParamExample example);
int updateByPrimaryKeySelective(RaffleTaskParam record);
int updateByPrimaryKey(RaffleTaskParam record);
}

30
src/main/java/com/ccsens/braintraining/persist/mapper/RaffleTimesMapper.java

@ -0,0 +1,30 @@
package com.ccsens.braintraining.persist.mapper;
import com.ccsens.braintraining.bean.po.RaffleTimes;
import com.ccsens.braintraining.bean.po.RaffleTimesExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface RaffleTimesMapper {
long countByExample(RaffleTimesExample example);
int deleteByExample(RaffleTimesExample example);
int deleteByPrimaryKey(Long id);
int insert(RaffleTimes record);
int insertSelective(RaffleTimes record);
List<RaffleTimes> selectByExample(RaffleTimesExample example);
RaffleTimes selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") RaffleTimes record, @Param("example") RaffleTimesExample example);
int updateByExample(@Param("record") RaffleTimes record, @Param("example") RaffleTimesExample example);
int updateByPrimaryKeySelective(RaffleTimes record);
int updateByPrimaryKey(RaffleTimes record);
}

30
src/main/java/com/ccsens/braintraining/persist/mapper/UserMapper.java

@ -0,0 +1,30 @@
package com.ccsens.braintraining.persist.mapper;
import com.ccsens.braintraining.bean.po.User;
import com.ccsens.braintraining.bean.po.UserExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface UserMapper {
long countByExample(UserExample example);
int deleteByExample(UserExample example);
int deleteByPrimaryKey(Long id);
int insert(User record);
int insertSelective(User record);
List<User> selectByExample(UserExample example);
User selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);
int updateByExample(@Param("record") User record, @Param("example") UserExample example);
int updateByPrimaryKeySelective(User record);
int updateByPrimaryKey(User record);
}

35
src/main/java/com/ccsens/braintraining/service/IRaffleService.java

@ -0,0 +1,35 @@
package com.ccsens.braintraining.service;
import com.ccsens.braintraining.bean.dto.RaffleDto;
import com.ccsens.braintraining.bean.vo.RaffleVo;
import com.github.pagehelper.PageInfo;
/**
* @author: whj
* @time: 2022/3/15 11:23
*/
public interface IRaffleService {
/**
* 查询当前的抽奖活动
* @param param 设备
* @param userId 操作者ID
* @return 抽奖信息
*/
RaffleVo.Active active(RaffleDto.Equipment param, Long userId);
/**
* 中奖信息
* @param param 分页
* @param userId 操作者ID
* @return 中奖信息
*/
PageInfo<RaffleVo.PrizeRecord> prizeRecord(RaffleDto.RecordList param, Long userId);
/**
* 抽奖
* @param param 活动
* @param userId 用户ID
* @return 奖品
*/
RaffleVo.Prize draw(RaffleDto.ActiveId param, Long userId);
}

111
src/main/java/com/ccsens/braintraining/service/RaffleService.java

@ -0,0 +1,111 @@
package com.ccsens.braintraining.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Snowflake;
import com.ccsens.braintraining.bean.dto.RaffleDto;
import com.ccsens.braintraining.bean.po.RaffleActive;
import com.ccsens.braintraining.bean.po.RaffleRecord;
import com.ccsens.braintraining.bean.vo.RaffleVo;
import com.ccsens.braintraining.persist.dao.RaffleDao;
import com.ccsens.braintraining.persist.mapper.RaffleActiveMapper;
import com.ccsens.braintraining.persist.mapper.RaffleRecordMapper;
import com.ccsens.braintraining.util.BrainTrainingCodeError;
import com.ccsens.util.exception.BaseException;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import java.util.Random;
/**
* @description:
* @author: whj
* @time: 2022/3/15 11:23
*/
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class RaffleService implements IRaffleService {
@Resource
private Snowflake snowflake;
@Resource
private RaffleDao raffleDao;
@Resource
private RaffleActiveMapper raffleActiveMapper;
@Resource
private RaffleRecordMapper raffleRecordMapper;
@Override
public RaffleVo.Active active(RaffleDto.Equipment param, Long userId) {
return raffleDao.queryActiveNow(param.getEquipmentId(), userId);
}
@Override
public PageInfo<RaffleVo.PrizeRecord> prizeRecord(RaffleDto.RecordList param, Long userId) {
PageHelper.startPage(param.getPageNum(), param.getPageSize());
List<RaffleVo.PrizeRecord> records = raffleDao.queryPrizeRecord(param.getActiveId());
return new PageInfo(records);
}
@Override
public RaffleVo.Prize draw(RaffleDto.ActiveId param, Long userId) {
// 判断抽奖是否在活动期
RaffleActive active = raffleActiveMapper.selectByPrimaryKey(param.getActiveId());
Long now = System.currentTimeMillis();
if (active == null || now < active.getStartTime() || now > active.getEndTime()) {
throw new BaseException(BrainTrainingCodeError.RAFFLE_ACTIVE_NOT_OPEN);
}
synchronized (this) {
// 判断用户有没有抽奖权限
Integer remainTimes = raffleDao.countTimes(param.getActiveId(), userId);
if (remainTimes == null || remainTimes <= 0) {
throw new BaseException(BrainTrainingCodeError.RAFFLE_ACTIVE_NOT_TIMES);
}
// 活动奖品
List<RaffleVo.PrizeRemain> remains = raffleDao.queryRemainPrize(param.getActiveId());
if (CollectionUtil.isEmpty(remains)) {
throw new BaseException(BrainTrainingCodeError.RAFFLE_ACTIVE_PRIZE_NO);
}
int[] nums = new int[remains.size()];
int total = 0;
for (int i = 0; i < remains.size(); i++) {
RaffleVo.PrizeRemain remain = remains.get(i);
nums[i] = i == 0 ? remain.getRemain(): nums[i-1] + remain.getRemain();
total += remain.getRemain();
}
int random = new Random().nextInt(total);
int index = -1;
if (random < nums[0]) {
index = 0;
} else {
for (int i = 1; i < remains.size() ; i++) {
if (random >= nums[i-1] && random < nums[i]) {
index = i;
break;
}
}
}
log.info("index:{}", index);
RaffleVo.PrizeRemain remain = remains.get(index);
RaffleVo.Prize prize = new RaffleVo.Prize();
BeanUtils.copyProperties(remain, prize);
// 添加中奖纪录
RaffleRecord record = new RaffleRecord();
record.setId(snowflake.nextId());
record.setPrizeId(prize.getPrizeId());
record.setUserId(userId);
raffleRecordMapper.insertSelective(record);
// 设置最小
raffleDao.decreasePrize(prize.getPrizeId());
return prize;
}
}
}

4
src/main/java/com/ccsens/braintraining/util/BrainTrainingCodeError.java

@ -9,6 +9,8 @@ import com.ccsens.util.CodeError;
*/
public class BrainTrainingCodeError extends CodeError {
public static final Code RAFFLE_ACTIVE_NOT_OPEN = new Code(501,"抽奖活动暂未开放,请开发后再参与活动。",true);
public static final Code RAFFLE_ACTIVE_NOT_TIMES = new Code(502,"您的抽奖机会已经用完了。",true);
public static final Code RAFFLE_ACTIVE_PRIZE_NO = new Code(503,"亟待运营人员补充奖品,请您稍后再试。",true);
}

5
src/main/java/com/ccsens/braintraining/util/BrainTrainingConstant.java

@ -8,4 +8,9 @@ import com.ccsens.util.WebConstant;
* @time: 2022/3/4 9:44
*/
public class BrainTrainingConstant extends WebConstant {
public static class User{
public final static String USER_IDS_KEY = "brain_training_user_ids";
}
}

3
src/main/resources/application-dev.yml

@ -48,3 +48,6 @@ file:
path: /home/cloud/braintraining/uploads/
domain: http://127.0.0.1:7280/v1.0/
imgDomain: http://127.0.0.1:7280/v1.0/uploads/
url:
token: http://101.201.226.163/gateway/ptostall/users/token
refreshToken: http://101.201.226.163/gateway/ptostall/users/refreshToken

2
src/main/resources/application-prod.yml

@ -14,3 +14,5 @@ file:
path: /home/cloud/braintraining/uploads/
domain: https://www.tall.wiki/braintraining/v1.0/
imgDomain: https://www.tall.wiki/braintraining/v1.0/uploads/
url:
token: http://101.201.226.163/gateway/ptostall/users/token

2
src/main/resources/application-test.yml

@ -14,3 +14,5 @@ file:
path: /home/cloud/braintraining/uploads/
domain: http://test.tall.wiki/braintraining/v1.0/
imgDomain: http://test.tall.wiki/braintraining/v1.0/uploads/
url:
token: http://101.201.226.163/gateway/ptostall/users/token

135
src/main/resources/mapper_dao/RaffleDao.xml

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.braintraining.persist.dao.RaffleDao">
<resultMap id="ActiveMap" type="com.ccsens.braintraining.bean.vo.RaffleVo$Active">
<id column="activeId"/>
<association property="active" javaType="com.ccsens.braintraining.bean.vo.RaffleVo$Intro">
<id property="activeId" column="activeId"/>
<result property="title" column="title"/>
<result property="subtitle" column="subtitle"/>
<result property="freeTimes" column="freeTimes"/>
<result property="startTime" column="startTime"/>
<result property="endTime" column="endTime"/>
</association>
<collection property="prizes" ofType="com.ccsens.braintraining.bean.vo.RaffleVo$Prize">
<id property="prizeId" column="prizeId"/>
<result property="name" column="prizeName"/>
<result property="icon" column="prizeIcon"/>
</collection>
<collection property="tasks" ofType="com.ccsens.braintraining.bean.vo.RaffleVo$Task">
<id property="taskId" column="taskId"/>
<result property="name" column="taskName"/>
<result property="icon" column="taskIcon"/>
<result property="type" column="type"/>
<result property="finishStatus" column="finishStatus"/>
</collection>
</resultMap>
<update id="decreasePrize">
UPDATE t_raffle_prize
SET remain = remain - 1
WHERE
id = #{prizeId}
</update>
<select id="queryActiveNow" resultMap="ActiveMap">
SELECT
a.id AS activeId,
a.title,
a.subtitle,
a.free_times AS freeTimes,
a.start_time AS startTime,
a.end_time AS endTime,
p.id AS prizeId,
p.NAME AS prizeName,
p.icon AS prizeIcon,
t.id AS taskId,
t.NAME AS taskName,
t.icon AS taskIcon,
t.type,
IF( t2.id IS NULL, 0, t2.finish_type + 1 ) AS finishStatus
FROM
(select * from t_raffle_active WHERE equipment_id = #{equipmentId} AND start_time &lt;= UNIX_TIMESTAMP(now()) * 1000 AND end_time &gt;= UNIX_TIMESTAMP(now()) * 1000 AND rec_status = 0 order by id desc limit 1) a
LEFT JOIN t_raffle_prize p ON a.id = p.active_id
AND p.total > 0
AND p.rec_status = 0
LEFT JOIN t_raffle_task t ON a.id = t.active_id
AND t.rec_status = 0
LEFT JOIN t_raffle_times t2 ON t.id = t2.task_id
<choose>
<when test="userId != null and userId != 0">AND t2.user_id = #{userId}</when>
<otherwise>AND t2.id is null</otherwise>
</choose>
AND t2.rec_status = 0
</select>
<select id="queryPrizeRecord" resultType="com.ccsens.braintraining.bean.vo.RaffleVo$PrizeRecord">
SELECT
p.NAME AS prizeName,
u.NAME AS userName
FROM
t_raffle_record r,
t_raffle_prize p,
t_user u
WHERE
r.prize_id = p.id
AND r.user_id = u.id
AND p.active_id = #{activeId}
AND p.type > 0
AND r.rec_status = 0
AND p.rec_status = 0
AND u.rec_status = 0
ORDER BY
r.id DESC
</select>
<select id="countTimes" resultType="java.lang.Integer">
SELECT
sum( IFNULL(a.free_times,0) + IFNULL(t.addTimes,0) - IFNULL(r.usedTimes,0) )
FROM
t_raffle_active a,
(
SELECT
sum( t1.increase_times ) AS addTimes
FROM
t_raffle_task t1,
t_raffle_times t2
WHERE
t1.id = t2.task_id
AND t1.active_id = #{activeId}
AND t2.user_id = #{userId}
AND t1.rec_status = 0
AND t2.rec_status = 0
) t,
(
SELECT
count(*) AS usedTimes
FROM
t_raffle_record r,
t_raffle_prize p
WHERE
r.prize_id = p.id
AND p.active_id = #{activeId}
AND r.user_id = #{userId}
AND r.rec_status = 0
AND p.rec_status = 0
) r
WHERE
a.id = #{activeId}
AND a.rec_status = 0
</select>
<select id="queryRemainPrize" resultType="com.ccsens.braintraining.bean.vo.RaffleVo$PrizeRemain">
SELECT
id AS prizeId,
NAME,
icon,
remain
FROM
t_raffle_prize
WHERE
active_id = #{activeId}
AND remain > 0
AND rec_status = 0
ORDER BY
id
</select>
</mapper>

323
src/main/resources/mapper_raw/RaffleActiveMapper.xml

@ -0,0 +1,323 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.braintraining.persist.mapper.RaffleActiveMapper">
<resultMap id="BaseResultMap" type="com.ccsens.braintraining.bean.po.RaffleActive">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="equipment_id" jdbcType="BIGINT" property="equipmentId" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="subtitle" jdbcType="VARCHAR" property="subtitle" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="free_times" jdbcType="TINYINT" property="freeTimes" />
<result column="start_time" jdbcType="BIGINT" property="startTime" />
<result column="end_time" jdbcType="BIGINT" property="endTime" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, equipment_id, title, subtitle, description, free_times, start_time, end_time,
operator, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.braintraining.bean.po.RaffleActiveExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_raffle_active
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_raffle_active
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_raffle_active
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.braintraining.bean.po.RaffleActiveExample">
delete from t_raffle_active
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.braintraining.bean.po.RaffleActive">
insert into t_raffle_active (id, equipment_id, title,
subtitle, description, free_times,
start_time, end_time, operator,
created_at, updated_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{equipmentId,jdbcType=BIGINT}, #{title,jdbcType=VARCHAR},
#{subtitle,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{freeTimes,jdbcType=TINYINT},
#{startTime,jdbcType=BIGINT}, #{endTime,jdbcType=BIGINT}, #{operator,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.braintraining.bean.po.RaffleActive">
insert into t_raffle_active
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="equipmentId != null">
equipment_id,
</if>
<if test="title != null">
title,
</if>
<if test="subtitle != null">
subtitle,
</if>
<if test="description != null">
description,
</if>
<if test="freeTimes != null">
free_times,
</if>
<if test="startTime != null">
start_time,
</if>
<if test="endTime != null">
end_time,
</if>
<if test="operator != null">
operator,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="equipmentId != null">
#{equipmentId,jdbcType=BIGINT},
</if>
<if test="title != null">
#{title,jdbcType=VARCHAR},
</if>
<if test="subtitle != null">
#{subtitle,jdbcType=VARCHAR},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="freeTimes != null">
#{freeTimes,jdbcType=TINYINT},
</if>
<if test="startTime != null">
#{startTime,jdbcType=BIGINT},
</if>
<if test="endTime != null">
#{endTime,jdbcType=BIGINT},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.braintraining.bean.po.RaffleActiveExample" resultType="java.lang.Long">
select count(*) from t_raffle_active
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_raffle_active
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.equipmentId != null">
equipment_id = #{record.equipmentId,jdbcType=BIGINT},
</if>
<if test="record.title != null">
title = #{record.title,jdbcType=VARCHAR},
</if>
<if test="record.subtitle != null">
subtitle = #{record.subtitle,jdbcType=VARCHAR},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.freeTimes != null">
free_times = #{record.freeTimes,jdbcType=TINYINT},
</if>
<if test="record.startTime != null">
start_time = #{record.startTime,jdbcType=BIGINT},
</if>
<if test="record.endTime != null">
end_time = #{record.endTime,jdbcType=BIGINT},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_raffle_active
set id = #{record.id,jdbcType=BIGINT},
equipment_id = #{record.equipmentId,jdbcType=BIGINT},
title = #{record.title,jdbcType=VARCHAR},
subtitle = #{record.subtitle,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
free_times = #{record.freeTimes,jdbcType=TINYINT},
start_time = #{record.startTime,jdbcType=BIGINT},
end_time = #{record.endTime,jdbcType=BIGINT},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.braintraining.bean.po.RaffleActive">
update t_raffle_active
<set>
<if test="equipmentId != null">
equipment_id = #{equipmentId,jdbcType=BIGINT},
</if>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="subtitle != null">
subtitle = #{subtitle,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="freeTimes != null">
free_times = #{freeTimes,jdbcType=TINYINT},
</if>
<if test="startTime != null">
start_time = #{startTime,jdbcType=BIGINT},
</if>
<if test="endTime != null">
end_time = #{endTime,jdbcType=BIGINT},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.braintraining.bean.po.RaffleActive">
update t_raffle_active
set equipment_id = #{equipmentId,jdbcType=BIGINT},
title = #{title,jdbcType=VARCHAR},
subtitle = #{subtitle,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
free_times = #{freeTimes,jdbcType=TINYINT},
start_time = #{startTime,jdbcType=BIGINT},
end_time = #{endTime,jdbcType=BIGINT},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

338
src/main/resources/mapper_raw/RafflePrizeMapper.xml

@ -0,0 +1,338 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.braintraining.persist.mapper.RafflePrizeMapper">
<resultMap id="BaseResultMap" type="com.ccsens.braintraining.bean.po.RafflePrize">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="active_id" jdbcType="BIGINT" property="activeId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="icon" jdbcType="VARCHAR" property="icon" />
<result column="total" jdbcType="INTEGER" property="total" />
<result column="remain" jdbcType="INTEGER" property="remain" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="type" jdbcType="TINYINT" property="type" />
<result column="param" jdbcType="VARCHAR" property="param" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, active_id, name, icon, total, remain, description, type, param, operator, created_at,
updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.braintraining.bean.po.RafflePrizeExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_raffle_prize
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_raffle_prize
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_raffle_prize
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.braintraining.bean.po.RafflePrizeExample">
delete from t_raffle_prize
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.braintraining.bean.po.RafflePrize">
insert into t_raffle_prize (id, active_id, name,
icon, total, remain,
description, type, param,
operator, created_at, updated_at,
rec_status)
values (#{id,jdbcType=BIGINT}, #{activeId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
#{icon,jdbcType=VARCHAR}, #{total,jdbcType=INTEGER}, #{remain,jdbcType=INTEGER},
#{description,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT}, #{param,jdbcType=VARCHAR},
#{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.braintraining.bean.po.RafflePrize">
insert into t_raffle_prize
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="activeId != null">
active_id,
</if>
<if test="name != null">
name,
</if>
<if test="icon != null">
icon,
</if>
<if test="total != null">
total,
</if>
<if test="remain != null">
remain,
</if>
<if test="description != null">
description,
</if>
<if test="type != null">
type,
</if>
<if test="param != null">
param,
</if>
<if test="operator != null">
operator,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="activeId != null">
#{activeId,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="icon != null">
#{icon,jdbcType=VARCHAR},
</if>
<if test="total != null">
#{total,jdbcType=INTEGER},
</if>
<if test="remain != null">
#{remain,jdbcType=INTEGER},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="type != null">
#{type,jdbcType=TINYINT},
</if>
<if test="param != null">
#{param,jdbcType=VARCHAR},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.braintraining.bean.po.RafflePrizeExample" resultType="java.lang.Long">
select count(*) from t_raffle_prize
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_raffle_prize
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.activeId != null">
active_id = #{record.activeId,jdbcType=BIGINT},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.icon != null">
icon = #{record.icon,jdbcType=VARCHAR},
</if>
<if test="record.total != null">
total = #{record.total,jdbcType=INTEGER},
</if>
<if test="record.remain != null">
remain = #{record.remain,jdbcType=INTEGER},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=TINYINT},
</if>
<if test="record.param != null">
param = #{record.param,jdbcType=VARCHAR},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_raffle_prize
set id = #{record.id,jdbcType=BIGINT},
active_id = #{record.activeId,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
icon = #{record.icon,jdbcType=VARCHAR},
total = #{record.total,jdbcType=INTEGER},
remain = #{record.remain,jdbcType=INTEGER},
description = #{record.description,jdbcType=VARCHAR},
type = #{record.type,jdbcType=TINYINT},
param = #{record.param,jdbcType=VARCHAR},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.braintraining.bean.po.RafflePrize">
update t_raffle_prize
<set>
<if test="activeId != null">
active_id = #{activeId,jdbcType=BIGINT},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="icon != null">
icon = #{icon,jdbcType=VARCHAR},
</if>
<if test="total != null">
total = #{total,jdbcType=INTEGER},
</if>
<if test="remain != null">
remain = #{remain,jdbcType=INTEGER},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="type != null">
type = #{type,jdbcType=TINYINT},
</if>
<if test="param != null">
param = #{param,jdbcType=VARCHAR},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.braintraining.bean.po.RafflePrize">
update t_raffle_prize
set active_id = #{activeId,jdbcType=BIGINT},
name = #{name,jdbcType=VARCHAR},
icon = #{icon,jdbcType=VARCHAR},
total = #{total,jdbcType=INTEGER},
remain = #{remain,jdbcType=INTEGER},
description = #{description,jdbcType=VARCHAR},
type = #{type,jdbcType=TINYINT},
param = #{param,jdbcType=VARCHAR},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

243
src/main/resources/mapper_raw/RaffleRecordMapper.xml

@ -0,0 +1,243 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.braintraining.persist.mapper.RaffleRecordMapper">
<resultMap id="BaseResultMap" type="com.ccsens.braintraining.bean.po.RaffleRecord">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="prize_id" jdbcType="BIGINT" property="prizeId" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, prize_id, user_id, operator, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.braintraining.bean.po.RaffleRecordExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_raffle_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_raffle_record
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_raffle_record
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.braintraining.bean.po.RaffleRecordExample">
delete from t_raffle_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.braintraining.bean.po.RaffleRecord">
insert into t_raffle_record (id, prize_id, user_id,
operator, created_at, updated_at,
rec_status)
values (#{id,jdbcType=BIGINT}, #{prizeId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT},
#{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.braintraining.bean.po.RaffleRecord">
insert into t_raffle_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="prizeId != null">
prize_id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="operator != null">
operator,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="prizeId != null">
#{prizeId,jdbcType=BIGINT},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.braintraining.bean.po.RaffleRecordExample" resultType="java.lang.Long">
select count(*) from t_raffle_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_raffle_record
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.prizeId != null">
prize_id = #{record.prizeId,jdbcType=BIGINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_raffle_record
set id = #{record.id,jdbcType=BIGINT},
prize_id = #{record.prizeId,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.braintraining.bean.po.RaffleRecord">
update t_raffle_record
<set>
<if test="prizeId != null">
prize_id = #{prizeId,jdbcType=BIGINT},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.braintraining.bean.po.RaffleRecord">
update t_raffle_record
set prize_id = #{prizeId,jdbcType=BIGINT},
user_id = #{userId,jdbcType=BIGINT},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

338
src/main/resources/mapper_raw/RaffleTaskMapper.xml

@ -0,0 +1,338 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.braintraining.persist.mapper.RaffleTaskMapper">
<resultMap id="BaseResultMap" type="com.ccsens.braintraining.bean.po.RaffleTask">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="active_id" jdbcType="BIGINT" property="activeId" />
<result column="icon" jdbcType="VARCHAR" property="icon" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="period" jdbcType="TINYINT" property="period" />
<result column="run_times" jdbcType="INTEGER" property="runTimes" />
<result column="type" jdbcType="TINYINT" property="type" />
<result column="increase_times" jdbcType="INTEGER" property="increaseTimes" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, active_id, icon, name, description, period, run_times, type, increase_times,
operator, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.braintraining.bean.po.RaffleTaskExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_raffle_task
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_raffle_task
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_raffle_task
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.braintraining.bean.po.RaffleTaskExample">
delete from t_raffle_task
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.braintraining.bean.po.RaffleTask">
insert into t_raffle_task (id, active_id, icon,
name, description, period,
run_times, type, increase_times,
operator, created_at, updated_at,
rec_status)
values (#{id,jdbcType=BIGINT}, #{activeId,jdbcType=BIGINT}, #{icon,jdbcType=VARCHAR},
#{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{period,jdbcType=TINYINT},
#{runTimes,jdbcType=INTEGER}, #{type,jdbcType=TINYINT}, #{increaseTimes,jdbcType=INTEGER},
#{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.braintraining.bean.po.RaffleTask">
insert into t_raffle_task
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="activeId != null">
active_id,
</if>
<if test="icon != null">
icon,
</if>
<if test="name != null">
name,
</if>
<if test="description != null">
description,
</if>
<if test="period != null">
period,
</if>
<if test="runTimes != null">
run_times,
</if>
<if test="type != null">
type,
</if>
<if test="increaseTimes != null">
increase_times,
</if>
<if test="operator != null">
operator,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="activeId != null">
#{activeId,jdbcType=BIGINT},
</if>
<if test="icon != null">
#{icon,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="period != null">
#{period,jdbcType=TINYINT},
</if>
<if test="runTimes != null">
#{runTimes,jdbcType=INTEGER},
</if>
<if test="type != null">
#{type,jdbcType=TINYINT},
</if>
<if test="increaseTimes != null">
#{increaseTimes,jdbcType=INTEGER},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.braintraining.bean.po.RaffleTaskExample" resultType="java.lang.Long">
select count(*) from t_raffle_task
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_raffle_task
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.activeId != null">
active_id = #{record.activeId,jdbcType=BIGINT},
</if>
<if test="record.icon != null">
icon = #{record.icon,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.period != null">
period = #{record.period,jdbcType=TINYINT},
</if>
<if test="record.runTimes != null">
run_times = #{record.runTimes,jdbcType=INTEGER},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=TINYINT},
</if>
<if test="record.increaseTimes != null">
increase_times = #{record.increaseTimes,jdbcType=INTEGER},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_raffle_task
set id = #{record.id,jdbcType=BIGINT},
active_id = #{record.activeId,jdbcType=BIGINT},
icon = #{record.icon,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
period = #{record.period,jdbcType=TINYINT},
run_times = #{record.runTimes,jdbcType=INTEGER},
type = #{record.type,jdbcType=TINYINT},
increase_times = #{record.increaseTimes,jdbcType=INTEGER},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.braintraining.bean.po.RaffleTask">
update t_raffle_task
<set>
<if test="activeId != null">
active_id = #{activeId,jdbcType=BIGINT},
</if>
<if test="icon != null">
icon = #{icon,jdbcType=VARCHAR},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="period != null">
period = #{period,jdbcType=TINYINT},
</if>
<if test="runTimes != null">
run_times = #{runTimes,jdbcType=INTEGER},
</if>
<if test="type != null">
type = #{type,jdbcType=TINYINT},
</if>
<if test="increaseTimes != null">
increase_times = #{increaseTimes,jdbcType=INTEGER},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.braintraining.bean.po.RaffleTask">
update t_raffle_task
set active_id = #{activeId,jdbcType=BIGINT},
icon = #{icon,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
period = #{period,jdbcType=TINYINT},
run_times = #{runTimes,jdbcType=INTEGER},
type = #{type,jdbcType=TINYINT},
increase_times = #{increaseTimes,jdbcType=INTEGER},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

258
src/main/resources/mapper_raw/RaffleTaskParamMapper.xml

@ -0,0 +1,258 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.braintraining.persist.mapper.RaffleTaskParamMapper">
<resultMap id="BaseResultMap" type="com.ccsens.braintraining.bean.po.RaffleTaskParam">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="task_id" jdbcType="BIGINT" property="taskId" />
<result column="key_word" jdbcType="VARCHAR" property="keyWord" />
<result column="key_value" jdbcType="VARCHAR" property="keyValue" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, task_id, key_word, key_value, operator, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.braintraining.bean.po.RaffleTaskParamExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_raffle_task_param
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_raffle_task_param
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_raffle_task_param
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.braintraining.bean.po.RaffleTaskParamExample">
delete from t_raffle_task_param
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.braintraining.bean.po.RaffleTaskParam">
insert into t_raffle_task_param (id, task_id, key_word,
key_value, operator, created_at,
updated_at, rec_status)
values (#{id,jdbcType=BIGINT}, #{taskId,jdbcType=BIGINT}, #{keyWord,jdbcType=VARCHAR},
#{keyValue,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.braintraining.bean.po.RaffleTaskParam">
insert into t_raffle_task_param
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="taskId != null">
task_id,
</if>
<if test="keyWord != null">
key_word,
</if>
<if test="keyValue != null">
key_value,
</if>
<if test="operator != null">
operator,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="taskId != null">
#{taskId,jdbcType=BIGINT},
</if>
<if test="keyWord != null">
#{keyWord,jdbcType=VARCHAR},
</if>
<if test="keyValue != null">
#{keyValue,jdbcType=VARCHAR},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.braintraining.bean.po.RaffleTaskParamExample" resultType="java.lang.Long">
select count(*) from t_raffle_task_param
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_raffle_task_param
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.taskId != null">
task_id = #{record.taskId,jdbcType=BIGINT},
</if>
<if test="record.keyWord != null">
key_word = #{record.keyWord,jdbcType=VARCHAR},
</if>
<if test="record.keyValue != null">
key_value = #{record.keyValue,jdbcType=VARCHAR},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_raffle_task_param
set id = #{record.id,jdbcType=BIGINT},
task_id = #{record.taskId,jdbcType=BIGINT},
key_word = #{record.keyWord,jdbcType=VARCHAR},
key_value = #{record.keyValue,jdbcType=VARCHAR},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.braintraining.bean.po.RaffleTaskParam">
update t_raffle_task_param
<set>
<if test="taskId != null">
task_id = #{taskId,jdbcType=BIGINT},
</if>
<if test="keyWord != null">
key_word = #{keyWord,jdbcType=VARCHAR},
</if>
<if test="keyValue != null">
key_value = #{keyValue,jdbcType=VARCHAR},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.braintraining.bean.po.RaffleTaskParam">
update t_raffle_task_param
set task_id = #{taskId,jdbcType=BIGINT},
key_word = #{keyWord,jdbcType=VARCHAR},
key_value = #{keyValue,jdbcType=VARCHAR},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

258
src/main/resources/mapper_raw/RaffleTimesMapper.xml

@ -0,0 +1,258 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.braintraining.persist.mapper.RaffleTimesMapper">
<resultMap id="BaseResultMap" type="com.ccsens.braintraining.bean.po.RaffleTimes">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="task_id" jdbcType="BIGINT" property="taskId" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="finish_type" jdbcType="TINYINT" property="finishType" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, task_id, user_id, finish_type, operator, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.braintraining.bean.po.RaffleTimesExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_raffle_times
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_raffle_times
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_raffle_times
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.braintraining.bean.po.RaffleTimesExample">
delete from t_raffle_times
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.braintraining.bean.po.RaffleTimes">
insert into t_raffle_times (id, task_id, user_id,
finish_type, operator, created_at,
updated_at, rec_status)
values (#{id,jdbcType=BIGINT}, #{taskId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT},
#{finishType,jdbcType=TINYINT}, #{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.braintraining.bean.po.RaffleTimes">
insert into t_raffle_times
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="taskId != null">
task_id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="finishType != null">
finish_type,
</if>
<if test="operator != null">
operator,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="taskId != null">
#{taskId,jdbcType=BIGINT},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="finishType != null">
#{finishType,jdbcType=TINYINT},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.braintraining.bean.po.RaffleTimesExample" resultType="java.lang.Long">
select count(*) from t_raffle_times
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_raffle_times
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.taskId != null">
task_id = #{record.taskId,jdbcType=BIGINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.finishType != null">
finish_type = #{record.finishType,jdbcType=TINYINT},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_raffle_times
set id = #{record.id,jdbcType=BIGINT},
task_id = #{record.taskId,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT},
finish_type = #{record.finishType,jdbcType=TINYINT},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.braintraining.bean.po.RaffleTimes">
update t_raffle_times
<set>
<if test="taskId != null">
task_id = #{taskId,jdbcType=BIGINT},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="finishType != null">
finish_type = #{finishType,jdbcType=TINYINT},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.braintraining.bean.po.RaffleTimes">
update t_raffle_times
set task_id = #{taskId,jdbcType=BIGINT},
user_id = #{userId,jdbcType=BIGINT},
finish_type = #{finishType,jdbcType=TINYINT},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

306
src/main/resources/mapper_raw/UserMapper.xml

@ -0,0 +1,306 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.braintraining.persist.mapper.UserMapper">
<resultMap id="BaseResultMap" type="com.ccsens.braintraining.bean.po.User">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="gender" jdbcType="TINYINT" property="gender" />
<result column="avatar_url" jdbcType="VARCHAR" property="avatarUrl" />
<result column="country" jdbcType="VARCHAR" property="country" />
<result column="province" jdbcType="VARCHAR" property="province" />
<result column="city" jdbcType="VARCHAR" property="city" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, name, gender, avatar_url, country, province, city, phone, created_at, updated_at,
rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.braintraining.bean.po.UserExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_user
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_user
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.braintraining.bean.po.UserExample">
delete from t_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.braintraining.bean.po.User">
insert into t_user (id, name, gender,
avatar_url, country, province,
city, phone, created_at,
updated_at, rec_status)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{gender,jdbcType=TINYINT},
#{avatarUrl,jdbcType=VARCHAR}, #{country,jdbcType=VARCHAR}, #{province,jdbcType=VARCHAR},
#{city,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.braintraining.bean.po.User">
insert into t_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="gender != null">
gender,
</if>
<if test="avatarUrl != null">
avatar_url,
</if>
<if test="country != null">
country,
</if>
<if test="province != null">
province,
</if>
<if test="city != null">
city,
</if>
<if test="phone != null">
phone,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="gender != null">
#{gender,jdbcType=TINYINT},
</if>
<if test="avatarUrl != null">
#{avatarUrl,jdbcType=VARCHAR},
</if>
<if test="country != null">
#{country,jdbcType=VARCHAR},
</if>
<if test="province != null">
#{province,jdbcType=VARCHAR},
</if>
<if test="city != null">
#{city,jdbcType=VARCHAR},
</if>
<if test="phone != null">
#{phone,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.braintraining.bean.po.UserExample" resultType="java.lang.Long">
select count(*) from t_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_user
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.gender != null">
gender = #{record.gender,jdbcType=TINYINT},
</if>
<if test="record.avatarUrl != null">
avatar_url = #{record.avatarUrl,jdbcType=VARCHAR},
</if>
<if test="record.country != null">
country = #{record.country,jdbcType=VARCHAR},
</if>
<if test="record.province != null">
province = #{record.province,jdbcType=VARCHAR},
</if>
<if test="record.city != null">
city = #{record.city,jdbcType=VARCHAR},
</if>
<if test="record.phone != null">
phone = #{record.phone,jdbcType=VARCHAR},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_user
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
gender = #{record.gender,jdbcType=TINYINT},
avatar_url = #{record.avatarUrl,jdbcType=VARCHAR},
country = #{record.country,jdbcType=VARCHAR},
province = #{record.province,jdbcType=VARCHAR},
city = #{record.city,jdbcType=VARCHAR},
phone = #{record.phone,jdbcType=VARCHAR},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.braintraining.bean.po.User">
update t_user
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="gender != null">
gender = #{gender,jdbcType=TINYINT},
</if>
<if test="avatarUrl != null">
avatar_url = #{avatarUrl,jdbcType=VARCHAR},
</if>
<if test="country != null">
country = #{country,jdbcType=VARCHAR},
</if>
<if test="province != null">
province = #{province,jdbcType=VARCHAR},
</if>
<if test="city != null">
city = #{city,jdbcType=VARCHAR},
</if>
<if test="phone != null">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.braintraining.bean.po.User">
update t_user
set name = #{name,jdbcType=VARCHAR},
gender = #{gender,jdbcType=TINYINT},
avatar_url = #{avatarUrl,jdbcType=VARCHAR},
country = #{country,jdbcType=VARCHAR},
province = #{province,jdbcType=VARCHAR},
city = #{city,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

7
src/main/resources/mbg.xml

@ -56,5 +56,12 @@
<property name="enableSubPackages" value="false" />
</javaClientGenerator>
<table tableName="t_assist_carousel" domainObjectName="AssistCarousel"/>
<table tableName="t_raffle_active" domainObjectName="RaffleActive"/>
<table tableName="t_raffle_prize" domainObjectName="RafflePrize"/>
<table tableName="t_raffle_record" domainObjectName="RaffleRecord"/>
<table tableName="t_raffle_task" domainObjectName="RaffleTask"/>
<table tableName="t_raffle_task_param" domainObjectName="RaffleTaskParam"/>
<table tableName="t_raffle_times" domainObjectName="RaffleTimes"/>
<table tableName="t_user" domainObjectName="User"/>
</context>
</generatorConfiguration>
Loading…
Cancel
Save