提交代码

yy_dev
胡锐 2 years ago
parent ef962770cb
commit 904cfee8e1
  1. 6
      bweb/src/main/java/com/bweb/controller/BsPayQrCodeController.java
  2. 11
      bweb/src/main/java/com/bweb/controller/BsStoreDiscountActivityController.java
  3. 8
      bweb/src/main/resources/dev/application.yml
  4. 4
      bweb/src/main/resources/dev/config.properties
  5. 4
      bweb/src/main/resources/pre/application.yml
  6. 1
      cweb/src/main/java/com/cweb/config/AuthConfig.java
  7. 28
      cweb/src/main/java/com/cweb/controller/BsPayQrCodeController.java
  8. 251
      cweb/src/main/java/com/cweb/controller/BsStoreDiscountActivityPartakeUserController.java
  9. 20
      cweb/src/main/java/com/cweb/controller/BsTradeOrderController.java
  10. 4
      cweb/src/main/java/com/cweb/controller/TestController.java
  11. 57
      cweb/src/main/java/com/cweb/notify/WeiXinController.java
  12. 8
      cweb/src/main/resources/dev/application.yml
  13. 4
      cweb/src/main/resources/pre/application.yml
  14. 4
      open-api/src/main/resources/dev/application.yml
  15. 4
      open-api/src/main/resources/pre/application.yml
  16. 8
      schedule/src/main/resources/dev/application.yml
  17. 4
      schedule/src/main/resources/pre/application.yml
  18. 22
      service/src/main/java/com/hfkj/channel/cpcn/CpcnTradeService.java
  19. 23
      service/src/main/java/com/hfkj/channel/cpcn/config/CpcnConfig.java
  20. 18
      service/src/main/java/com/hfkj/common/QRCodeGenerator.java
  21. 34
      service/src/main/java/com/hfkj/common/utils/StreamUtil.java
  22. 7
      service/src/main/java/com/hfkj/config/WeChatQrcodeUtils.java
  23. 41
      service/src/main/java/com/hfkj/dao/BsStoreDiscountActivityMapper.java
  24. 150
      service/src/main/java/com/hfkj/dao/BsStoreDiscountActivityPartakeUserMapper.java
  25. 7
      service/src/main/java/com/hfkj/dao/BsStoreDiscountActivityPartakeUserMapperExt.java
  26. 122
      service/src/main/java/com/hfkj/dao/BsStoreDiscountActivityPartakeUserRecordMapper.java
  27. 7
      service/src/main/java/com/hfkj/dao/BsStoreDiscountActivityPartakeUserRecordMapperExt.java
  28. 318
      service/src/main/java/com/hfkj/dao/BsStoreDiscountActivityPartakeUserRecordSqlProvider.java
  29. 416
      service/src/main/java/com/hfkj/dao/BsStoreDiscountActivityPartakeUserSqlProvider.java
  30. 42
      service/src/main/java/com/hfkj/dao/BsStoreDiscountActivitySqlProvider.java
  31. 48
      service/src/main/java/com/hfkj/entity/BsStoreDiscountActivity.java
  32. 180
      service/src/main/java/com/hfkj/entity/BsStoreDiscountActivityExample.java
  33. 329
      service/src/main/java/com/hfkj/entity/BsStoreDiscountActivityPartakeUser.java
  34. 1354
      service/src/main/java/com/hfkj/entity/BsStoreDiscountActivityPartakeUserExample.java
  35. 217
      service/src/main/java/com/hfkj/entity/BsStoreDiscountActivityPartakeUserRecord.java
  36. 934
      service/src/main/java/com/hfkj/entity/BsStoreDiscountActivityPartakeUserRecordExample.java
  37. 29
      service/src/main/java/com/hfkj/service/BsStoreDiscountActivityPartakeUserRecordService.java
  38. 46
      service/src/main/java/com/hfkj/service/BsStoreDiscountActivityPartakeUserService.java
  39. 6
      service/src/main/java/com/hfkj/service/BsStoreDiscountActivityService.java
  40. 15
      service/src/main/java/com/hfkj/service/BsTradeOrderService.java
  41. 4
      service/src/main/java/com/hfkj/service/impl/BsPayQrCodeServiceImpl.java
  42. 39
      service/src/main/java/com/hfkj/service/impl/BsStoreDiscountActivityPartakeUserRecordServiceImpl.java
  43. 178
      service/src/main/java/com/hfkj/service/impl/BsStoreDiscountActivityPartakeUserServiceImpl.java
  44. 33
      service/src/main/java/com/hfkj/service/impl/BsStoreDiscountActivityServiceImpl.java
  45. 59
      service/src/main/java/com/hfkj/service/impl/BsTradeOrderServiceImpl.java
  46. 49
      service/src/main/java/com/hfkj/sysenum/StoreDiscountActivityPartakeWayEnum.java
  47. 35
      service/src/main/java/com/hfkj/sysenum/WeChatQrCodeTypeEnum.java

