From 38d1cfff3d8702d2b295a668069915e2e62d11cf Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Wed, 27 Oct 2021 15:15:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cweb/controller/pay/OrderController.java | 69 +++++++++++ .../controller/pay/UnionPayController.java | 11 ++ hai-order/pom.xml | 15 +++ .../java/com/cweb/config/RedisConfig.java | 110 ++++++++++++++++++ .../com/cweb/config/SentinelFilterConfig.java | 23 ++++ .../com/cweb/controller/LoginController.java | 44 +++++++ .../src/main/resources/dev/application.yml | 16 ++- hai-order/src/main/resources/dev/web.xml | 8 ++ .../com/hai/dao/OutRechargePriceMapper.java | 17 ++- .../hai/dao/OutRechargePriceSqlProvider.java | 30 +++-- .../java/com/hai/entity/OutRechargePrice.java | 36 ++++-- .../hai/entity/OutRechargePriceExample.java | 108 +++++++++++++---- 12 files changed, 437 insertions(+), 50 deletions(-) create mode 100644 hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java create mode 100644 hai-order/src/main/java/com/cweb/config/RedisConfig.java create mode 100644 hai-order/src/main/java/com/cweb/config/SentinelFilterConfig.java create mode 100644 hai-order/src/main/resources/dev/web.xml diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java index 022d805a..8f1944b2 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java @@ -388,6 +388,75 @@ public class OrderController { } } + @RequestMapping(value="/unionPay",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "银联支付") + public ResponseData unionPay(@RequestBody String reqBodyStr,HttpServletRequest request) { + try { + // 用户 + SessionObject sessionObject = userCenter.getSessionObject(request); + HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); + + if (StringUtils.isBlank(reqBodyStr)) { + log.error("orderToPay error!", "参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + JSONObject jsonObject = JSONObject.parseObject(reqBodyStr); + Long orderId = jsonObject.getLong("orderId"); + + if (orderId == null) { + log.error("orderToPay error!", "参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + HighOrder order = highOrderService.getOrderById(orderId); + if(order == null) { + log.error("OrderController --> orderToPay() ERROR", "未找到订单信息"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_ORDER, ""); + } + //校验订单状态 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 + if(order.getOrderStatus() != 1) { + log.error("OrderController --> orderToPay() ERROR", "订单不处于待支付状态"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.ORDER_NO_STAY_PAY, ""); + } + +/* // 商品类型 1:卡卷 2:金币充值 + for (HighChildOrder childOrder : order.getHighChildOrderList()) { + if (childOrder.getGoodsType() == 2) { + HighCoupon coupon = highCouponService.getCouponById(childOrder.getGoodsId()); + // 支付类型:1.微信支付 2.金币支付 + if (coupon.getPayType() != 2) { + log.error("OrderController --> orderToPay() ERROR", "只支持积分支付"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, coupon.getCouponName() + ",只支持积分支付"); + } + } + }*/ + + + new Thread(() -> { + // 查询订单信息 + if (order == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_ORDER, ""); + } + HighUser highUser = highUserService.findByUserId(order.getMemId()); + HighChildOrder presentation = highOrderService.getChildOrderByPresentation(order.getId()); + WxMsgConfig.pushOneUser( + presentation.getGoodsName() + "(" + GoodsType.getNameByType(presentation.getGoodsType()) + ")", + String.valueOf(order.getPayPrice()), + order.getOrderNo(), + order.getPayTime(), + PayType.getNameByType(order.getPayType()), order.getId(), + highUser.getOpenId()); + }).start(); + + return ResponseMsgUtil.success("支付成功"); + } catch (Exception e) { + log.error("orderToPay error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/qzOrderToPay",method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "千猪订单支付发起支付") diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java new file mode 100644 index 00000000..bca144a5 --- /dev/null +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java @@ -0,0 +1,11 @@ +package com.cweb.controller.pay; + +import io.swagger.annotations.Api; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +@Controller +@RequestMapping(value = "/unionPay") +@Api(value = "银联支付") +public class UnionPayController { +} diff --git a/hai-order/pom.xml b/hai-order/pom.xml index 542d8b31..037d3ef1 100644 --- a/hai-order/pom.xml +++ b/hai-order/pom.xml @@ -18,6 +18,21 @@ hai-service PACKT-SNAPSHOT + + com.alibaba.csp + sentinel-core + 1.8.2 + + + com.alibaba.csp + sentinel-transport-simple-http + 1.8.2 + + + com.alibaba.csp + sentinel-web-servlet + 1.8.2 + diff --git a/hai-order/src/main/java/com/cweb/config/RedisConfig.java b/hai-order/src/main/java/com/cweb/config/RedisConfig.java new file mode 100644 index 00000000..c6db7fc4 --- /dev/null +++ b/hai-order/src/main/java/com/cweb/config/RedisConfig.java @@ -0,0 +1,110 @@ +package com.cweb.config; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.PropertyAccessor; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.cache.annotation.CachingConfigurerSupport; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.*; +import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; +import org.springframework.data.redis.serializer.StringRedisSerializer; + + +@Configuration +@EnableCaching //开启注解 +public class RedisConfig extends CachingConfigurerSupport { + + /** + * retemplate相关配置 + * @param factory + * @return + */ + @Bean + public RedisTemplate redisTemplate(RedisConnectionFactory factory) { + + RedisTemplate template = new RedisTemplate<>(); + // 配置连接工厂 + template.setConnectionFactory(factory); + + //使用Jackson2JsonRedisSerializer来序列化和反序列化redis的value值(默认使用JDK的序列化方式) + Jackson2JsonRedisSerializer jacksonSeial = new Jackson2JsonRedisSerializer(Object.class); + + ObjectMapper om = new ObjectMapper(); + // 指定要序列化的域,field,get和set,以及修饰符范围,ANY是都有包括private和public + om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + // 指定序列化输入的类型,类必须是非final修饰的,final修饰的类,比如String,Integer等会跑出异常 + om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); + jacksonSeial.setObjectMapper(om); + + // 值采用json序列化 + template.setValueSerializer(jacksonSeial); + //使用StringRedisSerializer来序列化和反序列化redis的key值 + template.setKeySerializer(new StringRedisSerializer()); + + // 设置hash key 和value序列化模式 + template.setHashKeySerializer(new StringRedisSerializer()); + template.setHashValueSerializer(jacksonSeial); + template.afterPropertiesSet(); + + return template; + } + + /** + * 对hash类型的数据操作 + * + * @param redisTemplate + * @return + */ + @Bean + public HashOperations hashOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForHash(); + } + + /** + * 对redis字符串类型数据操作 + * + * @param redisTemplate + * @return + */ + @Bean + public ValueOperations valueOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForValue(); + } + + /** + * 对链表类型的数据操作 + * + * @param redisTemplate + * @return + */ + @Bean + public ListOperations listOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForList(); + } + + /** + * 对无序集合类型的数据操作 + * + * @param redisTemplate + * @return + */ + @Bean + public SetOperations setOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForSet(); + } + + /** + * 对有序集合类型的数据操作 + * + * @param redisTemplate + * @return + */ + @Bean + public ZSetOperations zSetOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForZSet(); + } + +} \ No newline at end of file diff --git a/hai-order/src/main/java/com/cweb/config/SentinelFilterConfig.java b/hai-order/src/main/java/com/cweb/config/SentinelFilterConfig.java new file mode 100644 index 00000000..ae10cf71 --- /dev/null +++ b/hai-order/src/main/java/com/cweb/config/SentinelFilterConfig.java @@ -0,0 +1,23 @@ +package com.cweb.config; + +import com.alibaba.csp.sentinel.adapter.servlet.CommonFilter; +import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.servlet.Filter; + +@Configuration +public class SentinelFilterConfig { + + @Bean + public FilterRegistrationBean sentinelFilterRegistration() { + FilterRegistrationBean registration = new FilterRegistrationBean<>(); + registration.setFilter(new CommonFilter()); + registration.addUrlPatterns("/*"); + registration.setName("sentinelFilter"); + registration.setOrder(1); + + return registration; + } +} diff --git a/hai-order/src/main/java/com/cweb/controller/LoginController.java b/hai-order/src/main/java/com/cweb/controller/LoginController.java index caf6a6db..324e471f 100644 --- a/hai-order/src/main/java/com/cweb/controller/LoginController.java +++ b/hai-order/src/main/java/com/cweb/controller/LoginController.java @@ -1,11 +1,21 @@ package com.cweb.controller; +import com.alibaba.csp.sentinel.Entry; +import com.alibaba.csp.sentinel.SphU; +import com.alibaba.csp.sentinel.annotation.SentinelResource; +import com.alibaba.csp.sentinel.slots.block.BlockException; +import com.alibaba.csp.sentinel.slots.block.RuleConstant; +import com.alibaba.csp.sentinel.slots.block.flow.FlowRule; +import com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager; import io.swagger.annotations.Api; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import java.util.ArrayList; +import java.util.List; + @Controller @RequestMapping(value = "/login") @Api(value = "登录") @@ -13,5 +23,39 @@ public class LoginController { private static Logger log = LoggerFactory.getLogger(LoginController.class); + @SentinelResource("HelloWorld") + public void helloWorld() { + // 资源中的逻辑 + System.out.println("hello world"); + } + + + public static void main(String[] args) { + // 配置规则. + initFlowRules(); + + int i = 0; + while (i <= 100) { + i++; + // 1.5.0 版本开始可以直接利用 try-with-resources 特性 + try (Entry entry = SphU.entry("HelloWorld")) { + // 被保护的逻辑 + System.out.println("hello world"); + } catch (BlockException ex) { + // 处理被流控的逻辑 + System.out.println("blocked!"); + } + } + } + private static void initFlowRules(){ + List rules = new ArrayList<>(); + FlowRule rule = new FlowRule(); + rule.setResource("HelloWorld"); + rule.setGrade(RuleConstant.FLOW_GRADE_QPS); + // Set limit QPS to 20. + rule.setCount(20); + rules.add(rule); + FlowRuleManager.loadRules(rules); + } } diff --git a/hai-order/src/main/resources/dev/application.yml b/hai-order/src/main/resources/dev/application.yml index 5e945c93..c7da0636 100644 --- a/hai-order/src/main/resources/dev/application.yml +++ b/hai-order/src/main/resources/dev/application.yml @@ -1,7 +1,7 @@ server: - port: 9302 + port: 9304 servlet: - context-path: /brest + context-path: /order #配置是否为debug模式,debug模式下,不开启权限校验 debug: true @@ -27,6 +27,18 @@ spring: testOnReturn: false poolPreparedStatements: true maxOpenPreparedStatements: 20 + redis: + database: 0 + host: 139.159.177.244 + port: 36379 + password: HF123456.Redis + timeout: 1000 + jedis: + pool: + max-active: 20 + max-wait: -1 + max-idle: 10 + min-idle: 0 #配置日期返回至前台为时间戳 jackson: serialization: diff --git a/hai-order/src/main/resources/dev/web.xml b/hai-order/src/main/resources/dev/web.xml new file mode 100644 index 00000000..85429fec --- /dev/null +++ b/hai-order/src/main/resources/dev/web.xml @@ -0,0 +1,8 @@ + + SentinelCommonFilter + com.alibaba.csp.sentinel.adapter.servlet.CommonFilter + + + SentinelCommonFilter + /* + diff --git a/hai-service/src/main/java/com/hai/dao/OutRechargePriceMapper.java b/hai-service/src/main/java/com/hai/dao/OutRechargePriceMapper.java index 32638b1c..3874126e 100644 --- a/hai-service/src/main/java/com/hai/dao/OutRechargePriceMapper.java +++ b/hai-service/src/main/java/com/hai/dao/OutRechargePriceMapper.java @@ -41,10 +41,12 @@ public interface OutRechargePriceMapper extends OutRechargePriceMapperExt { @Insert({ "insert into out_recharge_price (`type`, price, ", "real_price, create_time, ", - "goods_id, discount, channel)", + "goods_id, discount, sort, ", + "`status`)", "values (#{type,jdbcType=INTEGER}, #{price,jdbcType=DECIMAL}, ", "#{realPrice,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, ", - "#{goodsId,jdbcType=BIGINT}, #{discount,jdbcType=REAL}, #{channel,jdbcType=BIGINT})" + "#{goodsId,jdbcType=BIGINT}, #{discount,jdbcType=REAL}, #{sort,jdbcType=INTEGER}, ", + "#{status,jdbcType=INTEGER})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(OutRechargePrice record); @@ -62,13 +64,14 @@ public interface OutRechargePriceMapper extends OutRechargePriceMapperExt { @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="goods_id", property="goodsId", jdbcType=JdbcType.BIGINT), @Result(column="discount", property="discount", jdbcType=JdbcType.REAL), - @Result(column="channel", property="channel", jdbcType=JdbcType.BIGINT) + @Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER) }) List selectByExample(OutRechargePriceExample example); @Select({ "select", - "id, `type`, price, real_price, create_time, goods_id, discount, channel", + "id, `type`, price, real_price, create_time, goods_id, discount, sort, `status`", "from out_recharge_price", "where id = #{id,jdbcType=BIGINT}" }) @@ -80,7 +83,8 @@ public interface OutRechargePriceMapper extends OutRechargePriceMapperExt { @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="goods_id", property="goodsId", jdbcType=JdbcType.BIGINT), @Result(column="discount", property="discount", jdbcType=JdbcType.REAL), - @Result(column="channel", property="channel", jdbcType=JdbcType.BIGINT) + @Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER) }) OutRechargePrice selectByPrimaryKey(Long id); @@ -101,7 +105,8 @@ public interface OutRechargePriceMapper extends OutRechargePriceMapperExt { "create_time = #{createTime,jdbcType=TIMESTAMP},", "goods_id = #{goodsId,jdbcType=BIGINT},", "discount = #{discount,jdbcType=REAL},", - "channel = #{channel,jdbcType=BIGINT}", + "sort = #{sort,jdbcType=INTEGER},", + "`status` = #{status,jdbcType=INTEGER}", "where id = #{id,jdbcType=BIGINT}" }) int updateByPrimaryKey(OutRechargePrice record); diff --git a/hai-service/src/main/java/com/hai/dao/OutRechargePriceSqlProvider.java b/hai-service/src/main/java/com/hai/dao/OutRechargePriceSqlProvider.java index 7cbaa8fd..9d386e26 100644 --- a/hai-service/src/main/java/com/hai/dao/OutRechargePriceSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/OutRechargePriceSqlProvider.java @@ -52,8 +52,12 @@ public class OutRechargePriceSqlProvider { sql.VALUES("discount", "#{discount,jdbcType=REAL}"); } - if (record.getChannel() != null) { - sql.VALUES("channel", "#{channel,jdbcType=BIGINT}"); + if (record.getSort() != null) { + sql.VALUES("sort", "#{sort,jdbcType=INTEGER}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); } return sql.toString(); @@ -72,7 +76,8 @@ public class OutRechargePriceSqlProvider { sql.SELECT("create_time"); sql.SELECT("goods_id"); sql.SELECT("discount"); - sql.SELECT("channel"); + sql.SELECT("sort"); + sql.SELECT("`status`"); sql.FROM("out_recharge_price"); applyWhere(sql, example, false); @@ -118,8 +123,12 @@ public class OutRechargePriceSqlProvider { sql.SET("discount = #{record.discount,jdbcType=REAL}"); } - if (record.getChannel() != null) { - sql.SET("channel = #{record.channel,jdbcType=BIGINT}"); + if (record.getSort() != null) { + sql.SET("sort = #{record.sort,jdbcType=INTEGER}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); } applyWhere(sql, example, true); @@ -137,7 +146,8 @@ public class OutRechargePriceSqlProvider { sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); sql.SET("goods_id = #{record.goodsId,jdbcType=BIGINT}"); sql.SET("discount = #{record.discount,jdbcType=REAL}"); - sql.SET("channel = #{record.channel,jdbcType=BIGINT}"); + sql.SET("sort = #{record.sort,jdbcType=INTEGER}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); OutRechargePriceExample example = (OutRechargePriceExample) parameter.get("example"); applyWhere(sql, example, true); @@ -172,8 +182,12 @@ public class OutRechargePriceSqlProvider { sql.SET("discount = #{discount,jdbcType=REAL}"); } - if (record.getChannel() != null) { - sql.SET("channel = #{channel,jdbcType=BIGINT}"); + if (record.getSort() != null) { + sql.SET("sort = #{sort,jdbcType=INTEGER}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); } sql.WHERE("id = #{id,jdbcType=BIGINT}"); diff --git a/hai-service/src/main/java/com/hai/entity/OutRechargePrice.java b/hai-service/src/main/java/com/hai/entity/OutRechargePrice.java index fc898cc0..15ced951 100644 --- a/hai-service/src/main/java/com/hai/entity/OutRechargePrice.java +++ b/hai-service/src/main/java/com/hai/entity/OutRechargePrice.java @@ -20,7 +20,7 @@ public class OutRechargePrice implements Serializable { private Long id; /** - * 1 话费充值 2. 中石化 3. 中石油 + * 1 电信 2.移动 3.联通 */ private Integer type; @@ -50,9 +50,14 @@ public class OutRechargePrice implements Serializable { private Float discount; /** - * 提供商编号 + * 排序 */ - private Long channel; + private Integer sort; + + /** + * 0:下架 1:上线 + */ + private Integer status; private static final long serialVersionUID = 1L; @@ -112,12 +117,20 @@ public class OutRechargePrice implements Serializable { this.discount = discount; } - public Long getChannel() { - return channel; + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + public Integer getStatus() { + return status; } - public void setChannel(Long channel) { - this.channel = channel; + public void setStatus(Integer status) { + this.status = status; } @Override @@ -139,7 +152,8 @@ public class OutRechargePrice implements Serializable { && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getGoodsId() == null ? other.getGoodsId() == null : this.getGoodsId().equals(other.getGoodsId())) && (this.getDiscount() == null ? other.getDiscount() == null : this.getDiscount().equals(other.getDiscount())) - && (this.getChannel() == null ? other.getChannel() == null : this.getChannel().equals(other.getChannel())); + && (this.getSort() == null ? other.getSort() == null : this.getSort().equals(other.getSort())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())); } @Override @@ -153,7 +167,8 @@ public class OutRechargePrice implements Serializable { result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getGoodsId() == null) ? 0 : getGoodsId().hashCode()); result = prime * result + ((getDiscount() == null) ? 0 : getDiscount().hashCode()); - result = prime * result + ((getChannel() == null) ? 0 : getChannel().hashCode()); + result = prime * result + ((getSort() == null) ? 0 : getSort().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); return result; } @@ -170,7 +185,8 @@ public class OutRechargePrice implements Serializable { sb.append(", createTime=").append(createTime); sb.append(", goodsId=").append(goodsId); sb.append(", discount=").append(discount); - sb.append(", channel=").append(channel); + sb.append(", sort=").append(sort); + sb.append(", status=").append(status); sb.append(", serialVersionUID=").append(serialVersionUID); sb.append("]"); return sb.toString(); diff --git a/hai-service/src/main/java/com/hai/entity/OutRechargePriceExample.java b/hai-service/src/main/java/com/hai/entity/OutRechargePriceExample.java index db0795ae..2193e872 100644 --- a/hai-service/src/main/java/com/hai/entity/OutRechargePriceExample.java +++ b/hai-service/src/main/java/com/hai/entity/OutRechargePriceExample.java @@ -546,63 +546,123 @@ public class OutRechargePriceExample { return (Criteria) this; } - public Criteria andChannelIsNull() { - addCriterion("channel is null"); + public Criteria andSortIsNull() { + addCriterion("sort is null"); return (Criteria) this; } - public Criteria andChannelIsNotNull() { - addCriterion("channel is not null"); + public Criteria andSortIsNotNull() { + addCriterion("sort is not null"); return (Criteria) this; } - public Criteria andChannelEqualTo(Long value) { - addCriterion("channel =", value, "channel"); + public Criteria andSortEqualTo(Integer value) { + addCriterion("sort =", value, "sort"); return (Criteria) this; } - public Criteria andChannelNotEqualTo(Long value) { - addCriterion("channel <>", value, "channel"); + public Criteria andSortNotEqualTo(Integer value) { + addCriterion("sort <>", value, "sort"); return (Criteria) this; } - public Criteria andChannelGreaterThan(Long value) { - addCriterion("channel >", value, "channel"); + public Criteria andSortGreaterThan(Integer value) { + addCriterion("sort >", value, "sort"); return (Criteria) this; } - public Criteria andChannelGreaterThanOrEqualTo(Long value) { - addCriterion("channel >=", value, "channel"); + public Criteria andSortGreaterThanOrEqualTo(Integer value) { + addCriterion("sort >=", value, "sort"); return (Criteria) this; } - public Criteria andChannelLessThan(Long value) { - addCriterion("channel <", value, "channel"); + public Criteria andSortLessThan(Integer value) { + addCriterion("sort <", value, "sort"); return (Criteria) this; } - public Criteria andChannelLessThanOrEqualTo(Long value) { - addCriterion("channel <=", value, "channel"); + public Criteria andSortLessThanOrEqualTo(Integer value) { + addCriterion("sort <=", value, "sort"); return (Criteria) this; } - public Criteria andChannelIn(List values) { - addCriterion("channel in", values, "channel"); + public Criteria andSortIn(List values) { + addCriterion("sort in", values, "sort"); return (Criteria) this; } - public Criteria andChannelNotIn(List values) { - addCriterion("channel not in", values, "channel"); + public Criteria andSortNotIn(List values) { + addCriterion("sort not in", values, "sort"); return (Criteria) this; } - public Criteria andChannelBetween(Long value1, Long value2) { - addCriterion("channel between", value1, value2, "channel"); + public Criteria andSortBetween(Integer value1, Integer value2) { + addCriterion("sort between", value1, value2, "sort"); return (Criteria) this; } - public Criteria andChannelNotBetween(Long value1, Long value2) { - addCriterion("channel not between", value1, value2, "channel"); + public Criteria andSortNotBetween(Integer value1, Integer value2) { + addCriterion("sort not between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("`status` not between", value1, value2, "status"); return (Criteria) this; } }