parent
e27e2b4678
commit
2e55eb832c
@ -0,0 +1,97 @@ |
||||
package com.cweb.controller; |
||||
|
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.common.utils.ResponseMsgUtil; |
||||
import com.hfkj.model.ResponseData; |
||||
import com.hfkj.service.rebate.BsRebateActivityAccountService; |
||||
import com.hfkj.service.rebate.BsRebateActivityService; |
||||
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; |
||||
|
||||
/** |
||||
* @className: BsRebateActivityController |
||||
* @author: HuRui |
||||
* @date: 2023/10/18 |
||||
**/ |
||||
@Controller |
||||
@Api(value = "活动金 - 活动账户") |
||||
@RequestMapping(value = "/rebateActivityAccount") |
||||
public class BsRebateActivityAccountController { |
||||
|
||||
private static Logger log = LoggerFactory.getLogger(BsRebateActivityAccountController.class); |
||||
|
||||
@Resource |
||||
private BsRebateActivityService rebateActivityService; |
||||
@Resource |
||||
private BsRebateActivityAccountService rebateActivityAccountService; |
||||
|
||||
@RequestMapping(value="/recharge",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "充值金额") |
||||
public ResponseData recharge(@RequestBody JSONObject body) { |
||||
try { |
||||
|
||||
if (body == null |
||||
|| StringUtils.isBlank(body.getString("activityNo")) |
||||
|| body.getBigDecimal("amount") == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
rebateActivityAccountService.recharge(body.getString("activityNo"), body.getBigDecimal("amount")); |
||||
|
||||
return ResponseMsgUtil.success("操作成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error(e.getMessage(), e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/recover",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "回收余额") |
||||
public ResponseData recover(@RequestBody JSONObject body) { |
||||
try { |
||||
|
||||
if (body == null || StringUtils.isBlank(body.getString("activityNo"))) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
Boolean result = rebateActivityAccountService.recover(body.getString("activityNo")); |
||||
if (!result) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "回收余额失败"); |
||||
} |
||||
|
||||
return ResponseMsgUtil.success("操作成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error(e.getMessage(), e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/getActivityAccount",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询活动账户") |
||||
public ResponseData getActivityAccount(@RequestParam(value = "activityNo" , required = true) String activityNo) { |
||||
try { |
||||
|
||||
return ResponseMsgUtil.success(rebateActivityAccountService.getAccountByActivityNo(activityNo)); |
||||
|
||||
} catch (Exception e) { |
||||
log.error(e.getMessage(), e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,294 @@ |
||||
package com.cweb.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.utils.ResponseMsgUtil; |
||||
import com.hfkj.entity.BsMer; |
||||
import com.hfkj.entity.BsRebateActivity; |
||||
import com.hfkj.model.ResponseData; |
||||
import com.hfkj.service.BsMerService; |
||||
import com.hfkj.service.rebate.BsRebateActivityAccountService; |
||||
import com.hfkj.service.rebate.BsRebateActivityService; |
||||
import com.hfkj.sysenum.RebateActivityPartakeTypeEnum; |
||||
import com.hfkj.sysenum.RebateActivityPreferentialTypeEnum; |
||||
import com.hfkj.sysenum.RebateActivityStatusEnum; |
||||
import com.hfkj.sysenum.RebateActivityTypeEnum; |
||||
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; |
||||
|
||||
/** |
||||
* @className: BsRebateActivityController |
||||
* @author: HuRui |
||||
* @date: 2023/10/18 |
||||
**/ |
||||
@Controller |
||||
@Api(value = "活动金 - 活动配置") |
||||
@RequestMapping(value = "/rebateActivity") |
||||
public class BsRebateActivityController { |
||||
|
||||
private static Logger log = LoggerFactory.getLogger(BsRebateActivityController.class); |
||||
|
||||
@Resource |
||||
private BsRebateActivityService rebateActivityService; |
||||
@Resource |
||||
private BsRebateActivityAccountService rebateActivityAccountService; |
||||
@Resource |
||||
private BsMerService merService; |
||||
|
||||
@RequestMapping(value="/addActivity",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "增加活动") |
||||
public ResponseData addActivity(@RequestBody JSONObject body) { |
||||
try { |
||||
|
||||
if (body == null |
||||
|| StringUtils.isBlank(body.getString("merNo")) |
||||
|| body.getInteger("activityType") == null |
||||
|| body.getInteger("preferentialType") == null |
||||
|| body.getBigDecimal("price") == null |
||||
|| body.getLong("endTime") == null |
||||
) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
// 活动类型
|
||||
RebateActivityTypeEnum activityType = RebateActivityTypeEnum.getDataByNumber(body.getInteger("activityType")); |
||||
if (activityType == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的活动类型"); |
||||
} |
||||
// 优惠类型
|
||||
RebateActivityPreferentialTypeEnum preferentialType = RebateActivityPreferentialTypeEnum.getDataByNumber(body.getInteger("activityType")); |
||||
if (preferentialType == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的优惠类型"); |
||||
} |
||||
// 满减条件
|
||||
if (preferentialType.getNumber().equals(RebateActivityPreferentialTypeEnum.type3.getNumber()) |
||||
&& body.getBigDecimal("condition") == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "满减类型未设置满减条件"); |
||||
} |
||||
// 限制类型
|
||||
if (body.getInteger("partakeType") != null) { |
||||
Integer partakeType = body.getInteger("partakeType"); |
||||
|
||||
if (RebateActivityPartakeTypeEnum.type1.getNumber().equals(partakeType) |
||||
&& body.getInteger("partakeNum") == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "需要上传限制使用次数"); |
||||
} |
||||
} |
||||
|
||||
// 查询商户
|
||||
BsMer mer = merService.getMer(body.getString("merNo")); |
||||
if (mer == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); |
||||
} |
||||
BsRebateActivity activity = new BsRebateActivity(); |
||||
activity.setMerId(mer.getId()); |
||||
activity.setMerNo(mer.getMerNo()); |
||||
activity.setMerName(mer.getMerName()); |
||||
activity.setMerAbbreviate(mer.getMerAbbreviate()); |
||||
activity.setActivityNo(System.currentTimeMillis()+""); |
||||
activity.setActivityType(activityType.getNumber()); |
||||
activity.setPreferentialType(preferentialType.getNumber()); |
||||
activity.setPrice(body.getBigDecimal("price")); |
||||
activity.setCondition(body.getBigDecimal("condition")); |
||||
activity.setEndTime(new Date(body.getLong("endTime"))); |
||||
activity.setRestrictPartakeType(body.getInteger("partakeType")); |
||||
activity.setRestrictPartakeNum(body.getInteger("partakeNum")); |
||||
activity.setStatus(RebateActivityStatusEnum.status1.getNumber()); |
||||
rebateActivityService.editData(activity); |
||||
|
||||
return ResponseMsgUtil.success("操作成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error(e.getMessage(), e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/updateActivity",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "修改活动") |
||||
public ResponseData updateActivity(@RequestBody JSONObject body) { |
||||
try { |
||||
|
||||
if (body == null |
||||
|| StringUtils.isBlank(body.getString("activityNo")) |
||||
|| body.getInteger("activityType") == null |
||||
|| body.getInteger("preferentialType") == null |
||||
|| body.getBigDecimal("price") == null |
||||
|| body.getLong("endTime") == null |
||||
) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
// 活动类型
|
||||
RebateActivityTypeEnum activityType = RebateActivityTypeEnum.getDataByNumber(body.getInteger("activityType")); |
||||
if (activityType == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的活动类型"); |
||||
} |
||||
// 优惠类型
|
||||
RebateActivityPreferentialTypeEnum preferentialType = RebateActivityPreferentialTypeEnum.getDataByNumber(body.getInteger("activityType")); |
||||
if (preferentialType == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的优惠类型"); |
||||
} |
||||
// 满减条件
|
||||
if (preferentialType.getNumber().equals(RebateActivityPreferentialTypeEnum.type3.getNumber()) |
||||
&& body.getBigDecimal("condition") == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "满减类型未设置满减条件"); |
||||
} |
||||
// 限制类型
|
||||
if (body.getInteger("partakeType") != null) { |
||||
Integer partakeType = body.getInteger("partakeType"); |
||||
|
||||
if (RebateActivityPartakeTypeEnum.type1.getNumber().equals(partakeType) |
||||
&& body.getInteger("partakeNum") == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "需要上传限制使用次数"); |
||||
} |
||||
} |
||||
// 查询活动
|
||||
BsRebateActivity activity = rebateActivityService.getActivityByNo(body.getString("activityNo")); |
||||
if (activity == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); |
||||
} |
||||
if (!activity.getStatus().equals(RebateActivityStatusEnum.status1.getNumber())) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前活动状态无法修改"); |
||||
} |
||||
activity.setActivityNo(System.currentTimeMillis()+""); |
||||
activity.setActivityType(activityType.getNumber()); |
||||
activity.setPreferentialType(preferentialType.getNumber()); |
||||
activity.setPrice(body.getBigDecimal("price")); |
||||
activity.setCondition(body.getBigDecimal("condition")); |
||||
activity.setEndTime(new Date(body.getLong("endTime"))); |
||||
activity.setRestrictPartakeType(body.getInteger("partakeType")); |
||||
activity.setRestrictPartakeNum(body.getInteger("partakeNum")); |
||||
rebateActivityService.editData(activity); |
||||
|
||||
return ResponseMsgUtil.success("操作成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error(e.getMessage(), e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/openActivity",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "开启活动") |
||||
public ResponseData openActivity(@RequestBody JSONObject body) { |
||||
try { |
||||
if (body == null || StringUtils.isBlank(body.getString("activityNo"))) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
rebateActivityService.openActivity(body.getString("activityNo")); |
||||
|
||||
return ResponseMsgUtil.success("操作成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error(e.getMessage(), e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/closeActivity",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "关闭活动") |
||||
public ResponseData closeActivity(@RequestBody JSONObject body) { |
||||
try { |
||||
if (body == null || StringUtils.isBlank(body.getString("activityNo"))) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
rebateActivityService.closeActivity(body.getString("activityNo")); |
||||
|
||||
return ResponseMsgUtil.success("操作成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error(e.getMessage(), e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/updateActivityEndTime",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "修改活动结束时间") |
||||
public ResponseData updateActivityEndTime(@RequestBody JSONObject body) { |
||||
try { |
||||
if (body == null || StringUtils.isBlank(body.getString("activityNo")) || body.getLong("endTime") == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
rebateActivityService.updateActivityEndTime(body.getString("activityNo"), new Date(body.getLong("endTime"))); |
||||
|
||||
return ResponseMsgUtil.success("操作成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error(e.getMessage(), e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/getActivityDetail",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询活动详情") |
||||
public ResponseData getActivityDetail(@RequestParam(value = "activityNo" , required = true) String activityNo) { |
||||
try { |
||||
// 查询活动
|
||||
BsRebateActivity activity = rebateActivityService.getActivityByNo(activityNo); |
||||
if (activity == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到活动"); |
||||
} |
||||
activity.setActivityAccount(rebateActivityAccountService.getAccountByActivityNo(activityNo)); |
||||
return ResponseMsgUtil.success(activity); |
||||
|
||||
} catch (Exception e) { |
||||
log.error(e.getMessage(), e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/getActivityList",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询活动列表") |
||||
public ResponseData getActivityList(@RequestParam(value = "activityNo" , required = false) String activityNo, |
||||
@RequestParam(value = "merNo" , required = false) String merNo, |
||||
@RequestParam(value = "merName" , required = false) String merName, |
||||
@RequestParam(value = "merAbbreviate" , required = false) String merAbbreviate, |
||||
@RequestParam(value = "status" , required = false) Integer status, |
||||
@RequestParam(value = "pageNum" , required = true) Integer pageNum, |
||||
@RequestParam(value = "pageSize" , required = true) Integer pageSize) { |
||||
try { |
||||
|
||||
Map<String,Object> param = new HashMap<>(); |
||||
param.put("activityNo", activityNo); |
||||
param.put("merNo", merNo); |
||||
param.put("merName", merName); |
||||
param.put("merAbbreviate", merAbbreviate); |
||||
param.put("status", status); |
||||
|
||||
PageHelper.startPage(pageNum,pageSize); |
||||
PageInfo<BsRebateActivity> pageInfo = new PageInfo<>(rebateActivityService.getActivityList(param)); |
||||
for (BsRebateActivity activity : pageInfo.getList()) { |
||||
activity.setActivityAccount(rebateActivityAccountService.getAccountByActivityNo(activity.getActivityNo())); |
||||
} |
||||
return ResponseMsgUtil.success(pageInfo); |
||||
|
||||
} catch (Exception e) { |
||||
log.error(e.getMessage(), e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,117 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsRebateActivityAccount; |
||||
import com.hfkj.entity.BsRebateActivityAccountExample; |
||||
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 BsRebateActivityAccountMapper extends BsRebateActivityAccountMapperExt { |
||||
@SelectProvider(type=BsRebateActivityAccountSqlProvider.class, method="countByExample") |
||||
long countByExample(BsRebateActivityAccountExample example); |
||||
|
||||
@DeleteProvider(type=BsRebateActivityAccountSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(BsRebateActivityAccountExample example); |
||||
|
||||
@Delete({ |
||||
"delete from bs_rebate_activity_account", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into bs_rebate_activity_account (activity_id, activity_no, ", |
||||
"amount, create_time, ", |
||||
"update_time, `status`, ", |
||||
"ext_1, ext_2, ext_3)", |
||||
"values (#{activityId,jdbcType=BIGINT}, #{activityNo,jdbcType=VARCHAR}, ", |
||||
"#{amount,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, ", |
||||
"#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ", |
||||
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(BsRebateActivityAccount record); |
||||
|
||||
@InsertProvider(type=BsRebateActivityAccountSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(BsRebateActivityAccount record); |
||||
|
||||
@SelectProvider(type=BsRebateActivityAccountSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="activity_id", property="activityId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="activity_no", property="activityNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="amount", property="amount", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@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<BsRebateActivityAccount> selectByExample(BsRebateActivityAccountExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, activity_id, activity_no, amount, create_time, update_time, `status`, ext_1, ", |
||||
"ext_2, ext_3", |
||||
"from bs_rebate_activity_account", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="activity_id", property="activityId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="activity_no", property="activityNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="amount", property="amount", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@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) |
||||
}) |
||||
BsRebateActivityAccount selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=BsRebateActivityAccountSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") BsRebateActivityAccount record, @Param("example") BsRebateActivityAccountExample example); |
||||
|
||||
@UpdateProvider(type=BsRebateActivityAccountSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") BsRebateActivityAccount record, @Param("example") BsRebateActivityAccountExample example); |
||||
|
||||
@UpdateProvider(type=BsRebateActivityAccountSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(BsRebateActivityAccount record); |
||||
|
||||
@Update({ |
||||
"update bs_rebate_activity_account", |
||||
"set activity_id = #{activityId,jdbcType=BIGINT},", |
||||
"activity_no = #{activityNo,jdbcType=VARCHAR},", |
||||
"amount = #{amount,jdbcType=DECIMAL},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"update_time = #{updateTime,jdbcType=TIMESTAMP},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(BsRebateActivityAccount record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface BsRebateActivityAccountMapperExt { |
||||
} |
@ -0,0 +1,147 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsRebateActivityAccountRecord; |
||||
import com.hfkj.entity.BsRebateActivityAccountRecordExample; |
||||
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 BsRebateActivityAccountRecordMapper extends BsRebateActivityAccountRecordMapperExt { |
||||
@SelectProvider(type=BsRebateActivityAccountRecordSqlProvider.class, method="countByExample") |
||||
long countByExample(BsRebateActivityAccountRecordExample example); |
||||
|
||||
@DeleteProvider(type=BsRebateActivityAccountRecordSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(BsRebateActivityAccountRecordExample example); |
||||
|
||||
@Delete({ |
||||
"delete from bs_rebate_activity_account_record", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into bs_rebate_activity_account_record (activity_id, activity_no, ", |
||||
"account_id, trade_type, ", |
||||
"trade_number, trade_amount, ", |
||||
"amount_before_change, amount_after_change, ", |
||||
"object_type, object_id, ", |
||||
"object_content, `status`, ", |
||||
"create_time, ext_1, ", |
||||
"ext_2, ext_3)", |
||||
"values (#{activityId,jdbcType=BIGINT}, #{activityNo,jdbcType=VARCHAR}, ", |
||||
"#{accountId,jdbcType=BIGINT}, #{tradeType,jdbcType=INTEGER}, ", |
||||
"#{tradeNumber,jdbcType=VARCHAR}, #{tradeAmount,jdbcType=DECIMAL}, ", |
||||
"#{amountBeforeChange,jdbcType=DECIMAL}, #{amountAfterChange,jdbcType=DECIMAL}, ", |
||||
"#{objectType,jdbcType=INTEGER}, #{objectId,jdbcType=BIGINT}, ", |
||||
"#{objectContent,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", |
||||
"#{createTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", |
||||
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(BsRebateActivityAccountRecord record); |
||||
|
||||
@InsertProvider(type=BsRebateActivityAccountRecordSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(BsRebateActivityAccountRecord record); |
||||
|
||||
@SelectProvider(type=BsRebateActivityAccountRecordSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="activity_id", property="activityId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="activity_no", property="activityNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="account_id", property="accountId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="trade_type", property="tradeType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="trade_number", property="tradeNumber", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="trade_amount", property="tradeAmount", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="amount_before_change", property="amountBeforeChange", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="amount_after_change", property="amountAfterChange", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="object_type", property="objectType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="object_content", property="objectContent", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@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<BsRebateActivityAccountRecord> selectByExample(BsRebateActivityAccountRecordExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, activity_id, activity_no, account_id, trade_type, trade_number, trade_amount, ", |
||||
"amount_before_change, amount_after_change, object_type, object_id, object_content, ", |
||||
"`status`, create_time, ext_1, ext_2, ext_3", |
||||
"from bs_rebate_activity_account_record", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="activity_id", property="activityId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="activity_no", property="activityNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="account_id", property="accountId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="trade_type", property="tradeType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="trade_number", property="tradeNumber", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="trade_amount", property="tradeAmount", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="amount_before_change", property="amountBeforeChange", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="amount_after_change", property="amountAfterChange", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="object_type", property="objectType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="object_content", property="objectContent", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@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) |
||||
}) |
||||
BsRebateActivityAccountRecord selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=BsRebateActivityAccountRecordSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") BsRebateActivityAccountRecord record, @Param("example") BsRebateActivityAccountRecordExample example); |
||||
|
||||
@UpdateProvider(type=BsRebateActivityAccountRecordSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") BsRebateActivityAccountRecord record, @Param("example") BsRebateActivityAccountRecordExample example); |
||||
|
||||
@UpdateProvider(type=BsRebateActivityAccountRecordSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(BsRebateActivityAccountRecord record); |
||||
|
||||
@Update({ |
||||
"update bs_rebate_activity_account_record", |
||||
"set activity_id = #{activityId,jdbcType=BIGINT},", |
||||
"activity_no = #{activityNo,jdbcType=VARCHAR},", |
||||
"account_id = #{accountId,jdbcType=BIGINT},", |
||||
"trade_type = #{tradeType,jdbcType=INTEGER},", |
||||
"trade_number = #{tradeNumber,jdbcType=VARCHAR},", |
||||
"trade_amount = #{tradeAmount,jdbcType=DECIMAL},", |
||||
"amount_before_change = #{amountBeforeChange,jdbcType=DECIMAL},", |
||||
"amount_after_change = #{amountAfterChange,jdbcType=DECIMAL},", |
||||
"object_type = #{objectType,jdbcType=INTEGER},", |
||||
"object_id = #{objectId,jdbcType=BIGINT},", |
||||
"object_content = #{objectContent,jdbcType=VARCHAR},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"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(BsRebateActivityAccountRecord record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface BsRebateActivityAccountRecordMapperExt { |
||||
} |
@ -0,0 +1,402 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsRebateActivityAccountRecord; |
||||
import com.hfkj.entity.BsRebateActivityAccountRecordExample.Criteria; |
||||
import com.hfkj.entity.BsRebateActivityAccountRecordExample.Criterion; |
||||
import com.hfkj.entity.BsRebateActivityAccountRecordExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class BsRebateActivityAccountRecordSqlProvider { |
||||
|
||||
public String countByExample(BsRebateActivityAccountRecordExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("bs_rebate_activity_account_record"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(BsRebateActivityAccountRecordExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("bs_rebate_activity_account_record"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(BsRebateActivityAccountRecord record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("bs_rebate_activity_account_record"); |
||||
|
||||
if (record.getActivityId() != null) { |
||||
sql.VALUES("activity_id", "#{activityId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getActivityNo() != null) { |
||||
sql.VALUES("activity_no", "#{activityNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getAccountId() != null) { |
||||
sql.VALUES("account_id", "#{accountId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getTradeType() != null) { |
||||
sql.VALUES("trade_type", "#{tradeType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getTradeNumber() != null) { |
||||
sql.VALUES("trade_number", "#{tradeNumber,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getTradeAmount() != null) { |
||||
sql.VALUES("trade_amount", "#{tradeAmount,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getAmountBeforeChange() != null) { |
||||
sql.VALUES("amount_before_change", "#{amountBeforeChange,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getAmountAfterChange() != null) { |
||||
sql.VALUES("amount_after_change", "#{amountAfterChange,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getObjectType() != null) { |
||||
sql.VALUES("object_type", "#{objectType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getObjectId() != null) { |
||||
sql.VALUES("object_id", "#{objectId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getObjectContent() != null) { |
||||
sql.VALUES("object_content", "#{objectContent,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.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(BsRebateActivityAccountRecordExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("activity_id"); |
||||
sql.SELECT("activity_no"); |
||||
sql.SELECT("account_id"); |
||||
sql.SELECT("trade_type"); |
||||
sql.SELECT("trade_number"); |
||||
sql.SELECT("trade_amount"); |
||||
sql.SELECT("amount_before_change"); |
||||
sql.SELECT("amount_after_change"); |
||||
sql.SELECT("object_type"); |
||||
sql.SELECT("object_id"); |
||||
sql.SELECT("object_content"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("bs_rebate_activity_account_record"); |
||||
applyWhere(sql, example, false); |
||||
|
||||
if (example != null && example.getOrderByClause() != null) { |
||||
sql.ORDER_BY(example.getOrderByClause()); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExampleSelective(Map<String, Object> parameter) { |
||||
BsRebateActivityAccountRecord record = (BsRebateActivityAccountRecord) parameter.get("record"); |
||||
BsRebateActivityAccountRecordExample example = (BsRebateActivityAccountRecordExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_rebate_activity_account_record"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getActivityId() != null) { |
||||
sql.SET("activity_id = #{record.activityId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getActivityNo() != null) { |
||||
sql.SET("activity_no = #{record.activityNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getAccountId() != null) { |
||||
sql.SET("account_id = #{record.accountId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getTradeType() != null) { |
||||
sql.SET("trade_type = #{record.tradeType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getTradeNumber() != null) { |
||||
sql.SET("trade_number = #{record.tradeNumber,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getTradeAmount() != null) { |
||||
sql.SET("trade_amount = #{record.tradeAmount,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getAmountBeforeChange() != null) { |
||||
sql.SET("amount_before_change = #{record.amountBeforeChange,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getAmountAfterChange() != null) { |
||||
sql.SET("amount_after_change = #{record.amountAfterChange,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getObjectType() != null) { |
||||
sql.SET("object_type = #{record.objectType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getObjectId() != null) { |
||||
sql.SET("object_id = #{record.objectId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getObjectContent() != null) { |
||||
sql.SET("object_content = #{record.objectContent,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.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_rebate_activity_account_record"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("activity_id = #{record.activityId,jdbcType=BIGINT}"); |
||||
sql.SET("activity_no = #{record.activityNo,jdbcType=VARCHAR}"); |
||||
sql.SET("account_id = #{record.accountId,jdbcType=BIGINT}"); |
||||
sql.SET("trade_type = #{record.tradeType,jdbcType=INTEGER}"); |
||||
sql.SET("trade_number = #{record.tradeNumber,jdbcType=VARCHAR}"); |
||||
sql.SET("trade_amount = #{record.tradeAmount,jdbcType=DECIMAL}"); |
||||
sql.SET("amount_before_change = #{record.amountBeforeChange,jdbcType=DECIMAL}"); |
||||
sql.SET("amount_after_change = #{record.amountAfterChange,jdbcType=DECIMAL}"); |
||||
sql.SET("object_type = #{record.objectType,jdbcType=INTEGER}"); |
||||
sql.SET("object_id = #{record.objectId,jdbcType=BIGINT}"); |
||||
sql.SET("object_content = #{record.objectContent,jdbcType=VARCHAR}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
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}"); |
||||
|
||||
BsRebateActivityAccountRecordExample example = (BsRebateActivityAccountRecordExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(BsRebateActivityAccountRecord record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_rebate_activity_account_record"); |
||||
|
||||
if (record.getActivityId() != null) { |
||||
sql.SET("activity_id = #{activityId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getActivityNo() != null) { |
||||
sql.SET("activity_no = #{activityNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getAccountId() != null) { |
||||
sql.SET("account_id = #{accountId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getTradeType() != null) { |
||||
sql.SET("trade_type = #{tradeType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getTradeNumber() != null) { |
||||
sql.SET("trade_number = #{tradeNumber,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getTradeAmount() != null) { |
||||
sql.SET("trade_amount = #{tradeAmount,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getAmountBeforeChange() != null) { |
||||
sql.SET("amount_before_change = #{amountBeforeChange,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getAmountAfterChange() != null) { |
||||
sql.SET("amount_after_change = #{amountAfterChange,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getObjectType() != null) { |
||||
sql.SET("object_type = #{objectType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getObjectId() != null) { |
||||
sql.SET("object_id = #{objectId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getObjectContent() != null) { |
||||
sql.SET("object_content = #{objectContent,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.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, BsRebateActivityAccountRecordExample 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,304 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsRebateActivityAccount; |
||||
import com.hfkj.entity.BsRebateActivityAccountExample.Criteria; |
||||
import com.hfkj.entity.BsRebateActivityAccountExample.Criterion; |
||||
import com.hfkj.entity.BsRebateActivityAccountExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class BsRebateActivityAccountSqlProvider { |
||||
|
||||
public String countByExample(BsRebateActivityAccountExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("bs_rebate_activity_account"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(BsRebateActivityAccountExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("bs_rebate_activity_account"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(BsRebateActivityAccount record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("bs_rebate_activity_account"); |
||||
|
||||
if (record.getActivityId() != null) { |
||||
sql.VALUES("activity_id", "#{activityId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getActivityNo() != null) { |
||||
sql.VALUES("activity_no", "#{activityNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getAmount() != null) { |
||||
sql.VALUES("amount", "#{amount,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
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(BsRebateActivityAccountExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("activity_id"); |
||||
sql.SELECT("activity_no"); |
||||
sql.SELECT("amount"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("update_time"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("bs_rebate_activity_account"); |
||||
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) { |
||||
BsRebateActivityAccount record = (BsRebateActivityAccount) parameter.get("record"); |
||||
BsRebateActivityAccountExample example = (BsRebateActivityAccountExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_rebate_activity_account"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getActivityId() != null) { |
||||
sql.SET("activity_id = #{record.activityId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getActivityNo() != null) { |
||||
sql.SET("activity_no = #{record.activityNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getAmount() != null) { |
||||
sql.SET("amount = #{record.amount,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
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.getStatus() != null) { |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
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_rebate_activity_account"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("activity_id = #{record.activityId,jdbcType=BIGINT}"); |
||||
sql.SET("activity_no = #{record.activityNo,jdbcType=VARCHAR}"); |
||||
sql.SET("amount = #{record.amount,jdbcType=DECIMAL}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
|
||||
BsRebateActivityAccountExample example = (BsRebateActivityAccountExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(BsRebateActivityAccount record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_rebate_activity_account"); |
||||
|
||||
if (record.getActivityId() != null) { |
||||
sql.SET("activity_id = #{activityId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getActivityNo() != null) { |
||||
sql.SET("activity_no = #{activityNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getAmount() != null) { |
||||
sql.SET("amount = #{amount,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
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, BsRebateActivityAccountExample 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,164 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsRebateActivity; |
||||
import com.hfkj.entity.BsRebateActivityExample; |
||||
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 BsRebateActivityMapper extends BsRebateActivityMapperExt { |
||||
@SelectProvider(type=BsRebateActivitySqlProvider.class, method="countByExample") |
||||
long countByExample(BsRebateActivityExample example); |
||||
|
||||
@DeleteProvider(type=BsRebateActivitySqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(BsRebateActivityExample example); |
||||
|
||||
@Delete({ |
||||
"delete from bs_rebate_activity", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into bs_rebate_activity (mer_id, mer_no, ", |
||||
"mer_name, mer_abbreviate, ", |
||||
"activity_no, activity_type, ", |
||||
"preferential_type, `condition`, ", |
||||
"price, restrict_partake_type, ", |
||||
"restrict_partake_num, start_time, ", |
||||
"end_time, reality_end_time, ", |
||||
"`status`, create_time, ", |
||||
"update_time, ext_1, ", |
||||
"ext_2, ext_3)", |
||||
"values (#{merId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, ", |
||||
"#{merName,jdbcType=VARCHAR}, #{merAbbreviate,jdbcType=VARCHAR}, ", |
||||
"#{activityNo,jdbcType=VARCHAR}, #{activityType,jdbcType=INTEGER}, ", |
||||
"#{preferentialType,jdbcType=INTEGER}, #{condition,jdbcType=DECIMAL}, ", |
||||
"#{price,jdbcType=DECIMAL}, #{restrictPartakeType,jdbcType=INTEGER}, ", |
||||
"#{restrictPartakeNum,jdbcType=INTEGER}, #{startTime,jdbcType=TIMESTAMP}, ", |
||||
"#{endTime,jdbcType=TIMESTAMP}, #{realityEndTime,jdbcType=TIMESTAMP}, ", |
||||
"#{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(BsRebateActivity record); |
||||
|
||||
@InsertProvider(type=BsRebateActivitySqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(BsRebateActivity record); |
||||
|
||||
@SelectProvider(type=BsRebateActivitySqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="mer_abbreviate", property="merAbbreviate", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="activity_no", property="activityNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="activity_type", property="activityType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="preferential_type", property="preferentialType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="condition", property="condition", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="price", property="price", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="restrict_partake_type", property="restrictPartakeType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="restrict_partake_num", property="restrictPartakeNum", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="reality_end_time", property="realityEndTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@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<BsRebateActivity> selectByExample(BsRebateActivityExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, mer_id, mer_no, mer_name, mer_abbreviate, activity_no, activity_type, preferential_type, ", |
||||
"`condition`, price, restrict_partake_type, restrict_partake_num, start_time, ", |
||||
"end_time, reality_end_time, `status`, create_time, update_time, ext_1, ext_2, ", |
||||
"ext_3", |
||||
"from bs_rebate_activity", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="mer_abbreviate", property="merAbbreviate", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="activity_no", property="activityNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="activity_type", property="activityType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="preferential_type", property="preferentialType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="condition", property="condition", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="price", property="price", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="restrict_partake_type", property="restrictPartakeType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="restrict_partake_num", property="restrictPartakeNum", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="reality_end_time", property="realityEndTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@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) |
||||
}) |
||||
BsRebateActivity selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=BsRebateActivitySqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") BsRebateActivity record, @Param("example") BsRebateActivityExample example); |
||||
|
||||
@UpdateProvider(type=BsRebateActivitySqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") BsRebateActivity record, @Param("example") BsRebateActivityExample example); |
||||
|
||||
@UpdateProvider(type=BsRebateActivitySqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(BsRebateActivity record); |
||||
|
||||
@Update({ |
||||
"update bs_rebate_activity", |
||||
"set mer_id = #{merId,jdbcType=BIGINT},", |
||||
"mer_no = #{merNo,jdbcType=VARCHAR},", |
||||
"mer_name = #{merName,jdbcType=VARCHAR},", |
||||
"mer_abbreviate = #{merAbbreviate,jdbcType=VARCHAR},", |
||||
"activity_no = #{activityNo,jdbcType=VARCHAR},", |
||||
"activity_type = #{activityType,jdbcType=INTEGER},", |
||||
"preferential_type = #{preferentialType,jdbcType=INTEGER},", |
||||
"`condition` = #{condition,jdbcType=DECIMAL},", |
||||
"price = #{price,jdbcType=DECIMAL},", |
||||
"restrict_partake_type = #{restrictPartakeType,jdbcType=INTEGER},", |
||||
"restrict_partake_num = #{restrictPartakeNum,jdbcType=INTEGER},", |
||||
"start_time = #{startTime,jdbcType=TIMESTAMP},", |
||||
"end_time = #{endTime,jdbcType=TIMESTAMP},", |
||||
"reality_end_time = #{realityEndTime,jdbcType=TIMESTAMP},", |
||||
"`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(BsRebateActivity record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface BsRebateActivityMapperExt { |
||||
} |
@ -0,0 +1,458 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsRebateActivity; |
||||
import com.hfkj.entity.BsRebateActivityExample.Criteria; |
||||
import com.hfkj.entity.BsRebateActivityExample.Criterion; |
||||
import com.hfkj.entity.BsRebateActivityExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class BsRebateActivitySqlProvider { |
||||
|
||||
public String countByExample(BsRebateActivityExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("bs_rebate_activity"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(BsRebateActivityExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("bs_rebate_activity"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(BsRebateActivity record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("bs_rebate_activity"); |
||||
|
||||
if (record.getMerId() != null) { |
||||
sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerNo() != null) { |
||||
sql.VALUES("mer_no", "#{merNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMerName() != null) { |
||||
sql.VALUES("mer_name", "#{merName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMerAbbreviate() != null) { |
||||
sql.VALUES("mer_abbreviate", "#{merAbbreviate,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getActivityNo() != null) { |
||||
sql.VALUES("activity_no", "#{activityNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getActivityType() != null) { |
||||
sql.VALUES("activity_type", "#{activityType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPreferentialType() != null) { |
||||
sql.VALUES("preferential_type", "#{preferentialType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCondition() != null) { |
||||
sql.VALUES("`condition`", "#{condition,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getPrice() != null) { |
||||
sql.VALUES("price", "#{price,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getRestrictPartakeType() != null) { |
||||
sql.VALUES("restrict_partake_type", "#{restrictPartakeType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getRestrictPartakeNum() != null) { |
||||
sql.VALUES("restrict_partake_num", "#{restrictPartakeNum,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.getRealityEndTime() != null) { |
||||
sql.VALUES("reality_end_time", "#{realityEndTime,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.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(BsRebateActivityExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("mer_id"); |
||||
sql.SELECT("mer_no"); |
||||
sql.SELECT("mer_name"); |
||||
sql.SELECT("mer_abbreviate"); |
||||
sql.SELECT("activity_no"); |
||||
sql.SELECT("activity_type"); |
||||
sql.SELECT("preferential_type"); |
||||
sql.SELECT("`condition`"); |
||||
sql.SELECT("price"); |
||||
sql.SELECT("restrict_partake_type"); |
||||
sql.SELECT("restrict_partake_num"); |
||||
sql.SELECT("start_time"); |
||||
sql.SELECT("end_time"); |
||||
sql.SELECT("reality_end_time"); |
||||
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_rebate_activity"); |
||||
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) { |
||||
BsRebateActivity record = (BsRebateActivity) parameter.get("record"); |
||||
BsRebateActivityExample example = (BsRebateActivityExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_rebate_activity"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerId() != null) { |
||||
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerNo() != null) { |
||||
sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMerName() != null) { |
||||
sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMerAbbreviate() != null) { |
||||
sql.SET("mer_abbreviate = #{record.merAbbreviate,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getActivityNo() != null) { |
||||
sql.SET("activity_no = #{record.activityNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getActivityType() != null) { |
||||
sql.SET("activity_type = #{record.activityType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPreferentialType() != null) { |
||||
sql.SET("preferential_type = #{record.preferentialType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCondition() != null) { |
||||
sql.SET("`condition` = #{record.condition,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getPrice() != null) { |
||||
sql.SET("price = #{record.price,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getRestrictPartakeType() != null) { |
||||
sql.SET("restrict_partake_type = #{record.restrictPartakeType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getRestrictPartakeNum() != null) { |
||||
sql.SET("restrict_partake_num = #{record.restrictPartakeNum,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.getRealityEndTime() != null) { |
||||
sql.SET("reality_end_time = #{record.realityEndTime,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.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_rebate_activity"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); |
||||
sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); |
||||
sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); |
||||
sql.SET("mer_abbreviate = #{record.merAbbreviate,jdbcType=VARCHAR}"); |
||||
sql.SET("activity_no = #{record.activityNo,jdbcType=VARCHAR}"); |
||||
sql.SET("activity_type = #{record.activityType,jdbcType=INTEGER}"); |
||||
sql.SET("preferential_type = #{record.preferentialType,jdbcType=INTEGER}"); |
||||
sql.SET("`condition` = #{record.condition,jdbcType=DECIMAL}"); |
||||
sql.SET("price = #{record.price,jdbcType=DECIMAL}"); |
||||
sql.SET("restrict_partake_type = #{record.restrictPartakeType,jdbcType=INTEGER}"); |
||||
sql.SET("restrict_partake_num = #{record.restrictPartakeNum,jdbcType=INTEGER}"); |
||||
sql.SET("start_time = #{record.startTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("end_time = #{record.endTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("reality_end_time = #{record.realityEndTime,jdbcType=TIMESTAMP}"); |
||||
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}"); |
||||
|
||||
BsRebateActivityExample example = (BsRebateActivityExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(BsRebateActivity record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_rebate_activity"); |
||||
|
||||
if (record.getMerId() != null) { |
||||
sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerNo() != null) { |
||||
sql.SET("mer_no = #{merNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMerName() != null) { |
||||
sql.SET("mer_name = #{merName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMerAbbreviate() != null) { |
||||
sql.SET("mer_abbreviate = #{merAbbreviate,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getActivityNo() != null) { |
||||
sql.SET("activity_no = #{activityNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getActivityType() != null) { |
||||
sql.SET("activity_type = #{activityType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPreferentialType() != null) { |
||||
sql.SET("preferential_type = #{preferentialType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCondition() != null) { |
||||
sql.SET("`condition` = #{condition,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getPrice() != null) { |
||||
sql.SET("price = #{price,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getRestrictPartakeType() != null) { |
||||
sql.SET("restrict_partake_type = #{restrictPartakeType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getRestrictPartakeNum() != null) { |
||||
sql.SET("restrict_partake_num = #{restrictPartakeNum,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.getRealityEndTime() != null) { |
||||
sql.SET("reality_end_time = #{realityEndTime,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.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, BsRebateActivityExample 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,387 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* bs_rebate_activity |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class BsRebateActivity implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 商户id |
||||
*/ |
||||
private Long merId; |
||||
|
||||
/** |
||||
* 商户号 |
||||
*/ |
||||
private String merNo; |
||||
|
||||
/** |
||||
* 商户名称 |
||||
*/ |
||||
private String merName; |
||||
|
||||
/** |
||||
* 商户简称 |
||||
*/ |
||||
private String merAbbreviate; |
||||
|
||||
/** |
||||
* 活动编号 |
||||
*/ |
||||
private String activityNo; |
||||
|
||||
/** |
||||
* 活动类型 1:优惠活动 2:优惠券 |
||||
*/ |
||||
private Integer activityType; |
||||
|
||||
/** |
||||
* 优惠类型 1:满减 2:立减 3:折扣 |
||||
*/ |
||||
private Integer preferentialType; |
||||
|
||||
/** |
||||
* 优惠条件(满减价格) |
||||
*/ |
||||
private BigDecimal condition; |
||||
|
||||
/** |
||||
* 优惠金额 |
||||
*/ |
||||
private BigDecimal price; |
||||
|
||||
/** |
||||
* 限制类型 1. 每日 |
||||
*/ |
||||
private Integer restrictPartakeType; |
||||
|
||||
/** |
||||
* 限制使用次数 |
||||
*/ |
||||
private Integer restrictPartakeNum; |
||||
|
||||
/** |
||||
* 活动开始时间 |
||||
*/ |
||||
private Date startTime; |
||||
|
||||
/** |
||||
* 活动结束时间 |
||||
*/ |
||||
private Date endTime; |
||||
|
||||
/** |
||||
* 实际活动结束时间 |
||||
*/ |
||||
private Date realityEndTime; |
||||
|
||||
/** |
||||
* 状态 0:不可用 1:编辑中 2:进行中 3:已结束 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 更新时间 |
||||
*/ |
||||
private Date updateTime; |
||||
|
||||
private String ext1; |
||||
|
||||
private String ext2; |
||||
|
||||
private String ext3; |
||||
|
||||
private BsRebateActivityAccount activityAccount; |
||||
|
||||
public BsRebateActivityAccount getActivityAccount() { |
||||
return activityAccount; |
||||
} |
||||
|
||||
public void setActivityAccount(BsRebateActivityAccount activityAccount) { |
||||
this.activityAccount = activityAccount; |
||||
} |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Long getMerId() { |
||||
return merId; |
||||
} |
||||
|
||||
public void setMerId(Long merId) { |
||||
this.merId = merId; |
||||
} |
||||
|
||||
public String getMerNo() { |
||||
return merNo; |
||||
} |
||||
|
||||
public void setMerNo(String merNo) { |
||||
this.merNo = merNo; |
||||
} |
||||
|
||||
public String getMerName() { |
||||
return merName; |
||||
} |
||||
|
||||
public void setMerName(String merName) { |
||||
this.merName = merName; |
||||
} |
||||
|
||||
public String getMerAbbreviate() { |
||||
return merAbbreviate; |
||||
} |
||||
|
||||
public void setMerAbbreviate(String merAbbreviate) { |
||||
this.merAbbreviate = merAbbreviate; |
||||
} |
||||
|
||||
public String getActivityNo() { |
||||
return activityNo; |
||||
} |
||||
|
||||
public void setActivityNo(String activityNo) { |
||||
this.activityNo = activityNo; |
||||
} |
||||
|
||||
public Integer getActivityType() { |
||||
return activityType; |
||||
} |
||||
|
||||
public void setActivityType(Integer activityType) { |
||||
this.activityType = activityType; |
||||
} |
||||
|
||||
public Integer getPreferentialType() { |
||||
return preferentialType; |
||||
} |
||||
|
||||
public void setPreferentialType(Integer preferentialType) { |
||||
this.preferentialType = preferentialType; |
||||
} |
||||
|
||||
public BigDecimal getCondition() { |
||||
return condition; |
||||
} |
||||
|
||||
public void setCondition(BigDecimal condition) { |
||||
this.condition = condition; |
||||
} |
||||
|
||||
public BigDecimal getPrice() { |
||||
return price; |
||||
} |
||||
|
||||
public void setPrice(BigDecimal price) { |
||||
this.price = price; |
||||
} |
||||
|
||||
public Integer getRestrictPartakeType() { |
||||
return restrictPartakeType; |
||||
} |
||||
|
||||
public void setRestrictPartakeType(Integer restrictPartakeType) { |
||||
this.restrictPartakeType = restrictPartakeType; |
||||
} |
||||
|
||||
public Integer getRestrictPartakeNum() { |
||||
return restrictPartakeNum; |
||||
} |
||||
|
||||
public void setRestrictPartakeNum(Integer restrictPartakeNum) { |
||||
this.restrictPartakeNum = restrictPartakeNum; |
||||
} |
||||
|
||||
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 Date getRealityEndTime() { |
||||
return realityEndTime; |
||||
} |
||||
|
||||
public void setRealityEndTime(Date realityEndTime) { |
||||
this.realityEndTime = realityEndTime; |
||||
} |
||||
|
||||
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; |
||||
} |
||||
BsRebateActivity other = (BsRebateActivity) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) |
||||
&& (this.getMerNo() == null ? other.getMerNo() == null : this.getMerNo().equals(other.getMerNo())) |
||||
&& (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName())) |
||||
&& (this.getMerAbbreviate() == null ? other.getMerAbbreviate() == null : this.getMerAbbreviate().equals(other.getMerAbbreviate())) |
||||
&& (this.getActivityNo() == null ? other.getActivityNo() == null : this.getActivityNo().equals(other.getActivityNo())) |
||||
&& (this.getActivityType() == null ? other.getActivityType() == null : this.getActivityType().equals(other.getActivityType())) |
||||
&& (this.getPreferentialType() == null ? other.getPreferentialType() == null : this.getPreferentialType().equals(other.getPreferentialType())) |
||||
&& (this.getCondition() == null ? other.getCondition() == null : this.getCondition().equals(other.getCondition())) |
||||
&& (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice())) |
||||
&& (this.getRestrictPartakeType() == null ? other.getRestrictPartakeType() == null : this.getRestrictPartakeType().equals(other.getRestrictPartakeType())) |
||||
&& (this.getRestrictPartakeNum() == null ? other.getRestrictPartakeNum() == null : this.getRestrictPartakeNum().equals(other.getRestrictPartakeNum())) |
||||
&& (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime())) |
||||
&& (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime())) |
||||
&& (this.getRealityEndTime() == null ? other.getRealityEndTime() == null : this.getRealityEndTime().equals(other.getRealityEndTime())) |
||||
&& (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 + ((getMerId() == null) ? 0 : getMerId().hashCode()); |
||||
result = prime * result + ((getMerNo() == null) ? 0 : getMerNo().hashCode()); |
||||
result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode()); |
||||
result = prime * result + ((getMerAbbreviate() == null) ? 0 : getMerAbbreviate().hashCode()); |
||||
result = prime * result + ((getActivityNo() == null) ? 0 : getActivityNo().hashCode()); |
||||
result = prime * result + ((getActivityType() == null) ? 0 : getActivityType().hashCode()); |
||||
result = prime * result + ((getPreferentialType() == null) ? 0 : getPreferentialType().hashCode()); |
||||
result = prime * result + ((getCondition() == null) ? 0 : getCondition().hashCode()); |
||||
result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode()); |
||||
result = prime * result + ((getRestrictPartakeType() == null) ? 0 : getRestrictPartakeType().hashCode()); |
||||
result = prime * result + ((getRestrictPartakeNum() == null) ? 0 : getRestrictPartakeNum().hashCode()); |
||||
result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode()); |
||||
result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode()); |
||||
result = prime * result + ((getRealityEndTime() == null) ? 0 : getRealityEndTime().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(", merId=").append(merId); |
||||
sb.append(", merNo=").append(merNo); |
||||
sb.append(", merName=").append(merName); |
||||
sb.append(", merAbbreviate=").append(merAbbreviate); |
||||
sb.append(", activityNo=").append(activityNo); |
||||
sb.append(", activityType=").append(activityType); |
||||
sb.append(", preferentialType=").append(preferentialType); |
||||
sb.append(", condition=").append(condition); |
||||
sb.append(", price=").append(price); |
||||
sb.append(", restrictPartakeType=").append(restrictPartakeType); |
||||
sb.append(", restrictPartakeNum=").append(restrictPartakeNum); |
||||
sb.append(", startTime=").append(startTime); |
||||
sb.append(", endTime=").append(endTime); |
||||
sb.append(", realityEndTime=").append(realityEndTime); |
||||
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,201 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* bs_rebate_activity_account |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class BsRebateActivityAccount implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 活动id |
||||
*/ |
||||
private Long activityId; |
||||
|
||||
/** |
||||
* 活动编号 |
||||
*/ |
||||
private String activityNo; |
||||
|
||||
/** |
||||
* 活动余额 |
||||
*/ |
||||
private BigDecimal amount; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 更新时间 |
||||
*/ |
||||
private Date updateTime; |
||||
|
||||
/** |
||||
* 状态 0:不可用 1:正常 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
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 getActivityId() { |
||||
return activityId; |
||||
} |
||||
|
||||
public void setActivityId(Long activityId) { |
||||
this.activityId = activityId; |
||||
} |
||||
|
||||
public String getActivityNo() { |
||||
return activityNo; |
||||
} |
||||
|
||||
public void setActivityNo(String activityNo) { |
||||
this.activityNo = activityNo; |
||||
} |
||||
|
||||
public BigDecimal getAmount() { |
||||
return amount; |
||||
} |
||||
|
||||
public void setAmount(BigDecimal amount) { |
||||
this.amount = amount; |
||||
} |
||||
|
||||
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 Integer getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(Integer status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
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; |
||||
} |
||||
BsRebateActivityAccount other = (BsRebateActivityAccount) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getActivityId() == null ? other.getActivityId() == null : this.getActivityId().equals(other.getActivityId())) |
||||
&& (this.getActivityNo() == null ? other.getActivityNo() == null : this.getActivityNo().equals(other.getActivityNo())) |
||||
&& (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (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 + ((getActivityId() == null) ? 0 : getActivityId().hashCode()); |
||||
result = prime * result + ((getActivityNo() == null) ? 0 : getActivityNo().hashCode()); |
||||
result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().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(", activityId=").append(activityId); |
||||
sb.append(", activityNo=").append(activityNo); |
||||
sb.append(", amount=").append(amount); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", updateTime=").append(updateTime); |
||||
sb.append(", status=").append(status); |
||||
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,864 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.util.ArrayList; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
public class BsRebateActivityAccountExample { |
||||
protected String orderByClause; |
||||
|
||||
protected boolean distinct; |
||||
|
||||
protected List<Criteria> oredCriteria; |
||||
|
||||
private Integer limit; |
||||
|
||||
private Long offset; |
||||
|
||||
public BsRebateActivityAccountExample() { |
||||
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 andActivityIdIsNull() { |
||||
addCriterion("activity_id is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andActivityIdIsNotNull() { |
||||
addCriterion("activity_id is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andActivityIdEqualTo(Long value) { |
||||
addCriterion("activity_id =", value, "activityId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andActivityIdNotEqualTo(Long value) { |
||||
addCriterion("activity_id <>", value, "activityId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andActivityIdGreaterThan(Long value) { |
||||
addCriterion("activity_id >", value, "activityId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andActivityIdGreaterThanOrEqualTo(Long value) { |
||||
addCriterion("activity_id >=", value, "activityId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andActivityIdLessThan(Long value) { |
||||
addCriterion("activity_id <", value, "activityId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andActivityIdLessThanOrEqualTo(Long value) { |
||||
addCriterion("activity_id <=", value, "activityId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andActivityIdIn(List<Long> values) { |
||||
addCriterion("activity_id in", values, "activityId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andActivityIdNotIn(List<Long> values) { |
||||
addCriterion("activity_id not in", values, "activityId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andActivityIdBetween(Long value1, Long value2) { |
||||
addCriterion("activity_id between", value1, value2, "activityId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andActivityIdNotBetween(Long value1, Long value2) { |
||||
addCriterion("activity_id not between", value1, value2, "activityId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andActivityNoIsNull() { |
||||
addCriterion("activity_no is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andActivityNoIsNotNull() { |
||||
addCriterion("activity_no is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andActivityNoEqualTo(String value) { |
||||
addCriterion("activity_no =", value, "activityNo"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andActivityNoNotEqualTo(String value) { |
||||
addCriterion("activity_no <>", value, "activityNo"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andActivityNoGreaterThan(String value) { |
||||
addCriterion("activity_no >", value, "activityNo"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andActivityNoGreaterThanOrEqualTo(String value) { |
||||
addCriterion("activity_no >=", value, "activityNo"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andActivityNoLessThan(String value) { |
||||
addCriterion("activity_no <", value, "activityNo"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andActivityNoLessThanOrEqualTo(String value) { |
||||
addCriterion("activity_no <=", value, "activityNo"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andActivityNoLike(String value) { |
||||
addCriterion("activity_no like", value, "activityNo"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andActivityNoNotLike(String value) { |
||||
addCriterion("activity_no not like", value, "activityNo"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andActivityNoIn(List<String> values) { |
||||
addCriterion("activity_no in", values, "activityNo"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andActivityNoNotIn(List<String> values) { |
||||
addCriterion("activity_no not in", values, "activityNo"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andActivityNoBetween(String value1, String value2) { |
||||
addCriterion("activity_no between", value1, value2, "activityNo"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andActivityNoNotBetween(String value1, String value2) { |
||||
addCriterion("activity_no not between", value1, value2, "activityNo"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAmountIsNull() { |
||||
addCriterion("amount is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAmountIsNotNull() { |
||||
addCriterion("amount is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAmountEqualTo(BigDecimal value) { |
||||
addCriterion("amount =", value, "amount"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAmountNotEqualTo(BigDecimal value) { |
||||
addCriterion("amount <>", value, "amount"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAmountGreaterThan(BigDecimal value) { |
||||
addCriterion("amount >", value, "amount"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAmountGreaterThanOrEqualTo(BigDecimal value) { |
||||
addCriterion("amount >=", value, "amount"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAmountLessThan(BigDecimal value) { |
||||
addCriterion("amount <", value, "amount"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAmountLessThanOrEqualTo(BigDecimal value) { |
||||
addCriterion("amount <=", value, "amount"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAmountIn(List<BigDecimal> values) { |
||||
addCriterion("amount in", values, "amount"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAmountNotIn(List<BigDecimal> values) { |
||||
addCriterion("amount not in", values, "amount"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAmountBetween(BigDecimal value1, BigDecimal value2) { |
||||
addCriterion("amount between", value1, value2, "amount"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAmountNotBetween(BigDecimal value1, BigDecimal value2) { |
||||
addCriterion("amount not between", value1, value2, "amount"); |
||||
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 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 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,313 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* bs_rebate_activity_account_record |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class BsRebateActivityAccountRecord implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 活动id |
||||
*/ |
||||
private Long activityId; |
||||
|
||||
/** |
||||
* 活动编号 |
||||
*/ |
||||
private String activityNo; |
||||
|
||||
/** |
||||
* 活动账户id |
||||
*/ |
||||
private Long accountId; |
||||
|
||||
/** |
||||
* 交易类型 1:入账 2:支出 |
||||
*/ |
||||
private Integer tradeType; |
||||
|
||||
/** |
||||
* 交易编号 |
||||
*/ |
||||
private String tradeNumber; |
||||
|
||||
/** |
||||
* 交易金额 |
||||
*/ |
||||
private BigDecimal tradeAmount; |
||||
|
||||
/** |
||||
* 交易变更前金额 |
||||
*/ |
||||
private BigDecimal amountBeforeChange; |
||||
|
||||
/** |
||||
* 交易变更后金额 |
||||
*/ |
||||
private BigDecimal amountAfterChange; |
||||
|
||||
/** |
||||
* 交易对象类型 1:活动金额充值 2:活动金额回收 3:支付交易 |
||||
*/ |
||||
private Integer objectType; |
||||
|
||||
/** |
||||
* 交易对象id |
||||
*/ |
||||
private Long objectId; |
||||
|
||||
/** |
||||
* 交易对象内容 |
||||
*/ |
||||
private String objectContent; |
||||
|
||||
/** |
||||
* 状态 0:不可用 1:正常 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
private String ext1; |
||||
|
||||
private String ext2; |
||||
|
||||
private String ext3; |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Long getActivityId() { |
||||
return activityId; |
||||
} |
||||
|
||||
public void setActivityId(Long activityId) { |
||||
this.activityId = activityId; |
||||
} |
||||
|
||||
public String getActivityNo() { |
||||
return activityNo; |
||||
} |
||||
|
||||
public void setActivityNo(String activityNo) { |
||||
this.activityNo = activityNo; |
||||
} |
||||
|
||||
public Long getAccountId() { |
||||
return accountId; |
||||
} |
||||
|
||||
public void setAccountId(Long accountId) { |
||||
this.accountId = accountId; |
||||
} |
||||
|
||||
public Integer getTradeType() { |
||||
return tradeType; |
||||
} |
||||
|
||||
public void setTradeType(Integer tradeType) { |
||||
this.tradeType = tradeType; |
||||
} |
||||
|
||||
public String getTradeNumber() { |
||||
return tradeNumber; |
||||
} |
||||
|
||||
public void setTradeNumber(String tradeNumber) { |
||||
this.tradeNumber = tradeNumber; |
||||
} |
||||
|
||||
public BigDecimal getTradeAmount() { |
||||
return tradeAmount; |
||||
} |
||||
|
||||
public void setTradeAmount(BigDecimal tradeAmount) { |
||||
this.tradeAmount = tradeAmount; |
||||
} |
||||
|
||||
public BigDecimal getAmountBeforeChange() { |
||||
return amountBeforeChange; |
||||
} |
||||
|
||||
public void setAmountBeforeChange(BigDecimal amountBeforeChange) { |
||||
this.amountBeforeChange = amountBeforeChange; |
||||
} |
||||
|
||||
public BigDecimal getAmountAfterChange() { |
||||
return amountAfterChange; |
||||
} |
||||
|
||||
public void setAmountAfterChange(BigDecimal amountAfterChange) { |
||||
this.amountAfterChange = amountAfterChange; |
||||
} |
||||
|
||||
public Integer getObjectType() { |
||||
return objectType; |
||||
} |
||||
|
||||
public void setObjectType(Integer objectType) { |
||||
this.objectType = objectType; |
||||
} |
||||
|
||||
public Long getObjectId() { |
||||
return objectId; |
||||
} |
||||
|
||||
public void setObjectId(Long objectId) { |
||||
this.objectId = objectId; |
||||
} |
||||
|
||||
public String getObjectContent() { |
||||
return objectContent; |
||||
} |
||||
|
||||
public void setObjectContent(String objectContent) { |
||||
this.objectContent = objectContent; |
||||
} |
||||
|
||||
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 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; |
||||
} |
||||
BsRebateActivityAccountRecord other = (BsRebateActivityAccountRecord) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getActivityId() == null ? other.getActivityId() == null : this.getActivityId().equals(other.getActivityId())) |
||||
&& (this.getActivityNo() == null ? other.getActivityNo() == null : this.getActivityNo().equals(other.getActivityNo())) |
||||
&& (this.getAccountId() == null ? other.getAccountId() == null : this.getAccountId().equals(other.getAccountId())) |
||||
&& (this.getTradeType() == null ? other.getTradeType() == null : this.getTradeType().equals(other.getTradeType())) |
||||
&& (this.getTradeNumber() == null ? other.getTradeNumber() == null : this.getTradeNumber().equals(other.getTradeNumber())) |
||||
&& (this.getTradeAmount() == null ? other.getTradeAmount() == null : this.getTradeAmount().equals(other.getTradeAmount())) |
||||
&& (this.getAmountBeforeChange() == null ? other.getAmountBeforeChange() == null : this.getAmountBeforeChange().equals(other.getAmountBeforeChange())) |
||||
&& (this.getAmountAfterChange() == null ? other.getAmountAfterChange() == null : this.getAmountAfterChange().equals(other.getAmountAfterChange())) |
||||
&& (this.getObjectType() == null ? other.getObjectType() == null : this.getObjectType().equals(other.getObjectType())) |
||||
&& (this.getObjectId() == null ? other.getObjectId() == null : this.getObjectId().equals(other.getObjectId())) |
||||
&& (this.getObjectContent() == null ? other.getObjectContent() == null : this.getObjectContent().equals(other.getObjectContent())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (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 + ((getActivityId() == null) ? 0 : getActivityId().hashCode()); |
||||
result = prime * result + ((getActivityNo() == null) ? 0 : getActivityNo().hashCode()); |
||||
result = prime * result + ((getAccountId() == null) ? 0 : getAccountId().hashCode()); |
||||
result = prime * result + ((getTradeType() == null) ? 0 : getTradeType().hashCode()); |
||||
result = prime * result + ((getTradeNumber() == null) ? 0 : getTradeNumber().hashCode()); |
||||
result = prime * result + ((getTradeAmount() == null) ? 0 : getTradeAmount().hashCode()); |
||||
result = prime * result + ((getAmountBeforeChange() == null) ? 0 : getAmountBeforeChange().hashCode()); |
||||
result = prime * result + ((getAmountAfterChange() == null) ? 0 : getAmountAfterChange().hashCode()); |
||||
result = prime * result + ((getObjectType() == null) ? 0 : getObjectType().hashCode()); |
||||
result = prime * result + ((getObjectId() == null) ? 0 : getObjectId().hashCode()); |
||||
result = prime * result + ((getObjectContent() == null) ? 0 : getObjectContent().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().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(", activityId=").append(activityId); |
||||
sb.append(", activityNo=").append(activityNo); |
||||
sb.append(", accountId=").append(accountId); |
||||
sb.append(", tradeType=").append(tradeType); |
||||
sb.append(", tradeNumber=").append(tradeNumber); |
||||
sb.append(", tradeAmount=").append(tradeAmount); |
||||
sb.append(", amountBeforeChange=").append(amountBeforeChange); |
||||
sb.append(", amountAfterChange=").append(amountAfterChange); |
||||
sb.append(", objectType=").append(objectType); |
||||
sb.append(", objectId=").append(objectId); |
||||
sb.append(", objectContent=").append(objectContent); |
||||
sb.append(", status=").append(status); |
||||
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(); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,31 @@ |
||||
package com.hfkj.service.rebate; |
||||
|
||||
import com.hfkj.entity.BsRebateActivityAccount; |
||||
import com.hfkj.entity.BsRebateActivityAccountRecord; |
||||
import com.hfkj.sysenum.RebateMerAccountTradeTypeEnum; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @className: BsRebateActivityAccountRecordService |
||||
* @author: HuRui |
||||
* @date: 2023/10/19 |
||||
**/ |
||||
public interface BsRebateActivityAccountRecordService { |
||||
|
||||
/** |
||||
* 编辑数据 |
||||
* @param record |
||||
*/ |
||||
void insert(BsRebateActivityAccountRecord record); |
||||
|
||||
/** |
||||
* 查询记录列表 |
||||
* @param param |
||||
* @return |
||||
*/ |
||||
List<BsRebateActivityAccountRecord> getRecordList(Map<String,Object> param); |
||||
|
||||
} |
@ -0,0 +1,58 @@ |
||||
package com.hfkj.service.rebate; |
||||
|
||||
import com.hfkj.entity.BsRebateActivityAccount; |
||||
import com.hfkj.entity.BsRebateMerAccount; |
||||
import com.hfkj.service.rebate.model.RebateActivityAccountTradeObject; |
||||
import com.hfkj.sysenum.RebateActivityAccountTradeTypeEnum; |
||||
import com.hfkj.sysenum.RebateMerAccountTradeTypeEnum; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @className: BsRebateActivityAccountService |
||||
* @author: HuRui |
||||
* @date: 2023/10/18 |
||||
**/ |
||||
public interface BsRebateActivityAccountService { |
||||
|
||||
/** |
||||
* 编辑数据 |
||||
* @param account |
||||
*/ |
||||
void editData(BsRebateActivityAccount account); |
||||
|
||||
/** |
||||
* 创建账户 |
||||
* @param account |
||||
*/ |
||||
void createAccount(BsRebateActivityAccount account); |
||||
|
||||
/** |
||||
* 查询账户 |
||||
* |
||||
* @param activityNo |
||||
* @return |
||||
*/ |
||||
BsRebateActivityAccount getAccountByActivityNo(String activityNo); |
||||
|
||||
/** |
||||
* 充值金额 |
||||
* @param activityNo 活动编号 |
||||
* @param amount 金额 |
||||
*/ |
||||
void recharge(String activityNo, BigDecimal amount); |
||||
|
||||
/** |
||||
* 回收金额 |
||||
* @param activityNo 活动编号 |
||||
* @return |
||||
*/ |
||||
Boolean recover(String activityNo); |
||||
|
||||
/** |
||||
* 账户交易 |
||||
*/ |
||||
Boolean accountTrade(String activityNo, RebateActivityAccountTradeTypeEnum tradeType, BigDecimal tradeAmount, RebateActivityAccountTradeObject tradeObject); |
||||
|
||||
} |
@ -0,0 +1,63 @@ |
||||
package com.hfkj.service.rebate; |
||||
|
||||
import com.hfkj.entity.BsRebateActivity; |
||||
|
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @className: BsRebateActivityService |
||||
* @author: HuRui |
||||
* @date: 2023/10/17 |
||||
**/ |
||||
public interface BsRebateActivityService { |
||||
|
||||
/** |
||||
* 编辑数据 |
||||
* @param rebateActivity |
||||
*/ |
||||
void editData(BsRebateActivity rebateActivity); |
||||
|
||||
/** |
||||
* 开启活动 |
||||
* @param activityNo 活动编号 |
||||
*/ |
||||
void openActivity(String activityNo); |
||||
|
||||
/** |
||||
* 关闭活动 |
||||
* @param activityNo 活动编号 |
||||
*/ |
||||
void closeActivity(String activityNo); |
||||
|
||||
/** |
||||
* 修改活动结束时间 |
||||
* @param activityNo 活动编号 |
||||
* @param newEndTime 新结束时间 |
||||
*/ |
||||
void updateActivityEndTime(String activityNo, Date newEndTime); |
||||
|
||||
/** |
||||
* 查询活动 |
||||
* @param activityNo 活动编号 |
||||
* @return |
||||
*/ |
||||
BsRebateActivity getActivityByNo(String activityNo); |
||||
|
||||
/** |
||||
* 获取商户当前活动 |
||||
* @param merNo |
||||
* @return |
||||
*/ |
||||
BsRebateActivity getMerCurrentActivity(String merNo); |
||||
|
||||
/** |
||||
* 查询活动列表 |
||||
* @param param |
||||
* @return |
||||
*/ |
||||
List<BsRebateActivity> getActivityList(Map<String,Object> param); |
||||
|
||||
|
||||
} |
@ -0,0 +1,58 @@ |
||||
package com.hfkj.service.rebate.impl; |
||||
|
||||
import com.hfkj.dao.BsRebateActivityAccountRecordMapper; |
||||
import com.hfkj.entity.BsRebateActivityAccountRecord; |
||||
import com.hfkj.entity.BsRebateActivityAccountRecordExample; |
||||
import com.hfkj.service.rebate.BsRebateActivityAccountRecordService; |
||||
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: BsRebateActivityAccountRecordServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2023/10/19 |
||||
**/ |
||||
@Service("rebateActivityAccountRecordService") |
||||
public class BsRebateActivityAccountRecordServiceImpl implements BsRebateActivityAccountRecordService { |
||||
|
||||
@Resource |
||||
private BsRebateActivityAccountRecordMapper rebateActivityAccountRecordMapper; |
||||
|
||||
@Override |
||||
public void insert(BsRebateActivityAccountRecord record) { |
||||
record.setCreateTime(new Date()); |
||||
record.setStatus(1); |
||||
rebateActivityAccountRecordMapper.insert(record); |
||||
} |
||||
|
||||
@Override |
||||
public List<BsRebateActivityAccountRecord> getRecordList(Map<String, Object> param) { |
||||
BsRebateActivityAccountRecordExample example = new BsRebateActivityAccountRecordExample(); |
||||
BsRebateActivityAccountRecordExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0); |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "activityNo"))) { |
||||
criteria.andActivityNoEqualTo(MapUtils.getString(param, "activityNo")); |
||||
} |
||||
|
||||
if (MapUtils.getInteger(param, "tradeType") != null) { |
||||
criteria.andTradeTypeEqualTo(MapUtils.getInteger(param, "tradeType")); |
||||
} |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "tradeNumber"))) { |
||||
criteria.andTradeNumberLike("%" + MapUtils.getString(param, "tradeNumber") + "%"); |
||||
} |
||||
|
||||
if (MapUtils.getInteger(param, "objectType") != null) { |
||||
criteria.andObjectTypeEqualTo(MapUtils.getInteger(param, "objectType")); |
||||
} |
||||
|
||||
example.setOrderByClause("create_time desc"); |
||||
return rebateActivityAccountRecordMapper.selectByExample(example); |
||||
} |
||||
} |
@ -0,0 +1,263 @@ |
||||
package com.hfkj.service.rebate.impl; |
||||
|
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.common.utils.DateUtil; |
||||
import com.hfkj.dao.BsRebateActivityAccountMapper; |
||||
import com.hfkj.entity.*; |
||||
import com.hfkj.service.rebate.BsRebateActivityAccountRecordService; |
||||
import com.hfkj.service.rebate.BsRebateActivityAccountService; |
||||
import com.hfkj.service.rebate.BsRebateActivityService; |
||||
import com.hfkj.service.rebate.BsRebateMerAccountService; |
||||
import com.hfkj.service.rebate.model.RebateActivityAccountTradeObject; |
||||
import com.hfkj.service.rebate.model.RebateMerAccountTradeObject; |
||||
import com.hfkj.sysenum.RebateActivityAccountObjectTypeEnum; |
||||
import com.hfkj.sysenum.RebateActivityAccountTradeTypeEnum; |
||||
import com.hfkj.sysenum.RebateActivityStatusEnum; |
||||
import com.hfkj.sysenum.RebateMerAccountObjectTypeEnum; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.data.redis.core.RedisTemplate; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.transaction.annotation.Isolation; |
||||
import org.springframework.transaction.annotation.Propagation; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import java.util.Random; |
||||
|
||||
/** |
||||
* @className: BsRebateActivityAccountServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2023/10/18 |
||||
**/ |
||||
@Service("rebateActivityAccountService") |
||||
public class BsRebateActivityAccountServiceImpl implements BsRebateActivityAccountService { |
||||
|
||||
@Resource |
||||
private BsRebateActivityAccountMapper rebateActivityAccountMapper; |
||||
@Resource |
||||
private BsRebateActivityAccountRecordService rebateActivityAccountRecordService; |
||||
@Resource |
||||
private BsRebateActivityService rebateActivityService; |
||||
@Resource |
||||
private BsRebateMerAccountService rebateMerAccountService; |
||||
@Autowired |
||||
private RedisTemplate<String, Object> redisTemplate; |
||||
|
||||
private final static String REBATE_ACTIVITY_ACCOUNT = "REBATE_ACTIVITY_ACCOUNT"; |
||||
@Override |
||||
public void editData(BsRebateActivityAccount account) { |
||||
if (account.getId() == null) { |
||||
account.setCreateTime(new Date()); |
||||
account.setUpdateTime(new Date()); |
||||
rebateActivityAccountMapper.insert(account); |
||||
} else { |
||||
account.setUpdateTime(new Date()); |
||||
rebateActivityAccountMapper.updateByPrimaryKey(account); |
||||
} |
||||
|
||||
redisTemplate.opsForValue().set(REBATE_ACTIVITY_ACCOUNT + ":" +account.getActivityNo(), account); |
||||
} |
||||
|
||||
@Override |
||||
public void createAccount(BsRebateActivityAccount account) { |
||||
editData(account); |
||||
} |
||||
|
||||
@Override |
||||
public BsRebateActivityAccount getAccountByActivityNo(String activityNo) { |
||||
Object obj = redisTemplate.opsForValue().get(REBATE_ACTIVITY_ACCOUNT + ":" + activityNo); |
||||
if (obj != null) { |
||||
return (BsRebateActivityAccount) obj; |
||||
} |
||||
BsRebateActivityAccountExample example = new BsRebateActivityAccountExample(); |
||||
example.createCriteria().andActivityNoEqualTo(activityNo).andStatusNotEqualTo(0); |
||||
List<BsRebateActivityAccount> list = rebateActivityAccountMapper.selectByExample(example); |
||||
if (list.size() > 0) { |
||||
BsRebateActivityAccount account = list.get(0); |
||||
redisTemplate.opsForValue().set(REBATE_ACTIVITY_ACCOUNT + ":" +account.getActivityNo(), account); |
||||
return account; |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
@Transactional(propagation= Propagation.REQUIRED) |
||||
public void recharge(String activityNo, BigDecimal amount) { |
||||
// 查询活动
|
||||
BsRebateActivity activity = rebateActivityService.getActivityByNo(activityNo); |
||||
if (activity == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到活动"); |
||||
} |
||||
if (activity.getStatus().equals(RebateActivityStatusEnum.status3.getNumber())) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法充值,活动已结束"); |
||||
} |
||||
// 查询商户账户
|
||||
BsRebateMerAccount account = rebateMerAccountService.getAccountByMerId(activity.getMerId()); |
||||
if (account == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户账户"); |
||||
} |
||||
|
||||
// 商户账户
|
||||
RebateMerAccountTradeObject merAccountTradeObject = new RebateMerAccountTradeObject(); |
||||
merAccountTradeObject.setTradeObjectType(RebateMerAccountObjectTypeEnum.type3); |
||||
merAccountTradeObject.setTradeObjectId(activity.getId()); |
||||
merAccountTradeObject.setTradeObjectContent("活动编号:" + activityNo + ",充值金额:" + amount + "元"); |
||||
rebateMerAccountService.expenditure(account.getAccountNumber(), amount, merAccountTradeObject); |
||||
|
||||
// 活动账户
|
||||
RebateActivityAccountTradeObject accountTradeObject = new RebateActivityAccountTradeObject(); |
||||
accountTradeObject.setTradeObjectType(RebateActivityAccountObjectTypeEnum.type1); |
||||
accountTradeObject.setTradeObjectId(activity.getId()); |
||||
accountTradeObject.setTradeObjectContent("充值金额:" + amount + "元"); |
||||
Boolean tradeResult = accountTrade(activity.getActivityNo(), RebateActivityAccountTradeTypeEnum.type1, amount, accountTradeObject); |
||||
if (!tradeResult) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "充值失败!"); |
||||
} |
||||
|
||||
} |
||||
|
||||
@Override |
||||
@Transactional(propagation= Propagation.REQUIRES_NEW) |
||||
public Boolean recover(String activityNo) { |
||||
String lockKey = "REBATE_ACTIVITY_ACCOUNT_" + activityNo; |
||||
try { |
||||
// 占坑锁
|
||||
Boolean lock = redisTemplate.opsForValue().setIfAbsent(lockKey, null); |
||||
if(lock) { |
||||
// 查询活动
|
||||
BsRebateActivity activity = rebateActivityService.getActivityByNo(activityNo); |
||||
if (activity == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到活动"); |
||||
} |
||||
// 查询活动账户
|
||||
BsRebateActivityAccount activityAccount = getAccountByActivityNo(activityNo); |
||||
if (activityAccount == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到活动账户"); |
||||
} |
||||
if (activityAccount.getAmount().compareTo(new BigDecimal("0")) == 0) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "活动账户余额不足"); |
||||
} |
||||
// 查询商户账户
|
||||
BsRebateMerAccount merAccount = rebateMerAccountService.getAccountByMerId(activity.getMerId()); |
||||
if (merAccount == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户账户"); |
||||
} |
||||
// 交易前金额
|
||||
BigDecimal amountBeforeChange = activityAccount.getAmount(); |
||||
// 回收金额
|
||||
BigDecimal tradeAmount = activityAccount.getAmount(); |
||||
activityAccount.setAmount(new BigDecimal("0")); |
||||
editData(activityAccount); |
||||
|
||||
// 交易后金额
|
||||
BigDecimal amountAfterChange = activityAccount.getAmount(); |
||||
|
||||
// 交易记录
|
||||
BsRebateActivityAccountRecord record = new BsRebateActivityAccountRecord(); |
||||
record.setActivityId(activityAccount.getActivityId()); |
||||
record.setActivityNo(activityAccount.getActivityNo()); |
||||
record.setAccountId(activityAccount.getId()); |
||||
record.setTradeType(RebateActivityAccountTradeTypeEnum.type2.getNumber()); |
||||
record.setTradeNumber(DateUtil.date2String(new Date(), "yyyyMMddHHmmss")+(new Random().nextInt(8999) + 1000)); |
||||
record.setTradeAmount(tradeAmount); |
||||
record.setAmountBeforeChange(amountBeforeChange); |
||||
record.setAmountAfterChange(amountAfterChange); |
||||
record.setObjectType(RebateActivityAccountObjectTypeEnum.type2.getNumber()); |
||||
record.setObjectContent("活动余额回收"); |
||||
rebateActivityAccountRecordService.insert(record); |
||||
|
||||
// 商户账户入账
|
||||
RebateMerAccountTradeObject merAccountTradeObject = new RebateMerAccountTradeObject(); |
||||
merAccountTradeObject.setTradeObjectId(activity.getId()); |
||||
merAccountTradeObject.setTradeObjectType(RebateMerAccountObjectTypeEnum.type4); |
||||
merAccountTradeObject.setTradeObjectContent("活动编号:" + activityNo + ",回收余额:" + tradeAmount + "元"); |
||||
rebateMerAccountService.income(merAccount.getAccountNumber(), tradeAmount, merAccountTradeObject); |
||||
|
||||
redisTemplate.delete(lockKey); |
||||
return true; |
||||
|
||||
} else { |
||||
// 加锁失败,重试
|
||||
Thread.sleep(100); |
||||
recover(activityNo); |
||||
} |
||||
|
||||
} catch (Exception e) { |
||||
redisTemplate.delete(lockKey); |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
/** |
||||
* 金额交易 |
||||
* @param activityNo 活动编号 |
||||
* @param tradeType 交易类型 |
||||
* @param tradeAmount 交易金额 |
||||
* @param tradeObject 交易对象 |
||||
*/ |
||||
@Transactional(propagation= Propagation.REQUIRES_NEW, isolation = Isolation.READ_COMMITTED) |
||||
public Boolean accountTrade(String activityNo, RebateActivityAccountTradeTypeEnum tradeType, BigDecimal tradeAmount, RebateActivityAccountTradeObject tradeObject) { |
||||
String lockKey = "REBATE_ACTIVITY_ACCOUNT_" + activityNo; |
||||
try { |
||||
// 占坑锁
|
||||
Boolean lock = redisTemplate.opsForValue().setIfAbsent(lockKey, tradeAmount); |
||||
if(lock) { |
||||
// 查询账户
|
||||
BsRebateActivityAccount account = getAccountByActivityNo(activityNo); |
||||
if (account == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到活动账户"); |
||||
} |
||||
// 交易前金额
|
||||
BigDecimal amountBeforeChange = account.getAmount(); |
||||
// 计算账户金额
|
||||
if (tradeType.getNumber().equals(RebateActivityAccountTradeTypeEnum.type1.getNumber())) { |
||||
account.setAmount(account.getAmount().add(tradeAmount)); |
||||
|
||||
} else if (tradeType.getNumber().equals(RebateActivityAccountTradeTypeEnum.type2.getNumber())) { |
||||
// 扣款金额是否大于账户余额
|
||||
if (tradeAmount.compareTo(account.getAmount()) >= 0) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "账户余额不足"); |
||||
} |
||||
account.setAmount(account.getAmount().subtract(tradeAmount)); |
||||
} |
||||
editData(account); |
||||
|
||||
// 交易后金额
|
||||
BigDecimal amountAfterChange = account.getAmount(); |
||||
|
||||
// 交易记录
|
||||
BsRebateActivityAccountRecord record = new BsRebateActivityAccountRecord(); |
||||
record.setActivityId(account.getActivityId()); |
||||
record.setActivityNo(account.getActivityNo()); |
||||
record.setAccountId(account.getId()); |
||||
record.setTradeType(tradeType.getNumber()); |
||||
record.setTradeNumber(DateUtil.date2String(new Date(), "yyyyMMddHHmmss")+(new Random().nextInt(8999) + 1000)); |
||||
record.setTradeAmount(tradeAmount); |
||||
record.setAmountBeforeChange(amountBeforeChange); |
||||
record.setAmountAfterChange(amountAfterChange); |
||||
record.setObjectType(tradeObject.getTradeObjectType().getNumber()); |
||||
record.setObjectId(tradeObject.getTradeObjectId()); |
||||
record.setObjectContent(tradeObject.getTradeObjectContent()); |
||||
rebateActivityAccountRecordService.insert(record); |
||||
|
||||
redisTemplate.delete(lockKey); |
||||
return true; |
||||
|
||||
} else { |
||||
// 加锁失败,重试
|
||||
Thread.sleep(100); |
||||
accountTrade(activityNo, tradeType, tradeAmount, tradeObject); |
||||
} |
||||
|
||||
} catch (Exception e) { |
||||
redisTemplate.delete(lockKey); |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,176 @@ |
||||
package com.hfkj.service.rebate.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.BsRebateActivityMapper; |
||||
import com.hfkj.entity.BsRebateActivity; |
||||
import com.hfkj.entity.BsRebateActivityAccount; |
||||
import com.hfkj.entity.BsRebateActivityExample; |
||||
import com.hfkj.service.rebate.BsRebateActivityAccountService; |
||||
import com.hfkj.service.rebate.BsRebateActivityService; |
||||
import com.hfkj.sysenum.RebateActivityStatusEnum; |
||||
import org.apache.commons.collections4.MapUtils; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @className: BsRebateActivityServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2023/10/18 |
||||
**/ |
||||
@Service("rebateActivityService") |
||||
public class BsRebateActivityServiceImpl implements BsRebateActivityService { |
||||
|
||||
@Resource |
||||
private BsRebateActivityMapper rebateActivityMapper; |
||||
|
||||
@Resource |
||||
private BsRebateActivityAccountService rebateActivityAccountService; |
||||
|
||||
@Autowired |
||||
private RedisUtil redisUtil; |
||||
|
||||
private final static String REBATE_ACTIVITY = "REBATE_ACTIVITY"; |
||||
private final static String MER_CURRENT_REBATE_ACTIVITY = "MER_CURRENT_REBATE_ACTIVITY"; |
||||
|
||||
@Override |
||||
public void editData(BsRebateActivity rebateActivity) { |
||||
if (rebateActivity.getId() == null) { |
||||
rebateActivity.setCreateTime(new Date()); |
||||
rebateActivity.setUpdateTime(new Date()); |
||||
rebateActivityMapper.insert(rebateActivity); |
||||
|
||||
// 创建活动账户
|
||||
BsRebateActivityAccount account = new BsRebateActivityAccount(); |
||||
account.setActivityId(rebateActivity.getId()); |
||||
account.setActivityNo(rebateActivity.getActivityNo()); |
||||
account.setAmount(new BigDecimal("0")); |
||||
account.setStatus(1); |
||||
rebateActivityAccountService.createAccount(account); |
||||
} else { |
||||
rebateActivity.setUpdateTime(new Date()); |
||||
rebateActivityMapper.updateByPrimaryKey(rebateActivity); |
||||
} |
||||
redisUtil.set(REBATE_ACTIVITY + ":" +rebateActivity.getActivityNo(), rebateActivity); |
||||
} |
||||
|
||||
@Override |
||||
public void openActivity(String activityNo) { |
||||
// 活动
|
||||
BsRebateActivity activity = getActivityByNo(activityNo); |
||||
if (activity == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到活动"); |
||||
} |
||||
if (!activity.getStatus().equals(RebateActivityStatusEnum.status1.getNumber())) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "活动状态错误"); |
||||
} |
||||
// 查询当前线上活动
|
||||
if (getMerCurrentActivity(activity.getMerNo()) != null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已达到线上活动数量限制,当前已有活动正在进行中"); |
||||
} |
||||
activity.setStartTime(new Date()); |
||||
activity.setStatus(RebateActivityStatusEnum.status2.getNumber()); |
||||
editData(activity); |
||||
|
||||
// 存入缓存
|
||||
redisUtil.set(MER_CURRENT_REBATE_ACTIVITY + ":" + activity.getMerNo(), activity); |
||||
} |
||||
|
||||
@Override |
||||
public void closeActivity(String activityNo) { |
||||
// 活动
|
||||
BsRebateActivity activity = getActivityByNo(activityNo); |
||||
if (activity == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到活动"); |
||||
} |
||||
if (!activity.getStatus().equals(RebateActivityStatusEnum.status2.getNumber())) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "活动状态错误"); |
||||
} |
||||
activity.setStatus(RebateActivityStatusEnum.status3.getNumber()); |
||||
activity.setRealityEndTime(new Date()); |
||||
editData(activity); |
||||
|
||||
// 删除缓存
|
||||
redisUtil.del(MER_CURRENT_REBATE_ACTIVITY + ":" + activity.getMerNo()); |
||||
} |
||||
|
||||
@Override |
||||
public void updateActivityEndTime(String activityNo, Date newEndTime) { |
||||
// 活动
|
||||
BsRebateActivity activity = getActivityByNo(activityNo); |
||||
if (activity == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到活动"); |
||||
} |
||||
activity.setEndTime(newEndTime); |
||||
editData(activity); |
||||
} |
||||
|
||||
@Override |
||||
public BsRebateActivity getActivityByNo(String activityNo) { |
||||
String key = REBATE_ACTIVITY + ":" + activityNo; |
||||
// 获取缓存
|
||||
Object obj = redisUtil.get(key); |
||||
if (obj != null) { |
||||
return (BsRebateActivity) obj; |
||||
} |
||||
BsRebateActivityExample example = new BsRebateActivityExample(); |
||||
example.createCriteria().andActivityNoEqualTo(activityNo).andStatusNotEqualTo(RebateActivityStatusEnum.status0.getNumber()); |
||||
List<BsRebateActivity> list = rebateActivityMapper.selectByExample(example); |
||||
if (list.size() > 0) { |
||||
BsRebateActivity rebateActivity = list.get(0); |
||||
redisUtil.set(REBATE_ACTIVITY + ":" +rebateActivity.getActivityNo(), rebateActivity); |
||||
return rebateActivity; |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public BsRebateActivity getMerCurrentActivity(String merNo) { |
||||
// 从缓存中读取
|
||||
Object obj = redisUtil.get(MER_CURRENT_REBATE_ACTIVITY + ":" + merNo); |
||||
if (obj != null) { |
||||
return (BsRebateActivity) obj; |
||||
} else { |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public List<BsRebateActivity> getActivityList(Map<String, Object> param) { |
||||
BsRebateActivityExample example = new BsRebateActivityExample(); |
||||
BsRebateActivityExample.Criteria criteria = example.createCriteria() |
||||
.andStatusNotEqualTo(RebateActivityStatusEnum.status0.getNumber()); |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "activityNo"))) { |
||||
criteria.andActivityNoLike("%" + MapUtils.getString(param, "activityNo") + "%"); |
||||
} |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "merNo"))) { |
||||
criteria.andMerNoEqualTo(MapUtils.getString(param, "merNo")); |
||||
} |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "merName"))) { |
||||
criteria.andMerNameLike(MapUtils.getString(param, "merName")); |
||||
} |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "merAbbreviate"))) { |
||||
criteria.andMerAbbreviateLike(MapUtils.getString(param, "merAbbreviate")); |
||||
} |
||||
|
||||
if (MapUtils.getInteger(param, "status") != null) { |
||||
criteria.andStatusEqualTo(MapUtils.getInteger(param, "status")); |
||||
} |
||||
|
||||
example.setOrderByClause("create_time desc"); |
||||
return rebateActivityMapper.selectByExample(example); |
||||
} |
||||
} |
@ -0,0 +1,30 @@ |
||||
package com.hfkj.service.rebate.model; |
||||
|
||||
import com.hfkj.sysenum.RebateActivityAccountObjectTypeEnum; |
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* 活动金 - 活动账户交易对象 |
||||
* @className: RebateMerAccountTradeObject |
||||
* @author: HuRui |
||||
* @date: 2023/10/19 |
||||
**/ |
||||
@Data |
||||
public class RebateActivityAccountTradeObject { |
||||
|
||||
/** |
||||
* 交易对象类型 |
||||
*/ |
||||
private RebateActivityAccountObjectTypeEnum tradeObjectType; |
||||
|
||||
/** |
||||
* 交易对象id |
||||
*/ |
||||
private Long tradeObjectId; |
||||
|
||||
/** |
||||
* 交易对象内容、备注 |
||||
*/ |
||||
private String tradeObjectContent; |
||||
|
||||
} |
@ -0,0 +1,40 @@ |
||||
package com.hfkj.sysenum; |
||||
|
||||
/** |
||||
* 返利金账户 交易类型 |
||||
* @className: RebateActivityAccountObjectTypeEnum |
||||
* @author: HuRui |
||||
* @date: 2023/10/19 |
||||
**/ |
||||
public enum RebateActivityAccountObjectTypeEnum { |
||||
type1(1, "活动金额充值"), |
||||
type2(2, "活动余额回收"), |
||||
type3(3, "支付交易"), |
||||
; |
||||
|
||||
private Integer number; |
||||
|
||||
private String name; |
||||
|
||||
RebateActivityAccountObjectTypeEnum(int number, String name) { |
||||
this.number = number; |
||||
this.name = name; |
||||
} |
||||
|
||||
public Integer getNumber() { |
||||
return number; |
||||
} |
||||
|
||||
public void setNumber(Integer number) { |
||||
this.number = number; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,39 @@ |
||||
package com.hfkj.sysenum; |
||||
|
||||
/** |
||||
* 返利金活动 交易类型 |
||||
* @className: RebateMerAccountObjectTypeEnum |
||||
* @author: HuRui |
||||
* @date: 2023/10/19 |
||||
**/ |
||||
public enum RebateActivityAccountTradeTypeEnum { |
||||
type1(1, "入账"), |
||||
type2(2, "支出"), |
||||
; |
||||
|
||||
private Integer number; |
||||
|
||||
private String name; |
||||
|
||||
RebateActivityAccountTradeTypeEnum(int number, String name) { |
||||
this.number = number; |
||||
this.name = name; |
||||
} |
||||
|
||||
public Integer getNumber() { |
||||
return number; |
||||
} |
||||
|
||||
public void setNumber(Integer number) { |
||||
this.number = number; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,45 @@ |
||||
package com.hfkj.sysenum; |
||||
|
||||
import java.util.Objects; |
||||
|
||||
/** |
||||
* 活动金 - 限制参与类型 |
||||
*/ |
||||
public enum RebateActivityPartakeTypeEnum { |
||||
type1(1, "每日"), |
||||
; |
||||
|
||||
private Integer number; |
||||
|
||||
private String name; |
||||
|
||||
RebateActivityPartakeTypeEnum(int number, String name) { |
||||
this.number = number; |
||||
this.name = name; |
||||
} |
||||
|
||||
public static RebateActivityPartakeTypeEnum getDataByNumber(Integer number) { |
||||
for (RebateActivityPartakeTypeEnum ele : values()) { |
||||
if (Objects.equals(number,ele.getNumber())) { |
||||
return ele; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public Integer getNumber() { |
||||
return number; |
||||
} |
||||
|
||||
public void setNumber(Integer number) { |
||||
this.number = number; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
} |
@ -0,0 +1,47 @@ |
||||
package com.hfkj.sysenum; |
||||
|
||||
import java.util.Objects; |
||||
|
||||
/** |
||||
* 活动金 - 优惠类型 |
||||
*/ |
||||
public enum RebateActivityPreferentialTypeEnum { |
||||
type1(1, "满减"), |
||||
type2(2, "立减"), |
||||
type3(3, "折扣"), |
||||
; |
||||
|
||||
private Integer number; |
||||
|
||||
private String name; |
||||
|
||||
RebateActivityPreferentialTypeEnum(int number, String name) { |
||||
this.number = number; |
||||
this.name = name; |
||||
} |
||||
|
||||
public static RebateActivityPreferentialTypeEnum getDataByNumber(Integer number) { |
||||
for (RebateActivityPreferentialTypeEnum ele : values()) { |
||||
if (Objects.equals(number,ele.getNumber())) { |
||||
return ele; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public Integer getNumber() { |
||||
return number; |
||||
} |
||||
|
||||
public void setNumber(Integer number) { |
||||
this.number = number; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
} |
@ -0,0 +1,37 @@ |
||||
package com.hfkj.sysenum; |
||||
|
||||
/** |
||||
* 活动金 - 活动状态 |
||||
*/ |
||||
public enum RebateActivityStatusEnum { |
||||
status0(0, "不可用"), |
||||
status1(1, "编辑中"), |
||||
status2(2, "进行中"), |
||||
status3(3, "已结束"), |
||||
; |
||||
|
||||
private Integer number; |
||||
|
||||
private String name; |
||||
|
||||
RebateActivityStatusEnum(int number, String name) { |
||||
this.number = number; |
||||
this.name = name; |
||||
} |
||||
|
||||
public Integer getNumber() { |
||||
return number; |
||||
} |
||||
|
||||
public void setNumber(Integer number) { |
||||
this.number = number; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
} |
@ -0,0 +1,46 @@ |
||||
package com.hfkj.sysenum; |
||||
|
||||
import java.util.Objects; |
||||
|
||||
/** |
||||
* 活动金 - 活动类型 |
||||
*/ |
||||
public enum RebateActivityTypeEnum { |
||||
type1(1, "优惠活动"), |
||||
type2(2, "优惠券"), |
||||
; |
||||
|
||||
private Integer number; |
||||
|
||||
private String name; |
||||
|
||||
RebateActivityTypeEnum(int number, String name) { |
||||
this.number = number; |
||||
this.name = name; |
||||
} |
||||
|
||||
public static RebateActivityTypeEnum getDataByNumber(Integer number) { |
||||
for (RebateActivityTypeEnum ele : values()) { |
||||
if (Objects.equals(number,ele.getNumber())) { |
||||
return ele; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public Integer getNumber() { |
||||
return number; |
||||
} |
||||
|
||||
public void setNumber(Integer number) { |
||||
this.number = number; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
} |
Loading…
Reference in new issue