@ -11,6 +11,7 @@ import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.EasyExcelUtil;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.config.CommonSysConst;
import com.hfkj.entity.BsPayQrCode;
import com.hfkj.model.ResponseData;
import com.hfkj.model.UserInfoModel;
@ -454,14 +455,13 @@ public class BsPayQrCodeController {
headList.add("门店");
headList.add("状态");
String fileUrl = SysConst.getSysConfig().getFileUrl() + "/temporary/";
String fileUrl = CommonSysConst.getSysConfig().getFilesystem() + "/temporary/";
String pathName = System.currentTimeMillis()+".xlsx";
File file = new File(fileUrl);
if (!file.exists()) {
file.mkdirs();
}
EasyExcel.write(fileUrl+pathName).head(EasyExcelUtil.generationHead(headList)).sheet("支付码").doWrite(dataList);
EasyExcel.write(fileUrl+pathName).head(EasyExcelUtil.generationHead(headList)).sheet("支付二维码").doWrite(dataList);
return ResponseMsgUtil.success(pathName);
} catch (Exception e) {

@ -14,6 +14,7 @@ import com.hfkj.model.UserInfoModel;
import com.hfkj.service.BsStoreDiscountActivityService;
import com.hfkj.service.BsStoreService;
import com.hfkj.sysenum.SecUserTypeEnum;
import com.hfkj.sysenum.StoreDiscountActivityPartakeWayEnum;
import com.hfkj.sysenum.StoreDiscountActivityStatusEnum;
import com.hfkj.sysenum.StoreDiscountActivityTypeEnum;
import io.swagger.annotations.Api;
@ -55,6 +56,7 @@ public class BsStoreDiscountActivityController {
public ResponseData configActivity(@RequestBody BsStoreDiscountActivity body) {
try {
if (body == null
|| body.getPartakeWay() == null
|| body.getStoreId() == null
|| StringUtils.isBlank(body.getName())
|| body.getDiscountType() == null
@ -71,6 +73,15 @@ public class BsStoreDiscountActivityController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, "");
}
StoreDiscountActivityPartakeWayEnum partakeWayEnum = StoreDiscountActivityPartakeWayEnum.getDataByNumber(body.getPartakeWay());
if (partakeWayEnum == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的参与类型");
}
if (partakeWayEnum.getNumber().equals(StoreDiscountActivityPartakeWayEnum.type3.getNumber())
&& body.getRestrictType() == null || body.getRestrictPartakeNum() == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "需要填写限制参与条件");
}
if (body.getDiscountType().equals(StoreDiscountActivityTypeEnum.type1.getNumber())
&& body.getDiscountCondition() == null) {
log.error("BsStoreDiscountActivityController --> configActivity() error!", "满减需要填写满减金额");

@ -9,7 +9,7 @@ debug: false
#datasource数据源设置
spring:
datasource:
url: jdbc:mysql://139.159.177.244:3306/gratia_pay?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
url: jdbc:mysql://139.9.154.68:3306/gratia_pay?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource
@ -29,7 +29,7 @@ spring:
maxOpenPreparedStatements: 20
redis:
database: 6
host: 139.159.177.244
host: 139.9.154.68
port: 36379
password: HF123456.Redis
timeout: 1000
@ -46,7 +46,7 @@ spring:
#MQTT配置信息
mqtt:
#MQTT服务地址
url: ws://139.159.177.244:1883/mqtt
url: ws://139.9.154.68:1883/mqtt
#用户名
username: printer_provider
#密码
@ -67,7 +67,7 @@ jetcache:
remote:
default:
type: redis
host: 139.159.177.244
host: 139.9.154.68
port: 36379
password: HF123456.Redis
database: 6

@ -1,2 +1,2 @@
fileUrl=/home/project/xuan-pay/filesystem
cmsPath=/home/project/hsg/filesystem/cmsPath
fileUrl=/home/project/gratia-pay/filesystem
cmsPath=/home/project/gratia-pay/filesystem/cmsPath

@ -9,7 +9,7 @@ debug: false
#datasource数据源设置
spring:
datasource:
url: jdbc:mysql://139.159.177.244:3306/xuan_pay_pre?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
url: jdbc:mysql://139.9.154.68:3306/xuan_pay_pre?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource
@ -29,7 +29,7 @@ spring:
maxOpenPreparedStatements: 20
redis:
database: 5
host: 139.159.177.244
host: 139.9.154.68
port: 36379
password: HF123456.Redis
timeout: 1000

@ -103,6 +103,7 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/laKaLaNotify/microPay")
.excludePathPatterns("/weiXinNotify/*")
.excludePathPatterns("/deviceOrderPay/orderNotify")
.excludePathPatterns("/storeDiscountActivityPartakeUser/*")
.excludePathPatterns("/wechat/*")
.excludePathPatterns("/cmsContent/*")
.excludePathPatterns("/common/*")

@ -7,13 +7,16 @@ import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.common.utils.StreamUtil;
import com.hfkj.entity.BsPayQrCode;
import com.hfkj.entity.BsStore;
import com.hfkj.entity.BsStoreDiscountActivity;
import com.hfkj.model.ResponseData;
import com.hfkj.service.BsPayQrCodeService;
import com.hfkj.service.BsStoreDiscountActivityService;
import com.hfkj.service.BsStoreService;
import com.hfkj.sysenum.PayQrCodeStatusEnum;
import com.hfkj.sysenum.StoreDiscountActivityStatusEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
@ -27,6 +30,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Controller
@RequestMapping(value = "/payQrCode")
@ -87,8 +91,30 @@ public class BsPayQrCodeController {
storeMap.put("storeName", store.getName());
param.put("store", storeMap);
List<BsStoreDiscountActivity> discountActivityList = new ArrayList<>();
// 门店优惠
Map<String, Object> activityParam = new HashMap<>();
activityParam.put("storeId", store.getId());
activityParam.put("partakeWay", 1);
activityParam.put("status", StoreDiscountActivityStatusEnum.status2.getNumber());
discountActivityList.addAll(storeDiscountActivityService.getActivityList(activityParam));
activityParam.clear();
// 商户优惠
activityParam.put("partakeWay", 1);
activityParam.put("merId", store.getMerId());
activityParam.put("storeIdNull", 0);
activityParam.put("status", StoreDiscountActivityStatusEnum.status2.getNumber());
discountActivityList.addAll(storeDiscountActivityService.getActivityList(activityParam));
// 用户优惠
if (StringUtils.isNotBlank(body.getString("phone"))) {
discountActivityList.addAll(storeDiscountActivityService.getUseDiscountListByPhone(body.getString("phone")));
}
// 优惠活动
param.put("discountActivity", storeDiscountActivityService.getAfootActivityByStore(store.getId()));
param.put("discountActivity", discountActivityList.stream().filter(StreamUtil.distinctByKey(b -> b.getId())).collect(Collectors.toList()));
return ResponseMsgUtil.success(param);
} catch (Exception e) {

@ -0,0 +1,251 @@
package com.cweb.controller;
import com.alibaba.fastjson.JSONObject;
import com.cweb.config.SysConst;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hfkj.common.QRCodeGenerator;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.HttpsUtils;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.config.CommonSysConst;
import com.hfkj.config.WeChatQrcodeUtils;
import com.hfkj.entity.*;
import com.hfkj.model.ResponseData;
import com.hfkj.service.*;
import com.hfkj.sysenum.StoreDiscountActivityStatusEnum;
import com.hfkj.sysenum.WeChatQrCodeActionNameEnum;
import com.hfkj.sysenum.WeChatQrCodeTypeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.*;
import java.util.List;
/**
* @className: BsStoreDiscountActivityPartakeUserController
* @author: HuRui
* @date: 2023/3/14
**/
@Controller
@Api(value = "优惠参与用户")
@RequestMapping(value = "/storeDiscountActivityPartakeUser")
public class BsStoreDiscountActivityPartakeUserController {
private static Logger log = LoggerFactory.getLogger(BsStoreDiscountActivityPartakeUserController.class);
@Resource
private BsStoreDiscountActivityPartakeUserService storeDiscountActivityPartakeUserService;
@Resource
private BsStoreDiscountActivityService storeDiscountActivityService;
@Resource
private BsStoreService storeService;
@Resource
private BsPayQrCodeService payQrCodeService;
@Resource
private BsTradeOrderService tradeOrderService;
@Resource
private WeChatQrcodeUtils weChatQrcodeUtils;
@RequestMapping(value = "/generateWeChatMpQrCode", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "生成微信公众号二维码")
public ResponseData generateWeChatMpQrCode(@RequestParam(value = "outTradeNo" , required = false) String outTradeNo,
@RequestParam(value = "qrCodeSn" , required = false) String qrCodeSn,
@RequestParam(value = "type" , required = true) Integer type,
@RequestParam(value = "systemType" , required = true) Integer systemType) {
try {
JSONObject response = HttpsUtils.doGet(CommonSysConst.getSysConfig().getHsg_domain_name() + "/v1/wxMsg/getWxToken");
if (StringUtils.isBlank(response.getString("return_data"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "获取token失败");
}
BsTradeOrder tradeNo = tradeOrderService.getOrderByOutTradeNo(outTradeNo);
if (tradeNo == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的订单");
}
String param = outTradeNo;
String fileUrl = "/share/" + System.currentTimeMillis() + ".png";
// type 生成类型
// 1:支付交易成功后
// 2:分享关注公众号
if (type == 1) {
// systemType系统类型;1:安卓 2:IOS
if (systemType == 1) {
// 生成支付二维码
QRCodeGenerator.generateQRCodeImage(
weChatQrcodeUtils.generateQrCodeImgUrl(response.getString("return_data"), WeChatQrCodeTypeEnum.PAYMENT_SUCCESS, param, WeChatQrCodeActionNameEnum.actionName1),
180,
180,
CommonSysConst.getSysConfig().getFilesystem() + fileUrl
);
QRCodeGenerator.overlapImage(fileUrl, "/template/qrCodeBackdrop1_1.png",96,32);
} else if (systemType == 2) {
// 生成支付二维码
QRCodeGenerator.generateQRCodeImage(
weChatQrcodeUtils.generateQrCodeImgUrl(response.getString("return_data"), WeChatQrCodeTypeEnum.PAYMENT_SUCCESS, param, WeChatQrCodeActionNameEnum.actionName1),
180,
180,
CommonSysConst.getSysConfig().getFilesystem() + fileUrl
);
QRCodeGenerator.overlapImage(fileUrl, "/template/qrCodeBackdrop1_2.png",96,32);
}
} else if (type == 2) {
// systemType系统类型;1:安卓 2:IOS
if (systemType == 1) {
// 生成支付二维码
QRCodeGenerator.generateQRCodeImage(
weChatQrcodeUtils.generateQrCodeImgUrl(response.getString("return_data"), WeChatQrCodeTypeEnum.PAYMENT_SUCCESS, param, WeChatQrCodeActionNameEnum.actionName1),
180,
180,
CommonSysConst.getSysConfig().getFilesystem() + fileUrl
);
QRCodeGenerator.overlapImage(fileUrl, "/template/qrCodeBackdrop2_1.png",96,32);
} else if (systemType == 2) {
// 生成支付二维码
QRCodeGenerator.generateQRCodeImage(
weChatQrcodeUtils.generateQrCodeImgUrl(response.getString("return_data"), WeChatQrCodeTypeEnum.SHARE, param, WeChatQrCodeActionNameEnum.actionName1),
578,
578,
CommonSysConst.getSysConfig().getFilesystem() + fileUrl
);
QRCodeGenerator.overlapImage(fileUrl, "/template/qrCodeBackdrop2_2.png",250,650);
}
}
return ResponseMsgUtil.success(SysConst.getSysConfig().getDomainName() + "/filesystem" + fileUrl);
} catch (Exception e) {
log.error("BsStoreDiscountActivityPartakeUserController --> generateWeChatMpQrCode() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getReceiveDiscountList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询领取优惠列表")
public ResponseData getReceiveDiscountList(@RequestParam(value = "qrCodeSn" , required = true) String qrCodeSn,
@RequestParam(value = "partakeWay" , required = true) Integer partakeWay) {
try {
BsPayQrCode qrCode = payQrCodeService.getDetailBySN(qrCodeSn);
if (qrCode == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知二维码");
}
if (qrCode.getStoreId() == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未绑定门店");
}
// 查询门店
BsStore store = storeService.getStoreById(qrCode.getStoreId());
if (store == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的门店");
}
List<BsStoreDiscountActivity> discountActivityList = new ArrayList<>();
// 门店活动
Map<String, Object> param = new HashMap<>();
param.put("storeId", store.getId());
param.put("partakeWay", partakeWay);
param.put("status", StoreDiscountActivityStatusEnum.status2.getNumber());
discountActivityList.addAll(storeDiscountActivityService.getActivityList(param));
param.clear();
// 商户活动
param.put("partakeWay", partakeWay);
param.put("merId", store.getMerId());
param.put("storeIdNull", 0);
param.put("status", StoreDiscountActivityStatusEnum.status2.getNumber());
discountActivityList.addAll(storeDiscountActivityService.getActivityList(param));
return ResponseMsgUtil.success(discountActivityList);
} catch (Exception e) {
log.error("BsStoreDiscountActivityPartakeUserController --> getReceiveDiscountList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/receiveDiscount", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "领取优惠")
public ResponseData receiveDiscount(@RequestBody JSONObject body) {
try {
if (StringUtils.isBlank(body.getString("phone"))
|| body.getJSONArray("activityIds") == null
|| body.getJSONArray("activityIds").size() == 0
) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
List<Long> activityIds = new ArrayList<>();
for (Object obj : body.getJSONArray("activityIds")) {
JSONObject activity = (JSONObject) obj;
if (activity == null || activity.getLong("id") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
activityIds.add(activity.getLong("id"));
}
storeDiscountActivityPartakeUserService.receiveDiscount(body.getString("phone"), activityIds);
return ResponseMsgUtil.success("领取成功");
} catch (Exception e) {
log.error("BsStoreDiscountActivityPartakeUserController --> receiveDiscount() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getDiscountListByPhone", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据手机号获取优惠列表")
public ResponseData getDiscountListByPhone(@RequestParam(value = "phone" , required = true) String phone,
@RequestParam(value = "status" , required = false) Integer status,
@RequestParam(value = "pageNum" , required = true) Integer pageNum,
@RequestParam(value = "pageSize" , required = true) Integer pageSize) {
try {
Map<String, Object> param = new HashMap<>();
param.put("userPhone", phone);
param.put("status", status);
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(storeDiscountActivityPartakeUserService.getList(param)));
} catch (Exception e) {
log.error("BsStoreDiscountActivityPartakeUserController --> getDiscountListByPhone() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getDiscountSurplusTotalNum", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据手机号获取可用优惠总次数")
public ResponseData getDiscountSurplusTotalNum(@RequestParam(value = "phone" , required = true) String phone) {
try {
Map<String, Object> param = new HashMap<>();
param.put("userPhone", phone);
param.put("status", 1);
Integer countNum = 0;
List<BsStoreDiscountActivityPartakeUser> list = storeDiscountActivityPartakeUserService.getList(param);
for (BsStoreDiscountActivityPartakeUser discountActivityPartakeUser : list) {
countNum += discountActivityPartakeUser.getPartakeSurplusNum();
}
return ResponseMsgUtil.success(countNum);
} catch (Exception e) {
log.error("BsStoreDiscountActivityPartakeUserController --> getDiscountSurplusTotalNum() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -92,13 +92,13 @@ public class BsTradeOrderController {
}
if (userDiscountType != null && userDiscountPrice != null) {
if (UserDiscountTypeEnum.getDataByNumber(storeDiscountType) == null) {
if (UserDiscountTypeEnum.getDataByNumber(userDiscountType) == null) {
log.error("calculation error!","未知的优惠类型");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的优惠类型");
}
if (userDiscountType.equals(UserDiscountTypeEnum.type3.getNumber())) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = userDiscountPrice.divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
BigDecimal priceRate = userDiscountPrice.setScale(2, BigDecimal.ROUND_DOWN);
payable = payable.multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP);
} else {
payable = payable.subtract(userDiscountPrice);
@ -171,7 +171,7 @@ public class BsTradeOrderController {
param.put("deviceId", device.getId());
// 创建交易订单
return ResponseMsgUtil.success(tradeOrderService.createOrder(store.getId(), body.getBigDecimal("totalAmount"),null,null, param));
return ResponseMsgUtil.success(tradeOrderService.createOrder(store.getId(), body.getBigDecimal("totalAmount"),null,null, null, param));
} catch (Exception e) {
log.error(e.getMessage(), e);
@ -240,12 +240,11 @@ public class BsTradeOrderController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "创建交易失败!商户状态异常");
}
// 门店优惠活动
/* if (body.getLong("storeDiscountId") != null) {
storeDiscountActivity = ;
}*/
BsStoreDiscountActivity storeDiscountActivity = storeDiscountActivityService.getAfootActivityByStore(store.getId());
// 优惠活动
BsStoreDiscountActivity storeDiscountActivity = null;
if (StringUtils.isNotBlank(body.getString("userPhone")) && body.getLong("storeDiscountId") != null) {
storeDiscountActivity = storeDiscountActivityService.getDetailById(body.getLong("storeDiscountId"));
}
// 用户优惠券
UserDiscount userDiscount = null;
@ -269,6 +268,7 @@ public class BsTradeOrderController {
store.getId(),
body.getBigDecimal("totalAmount"),
storeDiscountActivity,
body.getString("userPhone"),
userDiscount,
param));
@ -320,7 +320,7 @@ public class BsTradeOrderController {
}
// 创建交易订单
return ResponseMsgUtil.success(tradeOrderService.createOrder(store.getId(), body.getBigDecimal("totalAmount"), null, null,new HashMap<>()));
return ResponseMsgUtil.success(tradeOrderService.createOrder(store.getId(), body.getBigDecimal("totalAmount"), null, null,null,new HashMap<>()));
} catch (Exception e) {
log.error(e.getMessage(), e);

@ -7,7 +7,6 @@ import com.hfkj.channel.weixin.WeiXinMerService;
import com.hfkj.channel.weixin.utils.HttpClientBuilder;
import com.hfkj.common.utils.DateUtil;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.config.WeChatQrcodeUtils;
import com.hfkj.config.device.SoundService;
import com.hfkj.config.mqtt.MqttProviderService;
import com.hfkj.model.ResponseData;
@ -70,9 +69,6 @@ public class TestController {
}
}
@Resource
private WeChatQrcodeUtils weChatQrcodeUtils;
@RequestMapping(value="/soundSendMsg",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "音响发送消息")

@ -80,32 +80,11 @@ public class WeiXinController {
tradeOrderMsgService.editTradeOrderMsg(orderMsg);
if ("SUCCESS".equals(map.get("return_code")) && "SUCCESS".equals(map.get("result_code"))) {
// 查询订单
BsTradeOrder order = tradeOrderService.getOrderByOutTradeNo(map.get("out_trade_no"));
if (order != null && order.getStatus().equals(TradeOrderStatusEnum.status1.getNumber())) {
order.setPayMode(TradeOrderPayModeEnum.WECHAT.getCode());
order.setPlatformType(PlatformTypeEnum.type4.getNumber());
order.setPlatformMerNo(map.get("sub_mch_id"));
order.setPlatformTradeNo(map.get("transaction_id"));
order.setTradeActualAmount(new BigDecimal(map.get("total_fee")).divide(new BigDecimal("100")));
order.setStatus(TradeOrderStatusEnum.status3.getNumber());
order.setPayTime(new Date());
tradeOrderService.editOrder(order);
// 创建分账
if (order.getProfitSharingStatus().equals(true)) {
tradeOrderProfitSharingService.createProfitSharing(order);
}
Map<String,Object> param = new HashMap<>();
param.put("storeId", order.getStoreId());
param.put("deviceType", DeviceTypeEnum.type1.getNumber());
param.put("status", DeviceStatusEnum.status1.getNumber());
List<BsDevice> deviceList = deviceService.getDeviceList(param);
for (BsDevice device : deviceList) {
soundService.sendPayMsg(device.getDeviceNo(), order.getTradeAmount());
}
}
tradeOrderService.paySuccess(map.get("out_trade_no"),map.get("transaction_id"),
PlatformTypeEnum.type4,
TradeOrderPayModeEnum.WECHAT,
new BigDecimal(map.get("total_fee")).divide(new BigDecimal("100")),
map.get("sub_mch_id"));
}
BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream());
out.write(resXml.getBytes());
@ -177,30 +156,4 @@ public class WeiXinController {
}
}
public static void main(String[] args) {
String data = "<xml>\n" +
"<return_code><![CDATA[SUCCESS]]></return_code>\n" +
"<result_code><![CDATA[SUCCESS]]></result_code>\n" +
"<mch_id><![CDATA[1289663601]]></mch_id>\n" +
"<sub_mch_id><![CDATA[1609882817]]></sub_mch_id>\n" +
"<appid><![CDATA[wxa075e8509802f826]]></appid>\n" +
"<nonce_str><![CDATA[024df22ae6778ce5]]></nonce_str>\n" +
"<sign><![CDATA[1EA7934B67673EBB41B26671A1F1E09526AC2BB0F51A519DAED34F8421093327]]></sign>\n" +
"<transaction_id><![CDATA[4200001727202302237548265962]]></transaction_id>\n" +
"<out_order_no><![CDATA[ZF1130202302231540413358944000]]></out_order_no>\n" +
"<order_id><![CDATA[30000200502023022344319434800]]></order_id>\n" +
"<receivers><![CDATA[[{\"type\":\"MERCHANT_ID\",\"account\":\"1603942866\",\"amount\":1,\"description\":\"分给商户:惠昕石化\",\"result\":\"CLOSED\",\"finish_time\":\"20230223160731\",\"detail_id\":\"36000200502023022362619327881\"},{\"type\":\"MERCHANT_ID\",\"account\":\"1609882817\",\"amount\":99,\"description\":\"解冻给分账方\",\"result\":\"SUCCESS\",\"finish_time\":\"20230223160731\",\"detail_id\":\"36000200502023022362619327882\"}]]]></receivers>\n" +
"<status><![CDATA[FINISHED]]></status>\n" +
"</xml>";
try {
System.out.println(XmlUtil.parseXmlToTreeMap(data, "utf-8"));
} catch (ParserConfigurationException e) {
throw new RuntimeException(e);
} catch (IOException e) {
throw new RuntimeException(e);
} catch (SAXException e) {
throw new RuntimeException(e);
}
}
}

@ -9,7 +9,7 @@ debug: false
#datasource数据源设置
spring:
datasource:
url: jdbc:mysql://139.159.177.244:3306/gratia_pay?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
url: jdbc:mysql://139.9.154.68:3306/gratia_pay?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource
@ -29,7 +29,7 @@ spring:
maxOpenPreparedStatements: 20
redis:
database: 6
host: 139.159.177.244
host: 139.9.154.68
port: 36379
password: HF123456.Redis
timeout: 1000
@ -46,7 +46,7 @@ spring:
#MQTT配置信息
mqtt:
#MQTT服务地址
url: ws://139.159.177.244:8083/mqtt
url: ws://139.9.154.68:8083/mqtt
#用户名
username: printer_provider
#密码
@ -67,7 +67,7 @@ jetcache:
remote:
default:
type: redis
host: 139.159.177.244
host: 139.9.154.68
port: 36379
password: HF123456.Redis
database: 6

@ -9,7 +9,7 @@ debug: false
#datasource数据源设置
spring:
datasource:
url: jdbc:mysql://139.159.177.244:3306/xuan_pay_pre?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
url: jdbc:mysql://139.9.154.68:3306/xuan_pay_pre?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource
@ -29,7 +29,7 @@ spring:
maxOpenPreparedStatements: 20
redis:
database: 5
host: 139.159.177.244
host: 139.9.154.68
port: 36379
password: HF123456.Redis
timeout: 1000

@ -9,7 +9,7 @@ debug: false
#datasource数据源设置
spring:
datasource:
url: jdbc:mysql://139.159.177.244:3306/xuan_pay?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
url: jdbc:mysql://139.9.154.68:3306/xuan_pay?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource
@ -29,7 +29,7 @@ spring:
maxOpenPreparedStatements: 20
redis:
database: 4
host: 139.159.177.244
host: 139.9.154.68
port: 36379
password: HF123456.Redis
timeout: 1000

@ -9,7 +9,7 @@ debug: false
#datasource数据源设置
spring:
datasource:
url: jdbc:mysql://139.159.177.244:3306/xuan_pay_pre?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
url: jdbc:mysql://139.9.154.68:3306/xuan_pay_pre?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource
@ -29,7 +29,7 @@ spring:
maxOpenPreparedStatements: 20
redis:
database: 5
host: 139.159.177.244
host: 139.9.154.68
port: 36379
password: HF123456.Redis
timeout: 1000

@ -9,7 +9,7 @@ debug: false
#datasource数据源设置
spring:
datasource:
url: jdbc:mysql://139.159.177.244:3306/gratia_pay?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
url: jdbc:mysql://139.9.154.68:3306/gratia_pay?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource
@ -29,7 +29,7 @@ spring:
maxOpenPreparedStatements: 20
redis:
database: 6
host: 139.159.177.244
host: 139.9.154.68
port: 36379
password: HF123456.Redis
timeout: 1000
@ -46,7 +46,7 @@ spring:
#MQTT配置信息
mqtt:
#MQTT服务地址
url: ws://139.159.177.244:8083/mqtt
url: ws://139.9.154.68:8083/mqtt
#用户名
username: printer_provider
#密码
@ -67,7 +67,7 @@ jetcache:
remote:
default:
type: redis
host: 139.159.177.244
host: 139.9.154.68
port: 36379
password: HF123456.Redis
database: 6

@ -9,7 +9,7 @@ debug: false
#datasource数据源设置
spring:
datasource:
url: jdbc:mysql://139.159.177.244:3306/xuan_pay_pre?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8
url: jdbc:mysql://139.9.154.68:3306/xuan_pay_pre?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8
username: root
password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource
@ -30,7 +30,7 @@ spring:
redis:
database: 5
host: 139.159.177.244
host: 139.9.154.68
port: 36379
password: HF123456.Redis
timeout: 1000

@ -0,0 +1,22 @@
package com.hfkj.channel.cpcn;
import com.alibaba.fastjson.JSONObject;
/**
* 中金支付 交易业务
* @className: CnpcTradeService
* @author: HuRui
* @date: 2023/3/22
**/
public class CpcnTradeService {
public static JSONObject createTrade() {
return null;
}
}

@ -0,0 +1,23 @@
package com.hfkj.channel.cpcn.config;
/**
* 中金支付配置
* @className: CnpcConfig
* @author: HuRui
* @date: 2023/3/22
**/
public class CpcnConfig {
/**
* 业务接口请求
*/
private static String requestUrl = "https://test.cpcn.com.cn/Gateway4File/InterfaceII";
/**
* 文件接口请求
*/
private static String requestFileUrl = "https://test.cpcn.com.cn/Gateway4File/InterfaceII";
}

@ -5,7 +5,11 @@ import com.google.zxing.WriterException;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.QRCodeWriter;
import com.hfkj.config.CommonSysConst;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
@ -30,6 +34,20 @@ public class QRCodeGenerator {
}
// 二维码生产自定义图片
public static void overlapImage(String path , String bgPath , int x, int y) throws Exception {
BufferedImage read = ImageIO.read(new File(CommonSysConst.getSysConfig().getFilesystem() + bgPath));
Image image = ImageIO.read(new File(CommonSysConst.getSysConfig().getFilesystem() + path));
Graphics graphics = read.getGraphics();
graphics.drawImage(image, x ,y, null);
ImageIO.write(read , "png" , new File(CommonSysConst.getSysConfig().getFilesystem() + "/" + path));
}
public static void main(String[] args) {
try {
generateQRCodeImage("This is my first QR Code", 350, 350, "D:\\/ss/qr1.png");

@ -0,0 +1,34 @@
package com.hfkj.common.utils;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import java.util.function.Predicate;
/**
*
* @ClassName: StreamUtil
* @Description:TODO(List Steam)
* @author: 胡锐
* @date: 2019年3月25日 下午4:14:00
*
* @Copyright: 2019 www.shinwoten.com Inc. All rights reserved.
*/
public class StreamUtil {
/**
*
* @Title: distinctByKey
* @Description: TODO(对象 去重)
* @author: 胡锐
* @param: @param keyExtractor
* @param: @return
* @return: Predicate<T>
* @throws
*/
public static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) {
Map<Object,Boolean> seen = new ConcurrentHashMap<>();
return t -> seen.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null;
}
}

@ -13,6 +13,7 @@ import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.HttpsUtils;
import com.hfkj.common.utils.RedisUtil;
import com.hfkj.sysenum.WeChatQrCodeActionNameEnum;
import com.hfkj.sysenum.WeChatQrCodeTypeEnum;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.api.WxMpService;
@ -344,11 +345,11 @@ public class WeChatQrcodeUtils {
* @param code 参数
* @return
*/
public String generateQrCodeImgUrl(String token,String code) {
public String generateQrCodeImgUrl(String token, WeChatQrCodeTypeEnum codeTypeEnum, String code, WeChatQrCodeActionNameEnum actionNameEnum) {
// 组装 二维码参数
String sceneId = "type=4&codeType=paymentCode&code=" + code;
String sceneId = "type=4&codeType="+codeTypeEnum.getCode()+"&code=" + code;
// 获取二维码参数
JSONObject response = createWxQrCode(token, sceneId , WeChatQrCodeActionNameEnum.actionName3.getName());
JSONObject response = createWxQrCode(token, sceneId , actionNameEnum.getName());
if (StringUtils.isBlank(response.getString("url"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "生成失败");
}

@ -39,28 +39,32 @@ public interface BsStoreDiscountActivityMapper extends BsStoreDiscountActivityMa
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_store_discount_activity (company_id, company_name, ",
"agent_id, agent_name, ",
"salesman_id, salesman_name, ",
"mer_id, mer_name, store_id, ",
"insert into bs_store_discount_activity (partake_way, company_id, ",
"company_name, agent_id, ",
"agent_name, salesman_id, ",
"salesman_name, mer_id, ",
"mer_name, store_id, ",
"store_no, store_name, ",
"store_tel, `name`, ",
"discount_type, discount_condition, ",
"discount_price, final_cost_price, ",
"start_time, end_time, ",
"restrict_type, restrict_partake_num, ",
"`status`, operator_id, ",
"operator_name, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{companyId,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, ",
"#{agentId,jdbcType=BIGINT}, #{agentName,jdbcType=VARCHAR}, ",
"#{salesmanId,jdbcType=BIGINT}, #{salesmanName,jdbcType=VARCHAR}, ",
"#{merId,jdbcType=BIGINT}, #{merName,jdbcType=VARCHAR}, #{storeId,jdbcType=BIGINT}, ",
"values (#{partakeWay,jdbcType=INTEGER}, #{companyId,jdbcType=BIGINT}, ",
"#{companyName,jdbcType=VARCHAR}, #{agentId,jdbcType=BIGINT}, ",
"#{agentName,jdbcType=VARCHAR}, #{salesmanId,jdbcType=BIGINT}, ",
"#{salesmanName,jdbcType=VARCHAR}, #{merId,jdbcType=BIGINT}, ",
"#{merName,jdbcType=VARCHAR}, #{storeId,jdbcType=BIGINT}, ",
"#{storeNo,jdbcType=BIGINT}, #{storeName,jdbcType=VARCHAR}, ",
"#{storeTel,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, ",
"#{discountType,jdbcType=INTEGER}, #{discountCondition,jdbcType=DECIMAL}, ",
"#{discountPrice,jdbcType=DECIMAL}, #{finalCostPrice,jdbcType=DECIMAL}, ",
"#{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, ",
"#{restrictType,jdbcType=INTEGER}, #{restrictPartakeNum,jdbcType=INTEGER}, ",
"#{status,jdbcType=INTEGER}, #{operatorId,jdbcType=BIGINT}, ",
"#{operatorName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
@ -76,6 +80,7 @@ public interface BsStoreDiscountActivityMapper extends BsStoreDiscountActivityMa
@SelectProvider(type=BsStoreDiscountActivitySqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="partake_way", property="partakeWay", jdbcType=JdbcType.INTEGER),
@Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
@Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR),
@Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT),
@ -95,6 +100,8 @@ public interface BsStoreDiscountActivityMapper extends BsStoreDiscountActivityMa
@Result(column="final_cost_price", property="finalCostPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="restrict_type", property="restrictType", jdbcType=JdbcType.INTEGER),
@Result(column="restrict_partake_num", property="restrictPartakeNum", jdbcType=JdbcType.INTEGER),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT),
@Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR),
@ -108,16 +115,17 @@ public interface BsStoreDiscountActivityMapper extends BsStoreDiscountActivityMa
@Select({
"select",
"id, company_id, company_name, agent_id, agent_name, salesman_id, salesman_name, ",
"mer_id, mer_name, store_id, store_no, store_name, store_tel, `name`, discount_type, ",
"discount_condition, discount_price, final_cost_price, start_time, end_time, ",
"`status`, operator_id, operator_name, create_time, update_time, ext_1, ext_2, ",
"ext_3",
"id, partake_way, company_id, company_name, agent_id, agent_name, salesman_id, ",
"salesman_name, mer_id, mer_name, store_id, store_no, store_name, store_tel, ",
"`name`, discount_type, discount_condition, discount_price, final_cost_price, ",
"start_time, end_time, restrict_type, restrict_partake_num, `status`, operator_id, ",
"operator_name, create_time, update_time, ext_1, ext_2, ext_3",
"from bs_store_discount_activity",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="partake_way", property="partakeWay", jdbcType=JdbcType.INTEGER),
@Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
@Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR),
@Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT),
@ -137,6 +145,8 @@ public interface BsStoreDiscountActivityMapper extends BsStoreDiscountActivityMa
@Result(column="final_cost_price", property="finalCostPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="restrict_type", property="restrictType", jdbcType=JdbcType.INTEGER),
@Result(column="restrict_partake_num", property="restrictPartakeNum", jdbcType=JdbcType.INTEGER),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT),
@Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR),
@ -159,7 +169,8 @@ public interface BsStoreDiscountActivityMapper extends BsStoreDiscountActivityMa
@Update({
"update bs_store_discount_activity",
"set company_id = #{companyId,jdbcType=BIGINT},",
"set partake_way = #{partakeWay,jdbcType=INTEGER},",
"company_id = #{companyId,jdbcType=BIGINT},",
"company_name = #{companyName,jdbcType=VARCHAR},",
"agent_id = #{agentId,jdbcType=BIGINT},",
"agent_name = #{agentName,jdbcType=VARCHAR},",
@ -178,6 +189,8 @@ public interface BsStoreDiscountActivityMapper extends BsStoreDiscountActivityMa
"final_cost_price = #{finalCostPrice,jdbcType=DECIMAL},",
"start_time = #{startTime,jdbcType=TIMESTAMP},",
"end_time = #{endTime,jdbcType=TIMESTAMP},",
"restrict_type = #{restrictType,jdbcType=INTEGER},",
"restrict_partake_num = #{restrictPartakeNum,jdbcType=INTEGER},",
"`status` = #{status,jdbcType=INTEGER},",
"operator_id = #{operatorId,jdbcType=BIGINT},",
"operator_name = #{operatorName,jdbcType=VARCHAR},",

@ -0,0 +1,150 @@
package com.hfkj.dao;
import com.hfkj.entity.BsStoreDiscountActivityPartakeUser;
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;
/**
*
* 代码由工具生成,请勿修改!!!
* 如果需要扩展请在其父类进行扩展
*
**/
@Repository
public interface BsStoreDiscountActivityPartakeUserMapper extends BsStoreDiscountActivityPartakeUserMapperExt {
@SelectProvider(type=BsStoreDiscountActivityPartakeUserSqlProvider.class, method="countByExample")
long countByExample(BsStoreDiscountActivityPartakeUserExample example);
@DeleteProvider(type=BsStoreDiscountActivityPartakeUserSqlProvider.class, method="deleteByExample")
int deleteByExample(BsStoreDiscountActivityPartakeUserExample example);
@Delete({
"delete from bs_store_discount_activity_partake_user",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_store_discount_activity_partake_user (discount_activity_id, discount_activity_name, ",
"discount_type, discount_condition, ",
"discount_price, start_time, ",
"end_time, user_phone, ",
"partake_total_num, partake_surplus_num, ",
"partake_use_num, `status`, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{discountActivityId,jdbcType=BIGINT}, #{discountActivityName,jdbcType=VARCHAR}, ",
"#{discountType,jdbcType=INTEGER}, #{discountCondition,jdbcType=DECIMAL}, ",
"#{discountPrice,jdbcType=DECIMAL}, #{startTime,jdbcType=TIMESTAMP}, ",
"#{endTime,jdbcType=TIMESTAMP}, #{userPhone,jdbcType=VARCHAR}, ",
"#{partakeTotalNum,jdbcType=INTEGER}, #{partakeSurplusNum,jdbcType=INTEGER}, ",
"#{partakeUseNum,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsStoreDiscountActivityPartakeUser record);
@InsertProvider(type=BsStoreDiscountActivityPartakeUserSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsStoreDiscountActivityPartakeUser record);
@SelectProvider(type=BsStoreDiscountActivityPartakeUserSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="discount_activity_id", property="discountActivityId", jdbcType=JdbcType.BIGINT),
@Result(column="discount_activity_name", property="discountActivityName", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER),
@Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL),
@Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
@Result(column="partake_total_num", property="partakeTotalNum", jdbcType=JdbcType.INTEGER),
@Result(column="partake_surplus_num", property="partakeSurplusNum", jdbcType=JdbcType.INTEGER),
@Result(column="partake_use_num", property="partakeUseNum", jdbcType=JdbcType.INTEGER),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
List<BsStoreDiscountActivityPartakeUser> selectByExample(BsStoreDiscountActivityPartakeUserExample example);
@Select({
"select",
"id, discount_activity_id, discount_activity_name, discount_type, discount_condition, ",
"discount_price, start_time, end_time, user_phone, partake_total_num, partake_surplus_num, ",
"partake_use_num, `status`, create_time, update_time, ext_1, ext_2, ext_3",
"from bs_store_discount_activity_partake_user",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="discount_activity_id", property="discountActivityId", jdbcType=JdbcType.BIGINT),
@Result(column="discount_activity_name", property="discountActivityName", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER),
@Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL),
@Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
@Result(column="partake_total_num", property="partakeTotalNum", jdbcType=JdbcType.INTEGER),
@Result(column="partake_surplus_num", property="partakeSurplusNum", jdbcType=JdbcType.INTEGER),
@Result(column="partake_use_num", property="partakeUseNum", jdbcType=JdbcType.INTEGER),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
BsStoreDiscountActivityPartakeUser selectByPrimaryKey(Long id);
@UpdateProvider(type=BsStoreDiscountActivityPartakeUserSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsStoreDiscountActivityPartakeUser record, @Param("example") BsStoreDiscountActivityPartakeUserExample example);
@UpdateProvider(type=BsStoreDiscountActivityPartakeUserSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsStoreDiscountActivityPartakeUser record, @Param("example") BsStoreDiscountActivityPartakeUserExample example);
@UpdateProvider(type=BsStoreDiscountActivityPartakeUserSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsStoreDiscountActivityPartakeUser record);
@Update({
"update bs_store_discount_activity_partake_user",
"set discount_activity_id = #{discountActivityId,jdbcType=BIGINT},",
"discount_activity_name = #{discountActivityName,jdbcType=VARCHAR},",
"discount_type = #{discountType,jdbcType=INTEGER},",
"discount_condition = #{discountCondition,jdbcType=DECIMAL},",
"discount_price = #{discountPrice,jdbcType=DECIMAL},",
"start_time = #{startTime,jdbcType=TIMESTAMP},",
"end_time = #{endTime,jdbcType=TIMESTAMP},",
"user_phone = #{userPhone,jdbcType=VARCHAR},",
"partake_total_num = #{partakeTotalNum,jdbcType=INTEGER},",
"partake_surplus_num = #{partakeSurplusNum,jdbcType=INTEGER},",
"partake_use_num = #{partakeUseNum,jdbcType=INTEGER},",
"`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(BsStoreDiscountActivityPartakeUser record);
}

@ -0,0 +1,7 @@
package com.hfkj.dao;
/**
* mapper扩展类
*/
public interface BsStoreDiscountActivityPartakeUserMapperExt {
}

@ -0,0 +1,122 @@
package com.hfkj.dao;
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserRecord;
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserRecordExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;
/**
*
* 代码由工具生成,请勿修改!!!
* 如果需要扩展请在其父类进行扩展
*
**/
@Repository
public interface BsStoreDiscountActivityPartakeUserRecordMapper extends BsStoreDiscountActivityPartakeUserRecordMapperExt {
@SelectProvider(type=BsStoreDiscountActivityPartakeUserRecordSqlProvider.class, method="countByExample")
long countByExample(BsStoreDiscountActivityPartakeUserRecordExample example);
@DeleteProvider(type=BsStoreDiscountActivityPartakeUserRecordSqlProvider.class, method="deleteByExample")
int deleteByExample(BsStoreDiscountActivityPartakeUserRecordExample example);
@Delete({
"delete from bs_store_discount_activity_partake_user_record",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_store_discount_activity_partake_user_record (discount_activity_id, discount_activity_name, ",
"discount_type, discount_condition, ",
"discount_price, user_phone, ",
"create_time, ext_1, ",
"ext_2, ext_3)",
"values (#{discountActivityId,jdbcType=BIGINT}, #{discountActivityName,jdbcType=VARCHAR}, ",
"#{discountType,jdbcType=INTEGER}, #{discountCondition,jdbcType=DECIMAL}, ",
"#{discountPrice,jdbcType=DECIMAL}, #{userPhone,jdbcType=VARCHAR}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsStoreDiscountActivityPartakeUserRecord record);
@InsertProvider(type=BsStoreDiscountActivityPartakeUserRecordSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsStoreDiscountActivityPartakeUserRecord record);
@SelectProvider(type=BsStoreDiscountActivityPartakeUserRecordSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="discount_activity_id", property="discountActivityId", jdbcType=JdbcType.BIGINT),
@Result(column="discount_activity_name", property="discountActivityName", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER),
@Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL),
@Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
List<BsStoreDiscountActivityPartakeUserRecord> selectByExample(BsStoreDiscountActivityPartakeUserRecordExample example);
@Select({
"select",
"id, discount_activity_id, discount_activity_name, discount_type, discount_condition, ",
"discount_price, user_phone, create_time, ext_1, ext_2, ext_3",
"from bs_store_discount_activity_partake_user_record",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="discount_activity_id", property="discountActivityId", jdbcType=JdbcType.BIGINT),
@Result(column="discount_activity_name", property="discountActivityName", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER),
@Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL),
@Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
BsStoreDiscountActivityPartakeUserRecord selectByPrimaryKey(Long id);
@UpdateProvider(type=BsStoreDiscountActivityPartakeUserRecordSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsStoreDiscountActivityPartakeUserRecord record, @Param("example") BsStoreDiscountActivityPartakeUserRecordExample example);
@UpdateProvider(type=BsStoreDiscountActivityPartakeUserRecordSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsStoreDiscountActivityPartakeUserRecord record, @Param("example") BsStoreDiscountActivityPartakeUserRecordExample example);
@UpdateProvider(type=BsStoreDiscountActivityPartakeUserRecordSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsStoreDiscountActivityPartakeUserRecord record);
@Update({
"update bs_store_discount_activity_partake_user_record",
"set discount_activity_id = #{discountActivityId,jdbcType=BIGINT},",
"discount_activity_name = #{discountActivityName,jdbcType=VARCHAR},",
"discount_type = #{discountType,jdbcType=INTEGER},",
"discount_condition = #{discountCondition,jdbcType=DECIMAL},",
"discount_price = #{discountPrice,jdbcType=DECIMAL},",
"user_phone = #{userPhone,jdbcType=VARCHAR},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(BsStoreDiscountActivityPartakeUserRecord record);
}

@ -0,0 +1,7 @@
package com.hfkj.dao;
/**
* mapper扩展类
*/
public interface BsStoreDiscountActivityPartakeUserRecordMapperExt {
}

@ -0,0 +1,318 @@
package com.hfkj.dao;
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserRecord;
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserRecordExample.Criteria;
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserRecordExample.Criterion;
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserRecordExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsStoreDiscountActivityPartakeUserRecordSqlProvider {
public String countByExample(BsStoreDiscountActivityPartakeUserRecordExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_store_discount_activity_partake_user_record");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsStoreDiscountActivityPartakeUserRecordExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_store_discount_activity_partake_user_record");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsStoreDiscountActivityPartakeUserRecord record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_store_discount_activity_partake_user_record");
if (record.getDiscountActivityId() != null) {
sql.VALUES("discount_activity_id", "#{discountActivityId,jdbcType=BIGINT}");
}
if (record.getDiscountActivityName() != null) {
sql.VALUES("discount_activity_name", "#{discountActivityName,jdbcType=VARCHAR}");
}
if (record.getDiscountType() != null) {
sql.VALUES("discount_type", "#{discountType,jdbcType=INTEGER}");
}
if (record.getDiscountCondition() != null) {
sql.VALUES("discount_condition", "#{discountCondition,jdbcType=DECIMAL}");
}
if (record.getDiscountPrice() != null) {
sql.VALUES("discount_price", "#{discountPrice,jdbcType=DECIMAL}");
}
if (record.getUserPhone() != null) {
sql.VALUES("user_phone", "#{userPhone,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}");
}
return sql.toString();
}
public String selectByExample(BsStoreDiscountActivityPartakeUserRecordExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("discount_activity_id");
sql.SELECT("discount_activity_name");
sql.SELECT("discount_type");
sql.SELECT("discount_condition");
sql.SELECT("discount_price");
sql.SELECT("user_phone");
sql.SELECT("create_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("bs_store_discount_activity_partake_user_record");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String updateByExampleSelective(Map<String, Object> parameter) {
BsStoreDiscountActivityPartakeUserRecord record = (BsStoreDiscountActivityPartakeUserRecord) parameter.get("record");
BsStoreDiscountActivityPartakeUserRecordExample example = (BsStoreDiscountActivityPartakeUserRecordExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_store_discount_activity_partake_user_record");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getDiscountActivityId() != null) {
sql.SET("discount_activity_id = #{record.discountActivityId,jdbcType=BIGINT}");
}
if (record.getDiscountActivityName() != null) {
sql.SET("discount_activity_name = #{record.discountActivityName,jdbcType=VARCHAR}");
}
if (record.getDiscountType() != null) {
sql.SET("discount_type = #{record.discountType,jdbcType=INTEGER}");
}
if (record.getDiscountCondition() != null) {
sql.SET("discount_condition = #{record.discountCondition,jdbcType=DECIMAL}");
}
if (record.getDiscountPrice() != null) {
sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}");
}
if (record.getUserPhone() != null) {
sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
}
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExample(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("bs_store_discount_activity_partake_user_record");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("discount_activity_id = #{record.discountActivityId,jdbcType=BIGINT}");
sql.SET("discount_activity_name = #{record.discountActivityName,jdbcType=VARCHAR}");
sql.SET("discount_type = #{record.discountType,jdbcType=INTEGER}");
sql.SET("discount_condition = #{record.discountCondition,jdbcType=DECIMAL}");
sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}");
sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
BsStoreDiscountActivityPartakeUserRecordExample example = (BsStoreDiscountActivityPartakeUserRecordExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsStoreDiscountActivityPartakeUserRecord record) {
SQL sql = new SQL();
sql.UPDATE("bs_store_discount_activity_partake_user_record");
if (record.getDiscountActivityId() != null) {
sql.SET("discount_activity_id = #{discountActivityId,jdbcType=BIGINT}");
}
if (record.getDiscountActivityName() != null) {
sql.SET("discount_activity_name = #{discountActivityName,jdbcType=VARCHAR}");
}
if (record.getDiscountType() != null) {
sql.SET("discount_type = #{discountType,jdbcType=INTEGER}");
}
if (record.getDiscountCondition() != null) {
sql.SET("discount_condition = #{discountCondition,jdbcType=DECIMAL}");
}
if (record.getDiscountPrice() != null) {
sql.SET("discount_price = #{discountPrice,jdbcType=DECIMAL}");
}
if (record.getUserPhone() != null) {
sql.SET("user_phone = #{userPhone,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();
}
protected void applyWhere(SQL sql, BsStoreDiscountActivityPartakeUserRecordExample example, boolean includeExamplePhrase) {
if (example == null) {
return;
}
String parmPhrase1;
String parmPhrase1_th;
String parmPhrase2;
String parmPhrase2_th;
String parmPhrase3;
String parmPhrase3_th;
if (includeExamplePhrase) {
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
} else {
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
}
StringBuilder sb = new StringBuilder();
List<Criteria> oredCriteria = example.getOredCriteria();
boolean firstCriteria = true;
for (int i = 0; i < oredCriteria.size(); i++) {
Criteria criteria = oredCriteria.get(i);
if (criteria.isValid()) {
if (firstCriteria) {
firstCriteria = false;
} else {
sb.append(" or ");
}
sb.append('(');
List<Criterion> criterions = criteria.getAllCriteria();
boolean firstCriterion = true;
for (int j = 0; j < criterions.size(); j++) {
Criterion criterion = criterions.get(j);
if (firstCriterion) {
firstCriterion = false;
} else {
sb.append(" and ");
}
if (criterion.isNoValue()) {
sb.append(criterion.getCondition());
} else if (criterion.isSingleValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));
} else {
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));
}
} else if (criterion.isBetweenValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));
} else {
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));
}
} else if (criterion.isListValue()) {
sb.append(criterion.getCondition());
sb.append(" (");
List<?> listItems = (List<?>) criterion.getValue();
boolean comma = false;
for (int k = 0; k < listItems.size(); k++) {
if (comma) {
sb.append(", ");
} else {
comma = true;
}
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase3, i, j, k));
} else {
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));
}
}
sb.append(')');
}
}
sb.append(')');
}
}
if (sb.length() > 0) {
sql.WHERE(sb.toString());
}
}
}

@ -0,0 +1,416 @@
package com.hfkj.dao;
import com.hfkj.entity.BsStoreDiscountActivityPartakeUser;
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserExample.Criteria;
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserExample.Criterion;
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsStoreDiscountActivityPartakeUserSqlProvider {
public String countByExample(BsStoreDiscountActivityPartakeUserExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_store_discount_activity_partake_user");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsStoreDiscountActivityPartakeUserExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_store_discount_activity_partake_user");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsStoreDiscountActivityPartakeUser record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_store_discount_activity_partake_user");
if (record.getDiscountActivityId() != null) {
sql.VALUES("discount_activity_id", "#{discountActivityId,jdbcType=BIGINT}");
}
if (record.getDiscountActivityName() != null) {
sql.VALUES("discount_activity_name", "#{discountActivityName,jdbcType=VARCHAR}");
}
if (record.getDiscountType() != null) {
sql.VALUES("discount_type", "#{discountType,jdbcType=INTEGER}");
}
if (record.getDiscountCondition() != null) {
sql.VALUES("discount_condition", "#{discountCondition,jdbcType=DECIMAL}");
}
if (record.getDiscountPrice() != null) {
sql.VALUES("discount_price", "#{discountPrice,jdbcType=DECIMAL}");
}
if (record.getStartTime() != null) {
sql.VALUES("start_time", "#{startTime,jdbcType=TIMESTAMP}");
}
if (record.getEndTime() != null) {
sql.VALUES("end_time", "#{endTime,jdbcType=TIMESTAMP}");
}
if (record.getUserPhone() != null) {
sql.VALUES("user_phone", "#{userPhone,jdbcType=VARCHAR}");
}
if (record.getPartakeTotalNum() != null) {
sql.VALUES("partake_total_num", "#{partakeTotalNum,jdbcType=INTEGER}");
}
if (record.getPartakeSurplusNum() != null) {
sql.VALUES("partake_surplus_num", "#{partakeSurplusNum,jdbcType=INTEGER}");
}
if (record.getPartakeUseNum() != null) {
sql.VALUES("partake_use_num", "#{partakeUseNum,jdbcType=INTEGER}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}");
}
return sql.toString();
}
public String selectByExample(BsStoreDiscountActivityPartakeUserExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("discount_activity_id");
sql.SELECT("discount_activity_name");
sql.SELECT("discount_type");
sql.SELECT("discount_condition");
sql.SELECT("discount_price");
sql.SELECT("start_time");
sql.SELECT("end_time");
sql.SELECT("user_phone");
sql.SELECT("partake_total_num");
sql.SELECT("partake_surplus_num");
sql.SELECT("partake_use_num");
sql.SELECT("`status`");
sql.SELECT("create_time");
sql.SELECT("update_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("bs_store_discount_activity_partake_user");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String updateByExampleSelective(Map<String, Object> parameter) {
BsStoreDiscountActivityPartakeUser record = (BsStoreDiscountActivityPartakeUser) parameter.get("record");
BsStoreDiscountActivityPartakeUserExample example = (BsStoreDiscountActivityPartakeUserExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_store_discount_activity_partake_user");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getDiscountActivityId() != null) {
sql.SET("discount_activity_id = #{record.discountActivityId,jdbcType=BIGINT}");
}
if (record.getDiscountActivityName() != null) {
sql.SET("discount_activity_name = #{record.discountActivityName,jdbcType=VARCHAR}");
}
if (record.getDiscountType() != null) {
sql.SET("discount_type = #{record.discountType,jdbcType=INTEGER}");
}
if (record.getDiscountCondition() != null) {
sql.SET("discount_condition = #{record.discountCondition,jdbcType=DECIMAL}");
}
if (record.getDiscountPrice() != null) {
sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}");
}
if (record.getStartTime() != null) {
sql.SET("start_time = #{record.startTime,jdbcType=TIMESTAMP}");
}
if (record.getEndTime() != null) {
sql.SET("end_time = #{record.endTime,jdbcType=TIMESTAMP}");
}
if (record.getUserPhone() != null) {
sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}");
}
if (record.getPartakeTotalNum() != null) {
sql.SET("partake_total_num = #{record.partakeTotalNum,jdbcType=INTEGER}");
}
if (record.getPartakeSurplusNum() != null) {
sql.SET("partake_surplus_num = #{record.partakeSurplusNum,jdbcType=INTEGER}");
}
if (record.getPartakeUseNum() != null) {
sql.SET("partake_use_num = #{record.partakeUseNum,jdbcType=INTEGER}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
}
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExample(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("bs_store_discount_activity_partake_user");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("discount_activity_id = #{record.discountActivityId,jdbcType=BIGINT}");
sql.SET("discount_activity_name = #{record.discountActivityName,jdbcType=VARCHAR}");
sql.SET("discount_type = #{record.discountType,jdbcType=INTEGER}");
sql.SET("discount_condition = #{record.discountCondition,jdbcType=DECIMAL}");
sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}");
sql.SET("start_time = #{record.startTime,jdbcType=TIMESTAMP}");
sql.SET("end_time = #{record.endTime,jdbcType=TIMESTAMP}");
sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}");
sql.SET("partake_total_num = #{record.partakeTotalNum,jdbcType=INTEGER}");
sql.SET("partake_surplus_num = #{record.partakeSurplusNum,jdbcType=INTEGER}");
sql.SET("partake_use_num = #{record.partakeUseNum,jdbcType=INTEGER}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
BsStoreDiscountActivityPartakeUserExample example = (BsStoreDiscountActivityPartakeUserExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsStoreDiscountActivityPartakeUser record) {
SQL sql = new SQL();
sql.UPDATE("bs_store_discount_activity_partake_user");
if (record.getDiscountActivityId() != null) {
sql.SET("discount_activity_id = #{discountActivityId,jdbcType=BIGINT}");
}
if (record.getDiscountActivityName() != null) {
sql.SET("discount_activity_name = #{discountActivityName,jdbcType=VARCHAR}");
}
if (record.getDiscountType() != null) {
sql.SET("discount_type = #{discountType,jdbcType=INTEGER}");
}
if (record.getDiscountCondition() != null) {
sql.SET("discount_condition = #{discountCondition,jdbcType=DECIMAL}");
}
if (record.getDiscountPrice() != null) {
sql.SET("discount_price = #{discountPrice,jdbcType=DECIMAL}");
}
if (record.getStartTime() != null) {
sql.SET("start_time = #{startTime,jdbcType=TIMESTAMP}");
}
if (record.getEndTime() != null) {
sql.SET("end_time = #{endTime,jdbcType=TIMESTAMP}");
}
if (record.getUserPhone() != null) {
sql.SET("user_phone = #{userPhone,jdbcType=VARCHAR}");
}
if (record.getPartakeTotalNum() != null) {
sql.SET("partake_total_num = #{partakeTotalNum,jdbcType=INTEGER}");
}
if (record.getPartakeSurplusNum() != null) {
sql.SET("partake_surplus_num = #{partakeSurplusNum,jdbcType=INTEGER}");
}
if (record.getPartakeUseNum() != null) {
sql.SET("partake_use_num = #{partakeUseNum,jdbcType=INTEGER}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();
}
protected void applyWhere(SQL sql, BsStoreDiscountActivityPartakeUserExample example, boolean includeExamplePhrase) {
if (example == null) {
return;
}
String parmPhrase1;
String parmPhrase1_th;
String parmPhrase2;
String parmPhrase2_th;
String parmPhrase3;
String parmPhrase3_th;
if (includeExamplePhrase) {
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
} else {
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
}
StringBuilder sb = new StringBuilder();
List<Criteria> oredCriteria = example.getOredCriteria();
boolean firstCriteria = true;
for (int i = 0; i < oredCriteria.size(); i++) {
Criteria criteria = oredCriteria.get(i);
if (criteria.isValid()) {
if (firstCriteria) {
firstCriteria = false;
} else {
sb.append(" or ");
}
sb.append('(');
List<Criterion> criterions = criteria.getAllCriteria();
boolean firstCriterion = true;
for (int j = 0; j < criterions.size(); j++) {
Criterion criterion = criterions.get(j);
if (firstCriterion) {
firstCriterion = false;
} else {
sb.append(" and ");
}
if (criterion.isNoValue()) {
sb.append(criterion.getCondition());
} else if (criterion.isSingleValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));
} else {
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));
}
} else if (criterion.isBetweenValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));
} else {
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));
}
} else if (criterion.isListValue()) {
sb.append(criterion.getCondition());
sb.append(" (");
List<?> listItems = (List<?>) criterion.getValue();
boolean comma = false;
for (int k = 0; k < listItems.size(); k++) {
if (comma) {
sb.append(", ");
} else {
comma = true;
}
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase3, i, j, k));
} else {
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));
}
}
sb.append(')');
}
}
sb.append(')');
}
}
if (sb.length() > 0) {
sql.WHERE(sb.toString());
}
}
}

