提交代码

dev
胡锐 7 months ago
parent e6389261ce
commit 264ee4c947
  1. 130
      bweb/src/main/java/com/bweb/controller/BsAgentDiscountController.java
  2. 1
      bweb/src/main/java/com/bweb/controller/BsDiscountController.java
  3. 271
      bweb/src/main/java/com/bweb/controller/BsDiscountPkController.java
  4. 117
      bweb/src/main/java/com/bweb/controller/BsDiscountPkStockController.java
  5. 36
      cweb/src/main/java/com/cweb/controller/BsDiscountUserController.java
  6. 10
      cweb/src/main/java/com/cweb/controller/BsGasController.java
  7. 2
      cweb/src/main/java/com/cweb/controller/order/BsOrderController.java
  8. 54
      openapi/src/main/java/com/openapi/config/RestExceptionHandler.java
  9. 158
      openapi/src/main/java/com/openapi/controller/BsDiscountController.java
  10. BIN
      openapi/target/classes/com/OpenApiApplication.class
  11. BIN
      openapi/target/classes/com/openapi/config/AuthConfig$1.class
  12. BIN
      openapi/target/classes/com/openapi/config/AuthConfig.class
  13. BIN
      openapi/target/classes/com/openapi/config/ConfigListener.class
  14. BIN
      openapi/target/classes/com/openapi/config/CorsConfig.class
  15. BIN
      openapi/target/classes/com/openapi/config/MultipartConfig.class
  16. BIN
      openapi/target/classes/com/openapi/config/RedisConfig.class
  17. BIN
      openapi/target/classes/com/openapi/config/SwaggerConfig.class
  18. BIN
      openapi/target/classes/com/openapi/config/SysConfig.class
  19. BIN
      openapi/target/classes/com/openapi/config/SysConst.class
  20. BIN
      openapi/target/classes/com/openapi/controller/BsDiscountController.class
  21. 1
      openapi/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  22. 1
      openapi/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
  23. BIN
      openapi/target/oil-openapi-1.0-SNAPSHOT.jar
  24. BIN
      openapi/target/oil-openapi-1.0-SNAPSHOT.jar.original
  25. 31
      schedule/src/main/java/com/hfkj/schedule/DiscountSchedule.java
  26. 5
      service/src/main/java/com/hfkj/common/exception/ErrorCode.java
  27. 16
      service/src/main/java/com/hfkj/common/pay/util/SignatureUtil.java
  28. 152
      service/src/main/java/com/hfkj/dao/BsAgentApiLogMapper.java
  29. 13
      service/src/main/java/com/hfkj/dao/BsAgentApiLogMapperExt.java
  30. 360
      service/src/main/java/com/hfkj/dao/BsAgentApiLogSqlProvider.java
  31. 125
      service/src/main/java/com/hfkj/dao/BsAgentDiscountMapper.java
  32. 7
      service/src/main/java/com/hfkj/dao/BsAgentDiscountMapperExt.java
  33. 332
      service/src/main/java/com/hfkj/dao/BsAgentDiscountSqlProvider.java
  34. 17
      service/src/main/java/com/hfkj/dao/BsDiscountMapper.java
  35. 155
      service/src/main/java/com/hfkj/dao/BsDiscountPkMapper.java
  36. 7
      service/src/main/java/com/hfkj/dao/BsDiscountPkMapperExt.java
  37. 142
      service/src/main/java/com/hfkj/dao/BsDiscountPkRelMapper.java
  38. 7
      service/src/main/java/com/hfkj/dao/BsDiscountPkRelMapperExt.java
  39. 388
      service/src/main/java/com/hfkj/dao/BsDiscountPkRelSqlProvider.java
  40. 430
      service/src/main/java/com/hfkj/dao/BsDiscountPkSqlProvider.java
  41. 133
      service/src/main/java/com/hfkj/dao/BsDiscountPkStockBatchMapper.java
  42. 7
      service/src/main/java/com/hfkj/dao/BsDiscountPkStockBatchMapperExt.java
  43. 360
      service/src/main/java/com/hfkj/dao/BsDiscountPkStockBatchSqlProvider.java
  44. 148
      service/src/main/java/com/hfkj/dao/BsDiscountPkStockCodeMapper.java
  45. 36
      service/src/main/java/com/hfkj/dao/BsDiscountPkStockCodeMapperExt.java
  46. 402
      service/src/main/java/com/hfkj/dao/BsDiscountPkStockCodeSqlProvider.java
  47. 14
      service/src/main/java/com/hfkj/dao/BsDiscountSqlProvider.java
  48. 34
      service/src/main/java/com/hfkj/dao/BsDiscountStockCodeMapper.java
  49. 70
      service/src/main/java/com/hfkj/dao/BsDiscountStockCodeSqlProvider.java
  50. 18
      service/src/main/java/com/hfkj/dao/BsDiscountUserMapper.java
  51. 5
      service/src/main/java/com/hfkj/dao/BsDiscountUserMapperExt.java
  52. 14
      service/src/main/java/com/hfkj/dao/BsDiscountUserSqlProvider.java
  53. 36
      service/src/main/java/com/hfkj/dao/BsMerchantMapperExt.java
  54. 165
      service/src/main/java/com/hfkj/entity/BsAgentApiLog.java
  55. 763
      service/src/main/java/com/hfkj/entity/BsAgentApiLogExample.java
  56. 107
      service/src/main/java/com/hfkj/entity/BsAgentApiLogWithBLOBs.java
  57. 229
      service/src/main/java/com/hfkj/entity/BsAgentDiscount.java
  58. 993
      service/src/main/java/com/hfkj/entity/BsAgentDiscountExample.java
  59. 16
      service/src/main/java/com/hfkj/entity/BsDiscount.java
  60. 70
      service/src/main/java/com/hfkj/entity/BsDiscountExample.java
  61. 345
      service/src/main/java/com/hfkj/entity/BsDiscountPk.java
  62. 1454
      service/src/main/java/com/hfkj/entity/BsDiscountPkExample.java
  63. 297
      service/src/main/java/com/hfkj/entity/BsDiscountPkRel.java
  64. 1254
      service/src/main/java/com/hfkj/entity/BsDiscountPkRelExample.java
  65. 264
      service/src/main/java/com/hfkj/entity/BsDiscountPkStockBatch.java
  66. 1143
      service/src/main/java/com/hfkj/entity/BsDiscountPkStockBatchExample.java
  67. 312
      service/src/main/java/com/hfkj/entity/BsDiscountPkStockCode.java
  68. 1323
      service/src/main/java/com/hfkj/entity/BsDiscountPkStockCodeExample.java
  69. 84
      service/src/main/java/com/hfkj/entity/BsDiscountStockCode.java
  70. 330
      service/src/main/java/com/hfkj/entity/BsDiscountStockCodeExample.java
  71. 16
      service/src/main/java/com/hfkj/entity/BsDiscountUser.java
  72. 70
      service/src/main/java/com/hfkj/entity/BsDiscountUserExample.java
  73. 8
      service/src/main/java/com/hfkj/openapi/model/request/RequestPushDiscountModel.java
  74. 52
      service/src/main/java/com/hfkj/openapi/model/request/RequestPushPkDiscountModel.java
  75. 9
      service/src/main/java/com/hfkj/openapi/model/request/RequestQueryCodeModel.java
  76. 4
      service/src/main/java/com/hfkj/openapi/model/response/ResponsePushDiscountModel.java
  77. 40
      service/src/main/java/com/hfkj/openapi/model/response/ResponsePushDiscountPkModel.java
  78. 9
      service/src/main/java/com/hfkj/openapi/model/response/ResponseQueryCodeModel.java
  79. 26
      service/src/main/java/com/hfkj/service/agent/BsAgentApiLogService.java
  80. 44
      service/src/main/java/com/hfkj/service/agent/BsAgentDiscountService.java
  81. 35
      service/src/main/java/com/hfkj/service/agent/impl/BsAgentApiLogServiceImpl.java
  82. 91
      service/src/main/java/com/hfkj/service/agent/impl/BsAgentDiscountServiceImpl.java
  83. 33
      service/src/main/java/com/hfkj/service/discount/BsDiscountPkRelService.java
  84. 43
      service/src/main/java/com/hfkj/service/discount/BsDiscountPkService.java
  85. 43
      service/src/main/java/com/hfkj/service/discount/BsDiscountPkStockBatchService.java
  86. 42
      service/src/main/java/com/hfkj/service/discount/BsDiscountPkStockCodeService.java
  87. 17
      service/src/main/java/com/hfkj/service/discount/BsDiscountUserService.java
  88. 52
      service/src/main/java/com/hfkj/service/discount/impl/BsDiscountPkRelServiceImpl.java
  89. 111
      service/src/main/java/com/hfkj/service/discount/impl/BsDiscountPkServiceImpl.java
  90. 117
      service/src/main/java/com/hfkj/service/discount/impl/BsDiscountPkStockBatchServiceImpl.java
  91. 86
      service/src/main/java/com/hfkj/service/discount/impl/BsDiscountPkStockCodeServiceImpl.java
  92. 23
      service/src/main/java/com/hfkj/service/discount/impl/BsDiscountServiceImpl.java
  93. 109
      service/src/main/java/com/hfkj/service/discount/impl/BsDiscountUserServiceImpl.java
  94. 13
      service/src/main/java/com/hfkj/service/gas/BsGasService.java
  95. 5
      service/src/main/java/com/hfkj/service/gas/impl/BsGasServiceImpl.java
  96. 1
      service/src/main/java/com/hfkj/service/order/OrderCreateService.java
  97. 14
      service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java
  98. 46
      service/src/main/java/com/hfkj/sysenum/discount/DiscountPkStatusEnum.java
  99. 45
      service/src/main/java/com/hfkj/sysenum/discount/DiscountPkStockCodeStatusEnum.java

