parent
ef962770cb
commit
904cfee8e1
@ -1,2 +1,2 @@ |
||||
fileUrl=/home/project/xuan-pay/filesystem |
||||
cmsPath=/home/project/hsg/filesystem/cmsPath |
||||
fileUrl=/home/project/gratia-pay/filesystem |
||||
cmsPath=/home/project/gratia-pay/filesystem/cmsPath |
||||
|
@ -0,0 +1,251 @@ |
||||
package com.cweb.controller; |
||||
|
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.cweb.config.SysConst; |
||||
import com.github.pagehelper.PageHelper; |
||||
import com.github.pagehelper.PageInfo; |
||||
import com.hfkj.common.QRCodeGenerator; |
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.common.utils.HttpsUtils; |
||||
import com.hfkj.common.utils.ResponseMsgUtil; |
||||
import com.hfkj.config.CommonSysConst; |
||||
import com.hfkj.config.WeChatQrcodeUtils; |
||||
import com.hfkj.entity.*; |
||||
import com.hfkj.model.ResponseData; |
||||
import com.hfkj.service.*; |
||||
import com.hfkj.sysenum.StoreDiscountActivityStatusEnum; |
||||
import com.hfkj.sysenum.WeChatQrCodeActionNameEnum; |
||||
import com.hfkj.sysenum.WeChatQrCodeTypeEnum; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
import org.springframework.stereotype.Controller; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.annotation.Resource; |
||||
import javax.imageio.ImageIO; |
||||
import java.awt.*; |
||||
import java.awt.image.BufferedImage; |
||||
import java.io.File; |
||||
import java.util.*; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @className: BsStoreDiscountActivityPartakeUserController |
||||
* @author: HuRui |
||||
* @date: 2023/3/14 |
||||
**/ |
||||
@Controller |
||||
@Api(value = "优惠参与用户") |
||||
@RequestMapping(value = "/storeDiscountActivityPartakeUser") |
||||
public class BsStoreDiscountActivityPartakeUserController { |
||||
private static Logger log = LoggerFactory.getLogger(BsStoreDiscountActivityPartakeUserController.class); |
||||
@Resource |
||||
private BsStoreDiscountActivityPartakeUserService storeDiscountActivityPartakeUserService; |
||||
@Resource |
||||
private BsStoreDiscountActivityService storeDiscountActivityService; |
||||
@Resource |
||||
private BsStoreService storeService; |
||||
@Resource |
||||
private BsPayQrCodeService payQrCodeService; |
||||
@Resource |
||||
private BsTradeOrderService tradeOrderService; |
||||
@Resource |
||||
private WeChatQrcodeUtils weChatQrcodeUtils; |
||||
|
||||
@RequestMapping(value = "/generateWeChatMpQrCode", method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "生成微信公众号二维码") |
||||
public ResponseData generateWeChatMpQrCode(@RequestParam(value = "outTradeNo" , required = false) String outTradeNo, |
||||
@RequestParam(value = "qrCodeSn" , required = false) String qrCodeSn, |
||||
@RequestParam(value = "type" , required = true) Integer type, |
||||
@RequestParam(value = "systemType" , required = true) Integer systemType) { |
||||
try { |
||||
JSONObject response = HttpsUtils.doGet(CommonSysConst.getSysConfig().getHsg_domain_name() + "/v1/wxMsg/getWxToken"); |
||||
if (StringUtils.isBlank(response.getString("return_data"))) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "获取token失败"); |
||||
} |
||||
BsTradeOrder tradeNo = tradeOrderService.getOrderByOutTradeNo(outTradeNo); |
||||
if (tradeNo == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的订单"); |
||||
} |
||||
String param = outTradeNo; |
||||
String fileUrl = "/share/" + System.currentTimeMillis() + ".png"; |
||||
// type 生成类型
|
||||
// 1:支付交易成功后
|
||||
// 2:分享关注公众号
|
||||
if (type == 1) { |
||||
// systemType系统类型;1:安卓 2:IOS
|
||||
if (systemType == 1) { |
||||
// 生成支付二维码
|
||||
QRCodeGenerator.generateQRCodeImage( |
||||
weChatQrcodeUtils.generateQrCodeImgUrl(response.getString("return_data"), WeChatQrCodeTypeEnum.PAYMENT_SUCCESS, param, WeChatQrCodeActionNameEnum.actionName1), |
||||
180, |
||||
180, |
||||
CommonSysConst.getSysConfig().getFilesystem() + fileUrl |
||||
); |
||||
QRCodeGenerator.overlapImage(fileUrl, "/template/qrCodeBackdrop1_1.png",96,32); |
||||
} else if (systemType == 2) { |
||||
// 生成支付二维码
|
||||
QRCodeGenerator.generateQRCodeImage( |
||||
weChatQrcodeUtils.generateQrCodeImgUrl(response.getString("return_data"), WeChatQrCodeTypeEnum.PAYMENT_SUCCESS, param, WeChatQrCodeActionNameEnum.actionName1), |
||||
180, |
||||
180, |
||||
CommonSysConst.getSysConfig().getFilesystem() + fileUrl |
||||
); |
||||
QRCodeGenerator.overlapImage(fileUrl, "/template/qrCodeBackdrop1_2.png",96,32); |
||||
} |
||||
|
||||
} else if (type == 2) { |
||||
// systemType系统类型;1:安卓 2:IOS
|
||||
if (systemType == 1) { |
||||
// 生成支付二维码
|
||||
QRCodeGenerator.generateQRCodeImage( |
||||
weChatQrcodeUtils.generateQrCodeImgUrl(response.getString("return_data"), WeChatQrCodeTypeEnum.PAYMENT_SUCCESS, param, WeChatQrCodeActionNameEnum.actionName1), |
||||
180, |
||||
180, |
||||
CommonSysConst.getSysConfig().getFilesystem() + fileUrl |
||||
); |
||||
QRCodeGenerator.overlapImage(fileUrl, "/template/qrCodeBackdrop2_1.png",96,32); |
||||
|
||||
} else if (systemType == 2) { |
||||
// 生成支付二维码
|
||||
QRCodeGenerator.generateQRCodeImage( |
||||
weChatQrcodeUtils.generateQrCodeImgUrl(response.getString("return_data"), WeChatQrCodeTypeEnum.SHARE, param, WeChatQrCodeActionNameEnum.actionName1), |
||||
578, |
||||
578, |
||||
CommonSysConst.getSysConfig().getFilesystem() + fileUrl |
||||
); |
||||
QRCodeGenerator.overlapImage(fileUrl, "/template/qrCodeBackdrop2_2.png",250,650); |
||||
} |
||||
} |
||||
return ResponseMsgUtil.success(SysConst.getSysConfig().getDomainName() + "/filesystem" + fileUrl); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("BsStoreDiscountActivityPartakeUserController --> generateWeChatMpQrCode() error!", e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value = "/getReceiveDiscountList", method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询领取优惠列表") |
||||
public ResponseData getReceiveDiscountList(@RequestParam(value = "qrCodeSn" , required = true) String qrCodeSn, |
||||
@RequestParam(value = "partakeWay" , required = true) Integer partakeWay) { |
||||
try { |
||||
|
||||
BsPayQrCode qrCode = payQrCodeService.getDetailBySN(qrCodeSn); |
||||
if (qrCode == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知二维码"); |
||||
} |
||||
if (qrCode.getStoreId() == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未绑定门店"); |
||||
} |
||||
// 查询门店
|
||||
BsStore store = storeService.getStoreById(qrCode.getStoreId()); |
||||
if (store == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的门店"); |
||||
} |
||||
List<BsStoreDiscountActivity> discountActivityList = new ArrayList<>(); |
||||
|
||||
// 门店活动
|
||||
Map<String, Object> param = new HashMap<>(); |
||||
param.put("storeId", store.getId()); |
||||
param.put("partakeWay", partakeWay); |
||||
param.put("status", StoreDiscountActivityStatusEnum.status2.getNumber()); |
||||
discountActivityList.addAll(storeDiscountActivityService.getActivityList(param)); |
||||
|
||||
param.clear(); |
||||
// 商户活动
|
||||
param.put("partakeWay", partakeWay); |
||||
param.put("merId", store.getMerId()); |
||||
param.put("storeIdNull", 0); |
||||
param.put("status", StoreDiscountActivityStatusEnum.status2.getNumber()); |
||||
discountActivityList.addAll(storeDiscountActivityService.getActivityList(param)); |
||||
|
||||
return ResponseMsgUtil.success(discountActivityList); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("BsStoreDiscountActivityPartakeUserController --> getReceiveDiscountList() error!", e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value = "/receiveDiscount", method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "领取优惠") |
||||
public ResponseData receiveDiscount(@RequestBody JSONObject body) { |
||||
try { |
||||
if (StringUtils.isBlank(body.getString("phone")) |
||||
|| body.getJSONArray("activityIds") == null |
||||
|| body.getJSONArray("activityIds").size() == 0 |
||||
) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
List<Long> activityIds = new ArrayList<>(); |
||||
for (Object obj : body.getJSONArray("activityIds")) { |
||||
JSONObject activity = (JSONObject) obj; |
||||
if (activity == null || activity.getLong("id") == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
activityIds.add(activity.getLong("id")); |
||||
} |
||||
storeDiscountActivityPartakeUserService.receiveDiscount(body.getString("phone"), activityIds); |
||||
|
||||
return ResponseMsgUtil.success("领取成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("BsStoreDiscountActivityPartakeUserController --> receiveDiscount() error!", e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value = "/getDiscountListByPhone", method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "根据手机号获取优惠列表") |
||||
public ResponseData getDiscountListByPhone(@RequestParam(value = "phone" , required = true) String phone, |
||||
@RequestParam(value = "status" , required = false) Integer status, |
||||
@RequestParam(value = "pageNum" , required = true) Integer pageNum, |
||||
@RequestParam(value = "pageSize" , required = true) Integer pageSize) { |
||||
try { |
||||
Map<String, Object> param = new HashMap<>(); |
||||
param.put("userPhone", phone); |
||||
param.put("status", status); |
||||
|
||||
PageHelper.startPage(pageNum,pageSize); |
||||
return ResponseMsgUtil.success(new PageInfo<>(storeDiscountActivityPartakeUserService.getList(param))); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("BsStoreDiscountActivityPartakeUserController --> getDiscountListByPhone() error!", e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value = "/getDiscountSurplusTotalNum", method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "根据手机号获取可用优惠总次数") |
||||
public ResponseData getDiscountSurplusTotalNum(@RequestParam(value = "phone" , required = true) String phone) { |
||||
try { |
||||
Map<String, Object> param = new HashMap<>(); |
||||
param.put("userPhone", phone); |
||||
param.put("status", 1); |
||||
|
||||
Integer countNum = 0; |
||||
List<BsStoreDiscountActivityPartakeUser> list = storeDiscountActivityPartakeUserService.getList(param); |
||||
for (BsStoreDiscountActivityPartakeUser discountActivityPartakeUser : list) { |
||||
countNum += discountActivityPartakeUser.getPartakeSurplusNum(); |
||||
} |
||||
return ResponseMsgUtil.success(countNum); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("BsStoreDiscountActivityPartakeUserController --> getDiscountSurplusTotalNum() error!", e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,22 @@ |
||||
package com.hfkj.channel.cpcn; |
||||
|
||||
import com.alibaba.fastjson.JSONObject; |
||||
|
||||
/** |
||||
* 中金支付 交易业务 |
||||
* @className: CnpcTradeService |
||||
* @author: HuRui |
||||
* @date: 2023/3/22 |
||||
**/ |
||||
public class CpcnTradeService { |
||||
|
||||
|
||||
public static JSONObject createTrade() { |
||||
|
||||
|
||||
|
||||
|
||||
return null; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,23 @@ |
||||
package com.hfkj.channel.cpcn.config; |
||||
|
||||
/** |
||||
* 中金支付配置 |
||||
* @className: CnpcConfig |
||||
* @author: HuRui |
||||
* @date: 2023/3/22 |
||||
**/ |
||||
public class CpcnConfig { |
||||
/** |
||||
* 业务接口请求 |
||||
*/ |
||||
private static String requestUrl = "https://test.cpcn.com.cn/Gateway4File/InterfaceII"; |
||||
|
||||
/** |
||||
* 文件接口请求 |
||||
*/ |
||||
private static String requestFileUrl = "https://test.cpcn.com.cn/Gateway4File/InterfaceII"; |
||||
|
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,34 @@ |
||||
package com.hfkj.common.utils; |
||||
|
||||
import java.util.Map; |
||||
import java.util.concurrent.ConcurrentHashMap; |
||||
import java.util.function.Function; |
||||
import java.util.function.Predicate; |
||||
|
||||
/** |
||||
* |
||||
* @ClassName: StreamUtil |
||||
* @Description:TODO(List Steam) |
||||
* @author: 胡锐 |
||||
* @date: 2019年3月25日 下午4:14:00 |
||||
* |
||||
* @Copyright: 2019 www.shinwoten.com Inc. All rights reserved. |
||||
*/ |
||||
public class StreamUtil { |
||||
|
||||
/** |
||||
* |
||||
* @Title: distinctByKey |
||||
* @Description: TODO(对象 去重) |
||||
* @author: 胡锐 |
||||
* @param: @param keyExtractor |
||||
* @param: @return |
||||
* @return: Predicate<T> |
||||
* @throws |
||||
*/ |
||||
public static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) { |
||||
Map<Object,Boolean> seen = new ConcurrentHashMap<>(); |
||||
return t -> seen.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,150 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsStoreDiscountActivityPartakeUser; |
||||
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserExample; |
||||
import java.util.List; |
||||
import org.apache.ibatis.annotations.Delete; |
||||
import org.apache.ibatis.annotations.DeleteProvider; |
||||
import org.apache.ibatis.annotations.Insert; |
||||
import org.apache.ibatis.annotations.InsertProvider; |
||||
import org.apache.ibatis.annotations.Options; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Result; |
||||
import org.apache.ibatis.annotations.Results; |
||||
import org.apache.ibatis.annotations.Select; |
||||
import org.apache.ibatis.annotations.SelectProvider; |
||||
import org.apache.ibatis.annotations.Update; |
||||
import org.apache.ibatis.annotations.UpdateProvider; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
/** |
||||
* |
||||
* 代码由工具生成,请勿修改!!! |
||||
* 如果需要扩展请在其父类进行扩展 |
||||
* |
||||
**/ |
||||
@Repository |
||||
public interface BsStoreDiscountActivityPartakeUserMapper extends BsStoreDiscountActivityPartakeUserMapperExt { |
||||
@SelectProvider(type=BsStoreDiscountActivityPartakeUserSqlProvider.class, method="countByExample") |
||||
long countByExample(BsStoreDiscountActivityPartakeUserExample example); |
||||
|
||||
@DeleteProvider(type=BsStoreDiscountActivityPartakeUserSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(BsStoreDiscountActivityPartakeUserExample example); |
||||
|
||||
@Delete({ |
||||
"delete from bs_store_discount_activity_partake_user", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into bs_store_discount_activity_partake_user (discount_activity_id, discount_activity_name, ", |
||||
"discount_type, discount_condition, ", |
||||
"discount_price, start_time, ", |
||||
"end_time, user_phone, ", |
||||
"partake_total_num, partake_surplus_num, ", |
||||
"partake_use_num, `status`, ", |
||||
"create_time, update_time, ", |
||||
"ext_1, ext_2, ext_3)", |
||||
"values (#{discountActivityId,jdbcType=BIGINT}, #{discountActivityName,jdbcType=VARCHAR}, ", |
||||
"#{discountType,jdbcType=INTEGER}, #{discountCondition,jdbcType=DECIMAL}, ", |
||||
"#{discountPrice,jdbcType=DECIMAL}, #{startTime,jdbcType=TIMESTAMP}, ", |
||||
"#{endTime,jdbcType=TIMESTAMP}, #{userPhone,jdbcType=VARCHAR}, ", |
||||
"#{partakeTotalNum,jdbcType=INTEGER}, #{partakeSurplusNum,jdbcType=INTEGER}, ", |
||||
"#{partakeUseNum,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, ", |
||||
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", |
||||
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(BsStoreDiscountActivityPartakeUser record); |
||||
|
||||
@InsertProvider(type=BsStoreDiscountActivityPartakeUserSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(BsStoreDiscountActivityPartakeUser record); |
||||
|
||||
@SelectProvider(type=BsStoreDiscountActivityPartakeUserSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="discount_activity_id", property="discountActivityId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="discount_activity_name", property="discountActivityName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="partake_total_num", property="partakeTotalNum", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="partake_surplus_num", property="partakeSurplusNum", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="partake_use_num", property="partakeUseNum", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
List<BsStoreDiscountActivityPartakeUser> selectByExample(BsStoreDiscountActivityPartakeUserExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, discount_activity_id, discount_activity_name, discount_type, discount_condition, ", |
||||
"discount_price, start_time, end_time, user_phone, partake_total_num, partake_surplus_num, ", |
||||
"partake_use_num, `status`, create_time, update_time, ext_1, ext_2, ext_3", |
||||
"from bs_store_discount_activity_partake_user", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="discount_activity_id", property="discountActivityId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="discount_activity_name", property="discountActivityName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="partake_total_num", property="partakeTotalNum", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="partake_surplus_num", property="partakeSurplusNum", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="partake_use_num", property="partakeUseNum", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
BsStoreDiscountActivityPartakeUser selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=BsStoreDiscountActivityPartakeUserSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") BsStoreDiscountActivityPartakeUser record, @Param("example") BsStoreDiscountActivityPartakeUserExample example); |
||||
|
||||
@UpdateProvider(type=BsStoreDiscountActivityPartakeUserSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") BsStoreDiscountActivityPartakeUser record, @Param("example") BsStoreDiscountActivityPartakeUserExample example); |
||||
|
||||
@UpdateProvider(type=BsStoreDiscountActivityPartakeUserSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(BsStoreDiscountActivityPartakeUser record); |
||||
|
||||
@Update({ |
||||
"update bs_store_discount_activity_partake_user", |
||||
"set discount_activity_id = #{discountActivityId,jdbcType=BIGINT},", |
||||
"discount_activity_name = #{discountActivityName,jdbcType=VARCHAR},", |
||||
"discount_type = #{discountType,jdbcType=INTEGER},", |
||||
"discount_condition = #{discountCondition,jdbcType=DECIMAL},", |
||||
"discount_price = #{discountPrice,jdbcType=DECIMAL},", |
||||
"start_time = #{startTime,jdbcType=TIMESTAMP},", |
||||
"end_time = #{endTime,jdbcType=TIMESTAMP},", |
||||
"user_phone = #{userPhone,jdbcType=VARCHAR},", |
||||
"partake_total_num = #{partakeTotalNum,jdbcType=INTEGER},", |
||||
"partake_surplus_num = #{partakeSurplusNum,jdbcType=INTEGER},", |
||||
"partake_use_num = #{partakeUseNum,jdbcType=INTEGER},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"update_time = #{updateTime,jdbcType=TIMESTAMP},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(BsStoreDiscountActivityPartakeUser record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface BsStoreDiscountActivityPartakeUserMapperExt { |
||||
} |
@ -0,0 +1,122 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserRecord; |
||||
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserRecordExample; |
||||
import java.util.List; |
||||
import org.apache.ibatis.annotations.Delete; |
||||
import org.apache.ibatis.annotations.DeleteProvider; |
||||
import org.apache.ibatis.annotations.Insert; |
||||
import org.apache.ibatis.annotations.InsertProvider; |
||||
import org.apache.ibatis.annotations.Options; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Result; |
||||
import org.apache.ibatis.annotations.Results; |
||||
import org.apache.ibatis.annotations.Select; |
||||
import org.apache.ibatis.annotations.SelectProvider; |
||||
import org.apache.ibatis.annotations.Update; |
||||
import org.apache.ibatis.annotations.UpdateProvider; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
/** |
||||
* |
||||
* 代码由工具生成,请勿修改!!! |
||||
* 如果需要扩展请在其父类进行扩展 |
||||
* |
||||
**/ |
||||
@Repository |
||||
public interface BsStoreDiscountActivityPartakeUserRecordMapper extends BsStoreDiscountActivityPartakeUserRecordMapperExt { |
||||
@SelectProvider(type=BsStoreDiscountActivityPartakeUserRecordSqlProvider.class, method="countByExample") |
||||
long countByExample(BsStoreDiscountActivityPartakeUserRecordExample example); |
||||
|
||||
@DeleteProvider(type=BsStoreDiscountActivityPartakeUserRecordSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(BsStoreDiscountActivityPartakeUserRecordExample example); |
||||
|
||||
@Delete({ |
||||
"delete from bs_store_discount_activity_partake_user_record", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into bs_store_discount_activity_partake_user_record (discount_activity_id, discount_activity_name, ", |
||||
"discount_type, discount_condition, ", |
||||
"discount_price, user_phone, ", |
||||
"create_time, ext_1, ", |
||||
"ext_2, ext_3)", |
||||
"values (#{discountActivityId,jdbcType=BIGINT}, #{discountActivityName,jdbcType=VARCHAR}, ", |
||||
"#{discountType,jdbcType=INTEGER}, #{discountCondition,jdbcType=DECIMAL}, ", |
||||
"#{discountPrice,jdbcType=DECIMAL}, #{userPhone,jdbcType=VARCHAR}, ", |
||||
"#{createTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", |
||||
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(BsStoreDiscountActivityPartakeUserRecord record); |
||||
|
||||
@InsertProvider(type=BsStoreDiscountActivityPartakeUserRecordSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(BsStoreDiscountActivityPartakeUserRecord record); |
||||
|
||||
@SelectProvider(type=BsStoreDiscountActivityPartakeUserRecordSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="discount_activity_id", property="discountActivityId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="discount_activity_name", property="discountActivityName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
List<BsStoreDiscountActivityPartakeUserRecord> selectByExample(BsStoreDiscountActivityPartakeUserRecordExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, discount_activity_id, discount_activity_name, discount_type, discount_condition, ", |
||||
"discount_price, user_phone, create_time, ext_1, ext_2, ext_3", |
||||
"from bs_store_discount_activity_partake_user_record", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="discount_activity_id", property="discountActivityId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="discount_activity_name", property="discountActivityName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
BsStoreDiscountActivityPartakeUserRecord selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=BsStoreDiscountActivityPartakeUserRecordSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") BsStoreDiscountActivityPartakeUserRecord record, @Param("example") BsStoreDiscountActivityPartakeUserRecordExample example); |
||||
|
||||
@UpdateProvider(type=BsStoreDiscountActivityPartakeUserRecordSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") BsStoreDiscountActivityPartakeUserRecord record, @Param("example") BsStoreDiscountActivityPartakeUserRecordExample example); |
||||
|
||||
@UpdateProvider(type=BsStoreDiscountActivityPartakeUserRecordSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(BsStoreDiscountActivityPartakeUserRecord record); |
||||
|
||||
@Update({ |
||||
"update bs_store_discount_activity_partake_user_record", |
||||
"set discount_activity_id = #{discountActivityId,jdbcType=BIGINT},", |
||||
"discount_activity_name = #{discountActivityName,jdbcType=VARCHAR},", |
||||
"discount_type = #{discountType,jdbcType=INTEGER},", |
||||
"discount_condition = #{discountCondition,jdbcType=DECIMAL},", |
||||
"discount_price = #{discountPrice,jdbcType=DECIMAL},", |
||||
"user_phone = #{userPhone,jdbcType=VARCHAR},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(BsStoreDiscountActivityPartakeUserRecord record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface BsStoreDiscountActivityPartakeUserRecordMapperExt { |
||||
} |
@ -0,0 +1,318 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserRecord; |
||||
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserRecordExample.Criteria; |
||||
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserRecordExample.Criterion; |
||||
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserRecordExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class BsStoreDiscountActivityPartakeUserRecordSqlProvider { |
||||
|
||||
public String countByExample(BsStoreDiscountActivityPartakeUserRecordExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("bs_store_discount_activity_partake_user_record"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(BsStoreDiscountActivityPartakeUserRecordExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("bs_store_discount_activity_partake_user_record"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(BsStoreDiscountActivityPartakeUserRecord record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("bs_store_discount_activity_partake_user_record"); |
||||
|
||||
if (record.getDiscountActivityId() != null) { |
||||
sql.VALUES("discount_activity_id", "#{discountActivityId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getDiscountActivityName() != null) { |
||||
sql.VALUES("discount_activity_name", "#{discountActivityName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getDiscountType() != null) { |
||||
sql.VALUES("discount_type", "#{discountType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getDiscountCondition() != null) { |
||||
sql.VALUES("discount_condition", "#{discountCondition,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getDiscountPrice() != null) { |
||||
sql.VALUES("discount_price", "#{discountPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getUserPhone() != null) { |
||||
sql.VALUES("user_phone", "#{userPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String selectByExample(BsStoreDiscountActivityPartakeUserRecordExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("discount_activity_id"); |
||||
sql.SELECT("discount_activity_name"); |
||||
sql.SELECT("discount_type"); |
||||
sql.SELECT("discount_condition"); |
||||
sql.SELECT("discount_price"); |
||||
sql.SELECT("user_phone"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("bs_store_discount_activity_partake_user_record"); |
||||
applyWhere(sql, example, false); |
||||
|
||||
if (example != null && example.getOrderByClause() != null) { |
||||
sql.ORDER_BY(example.getOrderByClause()); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExampleSelective(Map<String, Object> parameter) { |
||||
BsStoreDiscountActivityPartakeUserRecord record = (BsStoreDiscountActivityPartakeUserRecord) parameter.get("record"); |
||||
BsStoreDiscountActivityPartakeUserRecordExample example = (BsStoreDiscountActivityPartakeUserRecordExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_store_discount_activity_partake_user_record"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getDiscountActivityId() != null) { |
||||
sql.SET("discount_activity_id = #{record.discountActivityId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getDiscountActivityName() != null) { |
||||
sql.SET("discount_activity_name = #{record.discountActivityName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getDiscountType() != null) { |
||||
sql.SET("discount_type = #{record.discountType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getDiscountCondition() != null) { |
||||
sql.SET("discount_condition = #{record.discountCondition,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getDiscountPrice() != null) { |
||||
sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getUserPhone() != null) { |
||||
sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_store_discount_activity_partake_user_record"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("discount_activity_id = #{record.discountActivityId,jdbcType=BIGINT}"); |
||||
sql.SET("discount_activity_name = #{record.discountActivityName,jdbcType=VARCHAR}"); |
||||
sql.SET("discount_type = #{record.discountType,jdbcType=INTEGER}"); |
||||
sql.SET("discount_condition = #{record.discountCondition,jdbcType=DECIMAL}"); |
||||
sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}"); |
||||
sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
|
||||
BsStoreDiscountActivityPartakeUserRecordExample example = (BsStoreDiscountActivityPartakeUserRecordExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(BsStoreDiscountActivityPartakeUserRecord record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_store_discount_activity_partake_user_record"); |
||||
|
||||
if (record.getDiscountActivityId() != null) { |
||||
sql.SET("discount_activity_id = #{discountActivityId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getDiscountActivityName() != null) { |
||||
sql.SET("discount_activity_name = #{discountActivityName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getDiscountType() != null) { |
||||
sql.SET("discount_type = #{discountType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getDiscountCondition() != null) { |
||||
sql.SET("discount_condition = #{discountCondition,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getDiscountPrice() != null) { |
||||
sql.SET("discount_price = #{discountPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getUserPhone() != null) { |
||||
sql.SET("user_phone = #{userPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
sql.WHERE("id = #{id,jdbcType=BIGINT}"); |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
protected void applyWhere(SQL sql, BsStoreDiscountActivityPartakeUserRecordExample example, boolean includeExamplePhrase) { |
||||
if (example == null) { |
||||
return; |
||||
} |
||||
|
||||
String parmPhrase1; |
||||
String parmPhrase1_th; |
||||
String parmPhrase2; |
||||
String parmPhrase2_th; |
||||
String parmPhrase3; |
||||
String parmPhrase3_th; |
||||
if (includeExamplePhrase) { |
||||
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} else { |
||||
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
List<Criteria> oredCriteria = example.getOredCriteria(); |
||||
boolean firstCriteria = true; |
||||
for (int i = 0; i < oredCriteria.size(); i++) { |
||||
Criteria criteria = oredCriteria.get(i); |
||||
if (criteria.isValid()) { |
||||
if (firstCriteria) { |
||||
firstCriteria = false; |
||||
} else { |
||||
sb.append(" or "); |
||||
} |
||||
|
||||
sb.append('('); |
||||
List<Criterion> criterions = criteria.getAllCriteria(); |
||||
boolean firstCriterion = true; |
||||
for (int j = 0; j < criterions.size(); j++) { |
||||
Criterion criterion = criterions.get(j); |
||||
if (firstCriterion) { |
||||
firstCriterion = false; |
||||
} else { |
||||
sb.append(" and "); |
||||
} |
||||
|
||||
if (criterion.isNoValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
} else if (criterion.isSingleValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isBetweenValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isListValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
sb.append(" ("); |
||||
List<?> listItems = (List<?>) criterion.getValue(); |
||||
boolean comma = false; |
||||
for (int k = 0; k < listItems.size(); k++) { |
||||
if (comma) { |
||||
sb.append(", "); |
||||
} else { |
||||
comma = true; |
||||
} |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase3, i, j, k)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
|
||||
if (sb.length() > 0) { |
||||
sql.WHERE(sb.toString()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,416 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsStoreDiscountActivityPartakeUser; |
||||
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserExample.Criteria; |
||||
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserExample.Criterion; |
||||
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class BsStoreDiscountActivityPartakeUserSqlProvider { |
||||
|
||||
public String countByExample(BsStoreDiscountActivityPartakeUserExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("bs_store_discount_activity_partake_user"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(BsStoreDiscountActivityPartakeUserExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("bs_store_discount_activity_partake_user"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(BsStoreDiscountActivityPartakeUser record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("bs_store_discount_activity_partake_user"); |
||||
|
||||
if (record.getDiscountActivityId() != null) { |
||||
sql.VALUES("discount_activity_id", "#{discountActivityId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getDiscountActivityName() != null) { |
||||
sql.VALUES("discount_activity_name", "#{discountActivityName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getDiscountType() != null) { |
||||
sql.VALUES("discount_type", "#{discountType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getDiscountCondition() != null) { |
||||
sql.VALUES("discount_condition", "#{discountCondition,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getDiscountPrice() != null) { |
||||
sql.VALUES("discount_price", "#{discountPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getStartTime() != null) { |
||||
sql.VALUES("start_time", "#{startTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getEndTime() != null) { |
||||
sql.VALUES("end_time", "#{endTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUserPhone() != null) { |
||||
sql.VALUES("user_phone", "#{userPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPartakeTotalNum() != null) { |
||||
sql.VALUES("partake_total_num", "#{partakeTotalNum,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPartakeSurplusNum() != null) { |
||||
sql.VALUES("partake_surplus_num", "#{partakeSurplusNum,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPartakeUseNum() != null) { |
||||
sql.VALUES("partake_use_num", "#{partakeUseNum,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String selectByExample(BsStoreDiscountActivityPartakeUserExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("discount_activity_id"); |
||||
sql.SELECT("discount_activity_name"); |
||||
sql.SELECT("discount_type"); |
||||
sql.SELECT("discount_condition"); |
||||
sql.SELECT("discount_price"); |
||||
sql.SELECT("start_time"); |
||||
sql.SELECT("end_time"); |
||||
sql.SELECT("user_phone"); |
||||
sql.SELECT("partake_total_num"); |
||||
sql.SELECT("partake_surplus_num"); |
||||
sql.SELECT("partake_use_num"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("update_time"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("bs_store_discount_activity_partake_user"); |
||||
applyWhere(sql, example, false); |
||||
|
||||
if (example != null && example.getOrderByClause() != null) { |
||||
sql.ORDER_BY(example.getOrderByClause()); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExampleSelective(Map<String, Object> parameter) { |
||||
BsStoreDiscountActivityPartakeUser record = (BsStoreDiscountActivityPartakeUser) parameter.get("record"); |
||||
BsStoreDiscountActivityPartakeUserExample example = (BsStoreDiscountActivityPartakeUserExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_store_discount_activity_partake_user"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getDiscountActivityId() != null) { |
||||
sql.SET("discount_activity_id = #{record.discountActivityId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getDiscountActivityName() != null) { |
||||
sql.SET("discount_activity_name = #{record.discountActivityName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getDiscountType() != null) { |
||||
sql.SET("discount_type = #{record.discountType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getDiscountCondition() != null) { |
||||
sql.SET("discount_condition = #{record.discountCondition,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getDiscountPrice() != null) { |
||||
sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getStartTime() != null) { |
||||
sql.SET("start_time = #{record.startTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getEndTime() != null) { |
||||
sql.SET("end_time = #{record.endTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUserPhone() != null) { |
||||
sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPartakeTotalNum() != null) { |
||||
sql.SET("partake_total_num = #{record.partakeTotalNum,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPartakeSurplusNum() != null) { |
||||
sql.SET("partake_surplus_num = #{record.partakeSurplusNum,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPartakeUseNum() != null) { |
||||
sql.SET("partake_use_num = #{record.partakeUseNum,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_store_discount_activity_partake_user"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("discount_activity_id = #{record.discountActivityId,jdbcType=BIGINT}"); |
||||
sql.SET("discount_activity_name = #{record.discountActivityName,jdbcType=VARCHAR}"); |
||||
sql.SET("discount_type = #{record.discountType,jdbcType=INTEGER}"); |
||||
sql.SET("discount_condition = #{record.discountCondition,jdbcType=DECIMAL}"); |
||||
sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}"); |
||||
sql.SET("start_time = #{record.startTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("end_time = #{record.endTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); |
||||
sql.SET("partake_total_num = #{record.partakeTotalNum,jdbcType=INTEGER}"); |
||||
sql.SET("partake_surplus_num = #{record.partakeSurplusNum,jdbcType=INTEGER}"); |
||||
sql.SET("partake_use_num = #{record.partakeUseNum,jdbcType=INTEGER}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
|
||||
BsStoreDiscountActivityPartakeUserExample example = (BsStoreDiscountActivityPartakeUserExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(BsStoreDiscountActivityPartakeUser record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_store_discount_activity_partake_user"); |
||||
|
||||
if (record.getDiscountActivityId() != null) { |
||||
sql.SET("discount_activity_id = #{discountActivityId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getDiscountActivityName() != null) { |
||||
sql.SET("discount_activity_name = #{discountActivityName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getDiscountType() != null) { |
||||
sql.SET("discount_type = #{discountType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getDiscountCondition() != null) { |
||||
sql.SET("discount_condition = #{discountCondition,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getDiscountPrice() != null) { |
||||
sql.SET("discount_price = #{discountPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getStartTime() != null) { |
||||
sql.SET("start_time = #{startTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getEndTime() != null) { |
||||
sql.SET("end_time = #{endTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUserPhone() != null) { |
||||
sql.SET("user_phone = #{userPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPartakeTotalNum() != null) { |
||||
sql.SET("partake_total_num = #{partakeTotalNum,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPartakeSurplusNum() != null) { |
||||
sql.SET("partake_surplus_num = #{partakeSurplusNum,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPartakeUseNum() != null) { |
||||
sql.SET("partake_use_num = #{partakeUseNum,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
sql.WHERE("id = #{id,jdbcType=BIGINT}"); |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
protected void applyWhere(SQL sql, BsStoreDiscountActivityPartakeUserExample example, boolean includeExamplePhrase) { |
||||
if (example == null) { |
||||
return; |
||||
} |
||||
|
||||
String parmPhrase1; |
||||
String parmPhrase1_th; |
||||
String parmPhrase2; |
||||
String parmPhrase2_th; |
||||
String parmPhrase3; |
||||
String parmPhrase3_th; |
||||
if (includeExamplePhrase) { |
||||
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} else { |
||||
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
List<Criteria> oredCriteria = example.getOredCriteria(); |
||||
boolean firstCriteria = true; |
||||
for (int i = 0; i < oredCriteria.size(); i++) { |
||||
Criteria criteria = oredCriteria.get(i); |
||||
if (criteria.isValid()) { |
||||
if (firstCriteria) { |
||||
firstCriteria = false; |
||||
} else { |
||||
sb.append(" or "); |
||||
} |
||||
|
||||
sb.append('('); |
||||
List<Criterion> criterions = criteria.getAllCriteria(); |
||||
boolean firstCriterion = true; |
||||
for (int j = 0; j < criterions.size(); j++) { |
||||
Criterion criterion = criterions.get(j); |
||||
if (firstCriterion) { |
||||
firstCriterion = false; |
||||
} else { |
||||
sb.append(" and "); |
||||
} |
||||
|
||||
if (criterion.isNoValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
} else if (criterion.isSingleValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isBetweenValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isListValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
sb.append(" ("); |
||||
List<?> listItems = (List<?>) criterion.getValue(); |
||||
boolean comma = false; |
||||
for (int k = 0; k < listItems.size(); k++) { |
||||
if (comma) { |
||||
sb.append(", "); |
||||
} else { |
||||
comma = true; |
||||
} |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase3, i, j, k)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
|
||||
if (sb.length() > 0) { |
||||
sql.WHERE(sb.toString()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,329 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* bs_store_discount_activity_partake_user |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class BsStoreDiscountActivityPartakeUser implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 优惠活动id |
||||
*/ |
||||
private Long discountActivityId; |
||||
|
||||
/** |
||||
* 优惠活动名称 |
||||
*/ |
||||
private String discountActivityName; |
||||
|
||||
/** |
||||
* 优惠类型 1. 满减 2. 立减 3. 折扣 |
||||
*/ |
||||
private Integer discountType; |
||||
|
||||
/** |
||||
* 优惠条件(满减价格) |
||||
*/ |
||||
private BigDecimal discountCondition; |
||||
|
||||
/** |
||||
* 优惠金额 |
||||
*/ |
||||
private BigDecimal discountPrice; |
||||
|
||||
/** |
||||
* 优惠活动开始时间 |
||||
*/ |
||||
private Date startTime; |
||||
|
||||
/** |
||||
* 优惠活动结束时间 |
||||
*/ |
||||
private Date endTime; |
||||
|
||||
/** |
||||
* 用户手机号 |
||||
*/ |
||||
private String userPhone; |
||||
|
||||
/** |
||||
* 参与总次数 |
||||
*/ |
||||
private Integer partakeTotalNum; |
||||
|
||||
/** |
||||
* 参与剩余次数 |
||||
*/ |
||||
private Integer partakeSurplusNum; |
||||
|
||||
/** |
||||
* 参与使用次数 |
||||
*/ |
||||
private Integer partakeUseNum; |
||||
|
||||
/** |
||||
* 状态 0:不可用 1:可用 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 更新时间 |
||||
*/ |
||||
private Date updateTime; |
||||
|
||||
private String ext1; |
||||
|
||||
private String ext2; |
||||
|
||||
private String ext3; |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Long getDiscountActivityId() { |
||||
return discountActivityId; |
||||
} |
||||
|
||||
public void setDiscountActivityId(Long discountActivityId) { |
||||
this.discountActivityId = discountActivityId; |
||||
} |
||||
|
||||
public String getDiscountActivityName() { |
||||
return discountActivityName; |
||||
} |
||||
|
||||
public void setDiscountActivityName(String discountActivityName) { |
||||
this.discountActivityName = discountActivityName; |
||||
} |
||||
|
||||
public Integer getDiscountType() { |
||||
return discountType; |
||||
} |
||||
|
||||
public void setDiscountType(Integer discountType) { |
||||
this.discountType = discountType; |
||||
} |
||||
|
||||
public BigDecimal getDiscountCondition() { |
||||
return discountCondition; |
||||
} |
||||
|
||||
public void setDiscountCondition(BigDecimal discountCondition) { |
||||
this.discountCondition = discountCondition; |
||||
} |
||||
|
||||
public BigDecimal getDiscountPrice() { |
||||
return discountPrice; |
||||
} |
||||
|
||||
public void setDiscountPrice(BigDecimal discountPrice) { |
||||
this.discountPrice = discountPrice; |
||||
} |
||||
|
||||
public Date getStartTime() { |
||||
return startTime; |
||||
} |
||||
|
||||
public void setStartTime(Date startTime) { |
||||
this.startTime = startTime; |
||||
} |
||||
|
||||
public Date getEndTime() { |
||||
return endTime; |
||||
} |
||||
|
||||
public void setEndTime(Date endTime) { |
||||
this.endTime = endTime; |
||||
} |
||||
|
||||
public String getUserPhone() { |
||||
return userPhone; |
||||
} |
||||
|
||||
public void setUserPhone(String userPhone) { |
||||
this.userPhone = userPhone; |
||||
} |
||||
|
||||
public Integer getPartakeTotalNum() { |
||||
return partakeTotalNum; |
||||
} |
||||
|
||||
public void setPartakeTotalNum(Integer partakeTotalNum) { |
||||
this.partakeTotalNum = partakeTotalNum; |
||||
} |
||||
|
||||
public Integer getPartakeSurplusNum() { |
||||
return partakeSurplusNum; |
||||
} |
||||
|
||||
public void setPartakeSurplusNum(Integer partakeSurplusNum) { |
||||
this.partakeSurplusNum = partakeSurplusNum; |
||||
} |
||||
|
||||
public Integer getPartakeUseNum() { |
||||
return partakeUseNum; |
||||
} |
||||
|
||||
public void setPartakeUseNum(Integer partakeUseNum) { |
||||
this.partakeUseNum = partakeUseNum; |
||||
} |
||||
|
||||
public Integer getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(Integer status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Date getUpdateTime() { |
||||
return updateTime; |
||||
} |
||||
|
||||
public void setUpdateTime(Date updateTime) { |
||||
this.updateTime = updateTime; |
||||
} |
||||
|
||||
public String getExt1() { |
||||
return ext1; |
||||
} |
||||
|
||||
public void setExt1(String ext1) { |
||||
this.ext1 = ext1; |
||||
} |
||||
|
||||
public String getExt2() { |
||||
return ext2; |
||||
} |
||||
|
||||
public void setExt2(String ext2) { |
||||
this.ext2 = ext2; |
||||
} |
||||
|
||||
public String getExt3() { |
||||
return ext3; |
||||
} |
||||
|
||||
public void setExt3(String ext3) { |
||||
this.ext3 = ext3; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object that) { |
||||
if (this == that) { |
||||
return true; |
||||
} |
||||
if (that == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != that.getClass()) { |
||||
return false; |
||||
} |
||||
BsStoreDiscountActivityPartakeUser other = (BsStoreDiscountActivityPartakeUser) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getDiscountActivityId() == null ? other.getDiscountActivityId() == null : this.getDiscountActivityId().equals(other.getDiscountActivityId())) |
||||
&& (this.getDiscountActivityName() == null ? other.getDiscountActivityName() == null : this.getDiscountActivityName().equals(other.getDiscountActivityName())) |
||||
&& (this.getDiscountType() == null ? other.getDiscountType() == null : this.getDiscountType().equals(other.getDiscountType())) |
||||
&& (this.getDiscountCondition() == null ? other.getDiscountCondition() == null : this.getDiscountCondition().equals(other.getDiscountCondition())) |
||||
&& (this.getDiscountPrice() == null ? other.getDiscountPrice() == null : this.getDiscountPrice().equals(other.getDiscountPrice())) |
||||
&& (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime())) |
||||
&& (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime())) |
||||
&& (this.getUserPhone() == null ? other.getUserPhone() == null : this.getUserPhone().equals(other.getUserPhone())) |
||||
&& (this.getPartakeTotalNum() == null ? other.getPartakeTotalNum() == null : this.getPartakeTotalNum().equals(other.getPartakeTotalNum())) |
||||
&& (this.getPartakeSurplusNum() == null ? other.getPartakeSurplusNum() == null : this.getPartakeSurplusNum().equals(other.getPartakeSurplusNum())) |
||||
&& (this.getPartakeUseNum() == null ? other.getPartakeUseNum() == null : this.getPartakeUseNum().equals(other.getPartakeUseNum())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) |
||||
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) |
||||
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) |
||||
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
final int prime = 31; |
||||
int result = 1; |
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); |
||||
result = prime * result + ((getDiscountActivityId() == null) ? 0 : getDiscountActivityId().hashCode()); |
||||
result = prime * result + ((getDiscountActivityName() == null) ? 0 : getDiscountActivityName().hashCode()); |
||||
result = prime * result + ((getDiscountType() == null) ? 0 : getDiscountType().hashCode()); |
||||
result = prime * result + ((getDiscountCondition() == null) ? 0 : getDiscountCondition().hashCode()); |
||||
result = prime * result + ((getDiscountPrice() == null) ? 0 : getDiscountPrice().hashCode()); |
||||
result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode()); |
||||
result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode()); |
||||
result = prime * result + ((getUserPhone() == null) ? 0 : getUserPhone().hashCode()); |
||||
result = prime * result + ((getPartakeTotalNum() == null) ? 0 : getPartakeTotalNum().hashCode()); |
||||
result = prime * result + ((getPartakeSurplusNum() == null) ? 0 : getPartakeSurplusNum().hashCode()); |
||||
result = prime * result + ((getPartakeUseNum() == null) ? 0 : getPartakeUseNum().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); |
||||
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); |
||||
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); |
||||
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); |
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
StringBuilder sb = new StringBuilder(); |
||||
sb.append(getClass().getSimpleName()); |
||||
sb.append(" ["); |
||||
sb.append("Hash = ").append(hashCode()); |
||||
sb.append(", id=").append(id); |
||||
sb.append(", discountActivityId=").append(discountActivityId); |
||||
sb.append(", discountActivityName=").append(discountActivityName); |
||||
sb.append(", discountType=").append(discountType); |
||||
sb.append(", discountCondition=").append(discountCondition); |
||||
sb.append(", discountPrice=").append(discountPrice); |
||||
sb.append(", startTime=").append(startTime); |
||||
sb.append(", endTime=").append(endTime); |
||||
sb.append(", userPhone=").append(userPhone); |
||||
sb.append(", partakeTotalNum=").append(partakeTotalNum); |
||||
sb.append(", partakeSurplusNum=").append(partakeSurplusNum); |
||||
sb.append(", partakeUseNum=").append(partakeUseNum); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", updateTime=").append(updateTime); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,217 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* bs_store_discount_activity_partake_user_record |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class BsStoreDiscountActivityPartakeUserRecord implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 优惠活动id |
||||
*/ |
||||
private Long discountActivityId; |
||||
|
||||
/** |
||||
* 优惠活动名称 |
||||
*/ |
||||
private String discountActivityName; |
||||
|
||||
/** |
||||
* 优惠类型 1. 满减 2. 立减 3. 折扣 |
||||
*/ |
||||
private Integer discountType; |
||||
|
||||
/** |
||||
* 优惠条件(满减价格) |
||||
*/ |
||||
private BigDecimal discountCondition; |
||||
|
||||
/** |
||||
* 优惠金额 |
||||
*/ |
||||
private BigDecimal discountPrice; |
||||
|
||||
/** |
||||
* 用户手机号 |
||||
*/ |
||||
private String userPhone; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
private String ext1; |
||||
|
||||
private String ext2; |
||||
|
||||
private String ext3; |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Long getDiscountActivityId() { |
||||
return discountActivityId; |
||||
} |
||||
|
||||
public void setDiscountActivityId(Long discountActivityId) { |
||||
this.discountActivityId = discountActivityId; |
||||
} |
||||
|
||||
public String getDiscountActivityName() { |
||||
return discountActivityName; |
||||
} |
||||
|
||||
public void setDiscountActivityName(String discountActivityName) { |
||||
this.discountActivityName = discountActivityName; |
||||
} |
||||
|
||||
public Integer getDiscountType() { |
||||
return discountType; |
||||
} |
||||
|
||||
public void setDiscountType(Integer discountType) { |
||||
this.discountType = discountType; |
||||
} |
||||
|
||||
public BigDecimal getDiscountCondition() { |
||||
return discountCondition; |
||||
} |
||||
|
||||
public void setDiscountCondition(BigDecimal discountCondition) { |
||||
this.discountCondition = discountCondition; |
||||
} |
||||
|
||||
public BigDecimal getDiscountPrice() { |
||||
return discountPrice; |
||||
} |
||||
|
||||
public void setDiscountPrice(BigDecimal discountPrice) { |
||||
this.discountPrice = discountPrice; |
||||
} |
||||
|
||||
public String getUserPhone() { |
||||
return userPhone; |
||||
} |
||||
|
||||
public void setUserPhone(String userPhone) { |
||||
this.userPhone = userPhone; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public String getExt1() { |
||||
return ext1; |
||||
} |
||||
|
||||
public void setExt1(String ext1) { |
||||
this.ext1 = ext1; |
||||
} |
||||
|
||||
public String getExt2() { |
||||
return ext2; |
||||
} |
||||
|
||||
public void setExt2(String ext2) { |
||||
this.ext2 = ext2; |
||||
} |
||||
|
||||
public String getExt3() { |
||||
return ext3; |
||||
} |
||||
|
||||
public void setExt3(String ext3) { |
||||
this.ext3 = ext3; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object that) { |
||||
if (this == that) { |
||||
return true; |
||||
} |
||||
if (that == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != that.getClass()) { |
||||
return false; |
||||
} |
||||
BsStoreDiscountActivityPartakeUserRecord other = (BsStoreDiscountActivityPartakeUserRecord) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getDiscountActivityId() == null ? other.getDiscountActivityId() == null : this.getDiscountActivityId().equals(other.getDiscountActivityId())) |
||||
&& (this.getDiscountActivityName() == null ? other.getDiscountActivityName() == null : this.getDiscountActivityName().equals(other.getDiscountActivityName())) |
||||
&& (this.getDiscountType() == null ? other.getDiscountType() == null : this.getDiscountType().equals(other.getDiscountType())) |
||||
&& (this.getDiscountCondition() == null ? other.getDiscountCondition() == null : this.getDiscountCondition().equals(other.getDiscountCondition())) |
||||
&& (this.getDiscountPrice() == null ? other.getDiscountPrice() == null : this.getDiscountPrice().equals(other.getDiscountPrice())) |
||||
&& (this.getUserPhone() == null ? other.getUserPhone() == null : this.getUserPhone().equals(other.getUserPhone())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) |
||||
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) |
||||
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
final int prime = 31; |
||||
int result = 1; |
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); |
||||
result = prime * result + ((getDiscountActivityId() == null) ? 0 : getDiscountActivityId().hashCode()); |
||||
result = prime * result + ((getDiscountActivityName() == null) ? 0 : getDiscountActivityName().hashCode()); |
||||
result = prime * result + ((getDiscountType() == null) ? 0 : getDiscountType().hashCode()); |
||||
result = prime * result + ((getDiscountCondition() == null) ? 0 : getDiscountCondition().hashCode()); |
||||
result = prime * result + ((getDiscountPrice() == null) ? 0 : getDiscountPrice().hashCode()); |
||||
result = prime * result + ((getUserPhone() == null) ? 0 : getUserPhone().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); |
||||
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); |
||||
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); |
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
StringBuilder sb = new StringBuilder(); |
||||
sb.append(getClass().getSimpleName()); |
||||
sb.append(" ["); |
||||
sb.append("Hash = ").append(hashCode()); |
||||
sb.append(", id=").append(id); |
||||
sb.append(", discountActivityId=").append(discountActivityId); |
||||
sb.append(", discountActivityName=").append(discountActivityName); |
||||
sb.append(", discountType=").append(discountType); |
||||
sb.append(", discountCondition=").append(discountCondition); |
||||
sb.append(", discountPrice=").append(discountPrice); |
||||
sb.append(", userPhone=").append(userPhone); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
@ -0,0 +1,934 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.util.ArrayList; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
public class BsStoreDiscountActivityPartakeUserRecordExample { |
||||
protected String orderByClause; |
||||
|
||||
protected boolean distinct; |
||||
|
||||
protected List<Criteria> oredCriteria; |
||||
|
||||
private Integer limit; |
||||
|
||||
private Long offset; |
||||
|
||||
public BsStoreDiscountActivityPartakeUserRecordExample() { |
||||
oredCriteria = new ArrayList<Criteria>(); |
||||
} |
||||
|
||||
public void setOrderByClause(String orderByClause) { |
||||
this.orderByClause = orderByClause; |
||||
} |
||||
|
||||
public String getOrderByClause() { |
||||
return orderByClause; |
||||
} |
||||
|
||||
public void setDistinct(boolean distinct) { |
||||
this.distinct = distinct; |
||||
} |
||||
|
||||
public boolean isDistinct() { |
||||
return distinct; |
||||
} |
||||
|
||||
public List<Criteria> getOredCriteria() { |
||||
return oredCriteria; |
||||
} |
||||
|
||||
public void or(Criteria criteria) { |
||||
oredCriteria.add(criteria); |
||||
} |
||||
|
||||
public Criteria or() { |
||||
Criteria criteria = createCriteriaInternal(); |
||||
oredCriteria.add(criteria); |
||||
return criteria; |
||||
} |
||||
|
||||
public Criteria createCriteria() { |
||||
Criteria criteria = createCriteriaInternal(); |
||||
if (oredCriteria.size() == 0) { |
||||
oredCriteria.add(criteria); |
||||
} |
||||
return criteria; |
||||
} |
||||
|
||||
protected Criteria createCriteriaInternal() { |
||||
Criteria criteria = new Criteria(); |
||||
return criteria; |
||||
} |
||||
|
||||
public void clear() { |
||||
oredCriteria.clear(); |
||||
orderByClause = null; |
||||
distinct = false; |
||||
} |
||||
|
||||
public void setLimit(Integer limit) { |
||||
this.limit = limit; |
||||
} |
||||
|
||||
public Integer getLimit() { |
||||
return limit; |
||||
} |
||||
|
||||
public void setOffset(Long offset) { |
||||
this.offset = offset; |
||||
} |
||||
|
||||
public Long getOffset() { |
||||
return offset; |
||||
} |
||||
|
||||
protected abstract static class GeneratedCriteria { |
||||
protected List<Criterion> criteria; |
||||
|
||||
protected GeneratedCriteria() { |
||||
super(); |
||||
criteria = new ArrayList<Criterion>(); |
||||
} |
||||
|
||||
public boolean isValid() { |
||||
return criteria.size() > 0; |
||||
} |
||||
|
||||
public List<Criterion> getAllCriteria() { |
||||
return criteria; |
||||
} |
||||
|
||||
public List<Criterion> getCriteria() { |
||||
return criteria; |
||||
} |
||||
|
||||
protected void addCriterion(String condition) { |
||||
if (condition == null) { |
||||
throw new RuntimeException("Value for condition cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition)); |
||||
} |
||||
|
||||
protected void addCriterion(String condition, Object value, String property) { |
||||
if (value == null) { |
||||
throw new RuntimeException("Value for " + property + " cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition, value)); |
||||
} |
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) { |
||||
if (value1 == null || value2 == null) { |
||||
throw new RuntimeException("Between values for " + property + " cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition, value1, value2)); |
||||
} |
||||
|
||||
public Criteria andIdIsNull() { |
||||
addCriterion("id is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdIsNotNull() { |
||||
addCriterion("id is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdEqualTo(Long value) { |
||||
addCriterion("id =", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotEqualTo(Long value) { |
||||
addCriterion("id <>", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdGreaterThan(Long value) { |
||||
addCriterion("id >", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Long value) { |
||||
addCriterion("id >=", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdLessThan(Long value) { |
||||
addCriterion("id <", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Long value) { |
||||
addCriterion("id <=", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdIn(List<Long> values) { |
||||
addCriterion("id in", values, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotIn(List<Long> values) { |
||||
addCriterion("id not in", values, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdBetween(Long value1, Long value2) { |
||||
addCriterion("id between", value1, value2, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotBetween(Long value1, Long value2) { |
||||
addCriterion("id not between", value1, value2, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityIdIsNull() { |
||||
addCriterion("discount_activity_id is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityIdIsNotNull() { |
||||
addCriterion("discount_activity_id is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityIdEqualTo(Long value) { |
||||
addCriterion("discount_activity_id =", value, "discountActivityId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityIdNotEqualTo(Long value) { |
||||
addCriterion("discount_activity_id <>", value, "discountActivityId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityIdGreaterThan(Long value) { |
||||
addCriterion("discount_activity_id >", value, "discountActivityId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityIdGreaterThanOrEqualTo(Long value) { |
||||
addCriterion("discount_activity_id >=", value, "discountActivityId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityIdLessThan(Long value) { |
||||
addCriterion("discount_activity_id <", value, "discountActivityId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityIdLessThanOrEqualTo(Long value) { |
||||
addCriterion("discount_activity_id <=", value, "discountActivityId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityIdIn(List<Long> values) { |
||||
addCriterion("discount_activity_id in", values, "discountActivityId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityIdNotIn(List<Long> values) { |
||||
addCriterion("discount_activity_id not in", values, "discountActivityId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityIdBetween(Long value1, Long value2) { |
||||
addCriterion("discount_activity_id between", value1, value2, "discountActivityId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityIdNotBetween(Long value1, Long value2) { |
||||
addCriterion("discount_activity_id not between", value1, value2, "discountActivityId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityNameIsNull() { |
||||
addCriterion("discount_activity_name is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityNameIsNotNull() { |
||||
addCriterion("discount_activity_name is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityNameEqualTo(String value) { |
||||
addCriterion("discount_activity_name =", value, "discountActivityName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityNameNotEqualTo(String value) { |
||||
addCriterion("discount_activity_name <>", value, "discountActivityName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityNameGreaterThan(String value) { |
||||
addCriterion("discount_activity_name >", value, "discountActivityName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityNameGreaterThanOrEqualTo(String value) { |
||||
addCriterion("discount_activity_name >=", value, "discountActivityName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityNameLessThan(String value) { |
||||
addCriterion("discount_activity_name <", value, "discountActivityName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityNameLessThanOrEqualTo(String value) { |
||||
addCriterion("discount_activity_name <=", value, "discountActivityName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityNameLike(String value) { |
||||
addCriterion("discount_activity_name like", value, "discountActivityName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityNameNotLike(String value) { |
||||
addCriterion("discount_activity_name not like", value, "discountActivityName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityNameIn(List<String> values) { |
||||
addCriterion("discount_activity_name in", values, "discountActivityName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityNameNotIn(List<String> values) { |
||||
addCriterion("discount_activity_name not in", values, "discountActivityName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityNameBetween(String value1, String value2) { |
||||
addCriterion("discount_activity_name between", value1, value2, "discountActivityName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountActivityNameNotBetween(String value1, String value2) { |
||||
addCriterion("discount_activity_name not between", value1, value2, "discountActivityName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountTypeIsNull() { |
||||
addCriterion("discount_type is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountTypeIsNotNull() { |
||||
addCriterion("discount_type is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountTypeEqualTo(Integer value) { |
||||
addCriterion("discount_type =", value, "discountType"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountTypeNotEqualTo(Integer value) { |
||||
addCriterion("discount_type <>", value, "discountType"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountTypeGreaterThan(Integer value) { |
||||
addCriterion("discount_type >", value, "discountType"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountTypeGreaterThanOrEqualTo(Integer value) { |
||||
addCriterion("discount_type >=", value, "discountType"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountTypeLessThan(Integer value) { |
||||
addCriterion("discount_type <", value, "discountType"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountTypeLessThanOrEqualTo(Integer value) { |
||||
addCriterion("discount_type <=", value, "discountType"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountTypeIn(List<Integer> values) { |
||||
addCriterion("discount_type in", values, "discountType"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountTypeNotIn(List<Integer> values) { |
||||
addCriterion("discount_type not in", values, "discountType"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountTypeBetween(Integer value1, Integer value2) { |
||||
addCriterion("discount_type between", value1, value2, "discountType"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountTypeNotBetween(Integer value1, Integer value2) { |
||||
addCriterion("discount_type not between", value1, value2, "discountType"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountConditionIsNull() { |
||||
addCriterion("discount_condition is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountConditionIsNotNull() { |
||||
addCriterion("discount_condition is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountConditionEqualTo(BigDecimal value) { |
||||
addCriterion("discount_condition =", value, "discountCondition"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountConditionNotEqualTo(BigDecimal value) { |
||||
addCriterion("discount_condition <>", value, "discountCondition"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountConditionGreaterThan(BigDecimal value) { |
||||
addCriterion("discount_condition >", value, "discountCondition"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountConditionGreaterThanOrEqualTo(BigDecimal value) { |
||||
addCriterion("discount_condition >=", value, "discountCondition"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountConditionLessThan(BigDecimal value) { |
||||
addCriterion("discount_condition <", value, "discountCondition"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountConditionLessThanOrEqualTo(BigDecimal value) { |
||||
addCriterion("discount_condition <=", value, "discountCondition"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountConditionIn(List<BigDecimal> values) { |
||||
addCriterion("discount_condition in", values, "discountCondition"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountConditionNotIn(List<BigDecimal> values) { |
||||
addCriterion("discount_condition not in", values, "discountCondition"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountConditionBetween(BigDecimal value1, BigDecimal value2) { |
||||
addCriterion("discount_condition between", value1, value2, "discountCondition"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountConditionNotBetween(BigDecimal value1, BigDecimal value2) { |
||||
addCriterion("discount_condition not between", value1, value2, "discountCondition"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountPriceIsNull() { |
||||
addCriterion("discount_price is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountPriceIsNotNull() { |
||||
addCriterion("discount_price is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountPriceEqualTo(BigDecimal value) { |
||||
addCriterion("discount_price =", value, "discountPrice"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountPriceNotEqualTo(BigDecimal value) { |
||||
addCriterion("discount_price <>", value, "discountPrice"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountPriceGreaterThan(BigDecimal value) { |
||||
addCriterion("discount_price >", value, "discountPrice"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountPriceGreaterThanOrEqualTo(BigDecimal value) { |
||||
addCriterion("discount_price >=", value, "discountPrice"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountPriceLessThan(BigDecimal value) { |
||||
addCriterion("discount_price <", value, "discountPrice"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountPriceLessThanOrEqualTo(BigDecimal value) { |
||||
addCriterion("discount_price <=", value, "discountPrice"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountPriceIn(List<BigDecimal> values) { |
||||
addCriterion("discount_price in", values, "discountPrice"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountPriceNotIn(List<BigDecimal> values) { |
||||
addCriterion("discount_price not in", values, "discountPrice"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountPriceBetween(BigDecimal value1, BigDecimal value2) { |
||||
addCriterion("discount_price between", value1, value2, "discountPrice"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountPriceNotBetween(BigDecimal value1, BigDecimal value2) { |
||||
addCriterion("discount_price not between", value1, value2, "discountPrice"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserPhoneIsNull() { |
||||
addCriterion("user_phone is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserPhoneIsNotNull() { |
||||
addCriterion("user_phone is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserPhoneEqualTo(String value) { |
||||
addCriterion("user_phone =", value, "userPhone"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserPhoneNotEqualTo(String value) { |
||||
addCriterion("user_phone <>", value, "userPhone"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserPhoneGreaterThan(String value) { |
||||
addCriterion("user_phone >", value, "userPhone"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserPhoneGreaterThanOrEqualTo(String value) { |
||||
addCriterion("user_phone >=", value, "userPhone"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserPhoneLessThan(String value) { |
||||
addCriterion("user_phone <", value, "userPhone"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserPhoneLessThanOrEqualTo(String value) { |
||||
addCriterion("user_phone <=", value, "userPhone"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserPhoneLike(String value) { |
||||
addCriterion("user_phone like", value, "userPhone"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserPhoneNotLike(String value) { |
||||
addCriterion("user_phone not like", value, "userPhone"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserPhoneIn(List<String> values) { |
||||
addCriterion("user_phone in", values, "userPhone"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserPhoneNotIn(List<String> values) { |
||||
addCriterion("user_phone not in", values, "userPhone"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserPhoneBetween(String value1, String value2) { |
||||
addCriterion("user_phone between", value1, value2, "userPhone"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserPhoneNotBetween(String value1, String value2) { |
||||
addCriterion("user_phone not between", value1, value2, "userPhone"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIsNull() { |
||||
addCriterion("create_time is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIsNotNull() { |
||||
addCriterion("create_time is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeEqualTo(Date value) { |
||||
addCriterion("create_time =", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotEqualTo(Date value) { |
||||
addCriterion("create_time <>", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeGreaterThan(Date value) { |
||||
addCriterion("create_time >", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { |
||||
addCriterion("create_time >=", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeLessThan(Date value) { |
||||
addCriterion("create_time <", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeLessThanOrEqualTo(Date value) { |
||||
addCriterion("create_time <=", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIn(List<Date> values) { |
||||
addCriterion("create_time in", values, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotIn(List<Date> values) { |
||||
addCriterion("create_time not in", values, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeBetween(Date value1, Date value2) { |
||||
addCriterion("create_time between", value1, value2, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotBetween(Date value1, Date value2) { |
||||
addCriterion("create_time not between", value1, value2, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1IsNull() { |
||||
addCriterion("ext_1 is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1IsNotNull() { |
||||
addCriterion("ext_1 is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1EqualTo(String value) { |
||||
addCriterion("ext_1 =", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotEqualTo(String value) { |
||||
addCriterion("ext_1 <>", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1GreaterThan(String value) { |
||||
addCriterion("ext_1 >", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1GreaterThanOrEqualTo(String value) { |
||||
addCriterion("ext_1 >=", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1LessThan(String value) { |
||||
addCriterion("ext_1 <", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1LessThanOrEqualTo(String value) { |
||||
addCriterion("ext_1 <=", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1Like(String value) { |
||||
addCriterion("ext_1 like", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotLike(String value) { |
||||
addCriterion("ext_1 not like", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1In(List<String> values) { |
||||
addCriterion("ext_1 in", values, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotIn(List<String> values) { |
||||
addCriterion("ext_1 not in", values, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1Between(String value1, String value2) { |
||||
addCriterion("ext_1 between", value1, value2, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotBetween(String value1, String value2) { |
||||
addCriterion("ext_1 not between", value1, value2, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2IsNull() { |
||||
addCriterion("ext_2 is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2IsNotNull() { |
||||
addCriterion("ext_2 is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2EqualTo(String value) { |
||||
addCriterion("ext_2 =", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotEqualTo(String value) { |
||||
addCriterion("ext_2 <>", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2GreaterThan(String value) { |
||||
addCriterion("ext_2 >", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2GreaterThanOrEqualTo(String value) { |
||||
addCriterion("ext_2 >=", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2LessThan(String value) { |
||||
addCriterion("ext_2 <", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2LessThanOrEqualTo(String value) { |
||||
addCriterion("ext_2 <=", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2Like(String value) { |
||||
addCriterion("ext_2 like", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotLike(String value) { |
||||
addCriterion("ext_2 not like", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2In(List<String> values) { |
||||
addCriterion("ext_2 in", values, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotIn(List<String> values) { |
||||
addCriterion("ext_2 not in", values, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2Between(String value1, String value2) { |
||||
addCriterion("ext_2 between", value1, value2, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotBetween(String value1, String value2) { |
||||
addCriterion("ext_2 not between", value1, value2, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3IsNull() { |
||||
addCriterion("ext_3 is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3IsNotNull() { |
||||
addCriterion("ext_3 is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3EqualTo(String value) { |
||||
addCriterion("ext_3 =", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotEqualTo(String value) { |
||||
addCriterion("ext_3 <>", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3GreaterThan(String value) { |
||||
addCriterion("ext_3 >", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3GreaterThanOrEqualTo(String value) { |
||||
addCriterion("ext_3 >=", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3LessThan(String value) { |
||||
addCriterion("ext_3 <", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3LessThanOrEqualTo(String value) { |
||||
addCriterion("ext_3 <=", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3Like(String value) { |
||||
addCriterion("ext_3 like", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotLike(String value) { |
||||
addCriterion("ext_3 not like", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3In(List<String> values) { |
||||
addCriterion("ext_3 in", values, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotIn(List<String> values) { |
||||
addCriterion("ext_3 not in", values, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3Between(String value1, String value2) { |
||||
addCriterion("ext_3 between", value1, value2, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotBetween(String value1, String value2) { |
||||
addCriterion("ext_3 not between", value1, value2, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
*/ |
||||
public static class Criteria extends GeneratedCriteria { |
||||
|
||||
protected Criteria() { |
||||
super(); |
||||
} |
||||
} |
||||
|
||||
public static class Criterion { |
||||
private String condition; |
||||
|
||||
private Object value; |
||||
|
||||
private Object secondValue; |
||||
|
||||
private boolean noValue; |
||||
|
||||
private boolean singleValue; |
||||
|
||||
private boolean betweenValue; |
||||
|
||||
private boolean listValue; |
||||
|
||||
private String typeHandler; |
||||
|
||||
public String getCondition() { |
||||
return condition; |
||||
} |
||||
|
||||
public Object getValue() { |
||||
return value; |
||||
} |
||||
|
||||
public Object getSecondValue() { |
||||
return secondValue; |
||||
} |
||||
|
||||
public boolean isNoValue() { |
||||
return noValue; |
||||
} |
||||
|
||||
public boolean isSingleValue() { |
||||
return singleValue; |
||||
} |
||||
|
||||
public boolean isBetweenValue() { |
||||
return betweenValue; |
||||
} |
||||
|
||||
public boolean isListValue() { |
||||
return listValue; |
||||
} |
||||
|
||||
public String getTypeHandler() { |
||||
return typeHandler; |
||||
} |
||||
|
||||
protected Criterion(String condition) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.typeHandler = null; |
||||
this.noValue = true; |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.value = value; |
||||
this.typeHandler = typeHandler; |
||||
if (value instanceof List<?>) { |
||||
this.listValue = true; |
||||
} else { |
||||
this.singleValue = true; |
||||
} |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value) { |
||||
this(condition, value, null); |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.value = value; |
||||
this.secondValue = secondValue; |
||||
this.typeHandler = typeHandler; |
||||
this.betweenValue = true; |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) { |
||||
this(condition, value, secondValue, null); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,29 @@ |
||||
package com.hfkj.service; |
||||
|
||||
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserRecord; |
||||
|
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* @className: BsStoreDiscountActivityPartakeUserRecordService |
||||
* @author: HuRui |
||||
* @date: 2023/3/24 |
||||
**/ |
||||
public interface BsStoreDiscountActivityPartakeUserRecordService { |
||||
|
||||
/** |
||||
* 增加记录 |
||||
* @param record |
||||
*/ |
||||
void insertRecord(BsStoreDiscountActivityPartakeUserRecord record); |
||||
|
||||
/** |
||||
* 查询参与次数 |
||||
* @param phone |
||||
* @param discountActivityId |
||||
* @param startTime |
||||
* @param endTime |
||||
* @return |
||||
*/ |
||||
Long getPartakeNum(String phone, Long discountActivityId, Date startTime, Date endTime); |
||||
} |
@ -0,0 +1,46 @@ |
||||
package com.hfkj.service; |
||||
|
||||
import com.hfkj.entity.BsStoreDiscountActivity; |
||||
import com.hfkj.entity.BsStoreDiscountActivityPartakeUser; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @className: BsStoreDiscountActivityPartakeUserService |
||||
* @author: HuRui |
||||
* @date: 2023/3/14 |
||||
**/ |
||||
public interface BsStoreDiscountActivityPartakeUserService { |
||||
|
||||
/** |
||||
* 编辑数据 |
||||
* @param storeDiscountActivityPartakeUser |
||||
*/ |
||||
void editData(BsStoreDiscountActivityPartakeUser storeDiscountActivityPartakeUser); |
||||
|
||||
/** |
||||
* 查询参与用户 |
||||
* @param phone |
||||
* @param activityId |
||||
* @return |
||||
*/ |
||||
BsStoreDiscountActivityPartakeUser getPartakeUser(String phone, Long activityId); |
||||
|
||||
/** |
||||
* 领取活动 |
||||
* @param phone 手机号 |
||||
* @param activityIds 活动id |
||||
*/ |
||||
void receiveDiscount(String phone, List<Long> activityIds); |
||||
|
||||
/** |
||||
* 查询列表 |
||||
* @param param |
||||
* @return |
||||
*/ |
||||
List<BsStoreDiscountActivityPartakeUser> getList(Map<String, Object> param); |
||||
|
||||
List<BsStoreDiscountActivityPartakeUser> getUseListByPhone(String phone); |
||||
|
||||
} |
@ -0,0 +1,39 @@ |
||||
package com.hfkj.service.impl; |
||||
|
||||
import com.hfkj.dao.BsStoreDiscountActivityPartakeUserRecordMapper; |
||||
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserRecord; |
||||
import com.hfkj.entity.BsStoreDiscountActivityPartakeUserRecordExample; |
||||
import com.hfkj.service.BsStoreDiscountActivityPartakeUserRecordService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* @className: BsStoreDiscountActivityPartakeUserRecordServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2023/3/24 |
||||
**/ |
||||
@Service("storeDiscountActivityPartakeUserRecordService") |
||||
public class BsStoreDiscountActivityPartakeUserRecordServiceImpl implements BsStoreDiscountActivityPartakeUserRecordService { |
||||
|
||||
@Resource |
||||
private BsStoreDiscountActivityPartakeUserRecordMapper recordMapper; |
||||
|
||||
@Override |
||||
public void insertRecord(BsStoreDiscountActivityPartakeUserRecord record) { |
||||
record.setCreateTime(new Date()); |
||||
recordMapper.insert(record); |
||||
} |
||||
|
||||
@Override |
||||
public Long getPartakeNum(String phone, Long discountActivityId, Date startTime, Date endTime) { |
||||
BsStoreDiscountActivityPartakeUserRecordExample example = new BsStoreDiscountActivityPartakeUserRecordExample(); |
||||
example.createCriteria() |
||||
.andUserPhoneEqualTo(phone) |
||||
.andDiscountActivityIdEqualTo(discountActivityId) |
||||
.andCreateTimeGreaterThanOrEqualTo(startTime) |
||||
.andCreateTimeLessThanOrEqualTo(endTime); |
||||
return recordMapper.countByExample(example); |
||||
} |
||||
} |
@ -0,0 +1,178 @@ |
||||
package com.hfkj.service.impl; |
||||
|
||||
import com.ccb.wlpt.util.StringUtil; |
||||
import com.hfkj.common.exception.BaseException; |
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.dao.BsStoreDiscountActivityPartakeUserMapper; |
||||
import com.hfkj.entity.*; |
||||
import com.hfkj.service.BsStoreDiscountActivityPartakeUserRecordService; |
||||
import com.hfkj.service.BsStoreDiscountActivityPartakeUserService; |
||||
import com.hfkj.service.BsStoreDiscountActivityService; |
||||
import com.hfkj.sysenum.StoreDiscountActivityPartakeWayEnum; |
||||
import com.hfkj.sysenum.StoreDiscountActivityStatusEnum; |
||||
import org.apache.commons.collections4.MapUtils; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.data.redis.core.RedisTemplate; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.*; |
||||
import java.util.stream.Collectors; |
||||
|
||||
/** |
||||
* @className: BsStoreDiscountActivityPartakeUserServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2023/3/14 |
||||
**/ |
||||
@Service("storeDiscountActivityPartakeUserService") |
||||
public class BsStoreDiscountActivityPartakeUserServiceImpl implements BsStoreDiscountActivityPartakeUserService { |
||||
|
||||
@Autowired |
||||
private RedisTemplate redisTemplate; |
||||
@Resource |
||||
private BsStoreDiscountActivityService storeDiscountActivityService; |
||||
@Resource |
||||
private BsStoreDiscountActivityPartakeUserMapper storeDiscountActivityPartakeUserMapper; |
||||
@Resource |
||||
private BsStoreDiscountActivityPartakeUserRecordService storeDiscountActivityPartakeUserRecordService; |
||||
@Override |
||||
public void editData(BsStoreDiscountActivityPartakeUser storeDiscountActivityPartakeUser) { |
||||
if (storeDiscountActivityPartakeUser.getId() == null) { |
||||
storeDiscountActivityPartakeUser.setStatus(1); |
||||
storeDiscountActivityPartakeUser.setCreateTime(new Date()); |
||||
storeDiscountActivityPartakeUser.setUpdateTime(new Date()); |
||||
storeDiscountActivityPartakeUserMapper.insert(storeDiscountActivityPartakeUser); |
||||
} else { |
||||
storeDiscountActivityPartakeUser.setUpdateTime(new Date()); |
||||
storeDiscountActivityPartakeUserMapper.updateByPrimaryKey(storeDiscountActivityPartakeUser); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public BsStoreDiscountActivityPartakeUser getPartakeUser(String phone, Long activityId) { |
||||
BsStoreDiscountActivityPartakeUserExample example = new BsStoreDiscountActivityPartakeUserExample(); |
||||
example.createCriteria().andUserPhoneEqualTo(phone).andDiscountActivityIdEqualTo(activityId); |
||||
List<BsStoreDiscountActivityPartakeUser> list = storeDiscountActivityPartakeUserMapper.selectByExample(example); |
||||
if (list.size() > 0) { |
||||
return list.get(0); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public void receiveDiscount(String phone, List<Long> activityIds) { |
||||
activityIds = activityIds.stream().distinct().collect(Collectors.toList()); |
||||
Boolean lock = redisTemplate.opsForValue().setIfAbsent("RECEIVE_DISCOUNT" + phone, phone); |
||||
try { |
||||
if(lock) { |
||||
//加锁成功...
|
||||
for (Long activityId : activityIds) { |
||||
// 查询活动
|
||||
BsStoreDiscountActivity activity = storeDiscountActivityService.getDetailById(activityId); |
||||
if (activity == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到活动"); |
||||
} |
||||
if (!activity.getStatus().equals(StoreDiscountActivityStatusEnum.status2.getNumber())) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "活动已结束"); |
||||
} |
||||
if (new Date().compareTo(activity.getEndTime()) >= 1) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "活动已结束"); |
||||
} |
||||
// 扫码领券
|
||||
if (activity.getPartakeWay().equals(StoreDiscountActivityPartakeWayEnum.type3.getNumber())) { |
||||
// 每日
|
||||
if (activity.getRestrictType().equals(1) && activity.getRestrictPartakeNum() != 0) { |
||||
Calendar startTime = Calendar.getInstance(); |
||||
startTime.setTime(new Date()); |
||||
startTime.set(Calendar.HOUR_OF_DAY, 00); |
||||
startTime.set(Calendar.MINUTE, 00); |
||||
startTime.set(Calendar.SECOND, 00); |
||||
|
||||
Calendar endTime = Calendar.getInstance(); |
||||
endTime.setTime(new Date()); |
||||
endTime.set(Calendar.HOUR_OF_DAY, 23); |
||||
endTime.set(Calendar.MINUTE, 59); |
||||
endTime.set(Calendar.SECOND, 59); |
||||
|
||||
Long partakeNum = storeDiscountActivityPartakeUserRecordService.getPartakeNum(phone, activityId, startTime.getTime(), endTime.getTime()); |
||||
if (partakeNum.intValue() >= activity.getRestrictPartakeNum()) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "今日领取上限"); |
||||
} |
||||
} |
||||
} |
||||
|
||||
BsStoreDiscountActivityPartakeUser partakeUser = getPartakeUser(phone, activityId); |
||||
if (partakeUser == null) { |
||||
partakeUser = new BsStoreDiscountActivityPartakeUser(); |
||||
partakeUser.setPartakeTotalNum(0); |
||||
partakeUser.setPartakeSurplusNum(0); |
||||
partakeUser.setPartakeUseNum(0); |
||||
} |
||||
partakeUser.setDiscountActivityId(activity.getId()); |
||||
partakeUser.setDiscountActivityName(activity.getName()); |
||||
partakeUser.setDiscountType(activity.getDiscountType()); |
||||
partakeUser.setDiscountCondition(activity.getDiscountCondition()); |
||||
partakeUser.setDiscountPrice(activity.getDiscountPrice()); |
||||
partakeUser.setStartTime(activity.getStartTime()); |
||||
partakeUser.setEndTime(activity.getEndTime()); |
||||
partakeUser.setUserPhone(phone); |
||||
partakeUser.setPartakeTotalNum(partakeUser.getPartakeTotalNum() + 1); |
||||
partakeUser.setPartakeSurplusNum(partakeUser.getPartakeSurplusNum() + 1); |
||||
editData(partakeUser); |
||||
|
||||
BsStoreDiscountActivityPartakeUserRecord record = new BsStoreDiscountActivityPartakeUserRecord(); |
||||
record.setUserPhone(phone); |
||||
record.setDiscountActivityId(activity.getId()); |
||||
record.setDiscountActivityName(activity.getName()); |
||||
record.setDiscountType(activity.getDiscountType()); |
||||
record.setDiscountCondition(activity.getDiscountCondition()); |
||||
record.setDiscountPrice(activity.getDiscountPrice()); |
||||
storeDiscountActivityPartakeUserRecordService.insertRecord(record); |
||||
} |
||||
} else { |
||||
System.out.println("加锁失败"); |
||||
Thread.sleep(100); // 加锁失败,重试
|
||||
receiveDiscount(phone, activityIds); |
||||
} |
||||
} catch (BaseException e) { |
||||
throw e; |
||||
|
||||
} catch (Exception e) { |
||||
System.out.println(e); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "领取失败,请稍后重试"); |
||||
|
||||
} finally { |
||||
// 删除key,释放锁
|
||||
redisTemplate.delete("RECEIVE_DISCOUNT" + phone); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public List<BsStoreDiscountActivityPartakeUser> getList(Map<String, Object> param) { |
||||
BsStoreDiscountActivityPartakeUserExample example = new BsStoreDiscountActivityPartakeUserExample(); |
||||
BsStoreDiscountActivityPartakeUserExample.Criteria criteria = example.createCriteria(); |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "userPhone"))) { |
||||
criteria.andUserPhoneEqualTo(MapUtils.getString(param, "userPhone")); |
||||
} |
||||
|
||||
if (MapUtils.getInteger(param, "status") != null) { |
||||
criteria.andStatusEqualTo(MapUtils.getInteger(param, "status")); |
||||
} |
||||
|
||||
example.setOrderByClause("create_time desc"); |
||||
return storeDiscountActivityPartakeUserMapper.selectByExample(example); |
||||
} |
||||
|
||||
@Override |
||||
public List<BsStoreDiscountActivityPartakeUser> getUseListByPhone(String phone) { |
||||
BsStoreDiscountActivityPartakeUserExample example = new BsStoreDiscountActivityPartakeUserExample(); |
||||
example.createCriteria().andUserPhoneEqualTo(phone).andStatusEqualTo(1).andPartakeSurplusNumGreaterThanOrEqualTo(1); |
||||
example.setOrderByClause("create_time desc"); |
||||
return storeDiscountActivityPartakeUserMapper.selectByExample(example); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,49 @@ |
||||
package com.hfkj.sysenum; |
||||
|
||||
import java.util.Objects; |
||||
|
||||
/** |
||||
* @className: StoreDiscountActivityEnum |
||||
* @author: HuRui |
||||
* @date: 2022/11/21 |
||||
**/ |
||||
public enum StoreDiscountActivityPartakeWayEnum { |
||||
type1(1, "交易"), |
||||
type2(2, "分享"), |
||||
type3(3, "扫码领券"), |
||||
; |
||||
|
||||
private Integer number; |
||||
|
||||
private String name; |
||||
|
||||
StoreDiscountActivityPartakeWayEnum(int number, String name) { |
||||
this.number = number; |
||||
this.name = name; |
||||
} |
||||
|
||||
public static StoreDiscountActivityPartakeWayEnum getDataByNumber(Integer number) { |
||||
for (StoreDiscountActivityPartakeWayEnum ele : values()) { |
||||
if (Objects.equals(number,ele.getNumber())) { |
||||
return ele; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public Integer getNumber() { |
||||
return number; |
||||
} |
||||
|
||||
public void setNumber(Integer number) { |
||||
this.number = number; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
} |
@ -0,0 +1,35 @@ |
||||
package com.hfkj.sysenum; |
||||
|
||||
/** |
||||
* 微信二维码代码类型 |
||||
*/ |
||||
public enum WeChatQrCodeTypeEnum { |
||||
PAYMENT_CODE("PAYMENT_CODE" , "支付码码牌上的二维码"), |
||||
PAYMENT_SUCCESS("PAYMENT_SUCCESS" , "支付成功生成的二维码"), |
||||
SHARE("SHARE" , "分享关注公众号"), |
||||
; |
||||
|
||||
private String code; |
||||
private String desc; |
||||
|
||||
WeChatQrCodeTypeEnum(String code , String desc) { |
||||
this.code = code; |
||||
this.desc = desc; |
||||
} |
||||
|
||||
public String getCode() { |
||||
return code; |
||||
} |
||||
|
||||
public void setCode(String code) { |
||||
this.code = code; |
||||
} |
||||
|
||||
public String getDesc() { |
||||
return desc; |
||||
} |
||||
|
||||
public void setDesc(String desc) { |
||||
this.desc = desc; |
||||
} |
||||
} |
Loading…
Reference in new issue