@ -28,6 +28,10 @@ public class BsStoreDiscountActivitySqlProvider {
SQL sql = new SQL();
sql.INSERT_INTO("bs_store_discount_activity");
if (record.getPartakeWay() != null) {
sql.VALUES("partake_way", "#{partakeWay,jdbcType=INTEGER}");
}
if (record.getCompanyId() != null) {
sql.VALUES("company_id", "#{companyId,jdbcType=BIGINT}");
}
@ -104,6 +108,14 @@ public class BsStoreDiscountActivitySqlProvider {
sql.VALUES("end_time", "#{endTime,jdbcType=TIMESTAMP}");
}
if (record.getRestrictType() != null) {
sql.VALUES("restrict_type", "#{restrictType,jdbcType=INTEGER}");
}
if (record.getRestrictPartakeNum() != null) {
sql.VALUES("restrict_partake_num", "#{restrictPartakeNum,jdbcType=INTEGER}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
@ -146,6 +158,7 @@ public class BsStoreDiscountActivitySqlProvider {
} else {
sql.SELECT("id");
}
sql.SELECT("partake_way");
sql.SELECT("company_id");
sql.SELECT("company_name");
sql.SELECT("agent_id");
@ -165,6 +178,8 @@ public class BsStoreDiscountActivitySqlProvider {
sql.SELECT("final_cost_price");
sql.SELECT("start_time");
sql.SELECT("end_time");
sql.SELECT("restrict_type");
sql.SELECT("restrict_partake_num");
sql.SELECT("`status`");
sql.SELECT("operator_id");
sql.SELECT("operator_name");
@ -194,6 +209,10 @@ public class BsStoreDiscountActivitySqlProvider {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getPartakeWay() != null) {
sql.SET("partake_way = #{record.partakeWay,jdbcType=INTEGER}");
}
if (record.getCompanyId() != null) {
sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}");
}
@ -270,6 +289,14 @@ public class BsStoreDiscountActivitySqlProvider {
sql.SET("end_time = #{record.endTime,jdbcType=TIMESTAMP}");
}
if (record.getRestrictType() != null) {
sql.SET("restrict_type = #{record.restrictType,jdbcType=INTEGER}");
}
if (record.getRestrictPartakeNum() != null) {
sql.SET("restrict_partake_num = #{record.restrictPartakeNum,jdbcType=INTEGER}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
@ -311,6 +338,7 @@ public class BsStoreDiscountActivitySqlProvider {
sql.UPDATE("bs_store_discount_activity");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("partake_way = #{record.partakeWay,jdbcType=INTEGER}");
sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}");
sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}");
sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}");
@ -330,6 +358,8 @@ public class BsStoreDiscountActivitySqlProvider {
sql.SET("final_cost_price = #{record.finalCostPrice,jdbcType=DECIMAL}");
sql.SET("start_time = #{record.startTime,jdbcType=TIMESTAMP}");
sql.SET("end_time = #{record.endTime,jdbcType=TIMESTAMP}");
sql.SET("restrict_type = #{record.restrictType,jdbcType=INTEGER}");
sql.SET("restrict_partake_num = #{record.restrictPartakeNum,jdbcType=INTEGER}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("operator_id = #{record.operatorId,jdbcType=BIGINT}");
sql.SET("operator_name = #{record.operatorName,jdbcType=VARCHAR}");
@ -348,6 +378,10 @@ public class BsStoreDiscountActivitySqlProvider {
SQL sql = new SQL();
sql.UPDATE("bs_store_discount_activity");
if (record.getPartakeWay() != null) {
sql.SET("partake_way = #{partakeWay,jdbcType=INTEGER}");
}
if (record.getCompanyId() != null) {
sql.SET("company_id = #{companyId,jdbcType=BIGINT}");
}
@ -424,6 +458,14 @@ public class BsStoreDiscountActivitySqlProvider {
sql.SET("end_time = #{endTime,jdbcType=TIMESTAMP}");
}
if (record.getRestrictType() != null) {
sql.SET("restrict_type = #{restrictType,jdbcType=INTEGER}");
}
if (record.getRestrictPartakeNum() != null) {
sql.SET("restrict_partake_num = #{restrictPartakeNum,jdbcType=INTEGER}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}

@ -19,6 +19,11 @@ public class BsStoreDiscountActivity implements Serializable {
*/
private Long id;
/**
* 参与方式 1. 交易 2. 分享
*/
private Integer partakeWay;
/**
* 公司id
*/
@ -114,6 +119,16 @@ public class BsStoreDiscountActivity implements Serializable {
*/
private Date endTime;
/**
* 限制类型 1. 每日
*/
private Integer restrictType;
/**
* 限制参与次数
*/
private Integer restrictPartakeNum;
/**
* 状态0. 删除 1. 编辑中 2. 进行中 3. 已结束
*/
@ -155,6 +170,14 @@ public class BsStoreDiscountActivity implements Serializable {
this.id = id;
}
public Integer getPartakeWay() {
return partakeWay;
}
public void setPartakeWay(Integer partakeWay) {
this.partakeWay = partakeWay;
}
public Long getCompanyId() {
return companyId;
}
@ -307,6 +330,22 @@ public class BsStoreDiscountActivity implements Serializable {
this.endTime = endTime;
}
public Integer getRestrictType() {
return restrictType;
}
public void setRestrictType(Integer restrictType) {
this.restrictType = restrictType;
}
public Integer getRestrictPartakeNum() {
return restrictPartakeNum;
}
public void setRestrictPartakeNum(Integer restrictPartakeNum) {
this.restrictPartakeNum = restrictPartakeNum;
}
public Integer getStatus() {
return status;
}
@ -384,6 +423,7 @@ public class BsStoreDiscountActivity implements Serializable {
}
BsStoreDiscountActivity other = (BsStoreDiscountActivity) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getPartakeWay() == null ? other.getPartakeWay() == null : this.getPartakeWay().equals(other.getPartakeWay()))
&& (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId()))
&& (this.getCompanyName() == null ? other.getCompanyName() == null : this.getCompanyName().equals(other.getCompanyName()))
&& (this.getAgentId() == null ? other.getAgentId() == null : this.getAgentId().equals(other.getAgentId()))
@ -403,6 +443,8 @@ public class BsStoreDiscountActivity implements Serializable {
&& (this.getFinalCostPrice() == null ? other.getFinalCostPrice() == null : this.getFinalCostPrice().equals(other.getFinalCostPrice()))
&& (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
&& (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()))
&& (this.getRestrictType() == null ? other.getRestrictType() == null : this.getRestrictType().equals(other.getRestrictType()))
&& (this.getRestrictPartakeNum() == null ? other.getRestrictPartakeNum() == null : this.getRestrictPartakeNum().equals(other.getRestrictPartakeNum()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getOperatorId() == null ? other.getOperatorId() == null : this.getOperatorId().equals(other.getOperatorId()))
&& (this.getOperatorName() == null ? other.getOperatorName() == null : this.getOperatorName().equals(other.getOperatorName()))
@ -418,6 +460,7 @@ public class BsStoreDiscountActivity implements Serializable {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getPartakeWay() == null) ? 0 : getPartakeWay().hashCode());
result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode());
result = prime * result + ((getCompanyName() == null) ? 0 : getCompanyName().hashCode());
result = prime * result + ((getAgentId() == null) ? 0 : getAgentId().hashCode());
@ -437,6 +480,8 @@ public class BsStoreDiscountActivity implements Serializable {
result = prime * result + ((getFinalCostPrice() == null) ? 0 : getFinalCostPrice().hashCode());
result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
result = prime * result + ((getRestrictType() == null) ? 0 : getRestrictType().hashCode());
result = prime * result + ((getRestrictPartakeNum() == null) ? 0 : getRestrictPartakeNum().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getOperatorId() == null) ? 0 : getOperatorId().hashCode());
result = prime * result + ((getOperatorName() == null) ? 0 : getOperatorName().hashCode());
@ -455,6 +500,7 @@ public class BsStoreDiscountActivity implements Serializable {
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", partakeWay=").append(partakeWay);
sb.append(", companyId=").append(companyId);
sb.append(", companyName=").append(companyName);
sb.append(", agentId=").append(agentId);
@ -474,6 +520,8 @@ public class BsStoreDiscountActivity implements Serializable {
sb.append(", finalCostPrice=").append(finalCostPrice);
sb.append(", startTime=").append(startTime);
sb.append(", endTime=").append(endTime);
sb.append(", restrictType=").append(restrictType);
sb.append(", restrictPartakeNum=").append(restrictPartakeNum);
sb.append(", status=").append(status);
sb.append(", operatorId=").append(operatorId);
sb.append(", operatorName=").append(operatorName);

@ -186,6 +186,66 @@ public class BsStoreDiscountActivityExample {
return (Criteria) this;
}
public Criteria andPartakeWayIsNull() {
addCriterion("partake_way is null");
return (Criteria) this;
}
public Criteria andPartakeWayIsNotNull() {
addCriterion("partake_way is not null");
return (Criteria) this;
}
public Criteria andPartakeWayEqualTo(Integer value) {
addCriterion("partake_way =", value, "partakeWay");
return (Criteria) this;
}
public Criteria andPartakeWayNotEqualTo(Integer value) {
addCriterion("partake_way <>", value, "partakeWay");
return (Criteria) this;
}
public Criteria andPartakeWayGreaterThan(Integer value) {
addCriterion("partake_way >", value, "partakeWay");
return (Criteria) this;
}
public Criteria andPartakeWayGreaterThanOrEqualTo(Integer value) {
addCriterion("partake_way >=", value, "partakeWay");
return (Criteria) this;
}
public Criteria andPartakeWayLessThan(Integer value) {
addCriterion("partake_way <", value, "partakeWay");
return (Criteria) this;
}
public Criteria andPartakeWayLessThanOrEqualTo(Integer value) {
addCriterion("partake_way <=", value, "partakeWay");
return (Criteria) this;
}
public Criteria andPartakeWayIn(List<Integer> values) {
addCriterion("partake_way in", values, "partakeWay");
return (Criteria) this;
}
public Criteria andPartakeWayNotIn(List<Integer> values) {
addCriterion("partake_way not in", values, "partakeWay");
return (Criteria) this;
}
public Criteria andPartakeWayBetween(Integer value1, Integer value2) {
addCriterion("partake_way between", value1, value2, "partakeWay");
return (Criteria) this;
}
public Criteria andPartakeWayNotBetween(Integer value1, Integer value2) {
addCriterion("partake_way not between", value1, value2, "partakeWay");
return (Criteria) this;
}
public Criteria andCompanyIdIsNull() {
addCriterion("company_id is null");
return (Criteria) this;
@ -1396,6 +1456,126 @@ public class BsStoreDiscountActivityExample {
return (Criteria) this;
}
public Criteria andRestrictTypeIsNull() {
addCriterion("restrict_type is null");
return (Criteria) this;
}
public Criteria andRestrictTypeIsNotNull() {
addCriterion("restrict_type is not null");
return (Criteria) this;
}
public Criteria andRestrictTypeEqualTo(Integer value) {
addCriterion("restrict_type =", value, "restrictType");
return (Criteria) this;
}
public Criteria andRestrictTypeNotEqualTo(Integer value) {
addCriterion("restrict_type <>", value, "restrictType");
return (Criteria) this;
}
public Criteria andRestrictTypeGreaterThan(Integer value) {
addCriterion("restrict_type >", value, "restrictType");
return (Criteria) this;
}
public Criteria andRestrictTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("restrict_type >=", value, "restrictType");
return (Criteria) this;
}
public Criteria andRestrictTypeLessThan(Integer value) {
addCriterion("restrict_type <", value, "restrictType");
return (Criteria) this;
}
public Criteria andRestrictTypeLessThanOrEqualTo(Integer value) {
addCriterion("restrict_type <=", value, "restrictType");
return (Criteria) this;
}
public Criteria andRestrictTypeIn(List<Integer> values) {
addCriterion("restrict_type in", values, "restrictType");
return (Criteria) this;
}
public Criteria andRestrictTypeNotIn(List<Integer> values) {
addCriterion("restrict_type not in", values, "restrictType");
return (Criteria) this;
}
public Criteria andRestrictTypeBetween(Integer value1, Integer value2) {
addCriterion("restrict_type between", value1, value2, "restrictType");
return (Criteria) this;
}
public Criteria andRestrictTypeNotBetween(Integer value1, Integer value2) {
addCriterion("restrict_type not between", value1, value2, "restrictType");
return (Criteria) this;
}
public Criteria andRestrictPartakeNumIsNull() {
addCriterion("restrict_partake_num is null");
return (Criteria) this;
}
public Criteria andRestrictPartakeNumIsNotNull() {
addCriterion("restrict_partake_num is not null");
return (Criteria) this;
}
public Criteria andRestrictPartakeNumEqualTo(Integer value) {
addCriterion("restrict_partake_num =", value, "restrictPartakeNum");
return (Criteria) this;
}
public Criteria andRestrictPartakeNumNotEqualTo(Integer value) {
addCriterion("restrict_partake_num <>", value, "restrictPartakeNum");
return (Criteria) this;
}
public Criteria andRestrictPartakeNumGreaterThan(Integer value) {
addCriterion("restrict_partake_num >", value, "restrictPartakeNum");
return (Criteria) this;
}
public Criteria andRestrictPartakeNumGreaterThanOrEqualTo(Integer value) {
addCriterion("restrict_partake_num >=", value, "restrictPartakeNum");
return (Criteria) this;
}
public Criteria andRestrictPartakeNumLessThan(Integer value) {
addCriterion("restrict_partake_num <", value, "restrictPartakeNum");
return (Criteria) this;
}
public Criteria andRestrictPartakeNumLessThanOrEqualTo(Integer value) {
addCriterion("restrict_partake_num <=", value, "restrictPartakeNum");
return (Criteria) this;
}
public Criteria andRestrictPartakeNumIn(List<Integer> values) {
addCriterion("restrict_partake_num in", values, "restrictPartakeNum");
return (Criteria) this;
}
public Criteria andRestrictPartakeNumNotIn(List<Integer> values) {
addCriterion("restrict_partake_num not in", values, "restrictPartakeNum");
return (Criteria) this;
}
public Criteria andRestrictPartakeNumBetween(Integer value1, Integer value2) {
addCriterion("restrict_partake_num between", value1, value2, "restrictPartakeNum");
return (Criteria) this;
}
public Criteria andRestrictPartakeNumNotBetween(Integer value1, Integer value2) {
addCriterion("restrict_partake_num not between", value1, value2, "restrictPartakeNum");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;

@ -0,0 +1,329 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* bs_store_discount_activity_partake_user
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsStoreDiscountActivityPartakeUser implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 优惠活动id
*/
private Long discountActivityId;
/**
* 优惠活动名称
*/
private String discountActivityName;
/**
* 优惠类型 1. 满减 2. 立减 3. 折扣
*/
private Integer discountType;
/**
* 优惠条件(满减价格)
*/
private BigDecimal discountCondition;
/**
* 优惠金额
*/
private BigDecimal discountPrice;
/**
* 优惠活动开始时间
*/
private Date startTime;
/**
* 优惠活动结束时间
*/
private Date endTime;
/**
* 用户手机号
*/
private String userPhone;
/**
* 参与总次数
*/
private Integer partakeTotalNum;
/**
* 参与剩余次数
*/
private Integer partakeSurplusNum;
/**
* 参与使用次数
*/
private Integer partakeUseNum;
/**
* 状态 0不可用 1可用
*/
private Integer status;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
private String ext1;
private String ext2;
private String ext3;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getDiscountActivityId() {
return discountActivityId;
}
public void setDiscountActivityId(Long discountActivityId) {
this.discountActivityId = discountActivityId;
}
public String getDiscountActivityName() {
return discountActivityName;
}
public void setDiscountActivityName(String discountActivityName) {
this.discountActivityName = discountActivityName;
}
public Integer getDiscountType() {
return discountType;
}
public void setDiscountType(Integer discountType) {
this.discountType = discountType;
}
public BigDecimal getDiscountCondition() {
return discountCondition;
}
public void setDiscountCondition(BigDecimal discountCondition) {
this.discountCondition = discountCondition;
}
public BigDecimal getDiscountPrice() {
return discountPrice;
}
public void setDiscountPrice(BigDecimal discountPrice) {
this.discountPrice = discountPrice;
}
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public String getUserPhone() {
return userPhone;
}
public void setUserPhone(String userPhone) {
this.userPhone = userPhone;
}
public Integer getPartakeTotalNum() {
return partakeTotalNum;
}
public void setPartakeTotalNum(Integer partakeTotalNum) {
this.partakeTotalNum = partakeTotalNum;
}
public Integer getPartakeSurplusNum() {
return partakeSurplusNum;
}
public void setPartakeSurplusNum(Integer partakeSurplusNum) {
this.partakeSurplusNum = partakeSurplusNum;
}
public Integer getPartakeUseNum() {
return partakeUseNum;
}
public void setPartakeUseNum(Integer partakeUseNum) {
this.partakeUseNum = partakeUseNum;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getExt1() {
return ext1;
}
public void setExt1(String ext1) {
this.ext1 = ext1;
}
public String getExt2() {
return ext2;
}
public void setExt2(String ext2) {
this.ext2 = ext2;
}
public String getExt3() {
return ext3;
}
public void setExt3(String ext3) {
this.ext3 = ext3;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
BsStoreDiscountActivityPartakeUser other = (BsStoreDiscountActivityPartakeUser) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getDiscountActivityId() == null ? other.getDiscountActivityId() == null : this.getDiscountActivityId().equals(other.getDiscountActivityId()))
&& (this.getDiscountActivityName() == null ? other.getDiscountActivityName() == null : this.getDiscountActivityName().equals(other.getDiscountActivityName()))
&& (this.getDiscountType() == null ? other.getDiscountType() == null : this.getDiscountType().equals(other.getDiscountType()))
&& (this.getDiscountCondition() == null ? other.getDiscountCondition() == null : this.getDiscountCondition().equals(other.getDiscountCondition()))
&& (this.getDiscountPrice() == null ? other.getDiscountPrice() == null : this.getDiscountPrice().equals(other.getDiscountPrice()))
&& (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
&& (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()))
&& (this.getUserPhone() == null ? other.getUserPhone() == null : this.getUserPhone().equals(other.getUserPhone()))
&& (this.getPartakeTotalNum() == null ? other.getPartakeTotalNum() == null : this.getPartakeTotalNum().equals(other.getPartakeTotalNum()))
&& (this.getPartakeSurplusNum() == null ? other.getPartakeSurplusNum() == null : this.getPartakeSurplusNum().equals(other.getPartakeSurplusNum()))
&& (this.getPartakeUseNum() == null ? other.getPartakeUseNum() == null : this.getPartakeUseNum().equals(other.getPartakeUseNum()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2()))
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getDiscountActivityId() == null) ? 0 : getDiscountActivityId().hashCode());
result = prime * result + ((getDiscountActivityName() == null) ? 0 : getDiscountActivityName().hashCode());
result = prime * result + ((getDiscountType() == null) ? 0 : getDiscountType().hashCode());
result = prime * result + ((getDiscountCondition() == null) ? 0 : getDiscountCondition().hashCode());
result = prime * result + ((getDiscountPrice() == null) ? 0 : getDiscountPrice().hashCode());
result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
result = prime * result + ((getUserPhone() == null) ? 0 : getUserPhone().hashCode());
result = prime * result + ((getPartakeTotalNum() == null) ? 0 : getPartakeTotalNum().hashCode());
result = prime * result + ((getPartakeSurplusNum() == null) ? 0 : getPartakeSurplusNum().hashCode());
result = prime * result + ((getPartakeUseNum() == null) ? 0 : getPartakeUseNum().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode());
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode());
return result;
}
@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(", discountActivityId=").append(discountActivityId);
sb.append(", discountActivityName=").append(discountActivityName);
sb.append(", discountType=").append(discountType);
sb.append(", discountCondition=").append(discountCondition);
sb.append(", discountPrice=").append(discountPrice);
sb.append(", startTime=").append(startTime);
sb.append(", endTime=").append(endTime);
sb.append(", userPhone=").append(userPhone);
sb.append(", partakeTotalNum=").append(partakeTotalNum);
sb.append(", partakeSurplusNum=").append(partakeSurplusNum);
sb.append(", partakeUseNum=").append(partakeUseNum);
sb.append(", status=").append(status);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);
sb.append(", ext3=").append(ext3);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

@ -0,0 +1,217 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* bs_store_discount_activity_partake_user_record
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsStoreDiscountActivityPartakeUserRecord implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 优惠活动id
*/
private Long discountActivityId;
/**
* 优惠活动名称
*/
private String discountActivityName;
/**
* 优惠类型 1. 满减 2. 立减 3. 折扣
*/
private Integer discountType;
/**
* 优惠条件(满减价格)
*/
private BigDecimal discountCondition;
/**
* 优惠金额
*/
private BigDecimal discountPrice;
/**
* 用户手机号
*/
private String userPhone;
/**
* 创建时间
*/
private Date createTime;
private String ext1;
private String ext2;
private String ext3;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getDiscountActivityId() {
return discountActivityId;
}
public void setDiscountActivityId(Long discountActivityId) {
this.discountActivityId = discountActivityId;
}
public String getDiscountActivityName() {
return discountActivityName;
}
public void setDiscountActivityName(String discountActivityName) {
this.discountActivityName = discountActivityName;
}
public Integer getDiscountType() {
return discountType;
}
public void setDiscountType(Integer discountType) {
this.discountType = discountType;
}
public BigDecimal getDiscountCondition() {
return discountCondition;
}
public void setDiscountCondition(BigDecimal discountCondition) {
this.discountCondition = discountCondition;
}
public BigDecimal getDiscountPrice() {
return discountPrice;
}
public void setDiscountPrice(BigDecimal discountPrice) {
this.discountPrice = discountPrice;
}
public String getUserPhone() {
return userPhone;
}
public void setUserPhone(String userPhone) {
this.userPhone = userPhone;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getExt1() {
return ext1;
}
public void setExt1(String ext1) {
this.ext1 = ext1;
}
public String getExt2() {
return ext2;
}
public void setExt2(String ext2) {
this.ext2 = ext2;
}
public String getExt3() {
return ext3;
}
public void setExt3(String ext3) {
this.ext3 = ext3;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
BsStoreDiscountActivityPartakeUserRecord other = (BsStoreDiscountActivityPartakeUserRecord) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getDiscountActivityId() == null ? other.getDiscountActivityId() == null : this.getDiscountActivityId().equals(other.getDiscountActivityId()))
&& (this.getDiscountActivityName() == null ? other.getDiscountActivityName() == null : this.getDiscountActivityName().equals(other.getDiscountActivityName()))
&& (this.getDiscountType() == null ? other.getDiscountType() == null : this.getDiscountType().equals(other.getDiscountType()))
&& (this.getDiscountCondition() == null ? other.getDiscountCondition() == null : this.getDiscountCondition().equals(other.getDiscountCondition()))
&& (this.getDiscountPrice() == null ? other.getDiscountPrice() == null : this.getDiscountPrice().equals(other.getDiscountPrice()))
&& (this.getUserPhone() == null ? other.getUserPhone() == null : this.getUserPhone().equals(other.getUserPhone()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2()))
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getDiscountActivityId() == null) ? 0 : getDiscountActivityId().hashCode());
result = prime * result + ((getDiscountActivityName() == null) ? 0 : getDiscountActivityName().hashCode());
result = prime * result + ((getDiscountType() == null) ? 0 : getDiscountType().hashCode());
result = prime * result + ((getDiscountCondition() == null) ? 0 : getDiscountCondition().hashCode());
result = prime * result + ((getDiscountPrice() == null) ? 0 : getDiscountPrice().hashCode());
result = prime * result + ((getUserPhone() == null) ? 0 : getUserPhone().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode());
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode());
return result;
}
@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(", discountActivityId=").append(discountActivityId);
sb.append(", discountActivityName=").append(discountActivityName);
sb.append(", discountType=").append(discountType);
sb.append(", discountCondition=").append(discountCondition);
sb.append(", discountPrice=").append(discountPrice);
sb.append(", userPhone=").append(userPhone);
sb.append(", createTime=").append(createTime);
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);
sb.append(", ext3=").append(ext3);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

@ -0,0 +1,934 @@
package com.hfkj.entity;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class BsStoreDiscountActivityPartakeUserRecordExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
private Integer limit;
private Long offset;
public BsStoreDiscountActivityPartakeUserRecordExample() {
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;
}
public void setLimit(Integer limit) {
this.limit = limit;
}
public Integer getLimit() {
return limit;
}
public void setOffset(Long offset) {
this.offset = offset;
}
public Long getOffset() {
return offset;
}
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 andDiscountActivityIdIsNull() {
addCriterion("discount_activity_id is null");
return (Criteria) this;
}
public Criteria andDiscountActivityIdIsNotNull() {
addCriterion("discount_activity_id is not null");
return (Criteria) this;
}
public Criteria andDiscountActivityIdEqualTo(Long value) {
addCriterion("discount_activity_id =", value, "discountActivityId");
return (Criteria) this;
}
public Criteria andDiscountActivityIdNotEqualTo(Long value) {
addCriterion("discount_activity_id <>", value, "discountActivityId");
return (Criteria) this;
}
public Criteria andDiscountActivityIdGreaterThan(Long value) {
addCriterion("discount_activity_id >", value, "discountActivityId");
return (Criteria) this;
}
public Criteria andDiscountActivityIdGreaterThanOrEqualTo(Long value) {
addCriterion("discount_activity_id >=", value, "discountActivityId");
return (Criteria) this;
}
public Criteria andDiscountActivityIdLessThan(Long value) {
addCriterion("discount_activity_id <", value, "discountActivityId");
return (Criteria) this;
}
public Criteria andDiscountActivityIdLessThanOrEqualTo(Long value) {
addCriterion("discount_activity_id <=", value, "discountActivityId");
return (Criteria) this;
}
public Criteria andDiscountActivityIdIn(List<Long> values) {
addCriterion("discount_activity_id in", values, "discountActivityId");
return (Criteria) this;
}
public Criteria andDiscountActivityIdNotIn(List<Long> values) {
addCriterion("discount_activity_id not in", values, "discountActivityId");
return (Criteria) this;
}
public Criteria andDiscountActivityIdBetween(Long value1, Long value2) {
addCriterion("discount_activity_id between", value1, value2, "discountActivityId");
return (Criteria) this;
}
public Criteria andDiscountActivityIdNotBetween(Long value1, Long value2) {
addCriterion("discount_activity_id not between", value1, value2, "discountActivityId");
return (Criteria) this;
}
public Criteria andDiscountActivityNameIsNull() {
addCriterion("discount_activity_name is null");
return (Criteria) this;
}
public Criteria andDiscountActivityNameIsNotNull() {
addCriterion("discount_activity_name is not null");
return (Criteria) this;
}
public Criteria andDiscountActivityNameEqualTo(String value) {
addCriterion("discount_activity_name =", value, "discountActivityName");
return (Criteria) this;
}
public Criteria andDiscountActivityNameNotEqualTo(String value) {
addCriterion("discount_activity_name <>", value, "discountActivityName");
return (Criteria) this;
}
public Criteria andDiscountActivityNameGreaterThan(String value) {
addCriterion("discount_activity_name >", value, "discountActivityName");
return (Criteria) this;
}
public Criteria andDiscountActivityNameGreaterThanOrEqualTo(String value) {
addCriterion("discount_activity_name >=", value, "discountActivityName");
return (Criteria) this;
}
public Criteria andDiscountActivityNameLessThan(String value) {
addCriterion("discount_activity_name <", value, "discountActivityName");
return (Criteria) this;
}
public Criteria andDiscountActivityNameLessThanOrEqualTo(String value) {
addCriterion("discount_activity_name <=", value, "discountActivityName");
return (Criteria) this;
}
public Criteria andDiscountActivityNameLike(String value) {
addCriterion("discount_activity_name like", value, "discountActivityName");
return (Criteria) this;
}
public Criteria andDiscountActivityNameNotLike(String value) {
addCriterion("discount_activity_name not like", value, "discountActivityName");
return (Criteria) this;
}
public Criteria andDiscountActivityNameIn(List<String> values) {
addCriterion("discount_activity_name in", values, "discountActivityName");
return (Criteria) this;
}
public Criteria andDiscountActivityNameNotIn(List<String> values) {
addCriterion("discount_activity_name not in", values, "discountActivityName");
return (Criteria) this;
}
public Criteria andDiscountActivityNameBetween(String value1, String value2) {
addCriterion("discount_activity_name between", value1, value2, "discountActivityName");
return (Criteria) this;
}
public Criteria andDiscountActivityNameNotBetween(String value1, String value2) {
addCriterion("discount_activity_name not between", value1, value2, "discountActivityName");
return (Criteria) this;
}
public Criteria andDiscountTypeIsNull() {
addCriterion("discount_type is null");
return (Criteria) this;
}
public Criteria andDiscountTypeIsNotNull() {
addCriterion("discount_type is not null");
return (Criteria) this;
}
public Criteria andDiscountTypeEqualTo(Integer value) {
addCriterion("discount_type =", value, "discountType");
return (Criteria) this;
}
public Criteria andDiscountTypeNotEqualTo(Integer value) {
addCriterion("discount_type <>", value, "discountType");
return (Criteria) this;
}
public Criteria andDiscountTypeGreaterThan(Integer value) {
addCriterion("discount_type >", value, "discountType");
return (Criteria) this;
}
public Criteria andDiscountTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("discount_type >=", value, "discountType");
return (Criteria) this;
}
public Criteria andDiscountTypeLessThan(Integer value) {
addCriterion("discount_type <", value, "discountType");
return (Criteria) this;
}
public Criteria andDiscountTypeLessThanOrEqualTo(Integer value) {
addCriterion("discount_type <=", value, "discountType");
return (Criteria) this;
}
public Criteria andDiscountTypeIn(List<Integer> values) {
addCriterion("discount_type in", values, "discountType");
return (Criteria) this;
}
public Criteria andDiscountTypeNotIn(List<Integer> values) {
addCriterion("discount_type not in", values, "discountType");
return (Criteria) this;
}
public Criteria andDiscountTypeBetween(Integer value1, Integer value2) {
addCriterion("discount_type between", value1, value2, "discountType");
return (Criteria) this;
}
public Criteria andDiscountTypeNotBetween(Integer value1, Integer value2) {
addCriterion("discount_type not between", value1, value2, "discountType");
return (Criteria) this;
}
public Criteria andDiscountConditionIsNull() {
addCriterion("discount_condition is null");
return (Criteria) this;
}
public Criteria andDiscountConditionIsNotNull() {
addCriterion("discount_condition is not null");
return (Criteria) this;
}
public Criteria andDiscountConditionEqualTo(BigDecimal value) {
addCriterion("discount_condition =", value, "discountCondition");
return (Criteria) this;
}
public Criteria andDiscountConditionNotEqualTo(BigDecimal value) {
addCriterion("discount_condition <>", value, "discountCondition");
return (Criteria) this;
}
public Criteria andDiscountConditionGreaterThan(BigDecimal value) {
addCriterion("discount_condition >", value, "discountCondition");
return (Criteria) this;
}
public Criteria andDiscountConditionGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("discount_condition >=", value, "discountCondition");
return (Criteria) this;
}
public Criteria andDiscountConditionLessThan(BigDecimal value) {
addCriterion("discount_condition <", value, "discountCondition");
return (Criteria) this;
}
public Criteria andDiscountConditionLessThanOrEqualTo(BigDecimal value) {
addCriterion("discount_condition <=", value, "discountCondition");
return (Criteria) this;
}
public Criteria andDiscountConditionIn(List<BigDecimal> values) {
addCriterion("discount_condition in", values, "discountCondition");
return (Criteria) this;
}
public Criteria andDiscountConditionNotIn(List<BigDecimal> values) {
addCriterion("discount_condition not in", values, "discountCondition");
return (Criteria) this;
}
public Criteria andDiscountConditionBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("discount_condition between", value1, value2, "discountCondition");
return (Criteria) this;
}
public Criteria andDiscountConditionNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("discount_condition not between", value1, value2, "discountCondition");
return (Criteria) this;
}
public Criteria andDiscountPriceIsNull() {
addCriterion("discount_price is null");
return (Criteria) this;
}
public Criteria andDiscountPriceIsNotNull() {
addCriterion("discount_price is not null");
return (Criteria) this;
}
public Criteria andDiscountPriceEqualTo(BigDecimal value) {
addCriterion("discount_price =", value, "discountPrice");
return (Criteria) this;
}
public Criteria andDiscountPriceNotEqualTo(BigDecimal value) {
addCriterion("discount_price <>", value, "discountPrice");
return (Criteria) this;
}
public Criteria andDiscountPriceGreaterThan(BigDecimal value) {
addCriterion("discount_price >", value, "discountPrice");
return (Criteria) this;
}
public Criteria andDiscountPriceGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("discount_price >=", value, "discountPrice");
return (Criteria) this;
}
public Criteria andDiscountPriceLessThan(BigDecimal value) {
addCriterion("discount_price <", value, "discountPrice");
return (Criteria) this;
}
public Criteria andDiscountPriceLessThanOrEqualTo(BigDecimal value) {
addCriterion("discount_price <=", value, "discountPrice");
return (Criteria) this;
}
public Criteria andDiscountPriceIn(List<BigDecimal> values) {
addCriterion("discount_price in", values, "discountPrice");
return (Criteria) this;
}
public Criteria andDiscountPriceNotIn(List<BigDecimal> values) {
addCriterion("discount_price not in", values, "discountPrice");
return (Criteria) this;
}
public Criteria andDiscountPriceBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("discount_price between", value1, value2, "discountPrice");
return (Criteria) this;
}
public Criteria andDiscountPriceNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("discount_price not between", value1, value2, "discountPrice");
return (Criteria) this;
}
public Criteria andUserPhoneIsNull() {
addCriterion("user_phone is null");
return (Criteria) this;
}
public Criteria andUserPhoneIsNotNull() {
addCriterion("user_phone is not null");
return (Criteria) this;
}
public Criteria andUserPhoneEqualTo(String value) {
addCriterion("user_phone =", value, "userPhone");
return (Criteria) this;
}
public Criteria andUserPhoneNotEqualTo(String value) {
addCriterion("user_phone <>", value, "userPhone");
return (Criteria) this;
}
public Criteria andUserPhoneGreaterThan(String value) {
addCriterion("user_phone >", value, "userPhone");
return (Criteria) this;
}
public Criteria andUserPhoneGreaterThanOrEqualTo(String value) {
addCriterion("user_phone >=", value, "userPhone");
return (Criteria) this;
}
public Criteria andUserPhoneLessThan(String value) {
addCriterion("user_phone <", value, "userPhone");
return (Criteria) this;
}
public Criteria andUserPhoneLessThanOrEqualTo(String value) {
addCriterion("user_phone <=", value, "userPhone");
return (Criteria) this;
}
public Criteria andUserPhoneLike(String value) {
addCriterion("user_phone like", value, "userPhone");
return (Criteria) this;
}
public Criteria andUserPhoneNotLike(String value) {
addCriterion("user_phone not like", value, "userPhone");
return (Criteria) this;
}
public Criteria andUserPhoneIn(List<String> values) {
addCriterion("user_phone in", values, "userPhone");
return (Criteria) this;
}
public Criteria andUserPhoneNotIn(List<String> values) {
addCriterion("user_phone not in", values, "userPhone");
return (Criteria) this;
}
public Criteria andUserPhoneBetween(String value1, String value2) {
addCriterion("user_phone between", value1, value2, "userPhone");
return (Criteria) this;
}
public Criteria andUserPhoneNotBetween(String value1, String value2) {
addCriterion("user_phone not between", value1, value2, "userPhone");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andExt1IsNull() {
addCriterion("ext_1 is null");
return (Criteria) this;
}
public Criteria andExt1IsNotNull() {
addCriterion("ext_1 is not null");
return (Criteria) this;
}
public Criteria andExt1EqualTo(String value) {
addCriterion("ext_1 =", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1NotEqualTo(String value) {
addCriterion("ext_1 <>", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1GreaterThan(String value) {
addCriterion("ext_1 >", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1GreaterThanOrEqualTo(String value) {
addCriterion("ext_1 >=", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1LessThan(String value) {
addCriterion("ext_1 <", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1LessThanOrEqualTo(String value) {
addCriterion("ext_1 <=", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1Like(String value) {
addCriterion("ext_1 like", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1NotLike(String value) {
addCriterion("ext_1 not like", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1In(List<String> values) {
addCriterion("ext_1 in", values, "ext1");
return (Criteria) this;
}
public Criteria andExt1NotIn(List<String> values) {
addCriterion("ext_1 not in", values, "ext1");
return (Criteria) this;
}
public Criteria andExt1Between(String value1, String value2) {
addCriterion("ext_1 between", value1, value2, "ext1");
return (Criteria) this;
}
public Criteria andExt1NotBetween(String value1, String value2) {
addCriterion("ext_1 not between", value1, value2, "ext1");
return (Criteria) this;
}
public Criteria andExt2IsNull() {
addCriterion("ext_2 is null");
return (Criteria) this;
}
public Criteria andExt2IsNotNull() {
addCriterion("ext_2 is not null");
return (Criteria) this;
}
public Criteria andExt2EqualTo(String value) {
addCriterion("ext_2 =", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2NotEqualTo(String value) {
addCriterion("ext_2 <>", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2GreaterThan(String value) {
addCriterion("ext_2 >", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2GreaterThanOrEqualTo(String value) {
addCriterion("ext_2 >=", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2LessThan(String value) {
addCriterion("ext_2 <", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2LessThanOrEqualTo(String value) {
addCriterion("ext_2 <=", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2Like(String value) {
addCriterion("ext_2 like", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2NotLike(String value) {
addCriterion("ext_2 not like", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2In(List<String> values) {
addCriterion("ext_2 in", values, "ext2");
return (Criteria) this;
}
public Criteria andExt2NotIn(List<String> values) {
addCriterion("ext_2 not in", values, "ext2");
return (Criteria) this;
}
public Criteria andExt2Between(String value1, String value2) {
addCriterion("ext_2 between", value1, value2, "ext2");
return (Criteria) this;
}
public Criteria andExt2NotBetween(String value1, String value2) {
addCriterion("ext_2 not between", value1, value2, "ext2");
return (Criteria) this;
}
public Criteria andExt3IsNull() {
addCriterion("ext_3 is null");
return (Criteria) this;
}
public Criteria andExt3IsNotNull() {
addCriterion("ext_3 is not null");
return (Criteria) this;
}
public Criteria andExt3EqualTo(String value) {
addCriterion("ext_3 =", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3NotEqualTo(String value) {
addCriterion("ext_3 <>", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3GreaterThan(String value) {
addCriterion("ext_3 >", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3GreaterThanOrEqualTo(String value) {
addCriterion("ext_3 >=", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3LessThan(String value) {
addCriterion("ext_3 <", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3LessThanOrEqualTo(String value) {
addCriterion("ext_3 <=", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3Like(String value) {
addCriterion("ext_3 like", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3NotLike(String value) {
addCriterion("ext_3 not like", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3In(List<String> values) {
addCriterion("ext_3 in", values, "ext3");
return (Criteria) this;
}
public Criteria andExt3NotIn(List<String> values) {
addCriterion("ext_3 not in", values, "ext3");
return (Criteria) this;
}
public Criteria andExt3Between(String value1, String value2) {
addCriterion("ext_3 between", value1, value2, "ext3");
return (Criteria) this;
}
public Criteria andExt3NotBetween(String value1, String value2) {
addCriterion("ext_3 not between", value1, value2, "ext3");
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);
}
}
}

@ -0,0 +1,29 @@
package com.hfkj.service;
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserRecord;
import java.util.Date;
/**
* @className: BsStoreDiscountActivityPartakeUserRecordService
* @author: HuRui
* @date: 2023/3/24
**/
public interface BsStoreDiscountActivityPartakeUserRecordService {
/**
* 增加记录
* @param record
*/
void insertRecord(BsStoreDiscountActivityPartakeUserRecord record);
/**
* 查询参与次数
* @param phone
* @param discountActivityId
* @param startTime
* @param endTime
* @return
*/
Long getPartakeNum(String phone, Long discountActivityId, Date startTime, Date endTime);
}

@ -0,0 +1,46 @@
package com.hfkj.service;
import com.hfkj.entity.BsStoreDiscountActivity;
import com.hfkj.entity.BsStoreDiscountActivityPartakeUser;
import java.util.List;
import java.util.Map;
/**
* @className: BsStoreDiscountActivityPartakeUserService
* @author: HuRui
* @date: 2023/3/14
**/
public interface BsStoreDiscountActivityPartakeUserService {
/**
* 编辑数据
* @param storeDiscountActivityPartakeUser
*/
void editData(BsStoreDiscountActivityPartakeUser storeDiscountActivityPartakeUser);
/**
* 查询参与用户
* @param phone
* @param activityId
* @return
*/
BsStoreDiscountActivityPartakeUser getPartakeUser(String phone, Long activityId);
/**
* 领取活动
* @param phone 手机号
* @param activityIds 活动id
*/
void receiveDiscount(String phone, List<Long> activityIds);
/**
* 查询列表
* @param param
* @return
*/
List<BsStoreDiscountActivityPartakeUser> getList(Map<String, Object> param);
List<BsStoreDiscountActivityPartakeUser> getUseListByPhone(String phone);
}

@ -27,11 +27,11 @@ public interface BsStoreDiscountActivityService {
BsStoreDiscountActivity getDetailById(Long id);
/**
* 查询门店优惠券活动
* @param storeId
* 根据手机号查询优惠
* @param phone
* @return
*/
BsStoreDiscountActivity getAfootActivityByStore(Long storeId);
List<BsStoreDiscountActivity> getUseDiscountListByPhone(String phone);
/**
* 查询门店优惠列表

@ -4,6 +4,8 @@ import com.hfkj.entity.BsStoreDiscountActivity;
import com.hfkj.entity.BsTradeOrder;
import com.hfkj.model.UserDiscount;
import com.hfkj.sysenum.PlatformTypeEnum;
import com.hfkj.sysenum.TradeOrderMsgTypeEnum;
import com.hfkj.sysenum.TradeOrderPayModeEnum;
import java.math.BigDecimal;
import java.util.List;
@ -27,7 +29,18 @@ public interface BsTradeOrderService {
* @param tradeAmount 交易金额
* @param param 其他参数
*/
Map<String, Object> createOrder(Long storeId, BigDecimal tradeAmount, BsStoreDiscountActivity storeDiscount, UserDiscount userDiscount, Map<String, Object> param);
Map<String, Object> createOrder(Long storeId, BigDecimal tradeAmount, BsStoreDiscountActivity storeDiscount, String userPhone, UserDiscount userDiscount, Map<String, Object> param);
/**
* 支付成功
* @param outTradeNo
* @param transactionId
* @param platformType
* @param tradeOrderPayMode
* @param tradeActualAmount
* @param subMchId
*/
void paySuccess(String outTradeNo, String transactionId, PlatformTypeEnum platformType, TradeOrderPayModeEnum tradeOrderPayMode, BigDecimal tradeActualAmount, String subMchId);
/**
* 根据交易流水 查询

@ -16,6 +16,8 @@ import com.hfkj.entity.*;
import com.hfkj.model.UserInfoModel;
import com.hfkj.service.*;
import com.hfkj.sysenum.PayQrCodeStatusEnum;
import com.hfkj.sysenum.WeChatQrCodeActionNameEnum;
import com.hfkj.sysenum.WeChatQrCodeTypeEnum;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
@ -92,7 +94,7 @@ public class BsPayQrCodeServiceImpl implements BsPayQrCodeService {
CommonSysConst.getSysConfig().getFilesystem() + "/payQrCode/" + payQrCode.getSerialNumber() + ".png"
);
// 生成公众号二维码
payQrCode.setWechatQrCodeUrl(weChatQrcodeUtils.generateQrCodeImgUrl(wxToken, payQrCode.getSerialNumber()));
payQrCode.setWechatQrCodeUrl(weChatQrcodeUtils.generateQrCodeImgUrl(wxToken, WeChatQrCodeTypeEnum.PAYMENT_CODE, payQrCode.getSerialNumber(), WeChatQrCodeActionNameEnum.actionName3));
payQrCodeMapper.updateByPrimaryKey(payQrCode);
} else {

@ -0,0 +1,39 @@
package com.hfkj.service.impl;
import com.hfkj.dao.BsStoreDiscountActivityPartakeUserRecordMapper;
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserRecord;
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserRecordExample;
import com.hfkj.service.BsStoreDiscountActivityPartakeUserRecordService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
/**
* @className: BsStoreDiscountActivityPartakeUserRecordServiceImpl
* @author: HuRui
* @date: 2023/3/24
**/
@Service("storeDiscountActivityPartakeUserRecordService")
public class BsStoreDiscountActivityPartakeUserRecordServiceImpl implements BsStoreDiscountActivityPartakeUserRecordService {
@Resource
private BsStoreDiscountActivityPartakeUserRecordMapper recordMapper;
@Override
public void insertRecord(BsStoreDiscountActivityPartakeUserRecord record) {
record.setCreateTime(new Date());
recordMapper.insert(record);
}
@Override
public Long getPartakeNum(String phone, Long discountActivityId, Date startTime, Date endTime) {
BsStoreDiscountActivityPartakeUserRecordExample example = new BsStoreDiscountActivityPartakeUserRecordExample();
example.createCriteria()
.andUserPhoneEqualTo(phone)
.andDiscountActivityIdEqualTo(discountActivityId)
.andCreateTimeGreaterThanOrEqualTo(startTime)
.andCreateTimeLessThanOrEqualTo(endTime);
return recordMapper.countByExample(example);
}
}

@ -0,0 +1,178 @@
package com.hfkj.service.impl;
import com.ccb.wlpt.util.StringUtil;
import com.hfkj.common.exception.BaseException;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.dao.BsStoreDiscountActivityPartakeUserMapper;
import com.hfkj.entity.*;
import com.hfkj.service.BsStoreDiscountActivityPartakeUserRecordService;
import com.hfkj.service.BsStoreDiscountActivityPartakeUserService;
import com.hfkj.service.BsStoreDiscountActivityService;
import com.hfkj.sysenum.StoreDiscountActivityPartakeWayEnum;
import com.hfkj.sysenum.StoreDiscountActivityStatusEnum;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
/**
* @className: BsStoreDiscountActivityPartakeUserServiceImpl
* @author: HuRui
* @date: 2023/3/14
**/
@Service("storeDiscountActivityPartakeUserService")
public class BsStoreDiscountActivityPartakeUserServiceImpl implements BsStoreDiscountActivityPartakeUserService {
@Autowired
private RedisTemplate redisTemplate;
@Resource
private BsStoreDiscountActivityService storeDiscountActivityService;
@Resource
private BsStoreDiscountActivityPartakeUserMapper storeDiscountActivityPartakeUserMapper;
@Resource
private BsStoreDiscountActivityPartakeUserRecordService storeDiscountActivityPartakeUserRecordService;
@Override
public void editData(BsStoreDiscountActivityPartakeUser storeDiscountActivityPartakeUser) {
if (storeDiscountActivityPartakeUser.getId() == null) {
storeDiscountActivityPartakeUser.setStatus(1);
storeDiscountActivityPartakeUser.setCreateTime(new Date());
storeDiscountActivityPartakeUser.setUpdateTime(new Date());
storeDiscountActivityPartakeUserMapper.insert(storeDiscountActivityPartakeUser);
} else {
storeDiscountActivityPartakeUser.setUpdateTime(new Date());
storeDiscountActivityPartakeUserMapper.updateByPrimaryKey(storeDiscountActivityPartakeUser);
}
}
@Override
public BsStoreDiscountActivityPartakeUser getPartakeUser(String phone, Long activityId) {
BsStoreDiscountActivityPartakeUserExample example = new BsStoreDiscountActivityPartakeUserExample();
example.createCriteria().andUserPhoneEqualTo(phone).andDiscountActivityIdEqualTo(activityId);
List<BsStoreDiscountActivityPartakeUser> list = storeDiscountActivityPartakeUserMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
@Override
public void receiveDiscount(String phone, List<Long> activityIds) {
activityIds = activityIds.stream().distinct().collect(Collectors.toList());
Boolean lock = redisTemplate.opsForValue().setIfAbsent("RECEIVE_DISCOUNT" + phone, phone);
try {
if(lock) {
//加锁成功...
for (Long activityId : activityIds) {
// 查询活动
BsStoreDiscountActivity activity = storeDiscountActivityService.getDetailById(activityId);
if (activity == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到活动");
}
if (!activity.getStatus().equals(StoreDiscountActivityStatusEnum.status2.getNumber())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "活动已结束");
}
if (new Date().compareTo(activity.getEndTime()) >= 1) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "活动已结束");
}
// 扫码领券
if (activity.getPartakeWay().equals(StoreDiscountActivityPartakeWayEnum.type3.getNumber())) {
// 每日
if (activity.getRestrictType().equals(1) && activity.getRestrictPartakeNum() != 0) {
Calendar startTime = Calendar.getInstance();
startTime.setTime(new Date());
startTime.set(Calendar.HOUR_OF_DAY, 00);
startTime.set(Calendar.MINUTE, 00);
startTime.set(Calendar.SECOND, 00);
Calendar endTime = Calendar.getInstance();
endTime.setTime(new Date());
endTime.set(Calendar.HOUR_OF_DAY, 23);
endTime.set(Calendar.MINUTE, 59);
endTime.set(Calendar.SECOND, 59);
Long partakeNum = storeDiscountActivityPartakeUserRecordService.getPartakeNum(phone, activityId, startTime.getTime(), endTime.getTime());
if (partakeNum.intValue() >= activity.getRestrictPartakeNum()) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "今日领取上限");
}
}
}
BsStoreDiscountActivityPartakeUser partakeUser = getPartakeUser(phone, activityId);
if (partakeUser == null) {
partakeUser = new BsStoreDiscountActivityPartakeUser();
partakeUser.setPartakeTotalNum(0);
partakeUser.setPartakeSurplusNum(0);
partakeUser.setPartakeUseNum(0);
}
partakeUser.setDiscountActivityId(activity.getId());
partakeUser.setDiscountActivityName(activity.getName());
partakeUser.setDiscountType(activity.getDiscountType());
partakeUser.setDiscountCondition(activity.getDiscountCondition());
partakeUser.setDiscountPrice(activity.getDiscountPrice());
partakeUser.setStartTime(activity.getStartTime());
partakeUser.setEndTime(activity.getEndTime());
partakeUser.setUserPhone(phone);
partakeUser.setPartakeTotalNum(partakeUser.getPartakeTotalNum() + 1);
partakeUser.setPartakeSurplusNum(partakeUser.getPartakeSurplusNum() + 1);
editData(partakeUser);
BsStoreDiscountActivityPartakeUserRecord record = new BsStoreDiscountActivityPartakeUserRecord();
record.setUserPhone(phone);
record.setDiscountActivityId(activity.getId());
record.setDiscountActivityName(activity.getName());
record.setDiscountType(activity.getDiscountType());
record.setDiscountCondition(activity.getDiscountCondition());
record.setDiscountPrice(activity.getDiscountPrice());
storeDiscountActivityPartakeUserRecordService.insertRecord(record);
}
} else {
System.out.println("加锁失败");
Thread.sleep(100); // 加锁失败,重试
receiveDiscount(phone, activityIds);
}
} catch (BaseException e) {
throw e;
} catch (Exception e) {
System.out.println(e);
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "领取失败,请稍后重试");
} finally {
// 删除key,释放锁
redisTemplate.delete("RECEIVE_DISCOUNT" + phone);
}
}
@Override
public List<BsStoreDiscountActivityPartakeUser> getList(Map<String, Object> param) {
BsStoreDiscountActivityPartakeUserExample example = new BsStoreDiscountActivityPartakeUserExample();
BsStoreDiscountActivityPartakeUserExample.Criteria criteria = example.createCriteria();
if (StringUtils.isNotBlank(MapUtils.getString(param, "userPhone"))) {
criteria.andUserPhoneEqualTo(MapUtils.getString(param, "userPhone"));
}
if (MapUtils.getInteger(param, "status") != null) {
criteria.andStatusEqualTo(MapUtils.getInteger(param, "status"));
}
example.setOrderByClause("create_time desc");
return storeDiscountActivityPartakeUserMapper.selectByExample(example);
}
@Override
public List<BsStoreDiscountActivityPartakeUser> getUseListByPhone(String phone) {
BsStoreDiscountActivityPartakeUserExample example = new BsStoreDiscountActivityPartakeUserExample();
example.createCriteria().andUserPhoneEqualTo(phone).andStatusEqualTo(1).andPartakeSurplusNumGreaterThanOrEqualTo(1);
example.setOrderByClause("create_time desc");
return storeDiscountActivityPartakeUserMapper.selectByExample(example);
}
}

@ -3,6 +3,8 @@ package com.hfkj.service.impl;
import com.hfkj.dao.BsStoreDiscountActivityMapper;
import com.hfkj.entity.BsStoreDiscountActivity;
import com.hfkj.entity.BsStoreDiscountActivityExample;
import com.hfkj.entity.BsStoreDiscountActivityPartakeUser;
import com.hfkj.service.BsStoreDiscountActivityPartakeUserService;
import com.hfkj.service.BsStoreDiscountActivityService;
import com.hfkj.sysenum.StoreDiscountActivityStatusEnum;
import org.apache.commons.collections4.MapUtils;
@ -10,6 +12,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -25,6 +28,9 @@ public class BsStoreDiscountActivityServiceImpl implements BsStoreDiscountActivi
@Resource
private BsStoreDiscountActivityMapper storeDiscountActivityMapper;
@Resource
private BsStoreDiscountActivityPartakeUserService storeDiscountActivityPartakeUserService;
@Override
public BsStoreDiscountActivity editActivity(BsStoreDiscountActivity discountActivity) {
if (discountActivity.getId() == null) {
@ -45,18 +51,13 @@ public class BsStoreDiscountActivityServiceImpl implements BsStoreDiscountActivi
}
@Override
public BsStoreDiscountActivity getAfootActivityByStore(Long storeId) {
BsStoreDiscountActivityExample example = new BsStoreDiscountActivityExample();
example.createCriteria()
.andStoreIdEqualTo(storeId)
.andStatusEqualTo(StoreDiscountActivityStatusEnum.status2.getNumber());
example.setOrderByClause("create_time desc");
List<BsStoreDiscountActivity> list = storeDiscountActivityMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
public List<BsStoreDiscountActivity> getUseDiscountListByPhone(String phone) {
List<BsStoreDiscountActivity> activityList = new ArrayList<>();
List<BsStoreDiscountActivityPartakeUser> list = storeDiscountActivityPartakeUserService.getUseListByPhone(phone);
for (BsStoreDiscountActivityPartakeUser partakeUser : list) {
activityList.add(getDetailById(partakeUser.getDiscountActivityId()));
}
return null;
return activityList;
}
@Override
@ -65,6 +66,10 @@ public class BsStoreDiscountActivityServiceImpl implements BsStoreDiscountActivi
BsStoreDiscountActivityExample.Criteria criteria = example.createCriteria()
.andStatusNotEqualTo(StoreDiscountActivityStatusEnum.status0.getNumber());
if (MapUtils.getInteger(param, "partakeWay") != null) {
criteria.andPartakeWayEqualTo(MapUtils.getInteger(param, "partakeWay"));
}
if (MapUtils.getLong(param, "companyId") != null) {
criteria.andCompanyIdEqualTo(MapUtils.getLong(param, "companyId"));
}
@ -77,12 +82,12 @@ public class BsStoreDiscountActivityServiceImpl implements BsStoreDiscountActivi
criteria.andStoreIdEqualTo(MapUtils.getLong(param, "storeId"));
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "storeName"))) {
criteria.andStoreNameLike("%" + MapUtils.getString(param, "storeName") + "%");
if (MapUtils.getLong(param, "storeIdNull") != null) {
criteria.andStoreIdIsNull();
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "storeName"))) {
criteria.andStoreNameLike("%"+MapUtils.getString(param, "storeName")+"%");
criteria.andStoreNameLike("%" + MapUtils.getString(param, "storeName") + "%");
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "name"))) {

@ -7,13 +7,11 @@ import com.hfkj.common.utils.DateUtil;
import com.hfkj.common.utils.HttpsUtils;
import com.hfkj.common.utils.IDGenerator;
import com.hfkj.config.CommonSysConst;
import com.hfkj.config.device.SoundService;
import com.hfkj.dao.BsTradeOrderMapper;
import com.hfkj.entity.*;
import com.hfkj.model.UserDiscount;
import com.hfkj.service.BsMerService;
import com.hfkj.service.BsSalesmanService;
import com.hfkj.service.BsStoreService;
import com.hfkj.service.BsTradeOrderService;
import com.hfkj.service.*;
import com.hfkj.sysenum.*;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
@ -41,6 +39,18 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService {
@Resource
private BsStoreService storeService;
@Resource
private BsTradeOrderProfitSharingService tradeOrderProfitSharingService;
@Resource
private BsStoreDiscountActivityPartakeUserService discountActivityPartakeUserService;
@Resource
private BsDeviceService deviceService;
@Resource
private SoundService soundService;
@Override
public void editOrder(BsTradeOrder tradeOrder) {
if (tradeOrder.getId() == null) {
@ -54,7 +64,7 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService {
}
@Override
public Map<String, Object> createOrder(Long storeId, BigDecimal tradeAmount, BsStoreDiscountActivity storeDiscount, UserDiscount userDiscount, Map<String, Object> param) {
public Map<String, Object> createOrder(Long storeId, BigDecimal tradeAmount, BsStoreDiscountActivity storeDiscount, String userPhone, UserDiscount userDiscount, Map<String, Object> param) {
// 查询门店信息
BsStore store = storeService.getStoreById(storeId);
if (store == null) {
@ -180,6 +190,45 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService {
return returnParam;
}
@Override
public void paySuccess(String outTradeNo, String transactionId, PlatformTypeEnum platformType, TradeOrderPayModeEnum tradeOrderPayMode, BigDecimal tradeActualAmount, String subMchId) {
// 查询订单
BsTradeOrder tradeOrder = getOrderByOutTradeNo(outTradeNo);
if (tradeOrder != null && tradeOrder.getStatus().equals(TradeOrderStatusEnum.status1.getNumber())) {
tradeOrder.setPayMode(tradeOrderPayMode.getCode());
tradeOrder.setPlatformType(platformType.getNumber());
tradeOrder.setPlatformMerNo(subMchId);
tradeOrder.setPlatformTradeNo(transactionId);
tradeOrder.setTradeActualAmount(tradeActualAmount);
tradeOrder.setStatus(TradeOrderStatusEnum.status3.getNumber());
tradeOrder.setPayTime(new Date());
editOrder(tradeOrder);
if (tradeOrder.getStoreDiscountId() != null && StringUtils.isNotBlank(tradeOrder.getUserPhone())) {
BsStoreDiscountActivityPartakeUser partakeUser = discountActivityPartakeUserService.getPartakeUser(tradeOrder.getUserPhone(), tradeOrder.getStoreDiscountId());
if (partakeUser != null) {
partakeUser.setPartakeSurplusNum(partakeUser.getPartakeSurplusNum() - 1);
partakeUser.setPartakeUseNum(partakeUser.getPartakeUseNum() + 1);
discountActivityPartakeUserService.editData(partakeUser);
}
}
// 创建分账
if (tradeOrder.getProfitSharingStatus().equals(true)) {
tradeOrderProfitSharingService.createProfitSharing(tradeOrder);
}
Map<String,Object> param = new HashMap<>();
param.put("storeId", tradeOrder.getStoreId());
param.put("deviceType", DeviceTypeEnum.type1.getNumber());
param.put("status", DeviceStatusEnum.status1.getNumber());
List<BsDevice> deviceList = deviceService.getDeviceList(param);
for (BsDevice device : deviceList) {
soundService.sendPayMsg(device.getDeviceNo(), tradeOrder.getTradeAmount());
}
}
}
@Override
public BsTradeOrder getOrderByOutTradeNo(String outTradeNo) {
BsTradeOrderExample example = new BsTradeOrderExample();

@ -0,0 +1,49 @@
package com.hfkj.sysenum;
import java.util.Objects;
/**
* @className: StoreDiscountActivityEnum
* @author: HuRui
* @date: 2022/11/21
**/
public enum StoreDiscountActivityPartakeWayEnum {
type1(1, "交易"),
type2(2, "分享"),
type3(3, "扫码领券"),
;
private Integer number;
private String name;
StoreDiscountActivityPartakeWayEnum(int number, String name) {
this.number = number;
this.name = name;
}
public static StoreDiscountActivityPartakeWayEnum getDataByNumber(Integer number) {
for (StoreDiscountActivityPartakeWayEnum ele : values()) {
if (Objects.equals(number,ele.getNumber())) {
return ele;
}
}
return null;
}
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

@ -0,0 +1,35 @@
package com.hfkj.sysenum;
/**
* 微信二维码代码类型
*/
public enum WeChatQrCodeTypeEnum {
PAYMENT_CODE("PAYMENT_CODE" , "支付码码牌上的二维码"),
PAYMENT_SUCCESS("PAYMENT_SUCCESS" , "支付成功生成的二维码"),
SHARE("SHARE" , "分享关注公众号"),
;
private String code;
private String desc;
WeChatQrCodeTypeEnum(String code , String desc) {
this.code = code;
this.desc = desc;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
Loading…
Cancel
Save