@ -0,0 +1,130 @@
package com.bweb.controller;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.BsAgentDiscount;
import com.hfkj.entity.BsDiscount;
import com.hfkj.entity.BsDiscountPk;
import com.hfkj.model.ResponseData;
import com.hfkj.model.SecUserSessionObject;
import com.hfkj.service.agent.BsAgentDiscountService;
import com.hfkj.service.discount.BsDiscountPkService;
import com.hfkj.service.discount.BsDiscountService;
import com.hfkj.service.discount.BsDiscountUserService;
import com.hfkj.sysenum.SecUserObjectTypeEnum;
import com.hfkj.sysenum.discount.DiscountStatusEnum;
import com.hfkj.sysenum.discount.DiscountStockCodeObtainTypeEnum;
import com.hfkj.sysenum.discount.DiscountTypeEnum;
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 java.util.Date;
import java.util.HashMap;
import java.util.Map;
@Controller
@RequestMapping(value = "/agentDiscount")
@Api(value = "优惠券管理")
public class BsAgentDiscountController {
private static Logger log = LoggerFactory.getLogger(BsAgentDiscountController.class);
@Resource
private BsAgentDiscountService agentDiscountService;
@Resource
private BsDiscountService discountService;
@Resource
private BsDiscountPkService discountPkService;
@RequestMapping(value="/create",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "创建")
public ResponseData create(@RequestBody JSONObject body) {
try {
if (body.getLong("agentId") == null
|| body.getInteger("type") == null
|| StringUtils.isBlank(body.getString("objectNo"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
if (agentDiscountService.getDetail(body.getLong("agentId"),body.getInteger("type"),body.getString("objectNo")) == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已绑定过优惠【"+body.getString("objectNo")+"】");
}
BsAgentDiscount agentDiscount = new BsAgentDiscount();
agentDiscount.setAgentId(body.getLong("agentId"));
agentDiscount.setType(body.getInteger("type"));
// 类型 1:优惠券 2:优惠卷包
if (body.getInteger("type") == 1) {
// 查询优惠券
BsDiscount discount = discountService.getDetail(body.getString("objectNo"));
if (discount == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到优惠券");
}
agentDiscount.setObjectId(discount.getId());
agentDiscount.setObjectNo(discount.getDiscountNo());
agentDiscount.setObjectName(discount.getDiscountName());
} else if (body.getInteger("type") == 2) {
// 查询优惠券
BsDiscountPk discountPk = discountPkService.getDetail(body.getString("objectNo"));
if (discountPk == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到优惠券");
}
agentDiscount.setObjectId(discountPk.getId());
agentDiscount.setObjectNo(discountPk.getDiscountPkNo());
agentDiscount.setObjectName(discountPk.getDiscountPkName());
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的类型");
}
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/delete",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "删除")
public ResponseData delete(@RequestBody JSONObject body) {
try {
if (body == null || body.getLong("id") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
agentDiscountService.delete(body.getLong("id"));
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/queryList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询列表")
public ResponseData queryList(@RequestParam(name = "agentId", required = true) Long agentId,
@RequestParam(name = "type", required = false) Integer type,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(agentDiscountService.getList(agentId, type,null)));
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
}

@ -92,6 +92,7 @@ public class BsDiscountController {
discount.setCreateUserType(2);
discount.setCreateUserId(userInfoModel.getAccount().getId());
discount.setCreateUserName(userInfoModel.getAccount().getUserName());
discount.setCreateUserMerNo(userInfoModel.getMerchant().getMerNo());
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, "");
}

@ -0,0 +1,271 @@
package com.bweb.controller;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.BsDiscount;
import com.hfkj.entity.BsDiscountPk;
import com.hfkj.entity.BsDiscountPkRel;
import com.hfkj.model.ResponseData;
import com.hfkj.model.SecUserSessionObject;
import com.hfkj.service.discount.BsDiscountPkRelService;
import com.hfkj.service.discount.BsDiscountPkService;
import com.hfkj.service.discount.BsDiscountService;
import com.hfkj.service.discount.BsDiscountUserService;
import com.hfkj.sysenum.SecUserObjectTypeEnum;
import com.hfkj.sysenum.discount.DiscountStatusEnum;
import com.hfkj.sysenum.discount.DiscountStockCodeObtainTypeEnum;
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 java.util.*;
@Controller
@RequestMapping(value = "/discountPk")
@Api(value = "优惠券包管理")
public class BsDiscountPkController {
private static Logger log = LoggerFactory.getLogger(BsDiscountPkController.class);
@Resource
private BsDiscountPkService discountPkService;
@Resource
private BsDiscountPkRelService discountPkRelService;
@Resource
private BsDiscountUserService discountUserService;
@Resource
private BsDiscountService discountService;
@Resource
private UserCenter userCenter;
@RequestMapping(value="/edit",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "编辑")
public ResponseData edit(@RequestBody JSONObject body) {
try {
if (StringUtils.isBlank(body.getString("discountPkName"))
|| body.getBigDecimal("salePrice") == null
|| body.getJSONArray("discountList") == null
|| body.getJSONArray("discountList").isEmpty()
) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
BsDiscountPk discountPk = null;
if (StringUtils.isNotBlank(body.getString("discountPkNo"))) {
// 查询卷包
discountPk = discountPkService.getDetail(body.getString("discountPkNo"));
if (discountPk == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的券包");
}
} else {
discountPk = new BsDiscountPk();
}
discountPk.setDiscountPkName(body.getString("discountPkName"));
discountPk.setDescribe(body.getString("describe"));
discountPk.setListImg(body.getString("listImg"));
discountPk.setContent(body.getString("content"));
discountPk.setSalePrice(body.getBigDecimal("salePrice"));
// 用户信息
SecUserSessionObject userInfoModel = userCenter.getSessionModel(SecUserSessionObject.class);
if (SecUserObjectTypeEnum.type1.getCode() == userInfoModel.getAccount().getObjectType()) {
discountPk.setCreateUserType(1);
discountPk.setCreateUserId(userInfoModel.getAccount().getId());
discountPk.setCreateUserName(userInfoModel.getAccount().getUserName());
} else if (SecUserObjectTypeEnum.type2.getCode() == userInfoModel.getAccount().getObjectType()) {
discountPk.setCreateUserType(2);
discountPk.setCreateUserId(userInfoModel.getAccount().getId());
discountPk.setCreateUserName(userInfoModel.getAccount().getUserName());
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, "");
}
List<BsDiscountPkRel> pkRelList = new ArrayList<>();
for (Object obj : body.getJSONArray("discountList")) {
JSONObject discountObj = (JSONObject)obj;
if (StringUtils.isBlank(discountObj.getString("discountNo"))
|| discountObj.getInteger("number") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 查询优惠券
BsDiscount discount = discountService.getDetail(discountObj.getString("discountNo"));
if (discount == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的优惠券"+discountObj.getString("discountNo"));
}
if (!discount.getStatus().equals(DiscountStatusEnum.status2.getCode())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, discount.getDiscountName()+"优惠券未上线");
}
BsDiscountPkRel discountPkRel = new BsDiscountPkRel();
discountPkRel.setNumber(discountObj.getInteger("number"));
discountPkRel.setDiscountNo(discount.getDiscountNo());
discountPkRel.setDiscountName(discount.getDiscountName());
discountPkRel.setDiscountType(discount.getDiscountType());
discountPkRel.setDiscountCondition(discount.getDiscountCondition());
discountPkRel.setDiscountPrice(discount.getDiscountPrice());
discountPkRel.setUseScope(discount.getUseScope());
discountPkRel.setReceiveExpirationDate(discount.getReceiveExpirationDate());
pkRelList.add(discountPkRel);
}
discountPkService.edit(discountPk, pkRelList);
return ResponseMsgUtil.success(discountPk);
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/online",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "上线优惠券包")
public ResponseData online(@RequestBody JSONObject body) {
try {
if (body == null || StringUtils.isBlank(body.getString("discountPkNo"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 查询优惠券
BsDiscountPk discountPk = discountPkService.getDetail(body.getString("discountPkNo"));
if (discountPk == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
discountPk.setStartTime(new Date());
discountPk.setStatus(DiscountStatusEnum.status2.getCode());
discountPkService.editData(discountPk);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/done",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "结束优惠券包")
public ResponseData done(@RequestBody JSONObject body) {
try {
if (body == null || StringUtils.isBlank(body.getString("discountPkNo"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 查询优惠券
BsDiscountPk discountPk = discountPkService.getDetail(body.getString("discountPkNo"));
if (discountPk == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
discountPk.setStatus(DiscountStatusEnum.status3.getCode());
discountPk.setEndTime(new Date());
discountPkService.editData(discountPk);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/delete",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "删除")
public ResponseData delete(@RequestBody JSONObject body) {
try {
if (StringUtils.isBlank(body.getString("discountPkNo"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 查询优惠券
BsDiscountPk discountPk = discountPkService.getDetail(body.getString("discountPkNo"));
if (discountPk == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
discountPk.setStatus(DiscountStatusEnum.status0.getCode());
discountPkService.editData(discountPk);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/giveUser",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "赠送用户")
public ResponseData giveUser(@RequestBody JSONObject body) {
try {
if (body == null
|| StringUtils.isBlank(body.getString("discountPkNo"))
|| StringUtils.isBlank(body.getString("userPhone"))
|| body.getInteger("number") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
discountUserService.receivePk(
body.getString("discountPkNo"),
body.getInteger("number"),
DiscountStockCodeObtainTypeEnum.type3,
body.getString("userPhone"),
null);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getDetail",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询详情")
public ResponseData getDetail(@RequestParam(name = "discountPkNo", required = true) String discountPkNo) {
try {
// 查询优惠券包
BsDiscountPk discountPk = discountPkService.getDetail(discountPkNo);
if (discountPk == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的优惠券包");
}
Map<String,Object> param = new HashMap<>();
param.put("discountPk", discountPk);
param.put("discountPkRel", discountPkRelService.getList(discountPkNo));
return ResponseMsgUtil.success(param);
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询列表")
public ResponseData getList(@RequestParam(name = "discountPkName", required = false) String discountPkName,
@RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
SecUserSessionObject userInfoModel = userCenter.getSessionModel(SecUserSessionObject.class);
Map<String,Object> param = new HashMap<>();
if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type1.getCode())
|| userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) {
param.put("createUserId", userInfoModel.getAccount().getId());
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, "");
}
param.put("discountPkName", discountPkName);
param.put("status", status);
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(discountPkService.getList(param)));
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
}

@ -0,0 +1,117 @@
package com.bweb.controller;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.model.ResponseData;
import com.hfkj.service.discount.*;
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 java.util.HashMap;
import java.util.Map;
@Controller
@RequestMapping(value = "/discountPkStock")
@Api(value = "优惠券包管理")
public class BsDiscountPkStockController {
private static Logger log = LoggerFactory.getLogger(BsDiscountPkStockController.class);
@Resource
private BsDiscountPkStockBatchService discountPkStockBatchService;
@Resource
private BsDiscountPkStockCodeService discountPkStockCodeService;
@Resource
private UserCenter userCenter;
@RequestMapping(value="/addStock",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "增加库存")
public ResponseData addStock(@RequestBody JSONObject body) {
try {
if (body == null
|| StringUtils.isBlank(body.getString("discountPkNo"))
|| body.getInteger("stockCount") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
discountPkStockBatchService.addStock(body.getString("discountNo"), body.getInteger("stockCount"));
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("BsDiscountStockController -> addStock() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/queryStockBatchList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询库存批次")
public ResponseData queryStockBatchList(@RequestParam(name = "discountPkNo", required = false) String discountPkNo,
@RequestParam(name = "discountPkName", required = false) String discountPkName,
@RequestParam(name = "batchNo", required = false) String batchNo,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
Map<String,Object> param = new HashMap<>();
param.put("discountPkNo", discountPkNo);
param.put("discountPkName", discountPkName);
param.put("batchNo", batchNo);
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(discountPkStockBatchService.getStockBatchList(param)));
} catch (Exception e) {
log.error("BsDiscountStockController -> queryStockBatchList() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/queryStockBatchDetail",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询库存批次详情")
public ResponseData queryStockBatchDetail(@RequestParam(name = "batchNo", required = true) String batchNo) {
try {
return ResponseMsgUtil.success(discountPkStockBatchService.getStockBatchDetail(batchNo));
} catch (Exception e) {
log.error("BsDiscountStockController -> queryStockBatchDetail() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/queryStockBatchCodeList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询库存批次优惠券code")
public ResponseData queryStockBatchCodeList(@RequestParam(name = "codeId", required = false) String codeId,
@RequestParam(name = "discountPkNo", required = false) String discountPkNo,
@RequestParam(name = "batchNo", required = false) String batchNo,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
Map<String,Object> param = new HashMap<>();
param.put("codeId", codeId);
param.put("discountPkNo", discountPkNo);
param.put("batchNo", batchNo);
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(discountPkStockCodeService.getCodeList(param)));
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
}

@ -9,10 +9,12 @@ import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.BsDiscountUser;
import com.hfkj.model.DiscountUserModel;
import com.hfkj.model.GasListModel;
import com.hfkj.model.ResponseData;
import com.hfkj.model.UserSessionObject;
import com.hfkj.service.discount.BsDiscountService;
import com.hfkj.service.discount.BsDiscountUserService;
import com.hfkj.service.gas.BsGasService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
@ -34,7 +36,7 @@ import java.util.*;
**/
@Controller
@RequestMapping(value = "/discountUser")
@Api(value = "优惠券库存管理")
@Api(value = "用户优惠券管理")
public class BsDiscountUserController {
private static Logger log = LoggerFactory.getLogger(BsDiscountUserController.class);
@Resource
@ -43,6 +45,30 @@ public class BsDiscountUserController {
private BsDiscountService discountService;
@Resource
private UserCenter userCenter;
@Resource
private BsGasService gasService;
@RequestMapping(value="/usableMerList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "可用加油站列表")
public ResponseData usableMerList(@RequestParam(name = "discountNo", required = true) String discountNo,
@RequestParam(name = "gasName", required = false) String gasName,
@RequestParam(name = "distanceLimit", required = false) Integer distanceLimit,
@RequestParam(name = "oilNo", required = true) String oilNo,
@RequestParam(name = "longitude", required = true) String longitude,
@RequestParam(name = "latitude", required = true) String latitude,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(gasService.getGasListByDiscount(discountNo,longitude, latitude, oilNo, gasName, distanceLimit, true)));
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/useDiscountList",method = RequestMethod.GET)
@ResponseBody
@ -62,13 +88,6 @@ public class BsDiscountUserController {
param.put("useMerNo", merNo);
param.put("useScope", useScope);
discountList = discountUserService.getUserDiscountList(param);
Iterator<DiscountUserModel> iterator = discountList.iterator();
while (iterator.hasNext()) {
// 如果订单总额 小于 满减价格
if (refuelPrice != null && refuelPrice.compareTo(iterator.next().getDiscountCondition()) < 0) {
iterator.remove();
}
}
}
} catch (Exception e) {
// 不做任何处理
@ -80,6 +99,7 @@ public class BsDiscountUserController {
}
}
@RequestMapping(value="/queryList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询列表")

@ -119,8 +119,10 @@ public class BsGasController {
discountPrice = discountUser.getDiscountPrice();
} else if (DiscountTypeEnum.type3.getCode().equals(discountUser.getDiscountType())) {
// 订单总额 * 折扣 = 优惠实际金额
discountPrice = refuelPrice.multiply(discountUser.getDiscountPrice()).setScale(2, BigDecimal.ROUND_HALF_DOWN);
// 加油金额 - (加油金额 * 折扣) = 优惠金额
discountPrice = refuelPrice.subtract(
refuelPrice.multiply(discountUser.getDiscountPrice().divide(new BigDecimal("100"))).setScale(2, BigDecimal.ROUND_HALF_DOWN)
);
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的油站");
}
@ -128,6 +130,10 @@ public class BsGasController {
// 计算价格
GasPayPriceModel gasPayPriceModel = gasService.refuelPriceCompute(refuelPrice, merNo, oilNo, agentMerId, userDiscountId==null);
gasPayPriceModel.setPayPrice(gasPayPriceModel.getPayPrice().subtract(discountPrice));
gasPayPriceModel.setPayPrice(gasPayPriceModel.getPayPrice().compareTo(new BigDecimal("0"))>=0?gasPayPriceModel.getPayPrice():new BigDecimal("0"));
if (userDiscountId != null) {
gasPayPriceModel.setTotalPreferences(discountPrice);
}
return ResponseMsgUtil.success(gasPayPriceModel);

@ -79,6 +79,8 @@ public class BsOrderController {
if (!merchant.getSourceType().equals(1) && StringUtils.isBlank(body.getUserPhone())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, "");
}
// todo 目前只有加油业务,设置加油金额
body.setTotalPrice(orderChild.getProductPrice());
}
}

@ -0,0 +1,54 @@
package com.openapi.config;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.model.ResponseData;
import org.springframework.validation.BindException;
import org.springframework.validation.ObjectError;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
import javax.xml.bind.ValidationException;
import java.util.stream.Collectors;
/**
* 异常
* @className: RestExceptionHandler
* @author: HuRui
* @date: 2023/5/23
**/
@RestControllerAdvice
public class RestExceptionHandler {
/**
* 默认全局异常处理
* @param e the e
* @return ResultData
*/
@ExceptionHandler(value = {BindException.class, ValidationException.class, MethodArgumentNotValidException.class})
public ResponseData handleValidatedException(Exception e) {
if (e instanceof MethodArgumentNotValidException) {
MethodArgumentNotValidException ex =(MethodArgumentNotValidException) e;
ObjectError objectError = ex.getBindingResult().getAllErrors().stream().collect(Collectors.toList()).get(0);
return ResponseMsgUtil.builderResponse(SysCode.OpenApi.getCode()+ErrorCode.OPEN_API_REQ_PARAMS_ERR.getCode(), objectError.getDefaultMessage(),null);
} else if (e instanceof ConstraintViolationException) {
ConstraintViolationException ex = (ConstraintViolationException) e;
ConstraintViolation<?> constraintViolation = ex.getConstraintViolations().stream().collect(Collectors.toList()).get(0);
return ResponseMsgUtil.builderResponse(SysCode.OpenApi.getCode()+ErrorCode.OPEN_API_REQ_PARAMS_ERR.getCode(), constraintViolation.getMessage(),null);
} else if (e instanceof BindException) {
BindException ex = (BindException ) e;
ObjectError objectError = ex.getAllErrors().stream().collect(Collectors.toList()).get(0);
return ResponseMsgUtil.builderResponse(SysCode.OpenApi.getCode()+ErrorCode.OPEN_API_REQ_PARAMS_ERR.getCode(), objectError.getDefaultMessage(),null);
}
return ResponseMsgUtil.builderResponse(SysCode.OpenApi.getCode()+ErrorCode.OPEN_API_REQ_PARAMS_ERR.getCode(), ErrorCode.OPEN_API_REQ_PARAMS_ERR.getMsg(),null);
}
}

@ -1,19 +1,26 @@
package com.openapi.controller;
import com.alibaba.fastjson.JSONObject;
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.common.pay.util.SignatureUtil;
import com.hfkj.common.utils.DateUtil;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.BsDiscountUser;
import com.hfkj.entity.*;
import com.hfkj.model.ResponseData;
import com.hfkj.openapi.model.request.RequestPushDiscountModel;
import com.hfkj.openapi.model.request.RequestPushPkDiscountModel;
import com.hfkj.openapi.model.request.RequestQueryCodeModel;
import com.hfkj.openapi.model.request.RequestQueryDiscountListModel;
import com.hfkj.openapi.model.response.ResponsePushDiscountModel;
import com.hfkj.openapi.model.response.ResponsePushDiscountPkModel;
import com.hfkj.openapi.model.response.ResponseQueryCodeModel;
import com.hfkj.service.agent.BsAgentApiLogService;
import com.hfkj.service.agent.BsAgentApiParamService;
import com.hfkj.service.agent.BsAgentDiscountService;
import com.hfkj.service.discount.BsDiscountPkRelService;
import com.hfkj.service.discount.BsDiscountUserService;
import com.hfkj.sysenum.discount.DiscountStockCodeObtainTypeEnum;
import io.swagger.annotations.Api;
@ -21,6 +28,7 @@ import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@ -37,44 +45,111 @@ public class BsDiscountController {
@Resource
private BsAgentApiParamService agentApiParamService;
@Resource
private BsAgentDiscountService agentDiscountService;
@Resource
private BsAgentApiLogService agentApiLogService;
@Resource
private BsDiscountUserService discountUserService;
@RequestMapping(value="/queryDiscountList",method = RequestMethod.POST)
@RequestMapping(value="/push",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "查询优惠券列表列表")
public ResponseData queryDiscountList(@RequestBody RequestQueryDiscountListModel body) {
log.info("========= Start 查询优惠券列表列表 Start ===========");
@ApiOperation(value = "推送优惠券")
public ResponseData push(@Validated @RequestBody RequestPushDiscountModel body) {
log.info("========= Start 推送优惠券 Start ===========");
log.info("请求参数:" + JSONObject.toJSONString(body));
BsAgentApiLogWithBLOBs apiLog = new BsAgentApiLogWithBLOBs();
apiLog.setAppId(body.getAppId());
apiLog.setRequestId(body.getReqId());
apiLog.setRequestUrl("discount/push");
apiLog.setRequestParam(JSONObject.toJSONString(body));
try {
// 验证签名
if (!SignatureUtil.checkSign(body.getSign(), body, agentApiParamService.getParamByAppId(body.getAppId()).getAppSecret())) {
BsAgentApiParam apiParam = agentApiParamService.getParamByAppId(body.getAppId());
if (!SignatureUtil.checkSign(body.getSign(), body, apiParam.getAppSecret())) {
throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_SIGN_ERR, "");
}
// 验证请求id
if (agentApiLogService.isExist(body.getAppId(), body.getReqId())) {
throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_REQ_ID_ERR, "");
}
// 查询代理商是否拥有优惠券权限
if (agentDiscountService.getDetail(apiParam.getAgentId(),1,body.getDiscountNo()) == null) {
throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_COMMON, "未配置优惠券");
}
// 领取优惠券
List<BsDiscountUser> codeDataList = discountUserService.receive(
body.getDiscountNo(),
body.getNumber(),
DiscountStockCodeObtainTypeEnum.type4, body.getPhone(),
body.getAppId()
);
List<Map<String,Object>> codeMapList = new ArrayList<>();
for (BsDiscountUser discountUser : codeDataList) {
Map<String,Object> codeMap = new HashMap<>();
codeMap.put("discountNo", discountUser.getDiscountNo());
codeMap.put("phone", discountUser.getUserPhone());
codeMap.put("code", discountUser.getDiscountStockCode());
codeMap.put("status", discountUser.getStatus());
codeMap.put("createTime", DateUtil.date2String(discountUser.getCreateTime(), DateUtil.Y_M_D_HMS));
codeMap.put("expirationDate", DateUtil.date2String(discountUser.getExpirationDate(), DateUtil.Y_M_D_HMS));
codeMapList.add(codeMap);
}
ResponsePushDiscountModel response = new ResponsePushDiscountModel();
response.setReqId(body.getReqId());
response.setAppId(body.getAppId());
response.setCodeList(codeMapList);
response.setSign(SignatureUtil.createSign(response, agentApiParamService.getParamByAppId(body.getAppId()).getAppSecret()));
log.info("返回参数:" + JSONObject.toJSONString(response));
apiLog.setResponseParam(JSONObject.toJSONString(response));
return ResponseMsgUtil.success("");
return ResponseMsgUtil.success(response);
} catch (Exception e) {
} catch (Exception e) {
log.info("出现异常:", e);
return ResponseMsgUtil.exception(e);
// 异常内容
ResponseData exception = ResponseMsgUtil.exception(e);
apiLog.setErrorContent(JSONObject.toJSONString(exception));
return exception;
} finally {
log.info("========= END 查询优惠券列表列表 END ===========");
// 记录日志
agentApiLogService.edit(apiLog);
log.info("========= END 推送优惠券 END ===========");
}
}
@RequestMapping(value="/push",method = RequestMethod.POST)
@RequestMapping(value="/pushPk",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "推送优惠券")
public ResponseData push(@RequestBody RequestPushDiscountModel body) {
log.info("========= Start 推送优惠券 Start ===========");
@ApiOperation(value = "推送优惠券")
public ResponseData pushPk(@Validated @RequestBody RequestPushPkDiscountModel body) {
log.info("========= Start 推送优惠券 Start ===========");
log.info("请求参数:" + JSONObject.toJSONString(body));
BsAgentApiLogWithBLOBs apiLog = new BsAgentApiLogWithBLOBs();
apiLog.setAppId(body.getAppId());
apiLog.setRequestId(body.getReqId());
apiLog.setRequestUrl("discount/pushPk");
apiLog.setRequestParam(JSONObject.toJSONString(body));
try {
// 验证签名
if (!SignatureUtil.checkSign(body.getSign(), body, agentApiParamService.getParamByAppId(body.getAppId()).getAppSecret())) {
BsAgentApiParam apiParam = agentApiParamService.getParamByAppId(body.getAppId());
if (!SignatureUtil.checkSign(body.getSign(), body, apiParam.getAppSecret())) {
throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_SIGN_ERR, "");
}
// 验证请求id
if (agentApiLogService.isExist(body.getAppId(), body.getReqId())) {
throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_REQ_ID_ERR, "");
}
// 查询代理商是否拥有优惠券包权限
if (agentDiscountService.getDetail(apiParam.getAgentId(),2,body.getDiscountPkNo()) == null) {
throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_COMMON, "未配置优惠券包");
}
// 领取优惠券
List<BsDiscountUser> codeDataList = discountUserService.receive(
body.getDiscountNo(),
List<BsDiscountUser> codeDataList = discountUserService.receivePk(
body.getDiscountPkNo(),
body.getNumber(),
DiscountStockCodeObtainTypeEnum.type4, body.getPhone(),
body.getAppId()
@ -87,58 +162,85 @@ public class BsDiscountController {
codeMap.put("phone", discountUser.getUserPhone());
codeMap.put("code", discountUser.getDiscountStockCode());
codeMap.put("status", discountUser.getStatus());
codeMap.put("createTime", discountUser.getCreateTime());
codeMap.put("expirationDate", discountUser.getExpirationDate());
codeMap.put("createTime", DateUtil.date2String(discountUser.getCreateTime(), DateUtil.Y_M_D_HMS));
codeMap.put("expirationDate", DateUtil.date2String(discountUser.getExpirationDate(), DateUtil.Y_M_D_HMS));
codeMapList.add(codeMap);
}
ResponsePushDiscountModel response = new ResponsePushDiscountModel();
ResponsePushDiscountPkModel response = new ResponsePushDiscountPkModel();
response.setReqId(body.getReqId());
response.setAppId(body.getAppId());
response.setDiscountPkNo(body.getDiscountPkNo());
response.setCodeList(codeMapList);
response.setSign(SignatureUtil.createSign(response, agentApiParamService.getParamByAppId(body.getAppId()).getAppSecret()));
log.info("返回参数:" + JSONObject.toJSONString(response));
apiLog.setResponseParam(JSONObject.toJSONString(response));
return ResponseMsgUtil.success(response);
} catch (Exception e) {
log.info("出现异常:", e);
return ResponseMsgUtil.exception(e);
// 异常内容
ResponseData exception = ResponseMsgUtil.exception(e);
apiLog.setErrorContent(JSONObject.toJSONString(exception));
return exception;
} finally {
log.info("========= END 推送优惠券 END ===========");
// 记录日志
agentApiLogService.edit(apiLog);
log.info("========= END 推送优惠券包 END ===========");
}
}
@RequestMapping(value="/queryCode",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "查询优惠券编码")
public ResponseData queryCode(@RequestBody RequestQueryCodeModel body) {
public ResponseData queryCode(@Validated @RequestBody RequestQueryCodeModel body) {
log.info("========= Start 查询优惠券编码 Start ===========");
log.info("请求参数:" + JSONObject.toJSONString(body));
BsAgentApiLogWithBLOBs apiLog = new BsAgentApiLogWithBLOBs();
apiLog.setAppId(body.getAppId());
apiLog.setRequestId(body.getReqId());
apiLog.setRequestUrl("discount/queryCode");
apiLog.setRequestParam(JSONObject.toJSONString(body));
try {
// 验证签名
if (!SignatureUtil.checkSign(body.getSign(), body, agentApiParamService.getParamByAppId(body.getAppId()).getAppSecret())) {
BsAgentApiParam apiParam = agentApiParamService.getParamByAppId(body.getAppId());
if (!SignatureUtil.checkSign(body.getSign(), body, apiParam.getAppSecret())) {
throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_SIGN_ERR, "");
}
// 验证请求id
if (agentApiLogService.isExist(body.getAppId(), body.getReqId())) {
throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_REQ_ID_ERR, "");
}
// 查询优惠券编码
BsDiscountUser discountUser = discountUserService.getDetailByCodeId(body.getCode());
if (discountUser == null) {
throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.COMMON_ERROR, "未找到数据");
}
ResponseQueryCodeModel response = new ResponseQueryCodeModel();
response.setReqId(body.getReqId());
response.setAppId(body.getAppId());
response.setDiscountNo(discountUser.getDiscountNo());
response.setPhone(discountUser.getUserPhone());
response.setCode(discountUser.getDiscountStockCode());
response.setStatus(discountUser.getStatus());
response.setCreateTime(discountUser.getCreateTime());
response.setExpirationDate(discountUser.getExpirationDate());
response.setCreateTime(DateUtil.date2String(discountUser.getCreateTime(), DateUtil.Y_M_D_HMS));
response.setExpirationDate(DateUtil.date2String(discountUser.getExpirationDate(), DateUtil.Y_M_D_HMS));
response.setSign(SignatureUtil.createSign(response, agentApiParamService.getParamByAppId(body.getAppId()).getAppSecret()));
log.info("返回参数:" + JSONObject.toJSONString(response));
apiLog.setResponseParam(JSONObject.toJSONString(response));
return ResponseMsgUtil.success(response);
} catch (Exception e) {
log.info("出现异常:", e);
return ResponseMsgUtil.exception(e);
// 异常内容
ResponseData exception = ResponseMsgUtil.exception(e);
apiLog.setErrorContent(JSONObject.toJSONString(exception));
return exception;
} finally {
// 记录日志
agentApiLogService.edit(apiLog);
log.info("========= END 查询优惠券编码 END ===========");
}
}

@ -1,5 +1,6 @@
com\openapi\config\RedisConfig.class
com\openapi\config\SysConst.class
com\openapi\config\RestExceptionHandler.class
com\openapi\config\AuthConfig.class
com\OpenApiApplication.class
com\openapi\config\SwaggerConfig.class

@ -7,4 +7,5 @@ D:\hurui\huifu\hai-oil-server\openapi\src\main\java\com\openapi\config\Multipart
D:\hurui\huifu\hai-oil-server\openapi\src\main\java\com\openapi\config\SysConst.java
D:\hurui\huifu\hai-oil-server\openapi\src\main\java\com\openapi\config\ConfigListener.java
D:\hurui\huifu\hai-oil-server\openapi\src\main\java\com\openapi\config\CorsConfig.java
D:\hurui\huifu\hai-oil-server\openapi\src\main\java\com\openapi\config\RestExceptionHandler.java
D:\hurui\huifu\hai-oil-server\openapi\src\main\java\com\openapi\config\RedisConfig.java

@ -0,0 +1,31 @@
package com.hfkj.schedule;
import com.hfkj.service.discount.BsDiscountUserService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* @className: DiscountSchedule
* @author: HuRui
* @date: 2024/9/4
**/
@Component
public class DiscountSchedule {
@Resource
private BsDiscountUserService discountUserService;
@Scheduled(cron="0 0/1 * * * ?") //每分钟执行一次
public void newLinkGasSchedule() {
try {
// 更新过期数据
discountUserService.expiration();;
} catch (Exception e) {
System.out.println("更新价格失败!!!");
}
}
}

@ -38,7 +38,10 @@ public enum ErrorCode {
//////////////////openapi业务异常/////////////
MSG_EVENT_NULL("2999","消息类型为空"),
OPEN_API_SIGN_ERR("1001","签名错误"),
OPEN_API_COMMON("4000",""),
OPEN_API_REQ_PARAMS_ERR("4001","请求参数校验失败"),
OPEN_API_SIGN_ERR("4002","签名错误"),
OPEN_API_REQ_ID_ERR("4003","请求id重复"),
USE_VISIT_ILLEGAL("4001","用户身份错误"),
RC_VISIT_ERROR("2998",""),

@ -81,16 +81,14 @@ public class SignatureUtil {
}
public static void main(String[] args) throws Exception {
String paramStr = "{\n" +
" \"merchantNo\": \"2023090816465844909\",\n" +
" \"outTradeNo\": \"ZF1130202305051459532538973458\",\n" +
" \"payMode\": \"WECHAT\",\n" +
" \"totalAmount\": 0.01,\n" +
" \"transType\": \"JSAPI\",\n" +
" \"profitSharing\": 0,\n" +
" \"specialField\": \"测试\"" +
String paramStr = "{ \n" +
" \"reqId\": \"cs0001\",\n" +
" \"appId\": \"hf7356c71fb97ab0\",\n" +
" \"discountNo\": \"D10008\",\n" +
" \"number\": \"1\",\n" +
" \"phone\": \"123456\"" +
"}";
String sign = createSign(JSONObject.parseObject(paramStr), "ZatCMLMSZxnkc2rk7dtpTORMLcKetcKt");
String sign = createSign(JSONObject.parseObject(paramStr), "8aef995ff71485dc19b36e35f04c4016");
System.out.println(sign);
}

@ -0,0 +1,152 @@
package com.hfkj.dao;
import com.hfkj.entity.BsAgentApiLog;
import com.hfkj.entity.BsAgentApiLogExample;
import com.hfkj.entity.BsAgentApiLogWithBLOBs;
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 BsAgentApiLogMapper extends BsAgentApiLogMapperExt {
@SelectProvider(type=BsAgentApiLogSqlProvider.class, method="countByExample")
long countByExample(BsAgentApiLogExample example);
@DeleteProvider(type=BsAgentApiLogSqlProvider.class, method="deleteByExample")
int deleteByExample(BsAgentApiLogExample example);
@Delete({
"delete from bs_agent_api_log",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_agent_api_log (app_id, request_id, ",
"request_url, create_time, ",
"ext_1, ext_2, ext_3, ",
"request_param, response_param, ",
"error_content)",
"values (#{appId,jdbcType=VARCHAR}, #{requestId,jdbcType=VARCHAR}, ",
"#{requestUrl,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, ",
"#{requestParam,jdbcType=LONGVARCHAR}, #{responseParam,jdbcType=LONGVARCHAR}, ",
"#{errorContent,jdbcType=LONGVARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsAgentApiLogWithBLOBs record);
@InsertProvider(type=BsAgentApiLogSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsAgentApiLogWithBLOBs record);
@SelectProvider(type=BsAgentApiLogSqlProvider.class, method="selectByExampleWithBLOBs")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="app_id", property="appId", jdbcType=JdbcType.VARCHAR),
@Result(column="request_id", property="requestId", jdbcType=JdbcType.VARCHAR),
@Result(column="request_url", property="requestUrl", 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),
@Result(column="request_param", property="requestParam", jdbcType=JdbcType.LONGVARCHAR),
@Result(column="response_param", property="responseParam", jdbcType=JdbcType.LONGVARCHAR),
@Result(column="error_content", property="errorContent", jdbcType=JdbcType.LONGVARCHAR)
})
List<BsAgentApiLogWithBLOBs> selectByExampleWithBLOBs(BsAgentApiLogExample example);
@SelectProvider(type=BsAgentApiLogSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="app_id", property="appId", jdbcType=JdbcType.VARCHAR),
@Result(column="request_id", property="requestId", jdbcType=JdbcType.VARCHAR),
@Result(column="request_url", property="requestUrl", 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<BsAgentApiLog> selectByExample(BsAgentApiLogExample example);
@Select({
"select",
"id, app_id, request_id, request_url, create_time, ext_1, ext_2, ext_3, request_param, ",
"response_param, error_content",
"from bs_agent_api_log",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="app_id", property="appId", jdbcType=JdbcType.VARCHAR),
@Result(column="request_id", property="requestId", jdbcType=JdbcType.VARCHAR),
@Result(column="request_url", property="requestUrl", 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),
@Result(column="request_param", property="requestParam", jdbcType=JdbcType.LONGVARCHAR),
@Result(column="response_param", property="responseParam", jdbcType=JdbcType.LONGVARCHAR),
@Result(column="error_content", property="errorContent", jdbcType=JdbcType.LONGVARCHAR)
})
BsAgentApiLogWithBLOBs selectByPrimaryKey(Long id);
@UpdateProvider(type=BsAgentApiLogSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsAgentApiLogWithBLOBs record, @Param("example") BsAgentApiLogExample example);
@UpdateProvider(type=BsAgentApiLogSqlProvider.class, method="updateByExampleWithBLOBs")
int updateByExampleWithBLOBs(@Param("record") BsAgentApiLogWithBLOBs record, @Param("example") BsAgentApiLogExample example);
@UpdateProvider(type=BsAgentApiLogSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsAgentApiLog record, @Param("example") BsAgentApiLogExample example);
@UpdateProvider(type=BsAgentApiLogSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsAgentApiLogWithBLOBs record);
@Update({
"update bs_agent_api_log",
"set app_id = #{appId,jdbcType=VARCHAR},",
"request_id = #{requestId,jdbcType=VARCHAR},",
"request_url = #{requestUrl,jdbcType=VARCHAR},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR},",
"request_param = #{requestParam,jdbcType=LONGVARCHAR},",
"response_param = #{responseParam,jdbcType=LONGVARCHAR},",
"error_content = #{errorContent,jdbcType=LONGVARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKeyWithBLOBs(BsAgentApiLogWithBLOBs record);
@Update({
"update bs_agent_api_log",
"set app_id = #{appId,jdbcType=VARCHAR},",
"request_id = #{requestId,jdbcType=VARCHAR},",
"request_url = #{requestUrl,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(BsAgentApiLog record);
}

@ -0,0 +1,13 @@
package com.hfkj.dao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/**
* mapper扩展类
*/
public interface BsAgentApiLogMapperExt {
@Select("select count(1) from bs_agent_api_log where app_id = #{appId} and request_id = #{reqId}")
int isExist(@Param("appId") String appId, @Param("reqId") String reqId);
}

@ -0,0 +1,360 @@
package com.hfkj.dao;
import com.hfkj.entity.BsAgentApiLogExample.Criteria;
import com.hfkj.entity.BsAgentApiLogExample.Criterion;
import com.hfkj.entity.BsAgentApiLogExample;
import com.hfkj.entity.BsAgentApiLogWithBLOBs;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsAgentApiLogSqlProvider {
public String countByExample(BsAgentApiLogExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_agent_api_log");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsAgentApiLogExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_agent_api_log");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsAgentApiLogWithBLOBs record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_agent_api_log");
if (record.getAppId() != null) {
sql.VALUES("app_id", "#{appId,jdbcType=VARCHAR}");
}
if (record.getRequestId() != null) {
sql.VALUES("request_id", "#{requestId,jdbcType=VARCHAR}");
}
if (record.getRequestUrl() != null) {
sql.VALUES("request_url", "#{requestUrl,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}");
}
if (record.getRequestParam() != null) {
sql.VALUES("request_param", "#{requestParam,jdbcType=LONGVARCHAR}");
}
if (record.getResponseParam() != null) {
sql.VALUES("response_param", "#{responseParam,jdbcType=LONGVARCHAR}");
}
if (record.getErrorContent() != null) {
sql.VALUES("error_content", "#{errorContent,jdbcType=LONGVARCHAR}");
}
return sql.toString();
}
public String selectByExampleWithBLOBs(BsAgentApiLogExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("app_id");
sql.SELECT("request_id");
sql.SELECT("request_url");
sql.SELECT("create_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.SELECT("request_param");
sql.SELECT("response_param");
sql.SELECT("error_content");
sql.FROM("bs_agent_api_log");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String selectByExample(BsAgentApiLogExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("app_id");
sql.SELECT("request_id");
sql.SELECT("request_url");
sql.SELECT("create_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("bs_agent_api_log");
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) {
BsAgentApiLogWithBLOBs record = (BsAgentApiLogWithBLOBs) parameter.get("record");
BsAgentApiLogExample example = (BsAgentApiLogExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_agent_api_log");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getAppId() != null) {
sql.SET("app_id = #{record.appId,jdbcType=VARCHAR}");
}
if (record.getRequestId() != null) {
sql.SET("request_id = #{record.requestId,jdbcType=VARCHAR}");
}
if (record.getRequestUrl() != null) {
sql.SET("request_url = #{record.requestUrl,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}");
}
if (record.getRequestParam() != null) {
sql.SET("request_param = #{record.requestParam,jdbcType=LONGVARCHAR}");
}
if (record.getResponseParam() != null) {
sql.SET("response_param = #{record.responseParam,jdbcType=LONGVARCHAR}");
}
if (record.getErrorContent() != null) {
sql.SET("error_content = #{record.errorContent,jdbcType=LONGVARCHAR}");
}
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExampleWithBLOBs(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("bs_agent_api_log");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("app_id = #{record.appId,jdbcType=VARCHAR}");
sql.SET("request_id = #{record.requestId,jdbcType=VARCHAR}");
sql.SET("request_url = #{record.requestUrl,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}");
sql.SET("request_param = #{record.requestParam,jdbcType=LONGVARCHAR}");
sql.SET("response_param = #{record.responseParam,jdbcType=LONGVARCHAR}");
sql.SET("error_content = #{record.errorContent,jdbcType=LONGVARCHAR}");
BsAgentApiLogExample example = (BsAgentApiLogExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExample(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("bs_agent_api_log");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("app_id = #{record.appId,jdbcType=VARCHAR}");
sql.SET("request_id = #{record.requestId,jdbcType=VARCHAR}");
sql.SET("request_url = #{record.requestUrl,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}");
BsAgentApiLogExample example = (BsAgentApiLogExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsAgentApiLogWithBLOBs record) {
SQL sql = new SQL();
sql.UPDATE("bs_agent_api_log");
if (record.getAppId() != null) {
sql.SET("app_id = #{appId,jdbcType=VARCHAR}");
}
if (record.getRequestId() != null) {
sql.SET("request_id = #{requestId,jdbcType=VARCHAR}");
}
if (record.getRequestUrl() != null) {
sql.SET("request_url = #{requestUrl,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}");
}
if (record.getRequestParam() != null) {
sql.SET("request_param = #{requestParam,jdbcType=LONGVARCHAR}");
}
if (record.getResponseParam() != null) {
sql.SET("response_param = #{responseParam,jdbcType=LONGVARCHAR}");
}
if (record.getErrorContent() != null) {
sql.SET("error_content = #{errorContent,jdbcType=LONGVARCHAR}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();
}
protected void applyWhere(SQL sql, BsAgentApiLogExample 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,125 @@
package com.hfkj.dao;
import com.hfkj.entity.BsAgentDiscount;
import com.hfkj.entity.BsAgentDiscountExample;
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 BsAgentDiscountMapper extends BsAgentDiscountMapperExt {
@SelectProvider(type=BsAgentDiscountSqlProvider.class, method="countByExample")
long countByExample(BsAgentDiscountExample example);
@DeleteProvider(type=BsAgentDiscountSqlProvider.class, method="deleteByExample")
int deleteByExample(BsAgentDiscountExample example);
@Delete({
"delete from bs_agent_discount",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_agent_discount (agent_id, `type`, ",
"object_id, object_no, ",
"object_name, `status`, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{agentId,jdbcType=BIGINT}, #{type,jdbcType=INTEGER}, ",
"#{objectId,jdbcType=BIGINT}, #{objectNo,jdbcType=VARCHAR}, ",
"#{objectName,jdbcType=VARCHAR}, #{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(BsAgentDiscount record);
@InsertProvider(type=BsAgentDiscountSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsAgentDiscount record);
@SelectProvider(type=BsAgentDiscountSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT),
@Result(column="object_no", property="objectNo", jdbcType=JdbcType.VARCHAR),
@Result(column="object_name", property="objectName", jdbcType=JdbcType.VARCHAR),
@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<BsAgentDiscount> selectByExample(BsAgentDiscountExample example);
@Select({
"select",
"id, agent_id, `type`, object_id, object_no, object_name, `status`, create_time, ",
"update_time, ext_1, ext_2, ext_3",
"from bs_agent_discount",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT),
@Result(column="object_no", property="objectNo", jdbcType=JdbcType.VARCHAR),
@Result(column="object_name", property="objectName", jdbcType=JdbcType.VARCHAR),
@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)
})
BsAgentDiscount selectByPrimaryKey(Long id);
@UpdateProvider(type=BsAgentDiscountSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsAgentDiscount record, @Param("example") BsAgentDiscountExample example);
@UpdateProvider(type=BsAgentDiscountSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsAgentDiscount record, @Param("example") BsAgentDiscountExample example);
@UpdateProvider(type=BsAgentDiscountSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsAgentDiscount record);
@Update({
"update bs_agent_discount",
"set agent_id = #{agentId,jdbcType=BIGINT},",
"`type` = #{type,jdbcType=INTEGER},",
"object_id = #{objectId,jdbcType=BIGINT},",
"object_no = #{objectNo,jdbcType=VARCHAR},",
"object_name = #{objectName,jdbcType=VARCHAR},",
"`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(BsAgentDiscount record);
}

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

@ -0,0 +1,332 @@
package com.hfkj.dao;
import com.hfkj.entity.BsAgentDiscount;
import com.hfkj.entity.BsAgentDiscountExample.Criteria;
import com.hfkj.entity.BsAgentDiscountExample.Criterion;
import com.hfkj.entity.BsAgentDiscountExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsAgentDiscountSqlProvider {
public String countByExample(BsAgentDiscountExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_agent_discount");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsAgentDiscountExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_agent_discount");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsAgentDiscount record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_agent_discount");
if (record.getAgentId() != null) {
sql.VALUES("agent_id", "#{agentId,jdbcType=BIGINT}");
}
if (record.getType() != null) {
sql.VALUES("`type`", "#{type,jdbcType=INTEGER}");
}
if (record.getObjectId() != null) {
sql.VALUES("object_id", "#{objectId,jdbcType=BIGINT}");
}
if (record.getObjectNo() != null) {
sql.VALUES("object_no", "#{objectNo,jdbcType=VARCHAR}");
}
if (record.getObjectName() != null) {
sql.VALUES("object_name", "#{objectName,jdbcType=VARCHAR}");
}
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(BsAgentDiscountExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("agent_id");
sql.SELECT("`type`");
sql.SELECT("object_id");
sql.SELECT("object_no");
sql.SELECT("object_name");
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_agent_discount");
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) {
BsAgentDiscount record = (BsAgentDiscount) parameter.get("record");
BsAgentDiscountExample example = (BsAgentDiscountExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_agent_discount");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getAgentId() != null) {
sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}");
}
if (record.getType() != null) {
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
}
if (record.getObjectId() != null) {
sql.SET("object_id = #{record.objectId,jdbcType=BIGINT}");
}
if (record.getObjectNo() != null) {
sql.SET("object_no = #{record.objectNo,jdbcType=VARCHAR}");
}
if (record.getObjectName() != null) {
sql.SET("object_name = #{record.objectName,jdbcType=VARCHAR}");
}
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_agent_discount");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}");
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
sql.SET("object_id = #{record.objectId,jdbcType=BIGINT}");
sql.SET("object_no = #{record.objectNo,jdbcType=VARCHAR}");
sql.SET("object_name = #{record.objectName,jdbcType=VARCHAR}");
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}");
BsAgentDiscountExample example = (BsAgentDiscountExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsAgentDiscount record) {
SQL sql = new SQL();
sql.UPDATE("bs_agent_discount");
if (record.getAgentId() != null) {
sql.SET("agent_id = #{agentId,jdbcType=BIGINT}");
}
if (record.getType() != null) {
sql.SET("`type` = #{type,jdbcType=INTEGER}");
}
if (record.getObjectId() != null) {
sql.SET("object_id = #{objectId,jdbcType=BIGINT}");
}
if (record.getObjectNo() != null) {
sql.SET("object_no = #{objectNo,jdbcType=VARCHAR}");
}
if (record.getObjectName() != null) {
sql.SET("object_name = #{objectName,jdbcType=VARCHAR}");
}
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, BsAgentDiscountExample 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());
}
}
}

@ -46,8 +46,9 @@ public interface BsDiscountMapper extends BsDiscountMapperExt {
"end_time, reality_end_time, ",
"`status`, create_time, ",
"create_user_type, create_user_id, ",
"create_user_name, update_time, ",
"ext_1, ext_2, ext_3)",
"create_user_name, create_user_mer_no, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{discountNo,jdbcType=VARCHAR}, #{discountName,jdbcType=VARCHAR}, ",
"#{discountType,jdbcType=INTEGER}, #{discountCondition,jdbcType=DECIMAL}, ",
"#{discountPrice,jdbcType=DECIMAL}, #{useScope,jdbcType=VARCHAR}, ",
@ -55,8 +56,9 @@ public interface BsDiscountMapper extends BsDiscountMapperExt {
"#{endTime,jdbcType=TIMESTAMP}, #{realityEndTime,jdbcType=TIMESTAMP}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{createUserType,jdbcType=INTEGER}, #{createUserId,jdbcType=BIGINT}, ",
"#{createUserName,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{createUserName,jdbcType=VARCHAR}, #{createUserMerNo,jdbcType=VARCHAR}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsDiscount record);
@ -83,6 +85,7 @@ public interface BsDiscountMapper extends BsDiscountMapperExt {
@Result(column="create_user_type", property="createUserType", jdbcType=JdbcType.INTEGER),
@Result(column="create_user_id", property="createUserId", jdbcType=JdbcType.BIGINT),
@Result(column="create_user_name", property="createUserName", jdbcType=JdbcType.VARCHAR),
@Result(column="create_user_mer_no", property="createUserMerNo", jdbcType=JdbcType.VARCHAR),
@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),
@ -94,8 +97,8 @@ public interface BsDiscountMapper extends BsDiscountMapperExt {
"select",
"id, discount_no, discount_name, discount_type, discount_condition, discount_price, ",
"use_scope, receive_expiration_date, start_time, end_time, reality_end_time, ",
"`status`, create_time, create_user_type, create_user_id, create_user_name, update_time, ",
"ext_1, ext_2, ext_3",
"`status`, create_time, create_user_type, create_user_id, create_user_name, create_user_mer_no, ",
"update_time, ext_1, ext_2, ext_3",
"from bs_discount",
"where id = #{id,jdbcType=BIGINT}"
})
@ -116,6 +119,7 @@ public interface BsDiscountMapper extends BsDiscountMapperExt {
@Result(column="create_user_type", property="createUserType", jdbcType=JdbcType.INTEGER),
@Result(column="create_user_id", property="createUserId", jdbcType=JdbcType.BIGINT),
@Result(column="create_user_name", property="createUserName", jdbcType=JdbcType.VARCHAR),
@Result(column="create_user_mer_no", property="createUserMerNo", jdbcType=JdbcType.VARCHAR),
@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),
@ -149,6 +153,7 @@ public interface BsDiscountMapper extends BsDiscountMapperExt {
"create_user_type = #{createUserType,jdbcType=INTEGER},",
"create_user_id = #{createUserId,jdbcType=BIGINT},",
"create_user_name = #{createUserName,jdbcType=VARCHAR},",
"create_user_mer_no = #{createUserMerNo,jdbcType=VARCHAR},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",

@ -0,0 +1,155 @@
package com.hfkj.dao;
import com.hfkj.entity.BsDiscountPk;
import com.hfkj.entity.BsDiscountPkExample;
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 BsDiscountPkMapper extends BsDiscountPkMapperExt {
@SelectProvider(type=BsDiscountPkSqlProvider.class, method="countByExample")
long countByExample(BsDiscountPkExample example);
@DeleteProvider(type=BsDiscountPkSqlProvider.class, method="deleteByExample")
int deleteByExample(BsDiscountPkExample example);
@Delete({
"delete from bs_discount_pk",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_discount_pk (discount_pk_no, discount_pk_name, ",
"`describe`, list_img, ",
"content, sale_price, ",
"sale_num, start_time, ",
"end_time, `status`, ",
"create_time, create_user_type, ",
"create_user_id, create_user_name, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{discountPkNo,jdbcType=VARCHAR}, #{discountPkName,jdbcType=VARCHAR}, ",
"#{describe,jdbcType=VARCHAR}, #{listImg,jdbcType=VARCHAR}, ",
"#{content,jdbcType=VARCHAR}, #{salePrice,jdbcType=DECIMAL}, ",
"#{saleNum,jdbcType=INTEGER}, #{startTime,jdbcType=TIMESTAMP}, ",
"#{endTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{createUserType,jdbcType=INTEGER}, ",
"#{createUserId,jdbcType=BIGINT}, #{createUserName,jdbcType=VARCHAR}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsDiscountPk record);
@InsertProvider(type=BsDiscountPkSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsDiscountPk record);
@SelectProvider(type=BsDiscountPkSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="discount_pk_no", property="discountPkNo", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_pk_name", property="discountPkName", jdbcType=JdbcType.VARCHAR),
@Result(column="describe", property="describe", jdbcType=JdbcType.VARCHAR),
@Result(column="list_img", property="listImg", jdbcType=JdbcType.VARCHAR),
@Result(column="content", property="content", jdbcType=JdbcType.VARCHAR),
@Result(column="sale_price", property="salePrice", jdbcType=JdbcType.DECIMAL),
@Result(column="sale_num", property="saleNum", jdbcType=JdbcType.INTEGER),
@Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="create_user_type", property="createUserType", jdbcType=JdbcType.INTEGER),
@Result(column="create_user_id", property="createUserId", jdbcType=JdbcType.BIGINT),
@Result(column="create_user_name", property="createUserName", jdbcType=JdbcType.VARCHAR),
@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<BsDiscountPk> selectByExample(BsDiscountPkExample example);
@Select({
"select",
"id, discount_pk_no, discount_pk_name, `describe`, list_img, content, sale_price, ",
"sale_num, start_time, end_time, `status`, create_time, create_user_type, create_user_id, ",
"create_user_name, update_time, ext_1, ext_2, ext_3",
"from bs_discount_pk",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="discount_pk_no", property="discountPkNo", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_pk_name", property="discountPkName", jdbcType=JdbcType.VARCHAR),
@Result(column="describe", property="describe", jdbcType=JdbcType.VARCHAR),
@Result(column="list_img", property="listImg", jdbcType=JdbcType.VARCHAR),
@Result(column="content", property="content", jdbcType=JdbcType.VARCHAR),
@Result(column="sale_price", property="salePrice", jdbcType=JdbcType.DECIMAL),
@Result(column="sale_num", property="saleNum", jdbcType=JdbcType.INTEGER),
@Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="create_user_type", property="createUserType", jdbcType=JdbcType.INTEGER),
@Result(column="create_user_id", property="createUserId", jdbcType=JdbcType.BIGINT),
@Result(column="create_user_name", property="createUserName", jdbcType=JdbcType.VARCHAR),
@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)
})
BsDiscountPk selectByPrimaryKey(Long id);
@UpdateProvider(type=BsDiscountPkSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsDiscountPk record, @Param("example") BsDiscountPkExample example);
@UpdateProvider(type=BsDiscountPkSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsDiscountPk record, @Param("example") BsDiscountPkExample example);
@UpdateProvider(type=BsDiscountPkSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsDiscountPk record);
@Update({
"update bs_discount_pk",
"set discount_pk_no = #{discountPkNo,jdbcType=VARCHAR},",
"discount_pk_name = #{discountPkName,jdbcType=VARCHAR},",
"`describe` = #{describe,jdbcType=VARCHAR},",
"list_img = #{listImg,jdbcType=VARCHAR},",
"content = #{content,jdbcType=VARCHAR},",
"sale_price = #{salePrice,jdbcType=DECIMAL},",
"sale_num = #{saleNum,jdbcType=INTEGER},",
"start_time = #{startTime,jdbcType=TIMESTAMP},",
"end_time = #{endTime,jdbcType=TIMESTAMP},",
"`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"create_user_type = #{createUserType,jdbcType=INTEGER},",
"create_user_id = #{createUserId,jdbcType=BIGINT},",
"create_user_name = #{createUserName,jdbcType=VARCHAR},",
"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(BsDiscountPk record);
}

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

@ -0,0 +1,142 @@
package com.hfkj.dao;
import com.hfkj.entity.BsDiscountPkRel;
import com.hfkj.entity.BsDiscountPkRelExample;
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 BsDiscountPkRelMapper extends BsDiscountPkRelMapperExt {
@SelectProvider(type=BsDiscountPkRelSqlProvider.class, method="countByExample")
long countByExample(BsDiscountPkRelExample example);
@DeleteProvider(type=BsDiscountPkRelSqlProvider.class, method="deleteByExample")
int deleteByExample(BsDiscountPkRelExample example);
@Delete({
"delete from bs_discount_pk_rel",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_discount_pk_rel (discount_pk_no, `number`, ",
"discount_no, discount_name, ",
"discount_type, discount_condition, ",
"discount_price, use_scope, ",
"receive_expiration_date, `status`, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{discountPkNo,jdbcType=VARCHAR}, #{number,jdbcType=INTEGER}, ",
"#{discountNo,jdbcType=VARCHAR}, #{discountName,jdbcType=VARCHAR}, ",
"#{discountType,jdbcType=INTEGER}, #{discountCondition,jdbcType=DECIMAL}, ",
"#{discountPrice,jdbcType=DECIMAL}, #{useScope,jdbcType=VARCHAR}, ",
"#{receiveExpirationDate,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(BsDiscountPkRel record);
@InsertProvider(type=BsDiscountPkRelSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsDiscountPkRel record);
@SelectProvider(type=BsDiscountPkRelSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="discount_pk_no", property="discountPkNo", jdbcType=JdbcType.VARCHAR),
@Result(column="number", property="number", jdbcType=JdbcType.INTEGER),
@Result(column="discount_no", property="discountNo", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_name", property="discountName", 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="use_scope", property="useScope", jdbcType=JdbcType.VARCHAR),
@Result(column="receive_expiration_date", property="receiveExpirationDate", 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<BsDiscountPkRel> selectByExample(BsDiscountPkRelExample example);
@Select({
"select",
"id, discount_pk_no, `number`, discount_no, discount_name, discount_type, discount_condition, ",
"discount_price, use_scope, receive_expiration_date, `status`, create_time, update_time, ",
"ext_1, ext_2, ext_3",
"from bs_discount_pk_rel",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="discount_pk_no", property="discountPkNo", jdbcType=JdbcType.VARCHAR),
@Result(column="number", property="number", jdbcType=JdbcType.INTEGER),
@Result(column="discount_no", property="discountNo", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_name", property="discountName", 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="use_scope", property="useScope", jdbcType=JdbcType.VARCHAR),
@Result(column="receive_expiration_date", property="receiveExpirationDate", 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)
})
BsDiscountPkRel selectByPrimaryKey(Long id);
@UpdateProvider(type=BsDiscountPkRelSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsDiscountPkRel record, @Param("example") BsDiscountPkRelExample example);
@UpdateProvider(type=BsDiscountPkRelSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsDiscountPkRel record, @Param("example") BsDiscountPkRelExample example);
@UpdateProvider(type=BsDiscountPkRelSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsDiscountPkRel record);
@Update({
"update bs_discount_pk_rel",
"set discount_pk_no = #{discountPkNo,jdbcType=VARCHAR},",
"`number` = #{number,jdbcType=INTEGER},",
"discount_no = #{discountNo,jdbcType=VARCHAR},",
"discount_name = #{discountName,jdbcType=VARCHAR},",
"discount_type = #{discountType,jdbcType=INTEGER},",
"discount_condition = #{discountCondition,jdbcType=DECIMAL},",
"discount_price = #{discountPrice,jdbcType=DECIMAL},",
"use_scope = #{useScope,jdbcType=VARCHAR},",
"receive_expiration_date = #{receiveExpirationDate,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(BsDiscountPkRel record);
}

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

@ -0,0 +1,388 @@
package com.hfkj.dao;
import com.hfkj.entity.BsDiscountPkRel;
import com.hfkj.entity.BsDiscountPkRelExample.Criteria;
import com.hfkj.entity.BsDiscountPkRelExample.Criterion;
import com.hfkj.entity.BsDiscountPkRelExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsDiscountPkRelSqlProvider {
public String countByExample(BsDiscountPkRelExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_discount_pk_rel");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsDiscountPkRelExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_discount_pk_rel");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsDiscountPkRel record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_discount_pk_rel");
if (record.getDiscountPkNo() != null) {
sql.VALUES("discount_pk_no", "#{discountPkNo,jdbcType=VARCHAR}");
}
if (record.getNumber() != null) {
sql.VALUES("`number`", "#{number,jdbcType=INTEGER}");
}
if (record.getDiscountNo() != null) {
sql.VALUES("discount_no", "#{discountNo,jdbcType=VARCHAR}");
}
if (record.getDiscountName() != null) {
sql.VALUES("discount_name", "#{discountName,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.getUseScope() != null) {
sql.VALUES("use_scope", "#{useScope,jdbcType=VARCHAR}");
}
if (record.getReceiveExpirationDate() != null) {
sql.VALUES("receive_expiration_date", "#{receiveExpirationDate,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(BsDiscountPkRelExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("discount_pk_no");
sql.SELECT("`number`");
sql.SELECT("discount_no");
sql.SELECT("discount_name");
sql.SELECT("discount_type");
sql.SELECT("discount_condition");
sql.SELECT("discount_price");
sql.SELECT("use_scope");
sql.SELECT("receive_expiration_date");
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_discount_pk_rel");
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) {
BsDiscountPkRel record = (BsDiscountPkRel) parameter.get("record");
BsDiscountPkRelExample example = (BsDiscountPkRelExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_discount_pk_rel");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getDiscountPkNo() != null) {
sql.SET("discount_pk_no = #{record.discountPkNo,jdbcType=VARCHAR}");
}
if (record.getNumber() != null) {
sql.SET("`number` = #{record.number,jdbcType=INTEGER}");
}
if (record.getDiscountNo() != null) {
sql.SET("discount_no = #{record.discountNo,jdbcType=VARCHAR}");
}
if (record.getDiscountName() != null) {
sql.SET("discount_name = #{record.discountName,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.getUseScope() != null) {
sql.SET("use_scope = #{record.useScope,jdbcType=VARCHAR}");
}
if (record.getReceiveExpirationDate() != null) {
sql.SET("receive_expiration_date = #{record.receiveExpirationDate,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_discount_pk_rel");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("discount_pk_no = #{record.discountPkNo,jdbcType=VARCHAR}");
sql.SET("`number` = #{record.number,jdbcType=INTEGER}");
sql.SET("discount_no = #{record.discountNo,jdbcType=VARCHAR}");
sql.SET("discount_name = #{record.discountName,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("use_scope = #{record.useScope,jdbcType=VARCHAR}");
sql.SET("receive_expiration_date = #{record.receiveExpirationDate,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}");
BsDiscountPkRelExample example = (BsDiscountPkRelExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsDiscountPkRel record) {
SQL sql = new SQL();
sql.UPDATE("bs_discount_pk_rel");
if (record.getDiscountPkNo() != null) {
sql.SET("discount_pk_no = #{discountPkNo,jdbcType=VARCHAR}");
}
if (record.getNumber() != null) {
sql.SET("`number` = #{number,jdbcType=INTEGER}");
}
if (record.getDiscountNo() != null) {
sql.SET("discount_no = #{discountNo,jdbcType=VARCHAR}");
}
if (record.getDiscountName() != null) {
sql.SET("discount_name = #{discountName,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.getUseScope() != null) {
sql.SET("use_scope = #{useScope,jdbcType=VARCHAR}");
}
if (record.getReceiveExpirationDate() != null) {
sql.SET("receive_expiration_date = #{receiveExpirationDate,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, BsDiscountPkRelExample 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,430 @@
package com.hfkj.dao;
import com.hfkj.entity.BsDiscountPk;
import com.hfkj.entity.BsDiscountPkExample.Criteria;
import com.hfkj.entity.BsDiscountPkExample.Criterion;
import com.hfkj.entity.BsDiscountPkExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsDiscountPkSqlProvider {
public String countByExample(BsDiscountPkExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_discount_pk");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsDiscountPkExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_discount_pk");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsDiscountPk record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_discount_pk");
if (record.getDiscountPkNo() != null) {
sql.VALUES("discount_pk_no", "#{discountPkNo,jdbcType=VARCHAR}");
}
if (record.getDiscountPkName() != null) {
sql.VALUES("discount_pk_name", "#{discountPkName,jdbcType=VARCHAR}");
}
if (record.getDescribe() != null) {
sql.VALUES("`describe`", "#{describe,jdbcType=VARCHAR}");
}
if (record.getListImg() != null) {
sql.VALUES("list_img", "#{listImg,jdbcType=VARCHAR}");
}
if (record.getContent() != null) {
sql.VALUES("content", "#{content,jdbcType=VARCHAR}");
}
if (record.getSalePrice() != null) {
sql.VALUES("sale_price", "#{salePrice,jdbcType=DECIMAL}");
}
if (record.getSaleNum() != null) {
sql.VALUES("sale_num", "#{saleNum,jdbcType=INTEGER}");
}
if (record.getStartTime() != null) {
sql.VALUES("start_time", "#{startTime,jdbcType=TIMESTAMP}");
}
if (record.getEndTime() != null) {
sql.VALUES("end_time", "#{endTime,jdbcType=TIMESTAMP}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
if (record.getCreateUserType() != null) {
sql.VALUES("create_user_type", "#{createUserType,jdbcType=INTEGER}");
}
if (record.getCreateUserId() != null) {
sql.VALUES("create_user_id", "#{createUserId,jdbcType=BIGINT}");
}
if (record.getCreateUserName() != null) {
sql.VALUES("create_user_name", "#{createUserName,jdbcType=VARCHAR}");
}
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(BsDiscountPkExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("discount_pk_no");
sql.SELECT("discount_pk_name");
sql.SELECT("`describe`");
sql.SELECT("list_img");
sql.SELECT("content");
sql.SELECT("sale_price");
sql.SELECT("sale_num");
sql.SELECT("start_time");
sql.SELECT("end_time");
sql.SELECT("`status`");
sql.SELECT("create_time");
sql.SELECT("create_user_type");
sql.SELECT("create_user_id");
sql.SELECT("create_user_name");
sql.SELECT("update_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("bs_discount_pk");
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) {
BsDiscountPk record = (BsDiscountPk) parameter.get("record");
BsDiscountPkExample example = (BsDiscountPkExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_discount_pk");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getDiscountPkNo() != null) {
sql.SET("discount_pk_no = #{record.discountPkNo,jdbcType=VARCHAR}");
}
if (record.getDiscountPkName() != null) {
sql.SET("discount_pk_name = #{record.discountPkName,jdbcType=VARCHAR}");
}
if (record.getDescribe() != null) {
sql.SET("`describe` = #{record.describe,jdbcType=VARCHAR}");
}
if (record.getListImg() != null) {
sql.SET("list_img = #{record.listImg,jdbcType=VARCHAR}");
}
if (record.getContent() != null) {
sql.SET("content = #{record.content,jdbcType=VARCHAR}");
}
if (record.getSalePrice() != null) {
sql.SET("sale_price = #{record.salePrice,jdbcType=DECIMAL}");
}
if (record.getSaleNum() != null) {
sql.SET("sale_num = #{record.saleNum,jdbcType=INTEGER}");
}
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.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
if (record.getCreateUserType() != null) {
sql.SET("create_user_type = #{record.createUserType,jdbcType=INTEGER}");
}
if (record.getCreateUserId() != null) {
sql.SET("create_user_id = #{record.createUserId,jdbcType=BIGINT}");
}
if (record.getCreateUserName() != null) {
sql.SET("create_user_name = #{record.createUserName,jdbcType=VARCHAR}");
}
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_discount_pk");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("discount_pk_no = #{record.discountPkNo,jdbcType=VARCHAR}");
sql.SET("discount_pk_name = #{record.discountPkName,jdbcType=VARCHAR}");
sql.SET("`describe` = #{record.describe,jdbcType=VARCHAR}");
sql.SET("list_img = #{record.listImg,jdbcType=VARCHAR}");
sql.SET("content = #{record.content,jdbcType=VARCHAR}");
sql.SET("sale_price = #{record.salePrice,jdbcType=DECIMAL}");
sql.SET("sale_num = #{record.saleNum,jdbcType=INTEGER}");
sql.SET("start_time = #{record.startTime,jdbcType=TIMESTAMP}");
sql.SET("end_time = #{record.endTime,jdbcType=TIMESTAMP}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("create_user_type = #{record.createUserType,jdbcType=INTEGER}");
sql.SET("create_user_id = #{record.createUserId,jdbcType=BIGINT}");
sql.SET("create_user_name = #{record.createUserName,jdbcType=VARCHAR}");
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}");
BsDiscountPkExample example = (BsDiscountPkExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsDiscountPk record) {
SQL sql = new SQL();
sql.UPDATE("bs_discount_pk");
if (record.getDiscountPkNo() != null) {
sql.SET("discount_pk_no = #{discountPkNo,jdbcType=VARCHAR}");
}
if (record.getDiscountPkName() != null) {
sql.SET("discount_pk_name = #{discountPkName,jdbcType=VARCHAR}");
}
if (record.getDescribe() != null) {
sql.SET("`describe` = #{describe,jdbcType=VARCHAR}");
}
if (record.getListImg() != null) {
sql.SET("list_img = #{listImg,jdbcType=VARCHAR}");
}
if (record.getContent() != null) {
sql.SET("content = #{content,jdbcType=VARCHAR}");
}
if (record.getSalePrice() != null) {
sql.SET("sale_price = #{salePrice,jdbcType=DECIMAL}");
}
if (record.getSaleNum() != null) {
sql.SET("sale_num = #{saleNum,jdbcType=INTEGER}");
}
if (record.getStartTime() != null) {
sql.SET("start_time = #{startTime,jdbcType=TIMESTAMP}");
}
if (record.getEndTime() != null) {
sql.SET("end_time = #{endTime,jdbcType=TIMESTAMP}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}
if (record.getCreateUserType() != null) {
sql.SET("create_user_type = #{createUserType,jdbcType=INTEGER}");
}
if (record.getCreateUserId() != null) {
sql.SET("create_user_id = #{createUserId,jdbcType=BIGINT}");
}
if (record.getCreateUserName() != null) {
sql.SET("create_user_name = #{createUserName,jdbcType=VARCHAR}");
}
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, BsDiscountPkExample 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,133 @@
package com.hfkj.dao;
import com.hfkj.entity.BsDiscountPkStockBatch;
import com.hfkj.entity.BsDiscountPkStockBatchExample;
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 BsDiscountPkStockBatchMapper extends BsDiscountPkStockBatchMapperExt {
@SelectProvider(type=BsDiscountPkStockBatchSqlProvider.class, method="countByExample")
long countByExample(BsDiscountPkStockBatchExample example);
@DeleteProvider(type=BsDiscountPkStockBatchSqlProvider.class, method="deleteByExample")
int deleteByExample(BsDiscountPkStockBatchExample example);
@Delete({
"delete from bs_discount_pk_stock_batch",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_discount_pk_stock_batch (discount_pk_id, discount_pk_no, ",
"discount_pk_name, batch_no, ",
"batch_stock_num, start_id, ",
"end_id, `status`, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{discountPkId,jdbcType=BIGINT}, #{discountPkNo,jdbcType=VARCHAR}, ",
"#{discountPkName,jdbcType=VARCHAR}, #{batchNo,jdbcType=VARCHAR}, ",
"#{batchStockNum,jdbcType=INTEGER}, #{startId,jdbcType=VARCHAR}, ",
"#{endId,jdbcType=VARCHAR}, #{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(BsDiscountPkStockBatch record);
@InsertProvider(type=BsDiscountPkStockBatchSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsDiscountPkStockBatch record);
@SelectProvider(type=BsDiscountPkStockBatchSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="discount_pk_id", property="discountPkId", jdbcType=JdbcType.BIGINT),
@Result(column="discount_pk_no", property="discountPkNo", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_pk_name", property="discountPkName", jdbcType=JdbcType.VARCHAR),
@Result(column="batch_no", property="batchNo", jdbcType=JdbcType.VARCHAR),
@Result(column="batch_stock_num", property="batchStockNum", jdbcType=JdbcType.INTEGER),
@Result(column="start_id", property="startId", jdbcType=JdbcType.VARCHAR),
@Result(column="end_id", property="endId", jdbcType=JdbcType.VARCHAR),
@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<BsDiscountPkStockBatch> selectByExample(BsDiscountPkStockBatchExample example);
@Select({
"select",
"id, discount_pk_id, discount_pk_no, discount_pk_name, batch_no, batch_stock_num, ",
"start_id, end_id, `status`, create_time, update_time, ext_1, ext_2, ext_3",
"from bs_discount_pk_stock_batch",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="discount_pk_id", property="discountPkId", jdbcType=JdbcType.BIGINT),
@Result(column="discount_pk_no", property="discountPkNo", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_pk_name", property="discountPkName", jdbcType=JdbcType.VARCHAR),
@Result(column="batch_no", property="batchNo", jdbcType=JdbcType.VARCHAR),
@Result(column="batch_stock_num", property="batchStockNum", jdbcType=JdbcType.INTEGER),
@Result(column="start_id", property="startId", jdbcType=JdbcType.VARCHAR),
@Result(column="end_id", property="endId", jdbcType=JdbcType.VARCHAR),
@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)
})
BsDiscountPkStockBatch selectByPrimaryKey(Long id);
@UpdateProvider(type=BsDiscountPkStockBatchSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsDiscountPkStockBatch record, @Param("example") BsDiscountPkStockBatchExample example);
@UpdateProvider(type=BsDiscountPkStockBatchSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsDiscountPkStockBatch record, @Param("example") BsDiscountPkStockBatchExample example);
@UpdateProvider(type=BsDiscountPkStockBatchSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsDiscountPkStockBatch record);
@Update({
"update bs_discount_pk_stock_batch",
"set discount_pk_id = #{discountPkId,jdbcType=BIGINT},",
"discount_pk_no = #{discountPkNo,jdbcType=VARCHAR},",
"discount_pk_name = #{discountPkName,jdbcType=VARCHAR},",
"batch_no = #{batchNo,jdbcType=VARCHAR},",
"batch_stock_num = #{batchStockNum,jdbcType=INTEGER},",
"start_id = #{startId,jdbcType=VARCHAR},",
"end_id = #{endId,jdbcType=VARCHAR},",
"`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(BsDiscountPkStockBatch record);
}

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

@ -0,0 +1,360 @@
package com.hfkj.dao;
import com.hfkj.entity.BsDiscountPkStockBatch;
import com.hfkj.entity.BsDiscountPkStockBatchExample.Criteria;
import com.hfkj.entity.BsDiscountPkStockBatchExample.Criterion;
import com.hfkj.entity.BsDiscountPkStockBatchExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsDiscountPkStockBatchSqlProvider {
public String countByExample(BsDiscountPkStockBatchExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_discount_pk_stock_batch");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsDiscountPkStockBatchExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_discount_pk_stock_batch");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsDiscountPkStockBatch record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_discount_pk_stock_batch");
if (record.getDiscountPkId() != null) {
sql.VALUES("discount_pk_id", "#{discountPkId,jdbcType=BIGINT}");
}
if (record.getDiscountPkNo() != null) {
sql.VALUES("discount_pk_no", "#{discountPkNo,jdbcType=VARCHAR}");
}
if (record.getDiscountPkName() != null) {
sql.VALUES("discount_pk_name", "#{discountPkName,jdbcType=VARCHAR}");
}
if (record.getBatchNo() != null) {
sql.VALUES("batch_no", "#{batchNo,jdbcType=VARCHAR}");
}
if (record.getBatchStockNum() != null) {
sql.VALUES("batch_stock_num", "#{batchStockNum,jdbcType=INTEGER}");
}
if (record.getStartId() != null) {
sql.VALUES("start_id", "#{startId,jdbcType=VARCHAR}");
}
if (record.getEndId() != null) {
sql.VALUES("end_id", "#{endId,jdbcType=VARCHAR}");
}
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(BsDiscountPkStockBatchExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("discount_pk_id");
sql.SELECT("discount_pk_no");
sql.SELECT("discount_pk_name");
sql.SELECT("batch_no");
sql.SELECT("batch_stock_num");
sql.SELECT("start_id");
sql.SELECT("end_id");
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_discount_pk_stock_batch");
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) {
BsDiscountPkStockBatch record = (BsDiscountPkStockBatch) parameter.get("record");
BsDiscountPkStockBatchExample example = (BsDiscountPkStockBatchExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_discount_pk_stock_batch");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getDiscountPkId() != null) {
sql.SET("discount_pk_id = #{record.discountPkId,jdbcType=BIGINT}");
}
if (record.getDiscountPkNo() != null) {
sql.SET("discount_pk_no = #{record.discountPkNo,jdbcType=VARCHAR}");
}
if (record.getDiscountPkName() != null) {
sql.SET("discount_pk_name = #{record.discountPkName,jdbcType=VARCHAR}");
}
if (record.getBatchNo() != null) {
sql.SET("batch_no = #{record.batchNo,jdbcType=VARCHAR}");
}
if (record.getBatchStockNum() != null) {
sql.SET("batch_stock_num = #{record.batchStockNum,jdbcType=INTEGER}");
}
if (record.getStartId() != null) {
sql.SET("start_id = #{record.startId,jdbcType=VARCHAR}");
}
if (record.getEndId() != null) {
sql.SET("end_id = #{record.endId,jdbcType=VARCHAR}");
}
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_discount_pk_stock_batch");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("discount_pk_id = #{record.discountPkId,jdbcType=BIGINT}");
sql.SET("discount_pk_no = #{record.discountPkNo,jdbcType=VARCHAR}");
sql.SET("discount_pk_name = #{record.discountPkName,jdbcType=VARCHAR}");
sql.SET("batch_no = #{record.batchNo,jdbcType=VARCHAR}");
sql.SET("batch_stock_num = #{record.batchStockNum,jdbcType=INTEGER}");
sql.SET("start_id = #{record.startId,jdbcType=VARCHAR}");
sql.SET("end_id = #{record.endId,jdbcType=VARCHAR}");
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}");
BsDiscountPkStockBatchExample example = (BsDiscountPkStockBatchExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsDiscountPkStockBatch record) {
SQL sql = new SQL();
sql.UPDATE("bs_discount_pk_stock_batch");
if (record.getDiscountPkId() != null) {
sql.SET("discount_pk_id = #{discountPkId,jdbcType=BIGINT}");
}
if (record.getDiscountPkNo() != null) {
sql.SET("discount_pk_no = #{discountPkNo,jdbcType=VARCHAR}");
}
if (record.getDiscountPkName() != null) {
sql.SET("discount_pk_name = #{discountPkName,jdbcType=VARCHAR}");
}
if (record.getBatchNo() != null) {
sql.SET("batch_no = #{batchNo,jdbcType=VARCHAR}");
}
if (record.getBatchStockNum() != null) {
sql.SET("batch_stock_num = #{batchStockNum,jdbcType=INTEGER}");
}
if (record.getStartId() != null) {
sql.SET("start_id = #{startId,jdbcType=VARCHAR}");
}
if (record.getEndId() != null) {
sql.SET("end_id = #{endId,jdbcType=VARCHAR}");
}
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, BsDiscountPkStockBatchExample 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,148 @@
package com.hfkj.dao;
import com.hfkj.entity.BsDiscountPkStockCode;
import com.hfkj.entity.BsDiscountPkStockCodeExample;
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 BsDiscountPkStockCodeMapper extends BsDiscountPkStockCodeMapperExt {
@SelectProvider(type=BsDiscountPkStockCodeSqlProvider.class, method="countByExample")
long countByExample(BsDiscountPkStockCodeExample example);
@DeleteProvider(type=BsDiscountPkStockCodeSqlProvider.class, method="deleteByExample")
int deleteByExample(BsDiscountPkStockCodeExample example);
@Delete({
"delete from bs_discount_pk_stock_code",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_discount_pk_stock_code (discount_pk_stock_batch_id, discount_pk_stock_batch_no, ",
"discount_pk_id, discount_pk_no, ",
"discount_pk_name, obtain_type, ",
"obtain_time, receive_mer_user_id, ",
"receive_mer_user_phone, `status`, ",
"agent_appid, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{discountPkStockBatchId,jdbcType=BIGINT}, #{discountPkStockBatchNo,jdbcType=VARCHAR}, ",
"#{discountPkId,jdbcType=BIGINT}, #{discountPkNo,jdbcType=VARCHAR}, ",
"#{discountPkName,jdbcType=VARCHAR}, #{obtainType,jdbcType=INTEGER}, ",
"#{obtainTime,jdbcType=TIMESTAMP}, #{receiveMerUserId,jdbcType=BIGINT}, ",
"#{receiveMerUserPhone,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{agentAppid,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsDiscountPkStockCode record);
@InsertProvider(type=BsDiscountPkStockCodeSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsDiscountPkStockCode record);
@SelectProvider(type=BsDiscountPkStockCodeSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="discount_pk_stock_batch_id", property="discountPkStockBatchId", jdbcType=JdbcType.BIGINT),
@Result(column="discount_pk_stock_batch_no", property="discountPkStockBatchNo", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_pk_id", property="discountPkId", jdbcType=JdbcType.BIGINT),
@Result(column="discount_pk_no", property="discountPkNo", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_pk_name", property="discountPkName", jdbcType=JdbcType.VARCHAR),
@Result(column="obtain_type", property="obtainType", jdbcType=JdbcType.INTEGER),
@Result(column="obtain_time", property="obtainTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="receive_mer_user_id", property="receiveMerUserId", jdbcType=JdbcType.BIGINT),
@Result(column="receive_mer_user_phone", property="receiveMerUserPhone", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="agent_appid", property="agentAppid", jdbcType=JdbcType.VARCHAR),
@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<BsDiscountPkStockCode> selectByExample(BsDiscountPkStockCodeExample example);
@Select({
"select",
"id, discount_pk_stock_batch_id, discount_pk_stock_batch_no, discount_pk_id, ",
"discount_pk_no, discount_pk_name, obtain_type, obtain_time, receive_mer_user_id, ",
"receive_mer_user_phone, `status`, agent_appid, create_time, update_time, ext_1, ",
"ext_2, ext_3",
"from bs_discount_pk_stock_code",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="discount_pk_stock_batch_id", property="discountPkStockBatchId", jdbcType=JdbcType.BIGINT),
@Result(column="discount_pk_stock_batch_no", property="discountPkStockBatchNo", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_pk_id", property="discountPkId", jdbcType=JdbcType.BIGINT),
@Result(column="discount_pk_no", property="discountPkNo", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_pk_name", property="discountPkName", jdbcType=JdbcType.VARCHAR),
@Result(column="obtain_type", property="obtainType", jdbcType=JdbcType.INTEGER),
@Result(column="obtain_time", property="obtainTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="receive_mer_user_id", property="receiveMerUserId", jdbcType=JdbcType.BIGINT),
@Result(column="receive_mer_user_phone", property="receiveMerUserPhone", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="agent_appid", property="agentAppid", jdbcType=JdbcType.VARCHAR),
@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)
})
BsDiscountPkStockCode selectByPrimaryKey(Long id);
@UpdateProvider(type=BsDiscountPkStockCodeSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsDiscountPkStockCode record, @Param("example") BsDiscountPkStockCodeExample example);
@UpdateProvider(type=BsDiscountPkStockCodeSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsDiscountPkStockCode record, @Param("example") BsDiscountPkStockCodeExample example);
@UpdateProvider(type=BsDiscountPkStockCodeSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsDiscountPkStockCode record);
@Update({
"update bs_discount_pk_stock_code",
"set discount_pk_stock_batch_id = #{discountPkStockBatchId,jdbcType=BIGINT},",
"discount_pk_stock_batch_no = #{discountPkStockBatchNo,jdbcType=VARCHAR},",
"discount_pk_id = #{discountPkId,jdbcType=BIGINT},",
"discount_pk_no = #{discountPkNo,jdbcType=VARCHAR},",
"discount_pk_name = #{discountPkName,jdbcType=VARCHAR},",
"obtain_type = #{obtainType,jdbcType=INTEGER},",
"obtain_time = #{obtainTime,jdbcType=TIMESTAMP},",
"receive_mer_user_id = #{receiveMerUserId,jdbcType=BIGINT},",
"receive_mer_user_phone = #{receiveMerUserPhone,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"agent_appid = #{agentAppid,jdbcType=VARCHAR},",
"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(BsDiscountPkStockCode record);
}

@ -0,0 +1,36 @@
package com.hfkj.dao;
import com.hfkj.entity.BsDiscountPkStockCode;
import com.hfkj.entity.BsDiscountStockCode;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* mapper扩展类
*/
public interface BsDiscountPkStockCodeMapperExt {
@Insert({"<script>" +
" insert into bs_discount_pk_stock_code (discount_pk_stock_batch_id, discount_pk_stock_batch_no," +
" discount_pk_id, discount_pk_no, discount_pk_name, `status`, create_time, update_time, ext_1, ext_2, ext_3) " +
" VALUES " +
" <foreach collection='list' item='item' index='index' separator=','>" +
" (#{item.discountPkStockBatchId}, " +
" #{item.discountPkStockBatchNo}," +
" #{item.discountPkId}," +
" #{item.discountPkNo}," +
" #{item.discountPkName}," +
" #{item.status}," +
" #{item.createTime}," +
" #{item.updateTime}," +
" #{item.ext1}," +
" #{item.ext2}, " +
" #{item.ext3})" +
" </foreach>" +
" </script>"})
@Options(useGeneratedKeys=true, keyProperty="id")
int insertList(@Param("list") List<BsDiscountPkStockCode> codeList);
}

@ -0,0 +1,402 @@
package com.hfkj.dao;
import com.hfkj.entity.BsDiscountPkStockCode;
import com.hfkj.entity.BsDiscountPkStockCodeExample.Criteria;
import com.hfkj.entity.BsDiscountPkStockCodeExample.Criterion;
import com.hfkj.entity.BsDiscountPkStockCodeExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsDiscountPkStockCodeSqlProvider {
public String countByExample(BsDiscountPkStockCodeExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_discount_pk_stock_code");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsDiscountPkStockCodeExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_discount_pk_stock_code");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsDiscountPkStockCode record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_discount_pk_stock_code");
if (record.getDiscountPkStockBatchId() != null) {
sql.VALUES("discount_pk_stock_batch_id", "#{discountPkStockBatchId,jdbcType=BIGINT}");
}
if (record.getDiscountPkStockBatchNo() != null) {
sql.VALUES("discount_pk_stock_batch_no", "#{discountPkStockBatchNo,jdbcType=VARCHAR}");
}
if (record.getDiscountPkId() != null) {
sql.VALUES("discount_pk_id", "#{discountPkId,jdbcType=BIGINT}");
}
if (record.getDiscountPkNo() != null) {
sql.VALUES("discount_pk_no", "#{discountPkNo,jdbcType=VARCHAR}");
}
if (record.getDiscountPkName() != null) {
sql.VALUES("discount_pk_name", "#{discountPkName,jdbcType=VARCHAR}");
}
if (record.getObtainType() != null) {
sql.VALUES("obtain_type", "#{obtainType,jdbcType=INTEGER}");
}
if (record.getObtainTime() != null) {
sql.VALUES("obtain_time", "#{obtainTime,jdbcType=TIMESTAMP}");
}
if (record.getReceiveMerUserId() != null) {
sql.VALUES("receive_mer_user_id", "#{receiveMerUserId,jdbcType=BIGINT}");
}
if (record.getReceiveMerUserPhone() != null) {
sql.VALUES("receive_mer_user_phone", "#{receiveMerUserPhone,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getAgentAppid() != null) {
sql.VALUES("agent_appid", "#{agentAppid,jdbcType=VARCHAR}");
}
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(BsDiscountPkStockCodeExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("discount_pk_stock_batch_id");
sql.SELECT("discount_pk_stock_batch_no");
sql.SELECT("discount_pk_id");
sql.SELECT("discount_pk_no");
sql.SELECT("discount_pk_name");
sql.SELECT("obtain_type");
sql.SELECT("obtain_time");
sql.SELECT("receive_mer_user_id");
sql.SELECT("receive_mer_user_phone");
sql.SELECT("`status`");
sql.SELECT("agent_appid");
sql.SELECT("create_time");
sql.SELECT("update_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("bs_discount_pk_stock_code");
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) {
BsDiscountPkStockCode record = (BsDiscountPkStockCode) parameter.get("record");
BsDiscountPkStockCodeExample example = (BsDiscountPkStockCodeExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_discount_pk_stock_code");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getDiscountPkStockBatchId() != null) {
sql.SET("discount_pk_stock_batch_id = #{record.discountPkStockBatchId,jdbcType=BIGINT}");
}
if (record.getDiscountPkStockBatchNo() != null) {
sql.SET("discount_pk_stock_batch_no = #{record.discountPkStockBatchNo,jdbcType=VARCHAR}");
}
if (record.getDiscountPkId() != null) {
sql.SET("discount_pk_id = #{record.discountPkId,jdbcType=BIGINT}");
}
if (record.getDiscountPkNo() != null) {
sql.SET("discount_pk_no = #{record.discountPkNo,jdbcType=VARCHAR}");
}
if (record.getDiscountPkName() != null) {
sql.SET("discount_pk_name = #{record.discountPkName,jdbcType=VARCHAR}");
}
if (record.getObtainType() != null) {
sql.SET("obtain_type = #{record.obtainType,jdbcType=INTEGER}");
}
if (record.getObtainTime() != null) {
sql.SET("obtain_time = #{record.obtainTime,jdbcType=TIMESTAMP}");
}
if (record.getReceiveMerUserId() != null) {
sql.SET("receive_mer_user_id = #{record.receiveMerUserId,jdbcType=BIGINT}");
}
if (record.getReceiveMerUserPhone() != null) {
sql.SET("receive_mer_user_phone = #{record.receiveMerUserPhone,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getAgentAppid() != null) {
sql.SET("agent_appid = #{record.agentAppid,jdbcType=VARCHAR}");
}
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_discount_pk_stock_code");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("discount_pk_stock_batch_id = #{record.discountPkStockBatchId,jdbcType=BIGINT}");
sql.SET("discount_pk_stock_batch_no = #{record.discountPkStockBatchNo,jdbcType=VARCHAR}");
sql.SET("discount_pk_id = #{record.discountPkId,jdbcType=BIGINT}");
sql.SET("discount_pk_no = #{record.discountPkNo,jdbcType=VARCHAR}");
sql.SET("discount_pk_name = #{record.discountPkName,jdbcType=VARCHAR}");
sql.SET("obtain_type = #{record.obtainType,jdbcType=INTEGER}");
sql.SET("obtain_time = #{record.obtainTime,jdbcType=TIMESTAMP}");
sql.SET("receive_mer_user_id = #{record.receiveMerUserId,jdbcType=BIGINT}");
sql.SET("receive_mer_user_phone = #{record.receiveMerUserPhone,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("agent_appid = #{record.agentAppid,jdbcType=VARCHAR}");
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}");
BsDiscountPkStockCodeExample example = (BsDiscountPkStockCodeExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsDiscountPkStockCode record) {
SQL sql = new SQL();
sql.UPDATE("bs_discount_pk_stock_code");
if (record.getDiscountPkStockBatchId() != null) {
sql.SET("discount_pk_stock_batch_id = #{discountPkStockBatchId,jdbcType=BIGINT}");
}
if (record.getDiscountPkStockBatchNo() != null) {
sql.SET("discount_pk_stock_batch_no = #{discountPkStockBatchNo,jdbcType=VARCHAR}");
}
if (record.getDiscountPkId() != null) {
sql.SET("discount_pk_id = #{discountPkId,jdbcType=BIGINT}");
}
if (record.getDiscountPkNo() != null) {
sql.SET("discount_pk_no = #{discountPkNo,jdbcType=VARCHAR}");
}
if (record.getDiscountPkName() != null) {
sql.SET("discount_pk_name = #{discountPkName,jdbcType=VARCHAR}");
}
if (record.getObtainType() != null) {
sql.SET("obtain_type = #{obtainType,jdbcType=INTEGER}");
}
if (record.getObtainTime() != null) {
sql.SET("obtain_time = #{obtainTime,jdbcType=TIMESTAMP}");
}
if (record.getReceiveMerUserId() != null) {
sql.SET("receive_mer_user_id = #{receiveMerUserId,jdbcType=BIGINT}");
}
if (record.getReceiveMerUserPhone() != null) {
sql.SET("receive_mer_user_phone = #{receiveMerUserPhone,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getAgentAppid() != null) {
sql.SET("agent_appid = #{agentAppid,jdbcType=VARCHAR}");
}
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, BsDiscountPkStockCodeExample 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());
}
}
}

@ -88,6 +88,10 @@ public class BsDiscountSqlProvider {
sql.VALUES("create_user_name", "#{createUserName,jdbcType=VARCHAR}");
}
if (record.getCreateUserMerNo() != null) {
sql.VALUES("create_user_mer_no", "#{createUserMerNo,jdbcType=VARCHAR}");
}
if (record.getUpdateTime() != null) {
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}");
}
@ -129,6 +133,7 @@ public class BsDiscountSqlProvider {
sql.SELECT("create_user_type");
sql.SELECT("create_user_id");
sql.SELECT("create_user_name");
sql.SELECT("create_user_mer_no");
sql.SELECT("update_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
@ -214,6 +219,10 @@ public class BsDiscountSqlProvider {
sql.SET("create_user_name = #{record.createUserName,jdbcType=VARCHAR}");
}
if (record.getCreateUserMerNo() != null) {
sql.SET("create_user_mer_no = #{record.createUserMerNo,jdbcType=VARCHAR}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
}
@ -254,6 +263,7 @@ public class BsDiscountSqlProvider {
sql.SET("create_user_type = #{record.createUserType,jdbcType=INTEGER}");
sql.SET("create_user_id = #{record.createUserId,jdbcType=BIGINT}");
sql.SET("create_user_name = #{record.createUserName,jdbcType=VARCHAR}");
sql.SET("create_user_mer_no = #{record.createUserMerNo,jdbcType=VARCHAR}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
@ -328,6 +338,10 @@ public class BsDiscountSqlProvider {
sql.SET("create_user_name = #{createUserName,jdbcType=VARCHAR}");
}
if (record.getCreateUserMerNo() != null) {
sql.SET("create_user_mer_no = #{createUserMerNo,jdbcType=VARCHAR}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}");
}

@ -44,17 +44,21 @@ public interface BsDiscountStockCodeMapper extends BsDiscountStockCodeMapperExt
"discount_name, obtain_type, ",
"obtain_time, receive_mer_user_id, ",
"receive_mer_user_phone, use_time, ",
"`status`, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"`status`, discount_pk_stock_code, ",
"discount_pk_id, discount_pk_no, ",
"discount_pk_name, agent_appid, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{discountStockBatchId,jdbcType=BIGINT}, #{discountStockBatchNo,jdbcType=VARCHAR}, ",
"#{discountId,jdbcType=BIGINT}, #{discountNo,jdbcType=VARCHAR}, ",
"#{discountName,jdbcType=VARCHAR}, #{obtainType,jdbcType=INTEGER}, ",
"#{obtainTime,jdbcType=TIMESTAMP}, #{receiveMerUserId,jdbcType=BIGINT}, ",
"#{receiveMerUserPhone,jdbcType=VARCHAR}, #{useTime,jdbcType=TIMESTAMP}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{status,jdbcType=INTEGER}, #{discountPkStockCode,jdbcType=BIGINT}, ",
"#{discountPkId,jdbcType=BIGINT}, #{discountPkNo,jdbcType=VARCHAR}, ",
"#{discountPkName,jdbcType=VARCHAR}, #{agentAppid,jdbcType=VARCHAR}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsDiscountStockCode record);
@ -77,6 +81,11 @@ public interface BsDiscountStockCodeMapper extends BsDiscountStockCodeMapperExt
@Result(column="receive_mer_user_phone", property="receiveMerUserPhone", jdbcType=JdbcType.VARCHAR),
@Result(column="use_time", property="useTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="discount_pk_stock_code", property="discountPkStockCode", jdbcType=JdbcType.BIGINT),
@Result(column="discount_pk_id", property="discountPkId", jdbcType=JdbcType.BIGINT),
@Result(column="discount_pk_no", property="discountPkNo", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_pk_name", property="discountPkName", jdbcType=JdbcType.VARCHAR),
@Result(column="agent_appid", property="agentAppid", jdbcType=JdbcType.VARCHAR),
@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),
@ -89,7 +98,8 @@ public interface BsDiscountStockCodeMapper extends BsDiscountStockCodeMapperExt
"select",
"id, discount_stock_batch_id, discount_stock_batch_no, discount_id, discount_no, ",
"discount_name, obtain_type, obtain_time, receive_mer_user_id, receive_mer_user_phone, ",
"use_time, `status`, create_time, update_time, ext_1, ext_2, ext_3",
"use_time, `status`, discount_pk_stock_code, discount_pk_id, discount_pk_no, ",
"discount_pk_name, agent_appid, create_time, update_time, ext_1, ext_2, ext_3",
"from bs_discount_stock_code",
"where id = #{id,jdbcType=BIGINT}"
})
@ -106,6 +116,11 @@ public interface BsDiscountStockCodeMapper extends BsDiscountStockCodeMapperExt
@Result(column="receive_mer_user_phone", property="receiveMerUserPhone", jdbcType=JdbcType.VARCHAR),
@Result(column="use_time", property="useTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="discount_pk_stock_code", property="discountPkStockCode", jdbcType=JdbcType.BIGINT),
@Result(column="discount_pk_id", property="discountPkId", jdbcType=JdbcType.BIGINT),
@Result(column="discount_pk_no", property="discountPkNo", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_pk_name", property="discountPkName", jdbcType=JdbcType.VARCHAR),
@Result(column="agent_appid", property="agentAppid", jdbcType=JdbcType.VARCHAR),
@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),
@ -136,6 +151,11 @@ public interface BsDiscountStockCodeMapper extends BsDiscountStockCodeMapperExt
"receive_mer_user_phone = #{receiveMerUserPhone,jdbcType=VARCHAR},",
"use_time = #{useTime,jdbcType=TIMESTAMP},",
"`status` = #{status,jdbcType=INTEGER},",
"discount_pk_stock_code = #{discountPkStockCode,jdbcType=BIGINT},",
"discount_pk_id = #{discountPkId,jdbcType=BIGINT},",
"discount_pk_no = #{discountPkNo,jdbcType=VARCHAR},",
"discount_pk_name = #{discountPkName,jdbcType=VARCHAR},",
"agent_appid = #{agentAppid,jdbcType=VARCHAR},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",

@ -72,6 +72,26 @@ public class BsDiscountStockCodeSqlProvider {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getDiscountPkStockCode() != null) {
sql.VALUES("discount_pk_stock_code", "#{discountPkStockCode,jdbcType=BIGINT}");
}
if (record.getDiscountPkId() != null) {
sql.VALUES("discount_pk_id", "#{discountPkId,jdbcType=BIGINT}");
}
if (record.getDiscountPkNo() != null) {
sql.VALUES("discount_pk_no", "#{discountPkNo,jdbcType=VARCHAR}");
}
if (record.getDiscountPkName() != null) {
sql.VALUES("discount_pk_name", "#{discountPkName,jdbcType=VARCHAR}");
}
if (record.getAgentAppid() != null) {
sql.VALUES("agent_appid", "#{agentAppid,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
@ -113,6 +133,11 @@ public class BsDiscountStockCodeSqlProvider {
sql.SELECT("receive_mer_user_phone");
sql.SELECT("use_time");
sql.SELECT("`status`");
sql.SELECT("discount_pk_stock_code");
sql.SELECT("discount_pk_id");
sql.SELECT("discount_pk_no");
sql.SELECT("discount_pk_name");
sql.SELECT("agent_appid");
sql.SELECT("create_time");
sql.SELECT("update_time");
sql.SELECT("ext_1");
@ -183,6 +208,26 @@ public class BsDiscountStockCodeSqlProvider {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getDiscountPkStockCode() != null) {
sql.SET("discount_pk_stock_code = #{record.discountPkStockCode,jdbcType=BIGINT}");
}
if (record.getDiscountPkId() != null) {
sql.SET("discount_pk_id = #{record.discountPkId,jdbcType=BIGINT}");
}
if (record.getDiscountPkNo() != null) {
sql.SET("discount_pk_no = #{record.discountPkNo,jdbcType=VARCHAR}");
}
if (record.getDiscountPkName() != null) {
sql.SET("discount_pk_name = #{record.discountPkName,jdbcType=VARCHAR}");
}
if (record.getAgentAppid() != null) {
sql.SET("agent_appid = #{record.agentAppid,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
@ -223,6 +268,11 @@ public class BsDiscountStockCodeSqlProvider {
sql.SET("receive_mer_user_phone = #{record.receiveMerUserPhone,jdbcType=VARCHAR}");
sql.SET("use_time = #{record.useTime,jdbcType=TIMESTAMP}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("discount_pk_stock_code = #{record.discountPkStockCode,jdbcType=BIGINT}");
sql.SET("discount_pk_id = #{record.discountPkId,jdbcType=BIGINT}");
sql.SET("discount_pk_no = #{record.discountPkNo,jdbcType=VARCHAR}");
sql.SET("discount_pk_name = #{record.discountPkName,jdbcType=VARCHAR}");
sql.SET("agent_appid = #{record.agentAppid,jdbcType=VARCHAR}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
@ -282,6 +332,26 @@ public class BsDiscountStockCodeSqlProvider {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getDiscountPkStockCode() != null) {
sql.SET("discount_pk_stock_code = #{discountPkStockCode,jdbcType=BIGINT}");
}
if (record.getDiscountPkId() != null) {
sql.SET("discount_pk_id = #{discountPkId,jdbcType=BIGINT}");
}
if (record.getDiscountPkNo() != null) {
sql.SET("discount_pk_no = #{discountPkNo,jdbcType=VARCHAR}");
}
if (record.getDiscountPkName() != null) {
sql.SET("discount_pk_name = #{discountPkName,jdbcType=VARCHAR}");
}
if (record.getAgentAppid() != null) {
sql.SET("agent_appid = #{agentAppid,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}

@ -45,18 +45,18 @@ public interface BsDiscountUserMapper extends BsDiscountUserMapperExt {
"discount_condition, discount_price, ",
"discount_stock_code, use_scope, ",
"use_date, expiration_date, ",
"`status`, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"agent_appid, `status`, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{userId,jdbcType=BIGINT}, #{userPhone,jdbcType=VARCHAR}, ",
"#{discountId,jdbcType=BIGINT}, #{discountNo,jdbcType=VARCHAR}, ",
"#{discountName,jdbcType=VARCHAR}, #{discountType,jdbcType=INTEGER}, ",
"#{discountCondition,jdbcType=DECIMAL}, #{discountPrice,jdbcType=DECIMAL}, ",
"#{discountStockCode,jdbcType=BIGINT}, #{useScope,jdbcType=VARCHAR}, ",
"#{useDate,jdbcType=TIMESTAMP}, #{expirationDate,jdbcType=TIMESTAMP}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{agentAppid,jdbcType=VARCHAR}, #{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(BsDiscountUser record);
@ -80,6 +80,7 @@ public interface BsDiscountUserMapper extends BsDiscountUserMapperExt {
@Result(column="use_scope", property="useScope", jdbcType=JdbcType.VARCHAR),
@Result(column="use_date", property="useDate", jdbcType=JdbcType.TIMESTAMP),
@Result(column="expiration_date", property="expirationDate", jdbcType=JdbcType.TIMESTAMP),
@Result(column="agent_appid", property="agentAppid", jdbcType=JdbcType.VARCHAR),
@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),
@ -93,7 +94,8 @@ public interface BsDiscountUserMapper extends BsDiscountUserMapperExt {
"select",
"id, user_id, user_phone, discount_id, discount_no, discount_name, discount_type, ",
"discount_condition, discount_price, discount_stock_code, use_scope, use_date, ",
"expiration_date, `status`, create_time, update_time, ext_1, ext_2, ext_3",
"expiration_date, agent_appid, `status`, create_time, update_time, ext_1, ext_2, ",
"ext_3",
"from bs_discount_user",
"where id = #{id,jdbcType=BIGINT}"
})
@ -111,6 +113,7 @@ public interface BsDiscountUserMapper extends BsDiscountUserMapperExt {
@Result(column="use_scope", property="useScope", jdbcType=JdbcType.VARCHAR),
@Result(column="use_date", property="useDate", jdbcType=JdbcType.TIMESTAMP),
@Result(column="expiration_date", property="expirationDate", jdbcType=JdbcType.TIMESTAMP),
@Result(column="agent_appid", property="agentAppid", jdbcType=JdbcType.VARCHAR),
@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),
@ -143,6 +146,7 @@ public interface BsDiscountUserMapper extends BsDiscountUserMapperExt {
"use_scope = #{useScope,jdbcType=VARCHAR},",
"use_date = #{useDate,jdbcType=TIMESTAMP},",
"expiration_date = #{expirationDate,jdbcType=TIMESTAMP},",
"agent_appid = #{agentAppid,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",

@ -3,6 +3,7 @@ package com.hfkj.dao;
import com.hfkj.model.DiscountUserModel;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List;
import java.util.Map;
@ -15,6 +16,7 @@ public interface BsDiscountUserMapperExt {
@Select({"" +
"<script>" +
" select" +
" id," +
" user_id userId," +
" discount_id discountId," +
" discount_no discountNo," +
@ -37,4 +39,7 @@ public interface BsDiscountUserMapperExt {
" <if test='param.useMerNo != null'> and discount_id in (select discount_id from bs_discount_use_mer where mer_no = #{param.useMerNo} GROUP BY discount_id) </if>" +
"</script>"})
List<DiscountUserModel> queryUserDiscountList(@Param("param") Map<String,Object> param);
@Update("<script>update bs_discount_user SET `status` = 3 where `status` = 1 <![CDATA[ and expiration_date <= NOW() ]]></script>")
void expiration();
}

@ -76,6 +76,10 @@ public class BsDiscountUserSqlProvider {
sql.VALUES("expiration_date", "#{expirationDate,jdbcType=TIMESTAMP}");
}
if (record.getAgentAppid() != null) {
sql.VALUES("agent_appid", "#{agentAppid,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
@ -122,6 +126,7 @@ public class BsDiscountUserSqlProvider {
sql.SELECT("use_scope");
sql.SELECT("use_date");
sql.SELECT("expiration_date");
sql.SELECT("agent_appid");
sql.SELECT("`status`");
sql.SELECT("create_time");
sql.SELECT("update_time");
@ -197,6 +202,10 @@ public class BsDiscountUserSqlProvider {
sql.SET("expiration_date = #{record.expirationDate,jdbcType=TIMESTAMP}");
}
if (record.getAgentAppid() != null) {
sql.SET("agent_appid = #{record.agentAppid,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
@ -242,6 +251,7 @@ public class BsDiscountUserSqlProvider {
sql.SET("use_scope = #{record.useScope,jdbcType=VARCHAR}");
sql.SET("use_date = #{record.useDate,jdbcType=TIMESTAMP}");
sql.SET("expiration_date = #{record.expirationDate,jdbcType=TIMESTAMP}");
sql.SET("agent_appid = #{record.agentAppid,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
@ -306,6 +316,10 @@ public class BsDiscountUserSqlProvider {
sql.SET("expiration_date = #{expirationDate,jdbcType=TIMESTAMP}");
}
if (record.getAgentAppid() != null) {
sql.SET("agent_appid = #{agentAppid,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}

@ -44,4 +44,40 @@ public interface BsMerchantMapperExt {
@Param("gasName") String gasName,
@Param("distanceLimit") Integer distanceLimit,
@Param("listShow") Boolean listShow);
@Select("<script>" +
" select * from (SELECT" +
" b.mer_no merNo," +
" b.mer_name merName," +
" b.address," +
" b.longitude," +
" b.latitude," +
" round(ST_Distance_Sphere(" +
" point(#{longitude}, #{latitude})," +
" point(b.longitude, b.latitude)" +
" ) / 1000, 2) as distance," +
" a.oil_no oilNo," +
" a.price_official priceOfficial," +
" a.price_gun priceGun," +
" a.price_vip priceVip," +
" a.gas_station_drop gasStationDrop," +
" b.list_show listShow" +
" FROM" +
" bs_gas_oil_price a" +
" LEFT JOIN bs_merchant b on b.id = a.mer_id" +
" where a.oil_no = #{oilNo} and a.`status` = 1" +
" and a.mer_id in (select mer_id from bs_discount_use_mer where discount_no = #{discountNo}) " +
" ORDER BY distance asc) a where 1 = 1" +
"<if test='gasName != null'> and a.merName like concat('%',#{gasName},'%') </if>" +
"<if test='distanceLimit != null'> <![CDATA[ and a.distance <= #{distanceLimit} ]]> </if>" +
"<if test='distanceLimit != null'> <![CDATA[ and a.distance <= #{distanceLimit} ]]> </if>" +
"<if test='listShow != null'> and a.listShow = #{listShow} </if>" +
"</script>")
List<GasListModel> queryGasListByDiscount(@Param("discountNo") String discountNo,
@Param("longitude") String longitude,
@Param("latitude") String latitude,
@Param("oilNo") String oilNo,
@Param("gasName") String gasName,
@Param("distanceLimit") Integer distanceLimit,
@Param("listShow") Boolean listShow);
}

@ -0,0 +1,165 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.util.Date;
/**
* bs_agent_api_log
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsAgentApiLog implements Serializable {
private Long id;
/**
* 代理商接入appid
*/
private String appId;
/**
* 请求id
*/
private String requestId;
/**
* 请求地址
*/
private String requestUrl;
/**
* 创建时间
*/
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 String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
public String getRequestId() {
return requestId;
}
public void setRequestId(String requestId) {
this.requestId = requestId;
}
public String getRequestUrl() {
return requestUrl;
}
public void setRequestUrl(String requestUrl) {
this.requestUrl = requestUrl;
}
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;
}
BsAgentApiLog other = (BsAgentApiLog) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getAppId() == null ? other.getAppId() == null : this.getAppId().equals(other.getAppId()))
&& (this.getRequestId() == null ? other.getRequestId() == null : this.getRequestId().equals(other.getRequestId()))
&& (this.getRequestUrl() == null ? other.getRequestUrl() == null : this.getRequestUrl().equals(other.getRequestUrl()))
&& (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 + ((getAppId() == null) ? 0 : getAppId().hashCode());
result = prime * result + ((getRequestId() == null) ? 0 : getRequestId().hashCode());
result = prime * result + ((getRequestUrl() == null) ? 0 : getRequestUrl().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(", appId=").append(appId);
sb.append(", requestId=").append(requestId);
sb.append(", requestUrl=").append(requestUrl);
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,763 @@
package com.hfkj.entity;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class BsAgentApiLogExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
private Integer limit;
private Long offset;
public BsAgentApiLogExample() {
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 andAppIdIsNull() {
addCriterion("app_id is null");
return (Criteria) this;
}
public Criteria andAppIdIsNotNull() {
addCriterion("app_id is not null");
return (Criteria) this;
}
public Criteria andAppIdEqualTo(String value) {
addCriterion("app_id =", value, "appId");
return (Criteria) this;
}
public Criteria andAppIdNotEqualTo(String value) {
addCriterion("app_id <>", value, "appId");
return (Criteria) this;
}
public Criteria andAppIdGreaterThan(String value) {
addCriterion("app_id >", value, "appId");
return (Criteria) this;
}
public Criteria andAppIdGreaterThanOrEqualTo(String value) {
addCriterion("app_id >=", value, "appId");
return (Criteria) this;
}
public Criteria andAppIdLessThan(String value) {
addCriterion("app_id <", value, "appId");
return (Criteria) this;
}
public Criteria andAppIdLessThanOrEqualTo(String value) {
addCriterion("app_id <=", value, "appId");
return (Criteria) this;
}
public Criteria andAppIdLike(String value) {
addCriterion("app_id like", value, "appId");
return (Criteria) this;
}
public Criteria andAppIdNotLike(String value) {
addCriterion("app_id not like", value, "appId");
return (Criteria) this;
}
public Criteria andAppIdIn(List<String> values) {
addCriterion("app_id in", values, "appId");
return (Criteria) this;
}
public Criteria andAppIdNotIn(List<String> values) {
addCriterion("app_id not in", values, "appId");
return (Criteria) this;
}
public Criteria andAppIdBetween(String value1, String value2) {
addCriterion("app_id between", value1, value2, "appId");
return (Criteria) this;
}
public Criteria andAppIdNotBetween(String value1, String value2) {
addCriterion("app_id not between", value1, value2, "appId");
return (Criteria) this;
}
public Criteria andRequestIdIsNull() {
addCriterion("request_id is null");
return (Criteria) this;
}
public Criteria andRequestIdIsNotNull() {
addCriterion("request_id is not null");
return (Criteria) this;
}
public Criteria andRequestIdEqualTo(String value) {
addCriterion("request_id =", value, "requestId");
return (Criteria) this;
}
public Criteria andRequestIdNotEqualTo(String value) {
addCriterion("request_id <>", value, "requestId");
return (Criteria) this;
}
public Criteria andRequestIdGreaterThan(String value) {
addCriterion("request_id >", value, "requestId");
return (Criteria) this;
}
public Criteria andRequestIdGreaterThanOrEqualTo(String value) {
addCriterion("request_id >=", value, "requestId");
return (Criteria) this;
}
public Criteria andRequestIdLessThan(String value) {
addCriterion("request_id <", value, "requestId");
return (Criteria) this;
}
public Criteria andRequestIdLessThanOrEqualTo(String value) {
addCriterion("request_id <=", value, "requestId");
return (Criteria) this;
}
public Criteria andRequestIdLike(String value) {
addCriterion("request_id like", value, "requestId");
return (Criteria) this;
}
public Criteria andRequestIdNotLike(String value) {
addCriterion("request_id not like", value, "requestId");
return (Criteria) this;
}
public Criteria andRequestIdIn(List<String> values) {
addCriterion("request_id in", values, "requestId");
return (Criteria) this;
}
public Criteria andRequestIdNotIn(List<String> values) {
addCriterion("request_id not in", values, "requestId");
return (Criteria) this;
}
public Criteria andRequestIdBetween(String value1, String value2) {
addCriterion("request_id between", value1, value2, "requestId");
return (Criteria) this;
}
public Criteria andRequestIdNotBetween(String value1, String value2) {
addCriterion("request_id not between", value1, value2, "requestId");
return (Criteria) this;
}
public Criteria andRequestUrlIsNull() {
addCriterion("request_url is null");
return (Criteria) this;
}
public Criteria andRequestUrlIsNotNull() {
addCriterion("request_url is not null");
return (Criteria) this;
}
public Criteria andRequestUrlEqualTo(String value) {
addCriterion("request_url =", value, "requestUrl");
return (Criteria) this;
}
public Criteria andRequestUrlNotEqualTo(String value) {
addCriterion("request_url <>", value, "requestUrl");
return (Criteria) this;
}
public Criteria andRequestUrlGreaterThan(String value) {
addCriterion("request_url >", value, "requestUrl");
return (Criteria) this;
}
public Criteria andRequestUrlGreaterThanOrEqualTo(String value) {
addCriterion("request_url >=", value, "requestUrl");
return (Criteria) this;
}
public Criteria andRequestUrlLessThan(String value) {
addCriterion("request_url <", value, "requestUrl");
return (Criteria) this;
}
public Criteria andRequestUrlLessThanOrEqualTo(String value) {
addCriterion("request_url <=", value, "requestUrl");
return (Criteria) this;
}
public Criteria andRequestUrlLike(String value) {
addCriterion("request_url like", value, "requestUrl");
return (Criteria) this;
}
public Criteria andRequestUrlNotLike(String value) {
addCriterion("request_url not like", value, "requestUrl");
return (Criteria) this;
}
public Criteria andRequestUrlIn(List<String> values) {
addCriterion("request_url in", values, "requestUrl");
return (Criteria) this;
}
public Criteria andRequestUrlNotIn(List<String> values) {
addCriterion("request_url not in", values, "requestUrl");
return (Criteria) this;
}
public Criteria andRequestUrlBetween(String value1, String value2) {
addCriterion("request_url between", value1, value2, "requestUrl");
return (Criteria) this;
}
public Criteria andRequestUrlNotBetween(String value1, String value2) {
addCriterion("request_url not between", value1, value2, "requestUrl");
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,107 @@
package com.hfkj.entity;
import java.io.Serializable;
/**
* bs_agent_api_log
* @author
*/
public class BsAgentApiLogWithBLOBs extends BsAgentApiLog implements Serializable {
/**
* 请求参数
*/
private String requestParam;
/**
* 响应参数
*/
private String responseParam;
/**
* 错误内容
*/
private String errorContent;
private static final long serialVersionUID = 1L;
public String getRequestParam() {
return requestParam;
}
public void setRequestParam(String requestParam) {
this.requestParam = requestParam;
}
public String getResponseParam() {
return responseParam;
}
public void setResponseParam(String responseParam) {
this.responseParam = responseParam;
}
public String getErrorContent() {
return errorContent;
}
public void setErrorContent(String errorContent) {
this.errorContent = errorContent;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
BsAgentApiLogWithBLOBs other = (BsAgentApiLogWithBLOBs) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getAppId() == null ? other.getAppId() == null : this.getAppId().equals(other.getAppId()))
&& (this.getRequestId() == null ? other.getRequestId() == null : this.getRequestId().equals(other.getRequestId()))
&& (this.getRequestUrl() == null ? other.getRequestUrl() == null : this.getRequestUrl().equals(other.getRequestUrl()))
&& (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()))
&& (this.getRequestParam() == null ? other.getRequestParam() == null : this.getRequestParam().equals(other.getRequestParam()))
&& (this.getResponseParam() == null ? other.getResponseParam() == null : this.getResponseParam().equals(other.getResponseParam()))
&& (this.getErrorContent() == null ? other.getErrorContent() == null : this.getErrorContent().equals(other.getErrorContent()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getAppId() == null) ? 0 : getAppId().hashCode());
result = prime * result + ((getRequestId() == null) ? 0 : getRequestId().hashCode());
result = prime * result + ((getRequestUrl() == null) ? 0 : getRequestUrl().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());
result = prime * result + ((getRequestParam() == null) ? 0 : getRequestParam().hashCode());
result = prime * result + ((getResponseParam() == null) ? 0 : getResponseParam().hashCode());
result = prime * result + ((getErrorContent() == null) ? 0 : getErrorContent().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", requestParam=").append(requestParam);
sb.append(", responseParam=").append(responseParam);
sb.append(", errorContent=").append(errorContent);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

@ -0,0 +1,229 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.util.Date;
/**
* bs_agent_discount
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsAgentDiscount implements Serializable {
private Long id;
/**
* 代理商id
*/
private Long agentId;
/**
* 类型 1优惠券 2优惠券编号
*/
private Integer type;
/**
* 类型对象id
*/
private Long objectId;
/**
* 类型对象编码
*/
private String objectNo;
/**
* 类型对象名称
*/
private String objectName;
/**
* 状态 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 getAgentId() {
return agentId;
}
public void setAgentId(Long agentId) {
this.agentId = agentId;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Long getObjectId() {
return objectId;
}
public void setObjectId(Long objectId) {
this.objectId = objectId;
}
public String getObjectNo() {
return objectNo;
}
public void setObjectNo(String objectNo) {
this.objectNo = objectNo;
}
public String getObjectName() {
return objectName;
}
public void setObjectName(String objectName) {
this.objectName = objectName;
}
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;
}
BsAgentDiscount other = (BsAgentDiscount) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getAgentId() == null ? other.getAgentId() == null : this.getAgentId().equals(other.getAgentId()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getObjectId() == null ? other.getObjectId() == null : this.getObjectId().equals(other.getObjectId()))
&& (this.getObjectNo() == null ? other.getObjectNo() == null : this.getObjectNo().equals(other.getObjectNo()))
&& (this.getObjectName() == null ? other.getObjectName() == null : this.getObjectName().equals(other.getObjectName()))
&& (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 + ((getAgentId() == null) ? 0 : getAgentId().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getObjectId() == null) ? 0 : getObjectId().hashCode());
result = prime * result + ((getObjectNo() == null) ? 0 : getObjectNo().hashCode());
result = prime * result + ((getObjectName() == null) ? 0 : getObjectName().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(", agentId=").append(agentId);
sb.append(", type=").append(type);
sb.append(", objectId=").append(objectId);
sb.append(", objectNo=").append(objectNo);
sb.append(", objectName=").append(objectName);
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,993 @@
package com.hfkj.entity;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class BsAgentDiscountExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
private Integer limit;
private Long offset;
public BsAgentDiscountExample() {
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 andAgentIdIsNull() {
addCriterion("agent_id is null");
return (Criteria) this;
}
public Criteria andAgentIdIsNotNull() {
addCriterion("agent_id is not null");
return (Criteria) this;
}
public Criteria andAgentIdEqualTo(Long value) {
addCriterion("agent_id =", value, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdNotEqualTo(Long value) {
addCriterion("agent_id <>", value, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdGreaterThan(Long value) {
addCriterion("agent_id >", value, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdGreaterThanOrEqualTo(Long value) {
addCriterion("agent_id >=", value, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdLessThan(Long value) {
addCriterion("agent_id <", value, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdLessThanOrEqualTo(Long value) {
addCriterion("agent_id <=", value, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdIn(List<Long> values) {
addCriterion("agent_id in", values, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdNotIn(List<Long> values) {
addCriterion("agent_id not in", values, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdBetween(Long value1, Long value2) {
addCriterion("agent_id between", value1, value2, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdNotBetween(Long value1, Long value2) {
addCriterion("agent_id not between", value1, value2, "agentId");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("`type` is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("`type` is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(Integer value) {
addCriterion("`type` =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(Integer value) {
addCriterion("`type` <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(Integer value) {
addCriterion("`type` >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("`type` >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(Integer value) {
addCriterion("`type` <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(Integer value) {
addCriterion("`type` <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<Integer> values) {
addCriterion("`type` in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<Integer> values) {
addCriterion("`type` not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(Integer value1, Integer value2) {
addCriterion("`type` between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(Integer value1, Integer value2) {
addCriterion("`type` not between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andObjectIdIsNull() {
addCriterion("object_id is null");
return (Criteria) this;
}
public Criteria andObjectIdIsNotNull() {
addCriterion("object_id is not null");
return (Criteria) this;
}
public Criteria andObjectIdEqualTo(Long value) {
addCriterion("object_id =", value, "objectId");
return (Criteria) this;
}
public Criteria andObjectIdNotEqualTo(Long value) {
addCriterion("object_id <>", value, "objectId");
return (Criteria) this;
}
public Criteria andObjectIdGreaterThan(Long value) {
addCriterion("object_id >", value, "objectId");
return (Criteria) this;
}
public Criteria andObjectIdGreaterThanOrEqualTo(Long value) {
addCriterion("object_id >=", value, "objectId");
return (Criteria) this;
}
public Criteria andObjectIdLessThan(Long value) {
addCriterion("object_id <", value, "objectId");
return (Criteria) this;
}
public Criteria andObjectIdLessThanOrEqualTo(Long value) {
addCriterion("object_id <=", value, "objectId");
return (Criteria) this;
}
public Criteria andObjectIdIn(List<Long> values) {
addCriterion("object_id in", values, "objectId");
return (Criteria) this;
}
public Criteria andObjectIdNotIn(List<Long> values) {
addCriterion("object_id not in", values, "objectId");
return (Criteria) this;
}
public Criteria andObjectIdBetween(Long value1, Long value2) {
addCriterion("object_id between", value1, value2, "objectId");
return (Criteria) this;
}
public Criteria andObjectIdNotBetween(Long value1, Long value2) {
addCriterion("object_id not between", value1, value2, "objectId");
return (Criteria) this;
}
public Criteria andObjectNoIsNull() {
addCriterion("object_no is null");
return (Criteria) this;
}
public Criteria andObjectNoIsNotNull() {
addCriterion("object_no is not null");
return (Criteria) this;
}
public Criteria andObjectNoEqualTo(String value) {
addCriterion("object_no =", value, "objectNo");
return (Criteria) this;
}
public Criteria andObjectNoNotEqualTo(String value) {
addCriterion("object_no <>", value, "objectNo");
return (Criteria) this;
}
public Criteria andObjectNoGreaterThan(String value) {
addCriterion("object_no >", value, "objectNo");
return (Criteria) this;
}
public Criteria andObjectNoGreaterThanOrEqualTo(String value) {
addCriterion("object_no >=", value, "objectNo");
return (Criteria) this;
}
public Criteria andObjectNoLessThan(String value) {
addCriterion("object_no <", value, "objectNo");
return (Criteria) this;
}
public Criteria andObjectNoLessThanOrEqualTo(String value) {
addCriterion("object_no <=", value, "objectNo");
return (Criteria) this;
}
public Criteria andObjectNoLike(String value) {
addCriterion("object_no like", value, "objectNo");
return (Criteria) this;
}
public Criteria andObjectNoNotLike(String value) {
addCriterion("object_no not like", value, "objectNo");
return (Criteria) this;
}
public Criteria andObjectNoIn(List<String> values) {
addCriterion("object_no in", values, "objectNo");
return (Criteria) this;
}
public Criteria andObjectNoNotIn(List<String> values) {
addCriterion("object_no not in", values, "objectNo");
return (Criteria) this;
}
public Criteria andObjectNoBetween(String value1, String value2) {
addCriterion("object_no between", value1, value2, "objectNo");
return (Criteria) this;
}
public Criteria andObjectNoNotBetween(String value1, String value2) {
addCriterion("object_no not between", value1, value2, "objectNo");
return (Criteria) this;
}
public Criteria andObjectNameIsNull() {
addCriterion("object_name is null");
return (Criteria) this;
}
public Criteria andObjectNameIsNotNull() {
addCriterion("object_name is not null");
return (Criteria) this;
}
public Criteria andObjectNameEqualTo(String value) {
addCriterion("object_name =", value, "objectName");
return (Criteria) this;
}
public Criteria andObjectNameNotEqualTo(String value) {
addCriterion("object_name <>", value, "objectName");
return (Criteria) this;
}
public Criteria andObjectNameGreaterThan(String value) {
addCriterion("object_name >", value, "objectName");
return (Criteria) this;
}
public Criteria andObjectNameGreaterThanOrEqualTo(String value) {
addCriterion("object_name >=", value, "objectName");
return (Criteria) this;
}
public Criteria andObjectNameLessThan(String value) {
addCriterion("object_name <", value, "objectName");
return (Criteria) this;
}
public Criteria andObjectNameLessThanOrEqualTo(String value) {
addCriterion("object_name <=", value, "objectName");
return (Criteria) this;
}
public Criteria andObjectNameLike(String value) {
addCriterion("object_name like", value, "objectName");
return (Criteria) this;
}
public Criteria andObjectNameNotLike(String value) {
addCriterion("object_name not like", value, "objectName");
return (Criteria) this;
}
public Criteria andObjectNameIn(List<String> values) {
addCriterion("object_name in", values, "objectName");
return (Criteria) this;
}
public Criteria andObjectNameNotIn(List<String> values) {
addCriterion("object_name not in", values, "objectName");
return (Criteria) this;
}
public Criteria andObjectNameBetween(String value1, String value2) {
addCriterion("object_name between", value1, value2, "objectName");
return (Criteria) this;
}
public Criteria andObjectNameNotBetween(String value1, String value2) {
addCriterion("object_name not between", value1, value2, "objectName");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("`status` is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(Integer value) {
addCriterion("`status` =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(Integer value) {
addCriterion("`status` <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(Integer value) {
addCriterion("`status` >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("`status` >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(Integer value) {
addCriterion("`status` <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(Integer value) {
addCriterion("`status` <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<Integer> values) {
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Integer> values) {
addCriterion("`status` not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(Integer value1, Integer value2) {
addCriterion("`status` between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(Integer value1, Integer value2) {
addCriterion("`status` not between", value1, value2, "status");
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 andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
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);
}
}
}

@ -94,6 +94,11 @@ public class BsDiscount implements Serializable {
*/
private String createUserName;
/**
* 创建人商户号
*/
private String createUserMerNo;
/**
* 修改时间
*/
@ -235,6 +240,14 @@ public class BsDiscount implements Serializable {
this.createUserName = createUserName;
}
public String getCreateUserMerNo() {
return createUserMerNo;
}
public void setCreateUserMerNo(String createUserMerNo) {
this.createUserMerNo = createUserMerNo;
}
public Date getUpdateTime() {
return updateTime;
}
@ -295,6 +308,7 @@ public class BsDiscount implements Serializable {
&& (this.getCreateUserType() == null ? other.getCreateUserType() == null : this.getCreateUserType().equals(other.getCreateUserType()))
&& (this.getCreateUserId() == null ? other.getCreateUserId() == null : this.getCreateUserId().equals(other.getCreateUserId()))
&& (this.getCreateUserName() == null ? other.getCreateUserName() == null : this.getCreateUserName().equals(other.getCreateUserName()))
&& (this.getCreateUserMerNo() == null ? other.getCreateUserMerNo() == null : this.getCreateUserMerNo().equals(other.getCreateUserMerNo()))
&& (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()))
@ -321,6 +335,7 @@ public class BsDiscount implements Serializable {
result = prime * result + ((getCreateUserType() == null) ? 0 : getCreateUserType().hashCode());
result = prime * result + ((getCreateUserId() == null) ? 0 : getCreateUserId().hashCode());
result = prime * result + ((getCreateUserName() == null) ? 0 : getCreateUserName().hashCode());
result = prime * result + ((getCreateUserMerNo() == null) ? 0 : getCreateUserMerNo().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());
@ -350,6 +365,7 @@ public class BsDiscount implements Serializable {
sb.append(", createUserType=").append(createUserType);
sb.append(", createUserId=").append(createUserId);
sb.append(", createUserName=").append(createUserName);
sb.append(", createUserMerNo=").append(createUserMerNo);
sb.append(", updateTime=").append(updateTime);
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);

@ -1126,6 +1126,76 @@ public class BsDiscountExample {
return (Criteria) this;
}
public Criteria andCreateUserMerNoIsNull() {
addCriterion("create_user_mer_no is null");
return (Criteria) this;
}
public Criteria andCreateUserMerNoIsNotNull() {
addCriterion("create_user_mer_no is not null");
return (Criteria) this;
}
public Criteria andCreateUserMerNoEqualTo(String value) {
addCriterion("create_user_mer_no =", value, "createUserMerNo");
return (Criteria) this;
}
public Criteria andCreateUserMerNoNotEqualTo(String value) {
addCriterion("create_user_mer_no <>", value, "createUserMerNo");
return (Criteria) this;
}
public Criteria andCreateUserMerNoGreaterThan(String value) {
addCriterion("create_user_mer_no >", value, "createUserMerNo");
return (Criteria) this;
}
public Criteria andCreateUserMerNoGreaterThanOrEqualTo(String value) {
addCriterion("create_user_mer_no >=", value, "createUserMerNo");
return (Criteria) this;
}
public Criteria andCreateUserMerNoLessThan(String value) {
addCriterion("create_user_mer_no <", value, "createUserMerNo");
return (Criteria) this;
}
public Criteria andCreateUserMerNoLessThanOrEqualTo(String value) {
addCriterion("create_user_mer_no <=", value, "createUserMerNo");
return (Criteria) this;
}
public Criteria andCreateUserMerNoLike(String value) {
addCriterion("create_user_mer_no like", value, "createUserMerNo");
return (Criteria) this;
}
public Criteria andCreateUserMerNoNotLike(String value) {
addCriterion("create_user_mer_no not like", value, "createUserMerNo");
return (Criteria) this;
}
public Criteria andCreateUserMerNoIn(List<String> values) {
addCriterion("create_user_mer_no in", values, "createUserMerNo");
return (Criteria) this;
}
public Criteria andCreateUserMerNoNotIn(List<String> values) {
addCriterion("create_user_mer_no not in", values, "createUserMerNo");
return (Criteria) this;
}
public Criteria andCreateUserMerNoBetween(String value1, String value2) {
addCriterion("create_user_mer_no between", value1, value2, "createUserMerNo");
return (Criteria) this;
}
public Criteria andCreateUserMerNoNotBetween(String value1, String value2) {
addCriterion("create_user_mer_no not between", value1, value2, "createUserMerNo");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;

@ -0,0 +1,345 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* bs_discount_pk
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsDiscountPk implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 优惠包编号
*/
private String discountPkNo;
/**
* 优惠包名称
*/
private String discountPkName;
/**
* 描述
*/
private String describe;
/**
* 列表图片
*/
private String listImg;
/**
* 内容图片
*/
private String content;
/**
* 销售价格
*/
private BigDecimal salePrice;
/**
* 销售数量
*/
private Integer saleNum;
/**
* 开始时间
*/
private Date startTime;
/**
* 结束时间
*/
private Date endTime;
/**
* 状态 0删除 1编辑中 2已上线 3已结束
*/
private Integer status;
/**
* 创建时间
*/
private Date createTime;
/**
* 创建人类型 1运营 2商户油站
*/
private Integer createUserType;
/**
* 创建人id
*/
private Long createUserId;
/**
* 创建人名称
*/
private String createUserName;
/**
* 修改时间
*/
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 String getDiscountPkNo() {
return discountPkNo;
}
public void setDiscountPkNo(String discountPkNo) {
this.discountPkNo = discountPkNo;
}
public String getDiscountPkName() {
return discountPkName;
}
public void setDiscountPkName(String discountPkName) {
this.discountPkName = discountPkName;
}
public String getDescribe() {
return describe;
}
public void setDescribe(String describe) {
this.describe = describe;
}
public String getListImg() {
return listImg;
}
public void setListImg(String listImg) {
this.listImg = listImg;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public BigDecimal getSalePrice() {
return salePrice;
}
public void setSalePrice(BigDecimal salePrice) {
this.salePrice = salePrice;
}
public Integer getSaleNum() {
return saleNum;
}
public void setSaleNum(Integer saleNum) {
this.saleNum = saleNum;
}
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 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 Integer getCreateUserType() {
return createUserType;
}
public void setCreateUserType(Integer createUserType) {
this.createUserType = createUserType;
}
public Long getCreateUserId() {
return createUserId;
}
public void setCreateUserId(Long createUserId) {
this.createUserId = createUserId;
}
public String getCreateUserName() {
return createUserName;
}
public void setCreateUserName(String createUserName) {
this.createUserName = createUserName;
}
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;
}
BsDiscountPk other = (BsDiscountPk) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getDiscountPkNo() == null ? other.getDiscountPkNo() == null : this.getDiscountPkNo().equals(other.getDiscountPkNo()))
&& (this.getDiscountPkName() == null ? other.getDiscountPkName() == null : this.getDiscountPkName().equals(other.getDiscountPkName()))
&& (this.getDescribe() == null ? other.getDescribe() == null : this.getDescribe().equals(other.getDescribe()))
&& (this.getListImg() == null ? other.getListImg() == null : this.getListImg().equals(other.getListImg()))
&& (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
&& (this.getSalePrice() == null ? other.getSalePrice() == null : this.getSalePrice().equals(other.getSalePrice()))
&& (this.getSaleNum() == null ? other.getSaleNum() == null : this.getSaleNum().equals(other.getSaleNum()))
&& (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
&& (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getCreateUserType() == null ? other.getCreateUserType() == null : this.getCreateUserType().equals(other.getCreateUserType()))
&& (this.getCreateUserId() == null ? other.getCreateUserId() == null : this.getCreateUserId().equals(other.getCreateUserId()))
&& (this.getCreateUserName() == null ? other.getCreateUserName() == null : this.getCreateUserName().equals(other.getCreateUserName()))
&& (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 + ((getDiscountPkNo() == null) ? 0 : getDiscountPkNo().hashCode());
result = prime * result + ((getDiscountPkName() == null) ? 0 : getDiscountPkName().hashCode());
result = prime * result + ((getDescribe() == null) ? 0 : getDescribe().hashCode());
result = prime * result + ((getListImg() == null) ? 0 : getListImg().hashCode());
result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
result = prime * result + ((getSalePrice() == null) ? 0 : getSalePrice().hashCode());
result = prime * result + ((getSaleNum() == null) ? 0 : getSaleNum().hashCode());
result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getCreateUserType() == null) ? 0 : getCreateUserType().hashCode());
result = prime * result + ((getCreateUserId() == null) ? 0 : getCreateUserId().hashCode());
result = prime * result + ((getCreateUserName() == null) ? 0 : getCreateUserName().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(", discountPkNo=").append(discountPkNo);
sb.append(", discountPkName=").append(discountPkName);
sb.append(", describe=").append(describe);
sb.append(", listImg=").append(listImg);
sb.append(", content=").append(content);
sb.append(", salePrice=").append(salePrice);
sb.append(", saleNum=").append(saleNum);
sb.append(", startTime=").append(startTime);
sb.append(", endTime=").append(endTime);
sb.append(", status=").append(status);
sb.append(", createTime=").append(createTime);
sb.append(", createUserType=").append(createUserType);
sb.append(", createUserId=").append(createUserId);
sb.append(", createUserName=").append(createUserName);
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,297 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* bs_discount_pk_rel
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsDiscountPkRel implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 优惠包编号
*/
private String discountPkNo;
/**
* 数量
*/
private Integer number;
/**
* 优惠券编号
*/
private String discountNo;
/**
* 优惠券名称
*/
private String discountName;
/**
* 优惠类型 1满减 2抵扣 3折扣
*/
private Integer discountType;
/**
* 优惠券条件(满减价格)
*/
private BigDecimal discountCondition;
/**
* 优惠券价格
*/
private BigDecimal discountPrice;
/**
* 使用范围支持多选 1加油 2商城
*/
private String useScope;
/**
* 领取有效期天数
*/
private Integer receiveExpirationDate;
/**
* 状态 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 String getDiscountPkNo() {
return discountPkNo;
}
public void setDiscountPkNo(String discountPkNo) {
this.discountPkNo = discountPkNo;
}
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public String getDiscountNo() {
return discountNo;
}
public void setDiscountNo(String discountNo) {
this.discountNo = discountNo;
}
public String getDiscountName() {
return discountName;
}
public void setDiscountName(String discountName) {
this.discountName = discountName;
}
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 getUseScope() {
return useScope;
}
public void setUseScope(String useScope) {
this.useScope = useScope;
}
public Integer getReceiveExpirationDate() {
return receiveExpirationDate;
}
public void setReceiveExpirationDate(Integer receiveExpirationDate) {
this.receiveExpirationDate = receiveExpirationDate;
}
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;
}
BsDiscountPkRel other = (BsDiscountPkRel) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getDiscountPkNo() == null ? other.getDiscountPkNo() == null : this.getDiscountPkNo().equals(other.getDiscountPkNo()))
&& (this.getNumber() == null ? other.getNumber() == null : this.getNumber().equals(other.getNumber()))
&& (this.getDiscountNo() == null ? other.getDiscountNo() == null : this.getDiscountNo().equals(other.getDiscountNo()))
&& (this.getDiscountName() == null ? other.getDiscountName() == null : this.getDiscountName().equals(other.getDiscountName()))
&& (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.getUseScope() == null ? other.getUseScope() == null : this.getUseScope().equals(other.getUseScope()))
&& (this.getReceiveExpirationDate() == null ? other.getReceiveExpirationDate() == null : this.getReceiveExpirationDate().equals(other.getReceiveExpirationDate()))
&& (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 + ((getDiscountPkNo() == null) ? 0 : getDiscountPkNo().hashCode());
result = prime * result + ((getNumber() == null) ? 0 : getNumber().hashCode());
result = prime * result + ((getDiscountNo() == null) ? 0 : getDiscountNo().hashCode());
result = prime * result + ((getDiscountName() == null) ? 0 : getDiscountName().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 + ((getUseScope() == null) ? 0 : getUseScope().hashCode());
result = prime * result + ((getReceiveExpirationDate() == null) ? 0 : getReceiveExpirationDate().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(", discountPkNo=").append(discountPkNo);
sb.append(", number=").append(number);
sb.append(", discountNo=").append(discountNo);
sb.append(", discountName=").append(discountName);
sb.append(", discountType=").append(discountType);
sb.append(", discountCondition=").append(discountCondition);
sb.append(", discountPrice=").append(discountPrice);
sb.append(", useScope=").append(useScope);
sb.append(", receiveExpirationDate=").append(receiveExpirationDate);
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,264 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.util.Date;
/**
* bs_discount_pk_stock_batch
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsDiscountPkStockBatch implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 优惠包id
*/
private Long discountPkId;
/**
* 优惠包编号
*/
private String discountPkNo;
/**
* 优惠包名称
*/
private String discountPkName;
/**
* 批次编号
*/
private String batchNo;
/**
* 批次库存数量
*/
private Integer batchStockNum;
/**
* 开始id
*/
private String startId;
/**
* 结束id
*/
private String endId;
/**
* 状态 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 getDiscountPkId() {
return discountPkId;
}
public void setDiscountPkId(Long discountPkId) {
this.discountPkId = discountPkId;
}
public String getDiscountPkNo() {
return discountPkNo;
}
public void setDiscountPkNo(String discountPkNo) {
this.discountPkNo = discountPkNo;
}
public String getDiscountPkName() {
return discountPkName;
}
public void setDiscountPkName(String discountPkName) {
this.discountPkName = discountPkName;
}
public String getBatchNo() {
return batchNo;
}
public void setBatchNo(String batchNo) {
this.batchNo = batchNo;
}
public Integer getBatchStockNum() {
return batchStockNum;
}
public void setBatchStockNum(Integer batchStockNum) {
this.batchStockNum = batchStockNum;
}
public String getStartId() {
return startId;
}
public void setStartId(String startId) {
this.startId = startId;
}
public String getEndId() {
return endId;
}
public void setEndId(String endId) {
this.endId = endId;
}
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;
}
BsDiscountPkStockBatch other = (BsDiscountPkStockBatch) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getDiscountPkId() == null ? other.getDiscountPkId() == null : this.getDiscountPkId().equals(other.getDiscountPkId()))
&& (this.getDiscountPkNo() == null ? other.getDiscountPkNo() == null : this.getDiscountPkNo().equals(other.getDiscountPkNo()))
&& (this.getDiscountPkName() == null ? other.getDiscountPkName() == null : this.getDiscountPkName().equals(other.getDiscountPkName()))
&& (this.getBatchNo() == null ? other.getBatchNo() == null : this.getBatchNo().equals(other.getBatchNo()))
&& (this.getBatchStockNum() == null ? other.getBatchStockNum() == null : this.getBatchStockNum().equals(other.getBatchStockNum()))
&& (this.getStartId() == null ? other.getStartId() == null : this.getStartId().equals(other.getStartId()))
&& (this.getEndId() == null ? other.getEndId() == null : this.getEndId().equals(other.getEndId()))
&& (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 + ((getDiscountPkId() == null) ? 0 : getDiscountPkId().hashCode());
result = prime * result + ((getDiscountPkNo() == null) ? 0 : getDiscountPkNo().hashCode());
result = prime * result + ((getDiscountPkName() == null) ? 0 : getDiscountPkName().hashCode());
result = prime * result + ((getBatchNo() == null) ? 0 : getBatchNo().hashCode());
result = prime * result + ((getBatchStockNum() == null) ? 0 : getBatchStockNum().hashCode());
result = prime * result + ((getStartId() == null) ? 0 : getStartId().hashCode());
result = prime * result + ((getEndId() == null) ? 0 : getEndId().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(", discountPkId=").append(discountPkId);
sb.append(", discountPkNo=").append(discountPkNo);
sb.append(", discountPkName=").append(discountPkName);
sb.append(", batchNo=").append(batchNo);
sb.append(", batchStockNum=").append(batchStockNum);
sb.append(", startId=").append(startId);
sb.append(", endId=").append(endId);
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,312 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.util.Date;
/**
* bs_discount_pk_stock_code
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsDiscountPkStockCode implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 优惠包库存批次id
*/
private Long discountPkStockBatchId;
/**
* 优惠包库存批次编号
*/
private String discountPkStockBatchNo;
/**
* 优惠包id
*/
private Long discountPkId;
/**
* 优惠包编号
*/
private String discountPkNo;
/**
* 优惠包名称
*/
private String discountPkName;
/**
* 获得方式 1加油 2商城 3: 赠送 4API
*/
private Integer obtainType;
/**
* 获得时间
*/
private Date obtainTime;
/**
* 领取用户id
*/
private Long receiveMerUserId;
/**
* 领取用户手机号
*/
private String receiveMerUserPhone;
/**
* 状态 1未领取 2已领取
*/
private Integer status;
/**
* 代理商接入appid
*/
private String agentAppid;
/**
* 创建时间
*/
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 getDiscountPkStockBatchId() {
return discountPkStockBatchId;
}
public void setDiscountPkStockBatchId(Long discountPkStockBatchId) {
this.discountPkStockBatchId = discountPkStockBatchId;
}
public String getDiscountPkStockBatchNo() {
return discountPkStockBatchNo;
}
public void setDiscountPkStockBatchNo(String discountPkStockBatchNo) {
this.discountPkStockBatchNo = discountPkStockBatchNo;
}
public Long getDiscountPkId() {
return discountPkId;
}
public void setDiscountPkId(Long discountPkId) {
this.discountPkId = discountPkId;
}
public String getDiscountPkNo() {
return discountPkNo;
}
public void setDiscountPkNo(String discountPkNo) {
this.discountPkNo = discountPkNo;
}
public String getDiscountPkName() {
return discountPkName;
}
public void setDiscountPkName(String discountPkName) {
this.discountPkName = discountPkName;
}
public Integer getObtainType() {
return obtainType;
}
public void setObtainType(Integer obtainType) {
this.obtainType = obtainType;
}
public Date getObtainTime() {
return obtainTime;
}
public void setObtainTime(Date obtainTime) {
this.obtainTime = obtainTime;
}
public Long getReceiveMerUserId() {
return receiveMerUserId;
}
public void setReceiveMerUserId(Long receiveMerUserId) {
this.receiveMerUserId = receiveMerUserId;
}
public String getReceiveMerUserPhone() {
return receiveMerUserPhone;
}
public void setReceiveMerUserPhone(String receiveMerUserPhone) {
this.receiveMerUserPhone = receiveMerUserPhone;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getAgentAppid() {
return agentAppid;
}
public void setAgentAppid(String agentAppid) {
this.agentAppid = agentAppid;
}
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;
}
BsDiscountPkStockCode other = (BsDiscountPkStockCode) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getDiscountPkStockBatchId() == null ? other.getDiscountPkStockBatchId() == null : this.getDiscountPkStockBatchId().equals(other.getDiscountPkStockBatchId()))
&& (this.getDiscountPkStockBatchNo() == null ? other.getDiscountPkStockBatchNo() == null : this.getDiscountPkStockBatchNo().equals(other.getDiscountPkStockBatchNo()))
&& (this.getDiscountPkId() == null ? other.getDiscountPkId() == null : this.getDiscountPkId().equals(other.getDiscountPkId()))
&& (this.getDiscountPkNo() == null ? other.getDiscountPkNo() == null : this.getDiscountPkNo().equals(other.getDiscountPkNo()))
&& (this.getDiscountPkName() == null ? other.getDiscountPkName() == null : this.getDiscountPkName().equals(other.getDiscountPkName()))
&& (this.getObtainType() == null ? other.getObtainType() == null : this.getObtainType().equals(other.getObtainType()))
&& (this.getObtainTime() == null ? other.getObtainTime() == null : this.getObtainTime().equals(other.getObtainTime()))
&& (this.getReceiveMerUserId() == null ? other.getReceiveMerUserId() == null : this.getReceiveMerUserId().equals(other.getReceiveMerUserId()))
&& (this.getReceiveMerUserPhone() == null ? other.getReceiveMerUserPhone() == null : this.getReceiveMerUserPhone().equals(other.getReceiveMerUserPhone()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getAgentAppid() == null ? other.getAgentAppid() == null : this.getAgentAppid().equals(other.getAgentAppid()))
&& (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 + ((getDiscountPkStockBatchId() == null) ? 0 : getDiscountPkStockBatchId().hashCode());
result = prime * result + ((getDiscountPkStockBatchNo() == null) ? 0 : getDiscountPkStockBatchNo().hashCode());
result = prime * result + ((getDiscountPkId() == null) ? 0 : getDiscountPkId().hashCode());
result = prime * result + ((getDiscountPkNo() == null) ? 0 : getDiscountPkNo().hashCode());
result = prime * result + ((getDiscountPkName() == null) ? 0 : getDiscountPkName().hashCode());
result = prime * result + ((getObtainType() == null) ? 0 : getObtainType().hashCode());
result = prime * result + ((getObtainTime() == null) ? 0 : getObtainTime().hashCode());
result = prime * result + ((getReceiveMerUserId() == null) ? 0 : getReceiveMerUserId().hashCode());
result = prime * result + ((getReceiveMerUserPhone() == null) ? 0 : getReceiveMerUserPhone().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getAgentAppid() == null) ? 0 : getAgentAppid().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(", discountPkStockBatchId=").append(discountPkStockBatchId);
sb.append(", discountPkStockBatchNo=").append(discountPkStockBatchNo);
sb.append(", discountPkId=").append(discountPkId);
sb.append(", discountPkNo=").append(discountPkNo);
sb.append(", discountPkName=").append(discountPkName);
sb.append(", obtainType=").append(obtainType);
sb.append(", obtainTime=").append(obtainTime);
sb.append(", receiveMerUserId=").append(receiveMerUserId);
sb.append(", receiveMerUserPhone=").append(receiveMerUserPhone);
sb.append(", status=").append(status);
sb.append(", agentAppid=").append(agentAppid);
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();
}
}

@ -44,7 +44,7 @@ public class BsDiscountStockCode implements Serializable {
private String discountName;
/**
* 获得方式 1加油 2商城
* 获得方式 1加油 2商城 3: 赠送 4API
*/
private Integer obtainType;
@ -69,10 +69,35 @@ public class BsDiscountStockCode implements Serializable {
private Date useTime;
/**
* 状态 1未领取 2未使用 3已使用
* 状态 1未领取 2未使用 3已使用
*/
private Integer status;
/**
* 优惠券包库存id
*/
private Long discountPkStockCode;
/**
* 优惠包id
*/
private Long discountPkId;
/**
* 优惠包编号
*/
private String discountPkNo;
/**
* 优惠券包名称
*/
private String discountPkName;
/**
* 代理商接入appid
*/
private String agentAppid;
/**
* 创建时间
*/
@ -187,6 +212,46 @@ public class BsDiscountStockCode implements Serializable {
this.status = status;
}
public Long getDiscountPkStockCode() {
return discountPkStockCode;
}
public void setDiscountPkStockCode(Long discountPkStockCode) {
this.discountPkStockCode = discountPkStockCode;
}
public Long getDiscountPkId() {
return discountPkId;
}
public void setDiscountPkId(Long discountPkId) {
this.discountPkId = discountPkId;
}
public String getDiscountPkNo() {
return discountPkNo;
}
public void setDiscountPkNo(String discountPkNo) {
this.discountPkNo = discountPkNo;
}
public String getDiscountPkName() {
return discountPkName;
}
public void setDiscountPkName(String discountPkName) {
this.discountPkName = discountPkName;
}
public String getAgentAppid() {
return agentAppid;
}
public void setAgentAppid(String agentAppid) {
this.agentAppid = agentAppid;
}
public Date getCreateTime() {
return createTime;
}
@ -251,6 +316,11 @@ public class BsDiscountStockCode implements Serializable {
&& (this.getReceiveMerUserPhone() == null ? other.getReceiveMerUserPhone() == null : this.getReceiveMerUserPhone().equals(other.getReceiveMerUserPhone()))
&& (this.getUseTime() == null ? other.getUseTime() == null : this.getUseTime().equals(other.getUseTime()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getDiscountPkStockCode() == null ? other.getDiscountPkStockCode() == null : this.getDiscountPkStockCode().equals(other.getDiscountPkStockCode()))
&& (this.getDiscountPkId() == null ? other.getDiscountPkId() == null : this.getDiscountPkId().equals(other.getDiscountPkId()))
&& (this.getDiscountPkNo() == null ? other.getDiscountPkNo() == null : this.getDiscountPkNo().equals(other.getDiscountPkNo()))
&& (this.getDiscountPkName() == null ? other.getDiscountPkName() == null : this.getDiscountPkName().equals(other.getDiscountPkName()))
&& (this.getAgentAppid() == null ? other.getAgentAppid() == null : this.getAgentAppid().equals(other.getAgentAppid()))
&& (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()))
@ -274,6 +344,11 @@ public class BsDiscountStockCode implements Serializable {
result = prime * result + ((getReceiveMerUserPhone() == null) ? 0 : getReceiveMerUserPhone().hashCode());
result = prime * result + ((getUseTime() == null) ? 0 : getUseTime().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getDiscountPkStockCode() == null) ? 0 : getDiscountPkStockCode().hashCode());
result = prime * result + ((getDiscountPkId() == null) ? 0 : getDiscountPkId().hashCode());
result = prime * result + ((getDiscountPkNo() == null) ? 0 : getDiscountPkNo().hashCode());
result = prime * result + ((getDiscountPkName() == null) ? 0 : getDiscountPkName().hashCode());
result = prime * result + ((getAgentAppid() == null) ? 0 : getAgentAppid().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());
@ -300,6 +375,11 @@ public class BsDiscountStockCode implements Serializable {
sb.append(", receiveMerUserPhone=").append(receiveMerUserPhone);
sb.append(", useTime=").append(useTime);
sb.append(", status=").append(status);
sb.append(", discountPkStockCode=").append(discountPkStockCode);
sb.append(", discountPkId=").append(discountPkId);
sb.append(", discountPkNo=").append(discountPkNo);
sb.append(", discountPkName=").append(discountPkName);
sb.append(", agentAppid=").append(agentAppid);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", ext1=").append(ext1);

@ -885,6 +885,336 @@ public class BsDiscountStockCodeExample {
return (Criteria) this;
}
public Criteria andDiscountPkStockCodeIsNull() {
addCriterion("discount_pk_stock_code is null");
return (Criteria) this;
}
public Criteria andDiscountPkStockCodeIsNotNull() {
addCriterion("discount_pk_stock_code is not null");
return (Criteria) this;
}
public Criteria andDiscountPkStockCodeEqualTo(Long value) {
addCriterion("discount_pk_stock_code =", value, "discountPkStockCode");
return (Criteria) this;
}
public Criteria andDiscountPkStockCodeNotEqualTo(Long value) {
addCriterion("discount_pk_stock_code <>", value, "discountPkStockCode");
return (Criteria) this;
}
public Criteria andDiscountPkStockCodeGreaterThan(Long value) {
addCriterion("discount_pk_stock_code >", value, "discountPkStockCode");
return (Criteria) this;
}
public Criteria andDiscountPkStockCodeGreaterThanOrEqualTo(Long value) {
addCriterion("discount_pk_stock_code >=", value, "discountPkStockCode");
return (Criteria) this;
}
public Criteria andDiscountPkStockCodeLessThan(Long value) {
addCriterion("discount_pk_stock_code <", value, "discountPkStockCode");
return (Criteria) this;
}
public Criteria andDiscountPkStockCodeLessThanOrEqualTo(Long value) {
addCriterion("discount_pk_stock_code <=", value, "discountPkStockCode");
return (Criteria) this;
}
public Criteria andDiscountPkStockCodeIn(List<Long> values) {
addCriterion("discount_pk_stock_code in", values, "discountPkStockCode");
return (Criteria) this;
}
public Criteria andDiscountPkStockCodeNotIn(List<Long> values) {
addCriterion("discount_pk_stock_code not in", values, "discountPkStockCode");
return (Criteria) this;
}
public Criteria andDiscountPkStockCodeBetween(Long value1, Long value2) {
addCriterion("discount_pk_stock_code between", value1, value2, "discountPkStockCode");
return (Criteria) this;
}
public Criteria andDiscountPkStockCodeNotBetween(Long value1, Long value2) {
addCriterion("discount_pk_stock_code not between", value1, value2, "discountPkStockCode");
return (Criteria) this;
}
public Criteria andDiscountPkIdIsNull() {
addCriterion("discount_pk_id is null");
return (Criteria) this;
}
public Criteria andDiscountPkIdIsNotNull() {
addCriterion("discount_pk_id is not null");
return (Criteria) this;
}
public Criteria andDiscountPkIdEqualTo(Long value) {
addCriterion("discount_pk_id =", value, "discountPkId");
return (Criteria) this;
}
public Criteria andDiscountPkIdNotEqualTo(Long value) {
addCriterion("discount_pk_id <>", value, "discountPkId");
return (Criteria) this;
}
public Criteria andDiscountPkIdGreaterThan(Long value) {
addCriterion("discount_pk_id >", value, "discountPkId");
return (Criteria) this;
}
public Criteria andDiscountPkIdGreaterThanOrEqualTo(Long value) {
addCriterion("discount_pk_id >=", value, "discountPkId");
return (Criteria) this;
}
public Criteria andDiscountPkIdLessThan(Long value) {
addCriterion("discount_pk_id <", value, "discountPkId");
return (Criteria) this;
}
public Criteria andDiscountPkIdLessThanOrEqualTo(Long value) {
addCriterion("discount_pk_id <=", value, "discountPkId");
return (Criteria) this;
}
public Criteria andDiscountPkIdIn(List<Long> values) {
addCriterion("discount_pk_id in", values, "discountPkId");
return (Criteria) this;
}
public Criteria andDiscountPkIdNotIn(List<Long> values) {
addCriterion("discount_pk_id not in", values, "discountPkId");
return (Criteria) this;
}
public Criteria andDiscountPkIdBetween(Long value1, Long value2) {
addCriterion("discount_pk_id between", value1, value2, "discountPkId");
return (Criteria) this;
}
public Criteria andDiscountPkIdNotBetween(Long value1, Long value2) {
addCriterion("discount_pk_id not between", value1, value2, "discountPkId");
return (Criteria) this;
}
public Criteria andDiscountPkNoIsNull() {
addCriterion("discount_pk_no is null");
return (Criteria) this;
}
public Criteria andDiscountPkNoIsNotNull() {
addCriterion("discount_pk_no is not null");
return (Criteria) this;
}
public Criteria andDiscountPkNoEqualTo(String value) {
addCriterion("discount_pk_no =", value, "discountPkNo");
return (Criteria) this;
}
public Criteria andDiscountPkNoNotEqualTo(String value) {
addCriterion("discount_pk_no <>", value, "discountPkNo");
return (Criteria) this;
}
public Criteria andDiscountPkNoGreaterThan(String value) {
addCriterion("discount_pk_no >", value, "discountPkNo");
return (Criteria) this;
}
public Criteria andDiscountPkNoGreaterThanOrEqualTo(String value) {
addCriterion("discount_pk_no >=", value, "discountPkNo");
return (Criteria) this;
}
public Criteria andDiscountPkNoLessThan(String value) {
addCriterion("discount_pk_no <", value, "discountPkNo");
return (Criteria) this;
}
public Criteria andDiscountPkNoLessThanOrEqualTo(String value) {
addCriterion("discount_pk_no <=", value, "discountPkNo");
return (Criteria) this;
}
public Criteria andDiscountPkNoLike(String value) {
addCriterion("discount_pk_no like", value, "discountPkNo");
return (Criteria) this;
}
public Criteria andDiscountPkNoNotLike(String value) {
addCriterion("discount_pk_no not like", value, "discountPkNo");
return (Criteria) this;
}
public Criteria andDiscountPkNoIn(List<String> values) {
addCriterion("discount_pk_no in", values, "discountPkNo");
return (Criteria) this;
}
public Criteria andDiscountPkNoNotIn(List<String> values) {
addCriterion("discount_pk_no not in", values, "discountPkNo");
return (Criteria) this;
}
public Criteria andDiscountPkNoBetween(String value1, String value2) {
addCriterion("discount_pk_no between", value1, value2, "discountPkNo");
return (Criteria) this;
}
public Criteria andDiscountPkNoNotBetween(String value1, String value2) {
addCriterion("discount_pk_no not between", value1, value2, "discountPkNo");
return (Criteria) this;
}
public Criteria andDiscountPkNameIsNull() {
addCriterion("discount_pk_name is null");
return (Criteria) this;
}
public Criteria andDiscountPkNameIsNotNull() {
addCriterion("discount_pk_name is not null");
return (Criteria) this;
}
public Criteria andDiscountPkNameEqualTo(String value) {
addCriterion("discount_pk_name =", value, "discountPkName");
return (Criteria) this;
}
public Criteria andDiscountPkNameNotEqualTo(String value) {
addCriterion("discount_pk_name <>", value, "discountPkName");
return (Criteria) this;
}
public Criteria andDiscountPkNameGreaterThan(String value) {
addCriterion("discount_pk_name >", value, "discountPkName");
return (Criteria) this;
}
public Criteria andDiscountPkNameGreaterThanOrEqualTo(String value) {
addCriterion("discount_pk_name >=", value, "discountPkName");
return (Criteria) this;
}
public Criteria andDiscountPkNameLessThan(String value) {
addCriterion("discount_pk_name <", value, "discountPkName");
return (Criteria) this;
}
public Criteria andDiscountPkNameLessThanOrEqualTo(String value) {
addCriterion("discount_pk_name <=", value, "discountPkName");
return (Criteria) this;
}
public Criteria andDiscountPkNameLike(String value) {
addCriterion("discount_pk_name like", value, "discountPkName");
return (Criteria) this;
}
public Criteria andDiscountPkNameNotLike(String value) {
addCriterion("discount_pk_name not like", value, "discountPkName");
return (Criteria) this;
}
public Criteria andDiscountPkNameIn(List<String> values) {
addCriterion("discount_pk_name in", values, "discountPkName");
return (Criteria) this;
}
public Criteria andDiscountPkNameNotIn(List<String> values) {
addCriterion("discount_pk_name not in", values, "discountPkName");
return (Criteria) this;
}
public Criteria andDiscountPkNameBetween(String value1, String value2) {
addCriterion("discount_pk_name between", value1, value2, "discountPkName");
return (Criteria) this;
}
public Criteria andDiscountPkNameNotBetween(String value1, String value2) {
addCriterion("discount_pk_name not between", value1, value2, "discountPkName");
return (Criteria) this;
}
public Criteria andAgentAppidIsNull() {
addCriterion("agent_appid is null");
return (Criteria) this;
}
public Criteria andAgentAppidIsNotNull() {
addCriterion("agent_appid is not null");
return (Criteria) this;
}
public Criteria andAgentAppidEqualTo(String value) {
addCriterion("agent_appid =", value, "agentAppid");
return (Criteria) this;
}
public Criteria andAgentAppidNotEqualTo(String value) {
addCriterion("agent_appid <>", value, "agentAppid");
return (Criteria) this;
}
public Criteria andAgentAppidGreaterThan(String value) {
addCriterion("agent_appid >", value, "agentAppid");
return (Criteria) this;
}
public Criteria andAgentAppidGreaterThanOrEqualTo(String value) {
addCriterion("agent_appid >=", value, "agentAppid");
return (Criteria) this;
}
public Criteria andAgentAppidLessThan(String value) {
addCriterion("agent_appid <", value, "agentAppid");
return (Criteria) this;
}
public Criteria andAgentAppidLessThanOrEqualTo(String value) {
addCriterion("agent_appid <=", value, "agentAppid");
return (Criteria) this;
}
public Criteria andAgentAppidLike(String value) {
addCriterion("agent_appid like", value, "agentAppid");
return (Criteria) this;
}
public Criteria andAgentAppidNotLike(String value) {
addCriterion("agent_appid not like", value, "agentAppid");
return (Criteria) this;
}
public Criteria andAgentAppidIn(List<String> values) {
addCriterion("agent_appid in", values, "agentAppid");
return (Criteria) this;
}
public Criteria andAgentAppidNotIn(List<String> values) {
addCriterion("agent_appid not in", values, "agentAppid");
return (Criteria) this;
}
public Criteria andAgentAppidBetween(String value1, String value2) {
addCriterion("agent_appid between", value1, value2, "agentAppid");
return (Criteria) this;
}
public Criteria andAgentAppidNotBetween(String value1, String value2) {
addCriterion("agent_appid not between", value1, value2, "agentAppid");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;

@ -79,6 +79,11 @@ public class BsDiscountUser implements Serializable {
*/
private Date expirationDate;
/**
* 代理商接入appid
*/
private String agentAppid;
/**
* 状态 1未使用 2已使用 3已过期
*/
@ -206,6 +211,14 @@ public class BsDiscountUser implements Serializable {
this.expirationDate = expirationDate;
}
public String getAgentAppid() {
return agentAppid;
}
public void setAgentAppid(String agentAppid) {
this.agentAppid = agentAppid;
}
public Integer getStatus() {
return status;
}
@ -279,6 +292,7 @@ public class BsDiscountUser implements Serializable {
&& (this.getUseScope() == null ? other.getUseScope() == null : this.getUseScope().equals(other.getUseScope()))
&& (this.getUseDate() == null ? other.getUseDate() == null : this.getUseDate().equals(other.getUseDate()))
&& (this.getExpirationDate() == null ? other.getExpirationDate() == null : this.getExpirationDate().equals(other.getExpirationDate()))
&& (this.getAgentAppid() == null ? other.getAgentAppid() == null : this.getAgentAppid().equals(other.getAgentAppid()))
&& (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()))
@ -304,6 +318,7 @@ public class BsDiscountUser implements Serializable {
result = prime * result + ((getUseScope() == null) ? 0 : getUseScope().hashCode());
result = prime * result + ((getUseDate() == null) ? 0 : getUseDate().hashCode());
result = prime * result + ((getExpirationDate() == null) ? 0 : getExpirationDate().hashCode());
result = prime * result + ((getAgentAppid() == null) ? 0 : getAgentAppid().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());
@ -332,6 +347,7 @@ public class BsDiscountUser implements Serializable {
sb.append(", useScope=").append(useScope);
sb.append(", useDate=").append(useDate);
sb.append(", expirationDate=").append(expirationDate);
sb.append(", agentAppid=").append(agentAppid);
sb.append(", status=").append(status);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);

@ -946,6 +946,76 @@ public class BsDiscountUserExample {
return (Criteria) this;
}
public Criteria andAgentAppidIsNull() {
addCriterion("agent_appid is null");
return (Criteria) this;
}
public Criteria andAgentAppidIsNotNull() {
addCriterion("agent_appid is not null");
return (Criteria) this;
}
public Criteria andAgentAppidEqualTo(String value) {
addCriterion("agent_appid =", value, "agentAppid");
return (Criteria) this;
}
public Criteria andAgentAppidNotEqualTo(String value) {
addCriterion("agent_appid <>", value, "agentAppid");
return (Criteria) this;
}
public Criteria andAgentAppidGreaterThan(String value) {
addCriterion("agent_appid >", value, "agentAppid");
return (Criteria) this;
}
public Criteria andAgentAppidGreaterThanOrEqualTo(String value) {
addCriterion("agent_appid >=", value, "agentAppid");
return (Criteria) this;
}
public Criteria andAgentAppidLessThan(String value) {
addCriterion("agent_appid <", value, "agentAppid");
return (Criteria) this;
}
public Criteria andAgentAppidLessThanOrEqualTo(String value) {
addCriterion("agent_appid <=", value, "agentAppid");
return (Criteria) this;
}
public Criteria andAgentAppidLike(String value) {
addCriterion("agent_appid like", value, "agentAppid");
return (Criteria) this;
}
public Criteria andAgentAppidNotLike(String value) {
addCriterion("agent_appid not like", value, "agentAppid");
return (Criteria) this;
}
public Criteria andAgentAppidIn(List<String> values) {
addCriterion("agent_appid in", values, "agentAppid");
return (Criteria) this;
}
public Criteria andAgentAppidNotIn(List<String> values) {
addCriterion("agent_appid not in", values, "agentAppid");
return (Criteria) this;
}
public Criteria andAgentAppidBetween(String value1, String value2) {
addCriterion("agent_appid between", value1, value2, "agentAppid");
return (Criteria) this;
}
public Criteria andAgentAppidNotBetween(String value1, String value2) {
addCriterion("agent_appid not between", value1, value2, "agentAppid");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;

@ -4,6 +4,7 @@ import lombok.Data;
import org.hibernate.validator.constraints.Range;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @className: RequestQueryDiscountListModel
@ -13,6 +14,12 @@ import javax.validation.constraints.NotBlank;
@Data
public class RequestPushDiscountModel {
/**
* appid
*/
@NotBlank(message = "请求id必填项")
private String reqId;
/**
* appid
*/
@ -29,6 +36,7 @@ public class RequestPushDiscountModel {
* 推送数量
*/
@Range(min = 1, max = 50,message = "数量必须设置在1至50之内")
@NotNull(message = "数量必填项")
private Integer number;
/**

@ -0,0 +1,52 @@
package com.hfkj.openapi.model.request;
import lombok.Data;
import org.hibernate.validator.constraints.Range;
import javax.validation.constraints.NotBlank;
/**
* @className: RequestQueryDiscountListModel
* @author: HuRui
* @date: 2024/9/1
**/
@Data
public class RequestPushPkDiscountModel {
/**
* appid
*/
@NotBlank(message = "请求id必填项")
private String reqId;
/**
* appid
*/
@NotBlank(message = "appId必填项")
private String appId;
/**
* 优惠券编号
*/
@NotBlank(message = "券包编号必填项")
private String discountPkNo;
/**
* 推送数量
*/
@Range(min = 1, max = 50,message = "数量必须设置在1至50之内")
private Integer number;
/**
* 电话
*/
@NotBlank(message = "电话必填项")
private String phone;
/**
* 签名参数
*/
@NotBlank(message = "签名必填项")
private String sign;
}

@ -3,6 +3,7 @@ package com.hfkj.openapi.model.request;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @className: RequestQueryDiscountListModel
@ -12,6 +13,12 @@ import javax.validation.constraints.NotBlank;
@Data
public class RequestQueryCodeModel {
/**
* appid
*/
@NotBlank(message = "请求id必填项")
private String reqId;
/**
* appid
*/
@ -21,7 +28,7 @@ public class RequestQueryCodeModel {
/**
* 优惠券code
*/
@NotBlank(message = "优惠券code必填项")
@NotNull(message = "优惠券code必填项")
private Long code;
/**

@ -14,6 +14,10 @@ import java.util.Map;
**/
@Data
public class ResponsePushDiscountModel {
/**
* 请求id
*/
private String reqId;
/**
* appid

@ -0,0 +1,40 @@
package com.hfkj.openapi.model.response;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* @className: RequestQueryDiscountListModel
* @author: HuRui
* @date: 2024/9/1
**/
@Data
public class ResponsePushDiscountPkModel {
/**
* 请求id
*/
private String reqId;
/**
* appid
*/
private String appId;
/**
* 券包编号
*/
private String discountPkNo;
/**
* 优惠券编码列表
*/
private List<Map<String,Object>> codeList;
/**
* 签名参数
*/
private String sign;
}

@ -13,6 +13,11 @@ import java.util.Date;
@Data
public class ResponseQueryCodeModel {
/**
* 请求id
*/
private String reqId;
/**
* appid
*/
@ -41,12 +46,12 @@ public class ResponseQueryCodeModel {
/**
* 创建时间
*/
private Date createTime;
private String createTime;
/**
* 过期时间
*/
private Date expirationDate;
private String expirationDate;
/**
* 签名参数

@ -0,0 +1,26 @@
package com.hfkj.service.agent;
import com.hfkj.entity.BsAgentApiLogWithBLOBs;
/**
* @className: BsAgentApiLogService
* @author: HuRui
* @date: 2024/9/3
**/
public interface BsAgentApiLogService {
/**
*
* @param data
*/
void edit(BsAgentApiLogWithBLOBs data);
/**
*
* @param appId
* @param reqId
* @return
*/
boolean isExist(String appId, String reqId);
}

@ -0,0 +1,44 @@
package com.hfkj.service.agent;
import com.hfkj.entity.BsAgentDiscount;
import java.util.List;
/**
* @className: BsAgentDiscountService
* @author: HuRui
* @date: 2024/9/3
**/
public interface BsAgentDiscountService {
/**
* 创建数据
* @param data
*/
void create(BsAgentDiscount data);
/**
* 删除
* @param id 数据id
*/
void delete(Long id);
/**
* 查询详情
* @param agentId
* @param type
* @param objectNo
* @return
*/
BsAgentDiscount getDetail(Long agentId, Integer type, String objectNo);
/**
* 查询列表
* @param agentId
* @param type
* @return
*/
List<BsAgentDiscount> getList(Long agentId,Integer type, String objectNo);
}

@ -0,0 +1,35 @@
package com.hfkj.service.agent.impl;
import com.hfkj.dao.BsAgentApiLogMapper;
import com.hfkj.entity.BsAgentApiLog;
import com.hfkj.entity.BsAgentApiLogWithBLOBs;
import com.hfkj.service.agent.BsAgentApiLogService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
/**
* @className: BsAgentApiLogServiceImpl
* @author: HuRui
* @date: 2024/9/3
**/
@Service("agentApiLogService")
public class BsAgentApiLogServiceImpl implements BsAgentApiLogService {
@Resource
private BsAgentApiLogMapper agentApiLogMapper;
@Override
public void edit(BsAgentApiLogWithBLOBs data) {
if (data.getId() == null) {
data.setCreateTime(new Date());
agentApiLogMapper.insertSelective(data);
} else {
agentApiLogMapper.updateByPrimaryKeyWithBLOBs(data);
}
}
@Override
public boolean isExist(String appId, String reqId) {
return agentApiLogMapper.isExist(appId, reqId) > 0;
}
}

@ -0,0 +1,91 @@
package com.hfkj.service.agent.impl;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.RedisUtil;
import com.hfkj.dao.BsAgentDiscountMapper;
import com.hfkj.entity.BsAgentDiscount;
import com.hfkj.entity.BsAgentDiscountExample;
import com.hfkj.service.agent.BsAgentDiscountService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
* @className: BsAgentDiscountServiceImpl
* @author: HuRui
* @date: 2024/9/3
**/
@Service("agentDiscountService")
public class BsAgentDiscountServiceImpl implements BsAgentDiscountService {
@Resource
private BsAgentDiscountMapper agentDiscountMapper;
@Resource
private RedisUtil redisUtil;
private final static String CACHE_KEY = "AGENT_DISCOUNT";
@Override
public void create(BsAgentDiscount data) {
data.setCreateTime(new Date());
data.setUpdateTime(new Date());
data.setStatus(1);
agentDiscountMapper.insert(data);
List<BsAgentDiscount> list = getList(data.getAgentId(), null,null);
list.add(data);
// 加入缓存
redisUtil.hset(CACHE_KEY,""+data.getAgentId(), list);
}
@Override
public void delete(Long id) {
// 查询数据
BsAgentDiscount data = agentDiscountMapper.selectByPrimaryKey(id);
if (data == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到数据");
}
data.setUpdateTime(new Date());
data.setStatus(0);
agentDiscountMapper.updateByPrimaryKey(data);
// 删除缓存
redisUtil.hdel(CACHE_KEY, ""+data.getAgentId());
}
@Override
public BsAgentDiscount getDetail(Long agentId, Integer type, String objectNo) {
List<BsAgentDiscount> list = getList(agentId, type, objectNo);
if (!list.isEmpty()) {
return list.get(0);
}
return null;
}
@Override
public List<BsAgentDiscount> getList(Long agentId, Integer type, String objectNo) {
Object cacheObj = redisUtil.hget(CACHE_KEY, "" + agentId);
if (cacheObj != null) {
return (List<BsAgentDiscount>) cacheObj;
}
BsAgentDiscountExample example = new BsAgentDiscountExample();
BsAgentDiscountExample.Criteria criteria = example.createCriteria()
.andStatusNotEqualTo(0)
.andAgentIdEqualTo(agentId);
if (type != null) {
criteria.andTypeEqualTo(type);
}
if (StringUtils.isNotBlank(objectNo)) {
criteria.andObjectNoEqualTo(objectNo);
}
example.setOrderByClause("create_time desc");
List<BsAgentDiscount> list = agentDiscountMapper.selectByExample(example);
// 加入缓存
redisUtil.hset(CACHE_KEY, ""+agentId, list);
return list;
}
}

@ -0,0 +1,33 @@
package com.hfkj.service.discount;
import com.hfkj.entity.BsDiscountPkRel;
import java.util.List;
import java.util.Map;
/**
* @className: BsDiscountPkRelService
* @author: HuRui
* @date: 2024/9/2
**/
public interface BsDiscountPkRelService {
/**
* 编辑数据
* @param data
*/
void editData(BsDiscountPkRel data);
/**
* 删除
* @param discountPkNo
*/
void delete(String discountPkNo);
/**
* 查询列表
* @param discountPkNo
* @return
*/
List<BsDiscountPkRel> getList(String discountPkNo);
}

@ -0,0 +1,43 @@
package com.hfkj.service.discount;
import com.hfkj.entity.BsDiscount;
import com.hfkj.entity.BsDiscountPk;
import com.hfkj.entity.BsDiscountPkRel;
import java.util.List;
import java.util.Map;
/**
* @className: BsDiscountPkService
* @author: HuRui
* @date: 2024/9/2
**/
public interface BsDiscountPkService {
/**
* 编辑数据
* @param data
*/
void editData(BsDiscountPk data);
/**
* 创建优惠券包
* @param discountPk
* @param pkRelList
*/
void edit(BsDiscountPk discountPk, List<BsDiscountPkRel> pkRelList);
/**
* 查询详情
* @param discountPkNo
* @return
*/
BsDiscountPk getDetail(String discountPkNo);
/**
* 查询列表
* @param param
* @return
*/
List<BsDiscountPk> getList(Map<String,Object> param);
}

@ -0,0 +1,43 @@
package com.hfkj.service.discount;
import com.hfkj.entity.BsDiscountPkStockBatch;
import com.hfkj.entity.BsDiscountStockBatch;
import com.hfkj.entity.BsDiscountStockCode;
import java.util.List;
import java.util.Map;
/**
* @className: BsDiscountPkStockBatchService
* @author: HuRui
* @date: 2024/9/2
**/
public interface BsDiscountPkStockBatchService {
/**
* 编辑数据
* @param data
*/
void editData(BsDiscountPkStockBatch data);
/**
* 增加库存
* @param discountPkNo
* @param stockCount
*/
void addStock(String discountPkNo,Integer stockCount);
/**
* 查询详情
* @param batchNo
* @return
*/
BsDiscountPkStockBatch getStockBatchDetail(String batchNo);
/**
* 查询库存批次列表
* @param param
* @return
*/
List<BsDiscountPkStockBatch> getStockBatchList(Map<String,Object> param);
}

@ -0,0 +1,42 @@
package com.hfkj.service.discount;
import com.hfkj.entity.BsDiscountPkStockCode;
import com.hfkj.entity.BsDiscountStockCode;
import java.util.List;
import java.util.Map;
/**
* @className: BsDiscountPkStockCodeService
* @author: HuRui
* @date: 2024/9/2
**/
public interface BsDiscountPkStockCodeService {
/**
* 批量插入
* @param codeList
*/
void insertList(List<BsDiscountPkStockCode> codeList);
/**
* 修改
* @param data
*/
void update(BsDiscountPkStockCode data);
/**
* 分配库存code需要配合锁使用
* @param discountPkNo
* @return
*/
List<BsDiscountPkStockCode> getAssignCodeList(String discountPkNo, Integer number);
/**
* 查询列表
* @param param
* @return
*/
List<BsDiscountPkStockCode> getCodeList(Map<String,Object> param);
}

@ -22,7 +22,7 @@ public interface BsDiscountUserService {
void editData(BsDiscountUser data);
/**
* 领取
* 领取优惠券
* @param discountNo 优惠券编号
* @param number 领取数量
* @param obtainType 获得方式
@ -30,6 +30,17 @@ public interface BsDiscountUserService {
*/
List<BsDiscountUser> receive(String discountNo, Integer number, DiscountStockCodeObtainTypeEnum obtainType, String userPhone, String agentAppid);
/**
* 领取优惠券包
* @param discountPkNo
* @param number
* @param obtainType
* @param userPhone
* @param agentAppid
* @return
*/
List<BsDiscountUser> receivePk(String discountPkNo, Integer number, DiscountStockCodeObtainTypeEnum obtainType, String userPhone, String agentAppid);
/**
* 使用优惠券
* @param id
@ -64,4 +75,8 @@ public interface BsDiscountUserService {
*/
List<DiscountUserModel> getUserDiscountList(Map<String,Object> param);
/**
* 过期
*/
void expiration();
}

@ -0,0 +1,52 @@
package com.hfkj.service.discount.impl;
import com.hfkj.dao.BsDiscountPkRelMapper;
import com.hfkj.entity.BsDiscountPk;
import com.hfkj.entity.BsDiscountPkRel;
import com.hfkj.entity.BsDiscountPkRelExample;
import com.hfkj.service.discount.BsDiscountPkRelService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
* @className: BsDiscountPkRelServiceImpl
* @author: HuRui
* @date: 2024/9/2
**/
@Service("discountPkRelService")
public class BsDiscountPkRelServiceImpl implements BsDiscountPkRelService {
@Resource
private BsDiscountPkRelMapper discountPkRelMapper;
@Override
public void editData(BsDiscountPkRel data) {
data.setUpdateTime(new Date());
if (data.getId() == null) {
data.setCreateTime(new Date());
data.setStatus(1);
discountPkRelMapper.insert(data);
} else {
discountPkRelMapper.updateByPrimaryKey(data);
}
}
@Override
public void delete(String discountPkNo) {
BsDiscountPkRelExample example = new BsDiscountPkRelExample();
example.createCriteria().andDiscountPkNoEqualTo(discountPkNo).andStatusEqualTo(1);
BsDiscountPkRel rel = new BsDiscountPkRel();
rel.setStatus(0);
discountPkRelMapper.updateByExampleSelective(rel, example);
}
@Override
public List<BsDiscountPkRel> getList(String discountPkNo) {
BsDiscountPkRelExample example = new BsDiscountPkRelExample();
example.createCriteria().andDiscountPkNoEqualTo(discountPkNo).andStatusNotEqualTo(0);
return discountPkRelMapper.selectByExample(example);
}
}

@ -0,0 +1,111 @@
package com.hfkj.service.discount.impl;
import com.hfkj.common.utils.RedisUtil;
import com.hfkj.dao.BsDiscountPkMapper;
import com.hfkj.entity.BsDiscountPk;
import com.hfkj.entity.BsDiscountPkExample;
import com.hfkj.entity.BsDiscountPkRel;
import com.hfkj.service.discount.BsDiscountPkRelService;
import com.hfkj.service.discount.BsDiscountPkService;
import com.hfkj.sysenum.discount.DiscountPkStatusEnum;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @className: BsDiscountPkServiceImpl
* @author: HuRui
* @date: 2024/9/2
**/
@Service("discountPkService")
public class BsDiscountPkServiceImpl implements BsDiscountPkService {
@Resource
private BsDiscountPkMapper discountPkMapper;
@Resource
private BsDiscountPkRelService discountPkRelService;
@Resource
private RedisUtil redisUtil;
private static final String CACHE_KEY = "DISCOUNT_PK";
@Override
public void editData(BsDiscountPk data) {
data.setUpdateTime(new Date());
if (data.getId() == null) {
data.setCreateTime(new Date());
data.setSaleNum(0);
data.setStatus(DiscountPkStatusEnum.status1.getCode());
discountPkMapper.insert(data);
data.setDiscountPkNo("DPK"+(10000+data.getId()));
discountPkMapper.updateByPrimaryKey(data);
} else {
discountPkMapper.updateByPrimaryKey(data);
}
// 缓存
redisUtil.hset(CACHE_KEY, data.getDiscountPkNo(), data);
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void edit(BsDiscountPk discountPk, List<BsDiscountPkRel> pkRelList) {
if (discountPk.getId() != null) {
// 删除关系
discountPkRelService.delete(discountPk.getDiscountPkNo());
}
editData(discountPk);
for (BsDiscountPkRel rel : pkRelList) {
rel.setDiscountPkNo(discountPk.getDiscountPkNo());
discountPkRelService.editData(rel);
}
}
@Override
public BsDiscountPk getDetail(String discountPkNo) {
Object cacheObj = redisUtil.hget(CACHE_KEY, discountPkNo);
if (cacheObj != null) {
return (BsDiscountPk)cacheObj;
}
BsDiscountPkExample example = new BsDiscountPkExample();
example.createCriteria().andDiscountPkNoEqualTo(discountPkNo).andStatusNotEqualTo(0);
List<BsDiscountPk> list = discountPkMapper.selectByExample(example);
if (!list.isEmpty()) {
return list.get(0);
}
return null;
}
@Override
public List<BsDiscountPk> getList(Map<String, Object> param) {
BsDiscountPkExample example = new BsDiscountPkExample();
BsDiscountPkExample.Criteria criteria = example.createCriteria()
.andStatusNotEqualTo(0);
if (StringUtils.isNotBlank(MapUtils.getString(param, "discountPkName"))) {
criteria.andDiscountPkNameLike("%"+MapUtils.getString(param, "discountPkName")+"%");
}
if (MapUtils.getInteger(param, "status") != null) {
criteria.andStatusEqualTo(MapUtils.getInteger(param, "status") );
}
if (MapUtils.getInteger(param, "createUserType") != null) {
criteria.andCreateUserTypeEqualTo(MapUtils.getInteger(param, "createUserType"));
}
if (MapUtils.getInteger(param, "createUserId") != null) {
criteria.andCreateUserIdEqualTo(MapUtils.getLong(param, "createUserId") );
}
example.setOrderByClause("create_time desc");
return discountPkMapper.selectByExample(example);
}
}

@ -0,0 +1,117 @@
package com.hfkj.service.discount.impl;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.dao.BsDiscountPkStockBatchMapper;
import com.hfkj.entity.*;
import com.hfkj.service.discount.*;
import com.hfkj.sysenum.discount.DiscountStockCodeStatusEnum;
import org.apache.commons.collections4.MapUtils;
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;
/**
* @className: BsDiscountPkStockBatchServiceImpl
* @author: HuRui
* @date: 2024/9/2
**/
@Service("discountPkStockBatchService")
public class BsDiscountPkStockBatchServiceImpl implements BsDiscountPkStockBatchService {
@Resource
private BsDiscountPkStockBatchMapper discountPkStockBatchMapper;
@Resource
private BsDiscountPkService discountPkService;
@Resource
private BsDiscountPkStockCodeService discountPkStockCodeService;
@Override
public void editData(BsDiscountPkStockBatch data) {
if (data.getId() == null) {
data.setCreateTime(new Date());
data.setUpdateTime(new Date());
discountPkStockBatchMapper.insert(data);
data.setBatchNo(""+System.currentTimeMillis());
discountPkStockBatchMapper.updateByPrimaryKey(data);
} else {
data.setUpdateTime(new Date());
discountPkStockBatchMapper.updateByPrimaryKey(data);
}
}
@Override
public void addStock(String discountPkNo, Integer stockCount) {
// 查询优惠券
BsDiscountPk discountPk = discountPkService.getDetail(discountPkNo);
if (discountPk == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的优惠券");
}
BsDiscountPkStockBatch batch = new BsDiscountPkStockBatch();
batch.setDiscountPkId(discountPk.getId());
batch.setDiscountPkNo(discountPk.getDiscountPkNo());
batch.setDiscountPkName(discountPk.getDiscountPkName());
batch.setBatchStockNum(stockCount);
batch.setStatus(1);
editData(batch);
List<BsDiscountPkStockCode> stockCodeList = new ArrayList<>();
BsDiscountPkStockCode discountPkCode;
for (int i = 0;i < stockCount;i++) {
discountPkCode = new BsDiscountPkStockCode();
discountPkCode.setDiscountPkStockBatchId(batch.getId());
discountPkCode.setDiscountPkStockBatchNo(batch.getBatchNo());
discountPkCode.setDiscountPkId(discountPk.getId());
discountPkCode.setDiscountPkNo(discountPk.getDiscountPkNo());
discountPkCode.setDiscountPkName(discountPk.getDiscountPkName());
discountPkCode.setStatus(DiscountStockCodeStatusEnum.status1.getCode());
discountPkCode.setCreateTime(new Date());
discountPkCode.setUpdateTime(new Date());
stockCodeList.add(discountPkCode);
}
// 批量新增
discountPkStockCodeService.insertList(stockCodeList);
batch.setStartId(""+stockCodeList.get(0).getId());
batch.setEndId(""+stockCodeList.get(stockCount-1).getId());
editData(batch);
}
@Override
public BsDiscountPkStockBatch getStockBatchDetail(String batchNo) {
BsDiscountPkStockBatchExample example = new BsDiscountPkStockBatchExample();
example.createCriteria().andBatchNoEqualTo(batchNo).andStatusNotEqualTo(0);
List<BsDiscountPkStockBatch> list = discountPkStockBatchMapper.selectByExample(example);
if (!list.isEmpty()) {
return list.get(0);
}
return null;
}
@Override
public List<BsDiscountPkStockBatch> getStockBatchList(Map<String, Object> param) {
BsDiscountPkStockBatchExample example = new BsDiscountPkStockBatchExample();
BsDiscountPkStockBatchExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0);
if (StringUtils.isNotBlank(MapUtils.getString(param, "discountPkNo"))) {
criteria.andDiscountPkNoEqualTo("%"+MapUtils.getString(param, "discountNo")+"%");
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "discountPkName"))) {
criteria.andDiscountPkNameEqualTo("%"+MapUtils.getString(param, "discountPkName")+"%");
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "batchNo"))) {
criteria.andBatchNoLike("%"+MapUtils.getString(param, "batchNo")+"%");
}
example.setOrderByClause("create_time desc");
return discountPkStockBatchMapper.selectByExample(example);
}
}

@ -0,0 +1,86 @@
package com.hfkj.service.discount.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.dao.BsDiscountPkStockCodeMapper;
import com.hfkj.entity.BsDiscountPkStockCode;
import com.hfkj.entity.BsDiscountPkStockCodeExample;
import com.hfkj.entity.BsDiscountStockCode;
import com.hfkj.entity.BsDiscountStockCodeExample;
import com.hfkj.service.discount.BsDiscountPkStockCodeService;
import com.hfkj.service.discount.BsDiscountStockCodeService;
import com.hfkj.sysenum.discount.DiscountStockCodeStatusEnum;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @className: BsDiscountPkStockCodeServiceImpl
* @author: HuRui
* @date: 2024/9/2
**/
@Service("discountPkStockCodeService")
public class BsDiscountPkStockCodeServiceImpl implements BsDiscountPkStockCodeService {
@Resource
private BsDiscountPkStockCodeMapper discountPkStockCodeMapper;
@Override
public void insertList(List<BsDiscountPkStockCode> codeList) {
discountPkStockCodeMapper.insertList(codeList);
}
@Override
public void update(BsDiscountPkStockCode data) {
data.setUpdateTime(new Date());
discountPkStockCodeMapper.updateByPrimaryKeySelective(data);
}
@Override
public List<BsDiscountPkStockCode> getAssignCodeList(String discountPkNo, Integer number) {
// 分页
PageHelper.startPage(1,number);
BsDiscountPkStockCodeExample example = new BsDiscountPkStockCodeExample();
example.createCriteria().andDiscountPkNoEqualTo(discountPkNo).andStatusEqualTo(DiscountStockCodeStatusEnum.status1.getCode());
example.setOrderByClause("create_time");
PageInfo<BsDiscountPkStockCode> pageInfo = new PageInfo<>(discountPkStockCodeMapper.selectByExample(example));
if (pageInfo.getList().size() != number) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券库存不足");
}
return pageInfo.getList();
}
@Override
public List<BsDiscountPkStockCode> getCodeList(Map<String, Object> param) {
BsDiscountPkStockCodeExample example = new BsDiscountPkStockCodeExample();
BsDiscountPkStockCodeExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0);
if (MapUtils.getLong(param, "codeId") != null) {
criteria.andIdEqualTo(MapUtils.getLong(param, "codeId"));
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "discountPkNo"))) {
criteria.andDiscountPkNoLike("%"+MapUtils.getString(param, "discountPkNo")+"%");
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "batchNo"))) {
criteria.andDiscountPkStockBatchNoLike("%"+MapUtils.getString(param, "batchNo")+"%");
}
if (MapUtils.getInteger(param, "status") != null) {
criteria.andStatusEqualTo(MapUtils.getInteger(param, "status"));
}
example.setOrderByClause("create_time desc");
return discountPkStockCodeMapper.selectByExample(example);
}
}

@ -7,17 +7,19 @@ import com.hfkj.common.utils.RedisUtil;
import com.hfkj.dao.BsDiscountMapper;
import com.hfkj.entity.BsDiscount;
import com.hfkj.entity.BsDiscountExample;
import com.hfkj.entity.BsDiscountUseMer;
import com.hfkj.service.discount.BsDiscountService;
import com.hfkj.service.discount.BsDiscountUseMerService;
import com.hfkj.sysenum.discount.DiscountStatusEnum;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @className: BsDiscountServiceImpl
@ -26,10 +28,11 @@ import java.util.Map;
**/
@Service("discountService")
public class BsDiscountServiceImpl implements BsDiscountService {
@Resource
private BsDiscountMapper discountMapper;
@Resource
private BsDiscountUseMerService discountUseMerService;
@Resource
private RedisUtil redisUtil;
// 缓存优惠券
private final static String CACHE_DISCOUNT_KEY = "DISCOUNT:";
@ -53,6 +56,14 @@ public class BsDiscountServiceImpl implements BsDiscountService {
@Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor= {RuntimeException.class})
public void editDiscount(BsDiscount discount) {
editData(discount);
// 创建人类型 1:运营 2:商户【油站】
if (discount.getCreateUserType().equals(2)) {
if (StringUtils.isNotBlank(discount.getCreateUserMerNo())) {
discountUseMerService.configUseMer(discount.getDiscountNo(), Collections.singletonList(discount.getCreateUserMerNo()));
}
}
// 加入缓存
redisUtil.set(CACHE_DISCOUNT_KEY+discount.getDiscountNo(), discount);
}
@ -129,6 +140,10 @@ public class BsDiscountServiceImpl implements BsDiscountService {
BsDiscountExample example = new BsDiscountExample();
BsDiscountExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(DiscountStatusEnum.status0.getCode());
if (StringUtils.isNotBlank(MapUtils.getString(param, "discountName"))) {
criteria.andDiscountNameLike("%"+MapUtils.getString(param, "discountName")+"%");
}
if (MapUtils.getInteger(param, "discountType") != null) {
criteria.andDiscountTypeEqualTo(MapUtils.getInteger(param, "discountType"));
}

@ -7,14 +7,9 @@ import com.hfkj.common.exception.SysCode;
import com.hfkj.dao.BsDiscountUserMapper;
import com.hfkj.entity.*;
import com.hfkj.model.DiscountUserModel;
import com.hfkj.service.discount.BsDiscountService;
import com.hfkj.service.discount.BsDiscountStockCodeService;
import com.hfkj.service.discount.BsDiscountUserService;
import com.hfkj.service.discount.*;
import com.hfkj.service.user.BsUserService;
import com.hfkj.sysenum.discount.DiscountStatusEnum;
import com.hfkj.sysenum.discount.DiscountStockCodeObtainTypeEnum;
import com.hfkj.sysenum.discount.DiscountStockCodeStatusEnum;
import com.hfkj.sysenum.discount.DiscountUserStatusEnum;
import com.hfkj.sysenum.discount.*;
import org.apache.commons.collections4.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
@ -39,10 +34,18 @@ public class BsDiscountUserServiceImpl implements BsDiscountUserService {
@Resource
private BsDiscountService discountService;
@Resource
private BsUserService userService;
@Resource
private BsDiscountStockCodeService discountStockCodeService;
@Resource
private BsDiscountPkService discountPkService;
@Resource
private BsDiscountPkRelService discountPkRelService;
@Resource
private BsDiscountPkStockCodeService discountPkStockCodeService;
@Resource
private BsUserService userService;
private static final String RECEIVE_DISCOUNT_LOCK_KEY = "RECEIVE_DISCOUNT";
private static final String RECEIVE_DISCOUNT_PK_LOCK_KEY = "RECEIVE_DISCOUNT_PK";
private static final String USE_DISCOUNT_LOCK_KEY = "USE_DISCOUNT";
@Override
@ -57,7 +60,7 @@ public class BsDiscountUserServiceImpl implements BsDiscountUserService {
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
@Transactional(propagation= Propagation.REQUIRED)
public List<BsDiscountUser> receive(String discountNo, Integer number, DiscountStockCodeObtainTypeEnum obtainType, String userPhone,String agentAppid) {
// 锁编号
String lockKey = RECEIVE_DISCOUNT_LOCK_KEY+"_"+discountNo;
@ -68,7 +71,7 @@ public class BsDiscountUserServiceImpl implements BsDiscountUserService {
// 查询优惠券
BsDiscount discount = discountService.getDetail(discountNo);
if (discount == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的优惠券");
}
if (!discount.getStatus().equals(DiscountStatusEnum.status2.getCode())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法领取!优惠券未上线或已结束");
@ -94,6 +97,7 @@ public class BsDiscountUserServiceImpl implements BsDiscountUserService {
discountStockCode.setReceiveMerUserId(user.getId());
discountStockCode.setReceiveMerUserPhone(user.getPhone());
discountStockCode.setStatus(DiscountStockCodeStatusEnum.status3.getCode());
discountStockCode.setAgentAppid(agentAppid);
discountStockCodeService.update(discountStockCode);
// 优惠券绑定用户
@ -109,7 +113,7 @@ public class BsDiscountUserServiceImpl implements BsDiscountUserService {
discountUser.setDiscountStockCode(discountStockCode.getId());
discountUser.setUseScope(discount.getUseScope());
discountUser.setStatus(DiscountUserStatusEnum.type1.getCode());
discountUser.setAgentAppid(agentAppid);
// 计算使用有效期
Calendar expirationDate = Calendar.getInstance();
expirationDate.setTime(new Date());
@ -148,6 +152,82 @@ public class BsDiscountUserServiceImpl implements BsDiscountUserService {
return new ArrayList<>();
}
@Override
@Transactional(propagation= Propagation.REQUIRED)
public List<BsDiscountUser> receivePk(String discountPkNo, Integer number, DiscountStockCodeObtainTypeEnum obtainType, String userPhone, String agentAppid) {
// 锁编号
String lockKey = RECEIVE_DISCOUNT_PK_LOCK_KEY+"_"+discountPkNo;
// 获取锁
Boolean lock = redisTemplate.opsForValue().setIfAbsent(lockKey, "");
if (Boolean.TRUE.equals(lock)) {
try {
// 查询优惠券包
BsDiscountPk discountPk = discountPkService.getDetail(discountPkNo);
if (discountPk == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的优惠券包");
}
if (!discountPk.getStatus().equals(DiscountPkStatusEnum.status2.getCode())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券状态错误,未上架或已下线!");
}
// 查询用户
BsUser user = userService.getUser(userPhone);
if (user == null) {
// 注册
Map<String, Object> other = new HashMap<>();
other.put("agentAppid", agentAppid);
user = userService.register(userPhone, other);
}
List<BsDiscountUser> receiveList = new ArrayList<>();
// 优惠券包库存编码
List<BsDiscountPkStockCode> codeList = discountPkStockCodeService.getAssignCodeList(discountPkNo, number);
for (BsDiscountPkStockCode code : codeList) {
code.setObtainType(obtainType.getCode());
code.setObtainTime(new Date());
code.setReceiveMerUserId(user.getId());
code.setReceiveMerUserPhone(user.getPhone());
code.setStatus(DiscountStockCodeStatusEnum.status3.getCode());
code.setAgentAppid(agentAppid);
discountPkStockCodeService.update(code);
// 查询优惠券包下的优惠券
List<BsDiscountPkRel> discountPkRelList = discountPkRelService.getList(discountPkNo);
for (BsDiscountPkRel discount : discountPkRelList) {
// 领取优惠券到用户账户
List<BsDiscountUser> discountUsers = receive(discount.getDiscountNo(), discount.getNumber(), obtainType, userPhone, agentAppid);
for (BsDiscountUser discountUser : discountUsers) {
// 优惠券库存编码
BsDiscountStockCode discountStockCode = discountStockCodeService.getDetail(discountUser.getDiscountStockCode());
if (discountStockCode != null) {
discountStockCode.setDiscountPkStockCode(discountStockCode.getId());
discountStockCode.setDiscountPkId(discountPk.getId());
discountStockCode.setDiscountPkNo(discountPk.getDiscountPkNo());
discountStockCode.setDiscountPkName(discountPk.getDiscountPkName());
discountStockCodeService.update(discountStockCode);
}
}
receiveList.addAll(discountUsers);
}
}
return receiveList;
} catch (BaseException e) {
// 释放锁
redisTemplate.delete(lockKey);
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, e.getErrorMsg());
} catch (Exception e) {
// 释放锁
redisTemplate.delete(lockKey);
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "领取优惠券,遇到未知问题");
}
} else {
receivePk(discountPkNo, number, obtainType, userPhone, agentAppid);
}
return new ArrayList<>();
}
@Override
@Transactional(propagation= Propagation.REQUIRED)
public BsDiscountUser userDiscount(Long id) {
@ -240,4 +320,9 @@ public class BsDiscountUserServiceImpl implements BsDiscountUserService {
public List<DiscountUserModel> getUserDiscountList(Map<String, Object> param) {
return discountUserMapper.queryUserDiscountList(param);
}
@Override
public void expiration() {
discountUserMapper.expiration();
}
}

@ -52,4 +52,17 @@ public interface BsGasService {
* @return
*/
List<GasListModel> getGasList(String longitude,String latitude,String oilNo,String gasName,Integer distanceLimit, Boolean listShow);
/**
* 查询优惠券可用油站列表
* @param discountNo
* @param longitude
* @param latitude
* @param oilNo
* @param gasName
* @param distanceLimit
* @param listShow
* @return
*/
List<GasListModel> getGasListByDiscount(String discountNo,String longitude,String latitude,String oilNo,String gasName,Integer distanceLimit, Boolean listShow);
}

@ -191,4 +191,9 @@ public class BsGasServiceImpl implements BsGasService {
return merchantMapper.queryGasList(longitude,latitude,oilNo,gasName,distanceLimit,listShow);
}
@Override
public List<GasListModel> getGasListByDiscount(String discountNo, String longitude, String latitude, String oilNo, String gasName, Integer distanceLimit, Boolean listShow) {
return merchantMapper.queryGasListByDiscount(discountNo,longitude,latitude,oilNo,gasName,distanceLimit,listShow);
}
}

@ -143,6 +143,7 @@ public class OrderCreateService {
gasOrder.setDeductionOilPrice(priceModel.getTotalPreferences());
gasOrder.setTotalDeductionPrice(gasOrder.getDeductionOilPrice().add(gasOrder.getDeductionCouponPrice()));
gasOrder.setPayablePrice(priceModel.getPayPrice().subtract(gasOrder.getTotalDeductionPrice()));
gasOrder.setPayablePrice(gasOrder.getPayablePrice().compareTo(new BigDecimal("0"))>=0?gasOrder.getPayablePrice():new BigDecimal("0"));
// 油价信息
gasOrder.setGasRefuelPrice(orderChild.getProductPrice());

@ -116,6 +116,7 @@ public class BsOrderServiceImpl implements BsOrderService {
deduction.setIntegralDiscountPrice(deduction.getIntegralDiscountPrice()==null?0L: deduction.getIntegralDiscountPrice());
deduction.setCouponDiscountPrice(new BigDecimal("0"));
deduction.setCouponDiscountActualPrice(new BigDecimal("0"));
if (deduction.getUserCouponDiscountId() != null) {
// 使用优惠券
BsDiscountUser discountUser = discountUserService.userDiscount(deduction.getUserCouponDiscountId());
@ -135,12 +136,15 @@ public class BsOrderServiceImpl implements BsOrderService {
deduction.setCouponDiscountActualPrice(discountUser.getDiscountPrice());
} else if (DiscountTypeEnum.type3.getCode().equals(discountUser.getDiscountType())) {
// 订单总额 * 折扣 = 优惠实际金额
deduction.setCouponDiscountActualPrice(order.getTotalPrice().multiply(discountUser.getDiscountPrice()).setScale(2, BigDecimal.ROUND_HALF_DOWN));
// 订单总额 - (订单总额 * 折扣) = 优惠金额
deduction.setCouponDiscountActualPrice(order.getTotalPrice().subtract(
order.getTotalPrice().multiply(discountUser.getDiscountPrice().divide(new BigDecimal("100"))).setScale(2, BigDecimal.ROUND_HALF_DOWN)
));
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的油站");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的优惠券类型");
}
}
deduction.setTotalDeductionPrice(deduction.getCouponDiscountActualPrice().add(new BigDecimal(deduction.getIntegralDiscountPrice().toString()).divide(new BigDecimal("100"))));
orderDeductionService.editData(deduction);
order.setDeduction(deduction);
@ -222,9 +226,9 @@ public class BsOrderServiceImpl implements BsOrderService {
editData(order);
if (order.getOrderStatus().equals(OrderStatusEnum.status1.getCode())) {
/* // 10分钟内未支付,自动取消订单
// 10分钟内未支付,自动取消订单
Message<OrderModel> rocketMsg = MessageBuilder.withPayload(order).build();
rocketMQTemplate.syncSend(OrderTopic.ORDER_TOPIC_CANCEL.getTopic(), rocketMsg,1000,14);*/
rocketMQTemplate.syncSend(OrderTopic.ORDER_TOPIC_CANCEL.getTopic(), rocketMsg,1000,14);
} else if (order.getOrderStatus().equals(OrderStatusEnum.status2.getCode())) {
// 支付校验

@ -0,0 +1,46 @@
package com.hfkj.sysenum.discount;
import java.util.Objects;
/**
* 优惠券包状态
* @author hurui
*/
public enum DiscountPkStatusEnum {
status0(0 , "删除"),
status1(1 , "编辑中"),
status2(2 , "已上线"),
status3(3 , "已结束"),
;
private Integer code;
private String name;
DiscountPkStatusEnum(int code , String name) {
this.code = code;
this.name = name;
}
public static String getNameByType(Integer code) {
for (DiscountPkStatusEnum ele : values()) {
if(Objects.equals(code,ele.getCode())) return ele.getName();
}
return null;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

@ -0,0 +1,45 @@
package com.hfkj.sysenum.discount;
import java.util.Objects;
/**
* 优惠券包code状态
* @author hurui
*/
public enum DiscountPkStockCodeStatusEnum {
status0(0 , "删除"),
status1(1 , "未领取"),
status2(2 , "已领取"),
;
private Integer code;
private String name;
DiscountPkStockCodeStatusEnum(int code , String name) {
this.code = code;
this.name = name;
}
public static String getNameByType(Integer code) {
for (DiscountPkStockCodeStatusEnum ele : values()) {
if(Objects.equals(code,ele.getCode())) return ele.getName();
}
return null;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
Loading…
Cancel
Save