parent
e6389261ce
commit
264ee4c947
@ -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); |
||||
} |
||||
} |
||||
|
||||
} |
@ -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); |
||||
} |
||||
} |
||||
|
||||
} |
@ -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); |
||||
} |
||||
|
||||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -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("更新价格失败!!!"); |
||||
} |
||||
} |
||||
|
||||
} |
@ -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()); |
||||
} |
||||
} |
||||
} |
@ -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()); |
||||
} |
||||
} |
||||
} |
@ -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); |
||||
} |
||||
} |
||||
} |
@ -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(); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -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(); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -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(); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -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: 赠送 4:API |
||||
*/ |
||||
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(); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -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; |
||||
|
||||
} |
@ -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; |
||||
|
||||
} |
@ -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); |
||||
|
||||
} |
@ -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); |
||||
} |
||||
} |
@ -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…
Reference in new issue