diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighCouponCodeOtherController.java b/hai-cweb/src/main/java/com/cweb/controller/HighCouponCodeOtherController.java new file mode 100644 index 00000000..a7111937 --- /dev/null +++ b/hai-cweb/src/main/java/com/cweb/controller/HighCouponCodeOtherController.java @@ -0,0 +1,57 @@ +package com.cweb.controller; + +import com.hai.common.security.SessionObject; +import com.hai.common.security.UserCenter; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.entity.HighCouponCodeOther; +import com.hai.entity.HighUser; +import com.hai.model.HighUserModel; +import com.hai.model.ResponseData; +import com.hai.service.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.Map; + +@Controller +@RequestMapping(value = "/couponCodeOther") +@Api(value = "用户接口") +public class HighCouponCodeOtherController { + + private static Logger log = LoggerFactory.getLogger(HighCouponCodeOtherController.class); + + @Resource + private HighCouponCodeOtherService highCouponCodeOtherService; + + @RequestMapping(value = "/getList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询卡券码列表") + public ResponseData getList(@RequestParam(name = "type", required = true) Integer type, + @RequestParam(name = "orderId", required = false) Long orderId, + @RequestParam(name = "childOrderId", required = false) Long childOrderId) { + try { + + Map map = new HashMap<>(); + map.put("type", type); + map.put("orderId", orderId); + map.put("childOrderId", childOrderId); + + return ResponseMsgUtil.success(highCouponCodeOtherService.getList(map)); + + } catch (Exception e) { + log.error("HighCouponCodeOtherController --> getList() error!", e); + return ResponseMsgUtil.exception(e); + } + } +} diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java b/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java index 5b307881..92b99104 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java @@ -195,6 +195,19 @@ public class HighTestController { } } + @RequestMapping(value = "/getCouState", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "测试") + public ResponseData getCouState(@RequestParam(name = "token", required = true) String token, + @RequestParam(name = "couNo", required = true) String couNo) { + try { + return ResponseMsgUtil.success(HuiLianTongConfig.getCouState(token,couNo)); + } catch (Exception e) { + log.error("HighOrderController --> getOrderById() error!", e); + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value = "/couJointDist", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "测试") diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighUserController.java b/hai-cweb/src/main/java/com/cweb/controller/HighUserController.java index c1ec9739..4fe485b5 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighUserController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighUserController.java @@ -1,20 +1,20 @@ package com.cweb.controller; +import com.alibaba.fastjson.JSONObject; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; -import com.hai.common.security.SessionObject; -import com.hai.common.security.UserCenter; -import com.hai.common.security.VerifyCode; -import com.hai.common.security.VerifyCodeStorage; +import com.hai.common.security.*; import com.hai.common.utils.ResponseMsgUtil; import com.hai.entity.HighOrder; import com.hai.entity.HighUser; import com.hai.entity.HighUserCoupon; +import com.hai.entity.HighUserPayPassword; import com.hai.model.HighUserModel; import com.hai.model.ResponseData; import com.hai.service.HighOrderService; import com.hai.service.HighUserCouponService; +import com.hai.service.HighUserPayPasswordService; import com.hai.service.HighUserService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -24,10 +24,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; @@ -57,6 +54,9 @@ public class HighUserController { @Resource private HighOrderService highOrderService; + @Resource + private HighUserPayPasswordService highUserPayPasswordService; + @RequestMapping(value = "/findUser", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据id查询详情") @@ -114,4 +114,94 @@ public class HighUserController { } } + @RequestMapping(value = "/isSetPayPwd", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "用户是否设置支付密码") + public ResponseData isSetPayPwd(HttpServletRequest request) { + try { + // 用户 + SessionObject sessionObject = userCenter.getSessionObject(request); + HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); + if (highUserPayPasswordService.getDetailByUser(userInfoModel.getHighUser().getId()) != null) { + return ResponseMsgUtil.success(true); + } + return ResponseMsgUtil.success(false); + + } catch (Exception e) { + log.error("HighUserController --> setUserPayPwd() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/setUserPayPwd", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "设置用户支付密码") + public ResponseData setUserPayPwd(@RequestBody JSONObject body,HttpServletRequest request, HttpServletResponse response) { + try { + // 用户 + SessionObject sessionObject = userCenter.getSessionObject(request); + HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); + + if (StringUtils.isBlank(body.getString("password")) + || body.getString("password").length() != 6){ + log.error("HighUserController --> setUserPayPwd() error!", "请设置6位支付密码"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请设置6支付密码"); + } + + // 查询用户密码 + HighUserPayPassword userPayPassword = highUserPayPasswordService.getDetailByUser(userInfoModel.getHighUser().getId()); + if (userPayPassword != null) { + log.error("HighUserController --> setUserPayPwd() error!", "您已设置了支付密码"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REPEAT_SET_USER_PAY_PWD, ""); + } + + userPayPassword = new HighUserPayPassword(); + userPayPassword.setUserId(userInfoModel.getHighUser().getId()); + userPayPassword.setPassword(AESEncodeUtil.aesEncrypt(body.getString("password"))); + highUserPayPasswordService.editUserPayPwd(userPayPassword); + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("HighUserController --> setUserPayPwd() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/updateUserPayPwd", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "修改用户支付密码") + public ResponseData updateUserPayPwd(@RequestBody JSONObject body,HttpServletRequest request, HttpServletResponse response) { + try { + // 用户 + SessionObject sessionObject = userCenter.getSessionObject(request); + HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); + if (StringUtils.isBlank(body.getString("password")) + || StringUtils.isBlank(body.getString("newPassword"))) { + log.error("HighUserController --> setUserPayPwd() error!", ""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + // 查询用户密码 + HighUserPayPassword userPayPassword = highUserPayPasswordService.getDetailByUser(userInfoModel.getHighUser().getId()); + if (userPayPassword == null) { + log.error("HighUserController --> setUserPayPwd() error!", "修改失败,未设置支付密码"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_SET_USER_PAY_PWD, ""); + } + + if (!AESEncodeUtil.aesEncrypt(body.getString("password")).equals(userPayPassword.getPassword())) { + log.error("HighUserController --> setUserPayPwd() error!", "修改失败,旧密码不一致"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "修改失败,旧密码不一致"); + } + + userPayPassword.setPassword(AESEncodeUtil.aesEncrypt(body.getString("newPassword"))); + highUserPayPasswordService.editUserPayPwd(userPayPassword); + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("HighUserController --> updateUserPayPwd() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + } 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 bd89c1d0..8f486ad2 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 @@ -11,6 +11,7 @@ import com.hai.common.pay.WechatPayUtil; import com.hai.common.pay.entity.OrderType; import com.hai.common.pay.entity.WeChatPayReqInfo; import com.hai.common.pay.util.MD5Util; +import com.hai.common.security.AESEncodeUtil; import com.hai.common.security.Base64Util; import com.hai.common.security.SessionObject; import com.hai.common.security.UserCenter; @@ -22,12 +23,15 @@ import com.hai.config.TuanYouConfig; import com.hai.entity.HighChildOrder; import com.hai.entity.HighCoupon; import com.hai.entity.HighOrder; +import com.hai.entity.HighUserPayPassword; import com.hai.model.HighCouponModel; +import com.hai.model.HighUserModel; import com.hai.model.ResponseData; import com.hai.model.UserInfoModel; import com.hai.service.HighCouponService; import com.hai.service.HighOrderService; import com.hai.service.HighQzOrderService; +import com.hai.service.HighUserPayPasswordService; import com.wechat.pay.contrib.apache.httpclient.WechatPayHttpClientBuilder; import com.wechat.pay.contrib.apache.httpclient.auth.AutoUpdateCertificatesVerifier; import com.wechat.pay.contrib.apache.httpclient.auth.PrivateKeySigner; @@ -92,6 +96,9 @@ public class OrderController { @Resource private HighQzOrderService highQzOrderService; + @Resource + private HighUserPayPasswordService highUserPayPasswordService; + /** * * @Title: orderToPay @@ -204,20 +211,42 @@ public class OrderController { @RequestMapping(value="/orderToGoldPay",method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "订单支付发起金币支付") - public ResponseData orderToGoldPay(@RequestBody String reqBodyStr) { + public ResponseData orderToGoldPay(@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"); + String password = jsonObject.getString("password"); if (orderId == null) { log.error("orderToPay error!", "参数错误"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } + if (StringUtils.isBlank(password)) { + log.error("orderToPay error!", "未输入支付密码"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_ENTER_USER_PAY_PWD, ""); + } + + // 查询用户支付密码 + HighUserPayPassword userPayPassword = highUserPayPasswordService.getDetailByUser(userInfoModel.getHighUser().getId()); + if (userPayPassword == null) { + log.error("orderToPay error!", "未设置支付密码"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_SET_USER_PAY_PWD, ""); + } + // 校验支付密码是否一直 + if (!AESEncodeUtil.aesEncrypt(password).equals(userPayPassword.getPassword())) { + log.error("orderToPay error!", ""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.USER_PAY_PWD_ERROR, ""); + } + HighOrder order = highOrderService.getOrderById(orderId); if(order == null) { log.error("OrderController --> orderToPay() ERROR", "未找到订单信息"); diff --git a/hai-schedule/src/main/java/com/hai/schedule/HighCouponSchedule.java b/hai-schedule/src/main/java/com/hai/schedule/HighCouponSchedule.java index 6bd8676b..7be41866 100644 --- a/hai-schedule/src/main/java/com/hai/schedule/HighCouponSchedule.java +++ b/hai-schedule/src/main/java/com/hai/schedule/HighCouponSchedule.java @@ -1,7 +1,14 @@ package com.hai.schedule; +import com.alibaba.fastjson.JSONObject; +import com.hai.common.exception.ErrorCode; +import com.hai.common.exception.ErrorHelp; +import com.hai.common.exception.SysCode; import com.hai.common.utils.ResponseMsgUtil; -import com.hai.entity.HighUserCoupon; +import com.hai.config.HuiLianTongConfig; +import com.hai.dao.HighCouponCodeOtherMapper; +import com.hai.entity.*; +import com.hai.service.HighOrderService; import com.hai.service.HighUserCouponService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -24,6 +31,12 @@ public class HighCouponSchedule { @Resource private HighUserCouponService highUserCouponService; + @Resource + private HighCouponCodeOtherMapper highCouponCodeOtherMapper; + + @Resource + private HighOrderService highOrderService; + /** * @Author 胡锐 * @Description 处理过期的卡券 @@ -41,4 +54,44 @@ public class HighCouponSchedule { } } } + + /** + * @Author 胡锐 + * @Description 处理汇联卡券状态 + * @Date 2021/4/4 22:44 + **/ + @Scheduled(cron="0 0/30 * * * ?") //每30分钟执行一次 + public void handleCouponStatus() throws Exception { + + HighCouponCodeOtherExample example = new HighCouponCodeOtherExample(); + example.createCriteria().andStatusEqualTo(20).andTypeEqualTo(1); + List otherList = highCouponCodeOtherMapper.selectByExample(example); + + // 获取token + JSONObject tokenObject = HuiLianTongConfig.getToken(); + if (!tokenObject.getString("result").equals("success")) { + log.error("HighCouponController -> insertCoupon() error!","获取token失败"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "获取token失败"); + } + + for (HighCouponCodeOther couponCodeOther : otherList) { + JSONObject data = HuiLianTongConfig.getCouState(tokenObject.getString("data"), couponCodeOther.getCouNo()); + if (data.getString("result").equals("success")) { + if (data.getJSONObject("data").getInteger("state") != 20) { + couponCodeOther.setStatus(data.getJSONObject("data").getInteger("state")); + highCouponCodeOtherMapper.updateByPrimaryKey(couponCodeOther); + } + + // 查询订单中的汇联通卡券全部已处理 + HighCouponCodeOtherExample otherExample = new HighCouponCodeOtherExample(); + otherExample.createCriteria().andChildOrderIdEqualTo(couponCodeOther.getChildOrderId()).andStatusEqualTo(20).andTypeEqualTo(1); + if (highCouponCodeOtherMapper.selectByExample(example).size() == 0) { + highOrderService.childOrderComplete(couponCodeOther.getChildOrderId()); + } + } + } + + + } + } diff --git a/hai-service/src/main/java/com/hai/common/exception/ErrorCode.java b/hai-service/src/main/java/com/hai/common/exception/ErrorCode.java index 28896be1..b8b7ac01 100644 --- a/hai-service/src/main/java/com/hai/common/exception/ErrorCode.java +++ b/hai-service/src/main/java/com/hai/common/exception/ErrorCode.java @@ -109,6 +109,10 @@ public enum ErrorCode { NOT_FOUND_AGENT("2126","未找到代理商信息"), DISCOUNT_STOCK_COUNT_ERROR("2127","优惠券库存数量不足"), RECHARGE_CLOSE("2128","系统已关闭,请稍后充值"), + REPEAT_SET_USER_PAY_PWD("2129","已设置支付密码"), + NOT_SET_USER_PAY_PWD("2130","未设置支付密码"), + NOT_ENTER_USER_PAY_PWD("2131","未输入支付密码"), + USER_PAY_PWD_ERROR("2132","支付密码错误"), STATUS_ERROR("3000","状态错误"), ADD_DATA_ERROR("3001","增加数据失败"), diff --git a/hai-service/src/main/java/com/hai/config/HuiLianTongConfig.java b/hai-service/src/main/java/com/hai/config/HuiLianTongConfig.java index bec50dd1..8b69f97d 100644 --- a/hai-service/src/main/java/com/hai/config/HuiLianTongConfig.java +++ b/hai-service/src/main/java/com/hai/config/HuiLianTongConfig.java @@ -57,6 +57,19 @@ public class HuiLianTongConfig { return HttpsUtils.doPost(CommonSysConst.getSysConfig().getHuiliantongUrl()+"/coupon/api/coupon_corp/getCorpCouTypes", JSON.toJSONString(map)); } + /** + * 获取电子券类型列表 + * @param token + * @return + * @throws Exception + */ + public static JSONObject getCouState(String token,String couNo) { + Map map = new HashMap<>(); + map.put("token", token); + map.put("couNo", couNo); + return HttpsUtils.doPost(CommonSysConst.getSysConfig().getHuiliantongUrl()+"/coupon/api/coupon_corp/getCouState", JSON.toJSONString(map)); + } + /** * 商户派发电子券 diff --git a/hai-service/src/main/java/com/hai/dao/HighCouponCodeOtherMapper.java b/hai-service/src/main/java/com/hai/dao/HighCouponCodeOtherMapper.java new file mode 100644 index 00000000..523833df --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighCouponCodeOtherMapper.java @@ -0,0 +1,133 @@ +package com.hai.dao; + +import com.hai.entity.HighCouponCodeOther; +import com.hai.entity.HighCouponCodeOtherExample; +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 HighCouponCodeOtherMapper extends HighCouponCodeOtherMapperExt { + @SelectProvider(type=HighCouponCodeOtherSqlProvider.class, method="countByExample") + long countByExample(HighCouponCodeOtherExample example); + + @DeleteProvider(type=HighCouponCodeOtherSqlProvider.class, method="deleteByExample") + int deleteByExample(HighCouponCodeOtherExample example); + + @Delete({ + "delete from high_coupon_code_other", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into high_coupon_code_other (`type`, order_id, ", + "child_order_id, cou_type_code, ", + "cou_no, `status`, active_time, ", + "valid_start_date, valid_end_date, ", + "create_time, ext_1, ", + "ext_2, ext_3)", + "values (#{type,jdbcType=INTEGER}, #{orderId,jdbcType=BIGINT}, ", + "#{childOrderId,jdbcType=BIGINT}, #{couTypeCode,jdbcType=VARCHAR}, ", + "#{couNo,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{activeTime,jdbcType=TIMESTAMP}, ", + "#{validStartDate,jdbcType=TIMESTAMP}, #{validEndDate,jdbcType=TIMESTAMP}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", + "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(HighCouponCodeOther record); + + @InsertProvider(type=HighCouponCodeOtherSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(HighCouponCodeOther record); + + @SelectProvider(type=HighCouponCodeOtherSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), + @Result(column="order_id", property="orderId", jdbcType=JdbcType.BIGINT), + @Result(column="child_order_id", property="childOrderId", jdbcType=JdbcType.BIGINT), + @Result(column="cou_type_code", property="couTypeCode", jdbcType=JdbcType.VARCHAR), + @Result(column="cou_no", property="couNo", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="active_time", property="activeTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="valid_start_date", property="validStartDate", jdbcType=JdbcType.TIMESTAMP), + @Result(column="valid_end_date", property="validEndDate", jdbcType=JdbcType.TIMESTAMP), + @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 selectByExample(HighCouponCodeOtherExample example); + + @Select({ + "select", + "id, `type`, order_id, child_order_id, cou_type_code, cou_no, `status`, active_time, ", + "valid_start_date, valid_end_date, create_time, ext_1, ext_2, ext_3", + "from high_coupon_code_other", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), + @Result(column="order_id", property="orderId", jdbcType=JdbcType.BIGINT), + @Result(column="child_order_id", property="childOrderId", jdbcType=JdbcType.BIGINT), + @Result(column="cou_type_code", property="couTypeCode", jdbcType=JdbcType.VARCHAR), + @Result(column="cou_no", property="couNo", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="active_time", property="activeTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="valid_start_date", property="validStartDate", jdbcType=JdbcType.TIMESTAMP), + @Result(column="valid_end_date", property="validEndDate", jdbcType=JdbcType.TIMESTAMP), + @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) + }) + HighCouponCodeOther selectByPrimaryKey(Long id); + + @UpdateProvider(type=HighCouponCodeOtherSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") HighCouponCodeOther record, @Param("example") HighCouponCodeOtherExample example); + + @UpdateProvider(type=HighCouponCodeOtherSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") HighCouponCodeOther record, @Param("example") HighCouponCodeOtherExample example); + + @UpdateProvider(type=HighCouponCodeOtherSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(HighCouponCodeOther record); + + @Update({ + "update high_coupon_code_other", + "set `type` = #{type,jdbcType=INTEGER},", + "order_id = #{orderId,jdbcType=BIGINT},", + "child_order_id = #{childOrderId,jdbcType=BIGINT},", + "cou_type_code = #{couTypeCode,jdbcType=VARCHAR},", + "cou_no = #{couNo,jdbcType=VARCHAR},", + "`status` = #{status,jdbcType=INTEGER},", + "active_time = #{activeTime,jdbcType=TIMESTAMP},", + "valid_start_date = #{validStartDate,jdbcType=TIMESTAMP},", + "valid_end_date = #{validEndDate,jdbcType=TIMESTAMP},", + "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(HighCouponCodeOther record); +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighCouponCodeOtherMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighCouponCodeOtherMapperExt.java new file mode 100644 index 00000000..72fff166 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighCouponCodeOtherMapperExt.java @@ -0,0 +1,7 @@ +package com.hai.dao; + +/** + * mapper扩展类 + */ +public interface HighCouponCodeOtherMapperExt { +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighCouponCodeOtherSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighCouponCodeOtherSqlProvider.java new file mode 100644 index 00000000..8e3059d9 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighCouponCodeOtherSqlProvider.java @@ -0,0 +1,360 @@ +package com.hai.dao; + +import com.hai.entity.HighCouponCodeOther; +import com.hai.entity.HighCouponCodeOtherExample.Criteria; +import com.hai.entity.HighCouponCodeOtherExample.Criterion; +import com.hai.entity.HighCouponCodeOtherExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class HighCouponCodeOtherSqlProvider { + + public String countByExample(HighCouponCodeOtherExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("high_coupon_code_other"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(HighCouponCodeOtherExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("high_coupon_code_other"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(HighCouponCodeOther record) { + SQL sql = new SQL(); + sql.INSERT_INTO("high_coupon_code_other"); + + if (record.getType() != null) { + sql.VALUES("`type`", "#{type,jdbcType=INTEGER}"); + } + + if (record.getOrderId() != null) { + sql.VALUES("order_id", "#{orderId,jdbcType=BIGINT}"); + } + + if (record.getChildOrderId() != null) { + sql.VALUES("child_order_id", "#{childOrderId,jdbcType=BIGINT}"); + } + + if (record.getCouTypeCode() != null) { + sql.VALUES("cou_type_code", "#{couTypeCode,jdbcType=VARCHAR}"); + } + + if (record.getCouNo() != null) { + sql.VALUES("cou_no", "#{couNo,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + if (record.getActiveTime() != null) { + sql.VALUES("active_time", "#{activeTime,jdbcType=TIMESTAMP}"); + } + + if (record.getValidStartDate() != null) { + sql.VALUES("valid_start_date", "#{validStartDate,jdbcType=TIMESTAMP}"); + } + + if (record.getValidEndDate() != null) { + sql.VALUES("valid_end_date", "#{validEndDate,jdbcType=TIMESTAMP}"); + } + + 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(HighCouponCodeOtherExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("`type`"); + sql.SELECT("order_id"); + sql.SELECT("child_order_id"); + sql.SELECT("cou_type_code"); + sql.SELECT("cou_no"); + sql.SELECT("`status`"); + sql.SELECT("active_time"); + sql.SELECT("valid_start_date"); + sql.SELECT("valid_end_date"); + sql.SELECT("create_time"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("high_coupon_code_other"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + HighCouponCodeOther record = (HighCouponCodeOther) parameter.get("record"); + HighCouponCodeOtherExample example = (HighCouponCodeOtherExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("high_coupon_code_other"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getType() != null) { + sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); + } + + if (record.getOrderId() != null) { + sql.SET("order_id = #{record.orderId,jdbcType=BIGINT}"); + } + + if (record.getChildOrderId() != null) { + sql.SET("child_order_id = #{record.childOrderId,jdbcType=BIGINT}"); + } + + if (record.getCouTypeCode() != null) { + sql.SET("cou_type_code = #{record.couTypeCode,jdbcType=VARCHAR}"); + } + + if (record.getCouNo() != null) { + sql.SET("cou_no = #{record.couNo,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + } + + if (record.getActiveTime() != null) { + sql.SET("active_time = #{record.activeTime,jdbcType=TIMESTAMP}"); + } + + if (record.getValidStartDate() != null) { + sql.SET("valid_start_date = #{record.validStartDate,jdbcType=TIMESTAMP}"); + } + + if (record.getValidEndDate() != null) { + sql.SET("valid_end_date = #{record.validEndDate,jdbcType=TIMESTAMP}"); + } + + 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 parameter) { + SQL sql = new SQL(); + sql.UPDATE("high_coupon_code_other"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); + sql.SET("order_id = #{record.orderId,jdbcType=BIGINT}"); + sql.SET("child_order_id = #{record.childOrderId,jdbcType=BIGINT}"); + sql.SET("cou_type_code = #{record.couTypeCode,jdbcType=VARCHAR}"); + sql.SET("cou_no = #{record.couNo,jdbcType=VARCHAR}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("active_time = #{record.activeTime,jdbcType=TIMESTAMP}"); + sql.SET("valid_start_date = #{record.validStartDate,jdbcType=TIMESTAMP}"); + sql.SET("valid_end_date = #{record.validEndDate,jdbcType=TIMESTAMP}"); + 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}"); + + HighCouponCodeOtherExample example = (HighCouponCodeOtherExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(HighCouponCodeOther record) { + SQL sql = new SQL(); + sql.UPDATE("high_coupon_code_other"); + + if (record.getType() != null) { + sql.SET("`type` = #{type,jdbcType=INTEGER}"); + } + + if (record.getOrderId() != null) { + sql.SET("order_id = #{orderId,jdbcType=BIGINT}"); + } + + if (record.getChildOrderId() != null) { + sql.SET("child_order_id = #{childOrderId,jdbcType=BIGINT}"); + } + + if (record.getCouTypeCode() != null) { + sql.SET("cou_type_code = #{couTypeCode,jdbcType=VARCHAR}"); + } + + if (record.getCouNo() != null) { + sql.SET("cou_no = #{couNo,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + if (record.getActiveTime() != null) { + sql.SET("active_time = #{activeTime,jdbcType=TIMESTAMP}"); + } + + if (record.getValidStartDate() != null) { + sql.SET("valid_start_date = #{validStartDate,jdbcType=TIMESTAMP}"); + } + + if (record.getValidEndDate() != null) { + sql.SET("valid_end_date = #{validEndDate,jdbcType=TIMESTAMP}"); + } + + 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, HighCouponCodeOtherExample 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 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 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()); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighCouponCodeOther.java b/hai-service/src/main/java/com/hai/entity/HighCouponCodeOther.java new file mode 100644 index 00000000..4de2daf8 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighCouponCodeOther.java @@ -0,0 +1,264 @@ +package com.hai.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * high_coupon_code_other + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class HighCouponCodeOther implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 类型: 1 汇联通 + */ + private Integer type; + + /** + * 订单id + */ + private Long orderId; + + /** + * 子订单id + */ + private Long childOrderId; + + /** + * 卡券类型code + */ + private String couTypeCode; + + /** + * 卡券号 + */ + private String couNo; + + /** + * 状态:已核销(40),20(已激活)50 已作废 + */ + private Integer status; + + /** + * 激活时间 + */ + private Date activeTime; + + /** + * 有效期开始时间 + */ + private Date validStartDate; + + /** + * 有效期结束时间 + */ + private Date validEndDate; + + /** + * 创建时间 + */ + 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 Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public Long getOrderId() { + return orderId; + } + + public void setOrderId(Long orderId) { + this.orderId = orderId; + } + + public Long getChildOrderId() { + return childOrderId; + } + + public void setChildOrderId(Long childOrderId) { + this.childOrderId = childOrderId; + } + + public String getCouTypeCode() { + return couTypeCode; + } + + public void setCouTypeCode(String couTypeCode) { + this.couTypeCode = couTypeCode; + } + + public String getCouNo() { + return couNo; + } + + public void setCouNo(String couNo) { + this.couNo = couNo; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Date getActiveTime() { + return activeTime; + } + + public void setActiveTime(Date activeTime) { + this.activeTime = activeTime; + } + + public Date getValidStartDate() { + return validStartDate; + } + + public void setValidStartDate(Date validStartDate) { + this.validStartDate = validStartDate; + } + + public Date getValidEndDate() { + return validEndDate; + } + + public void setValidEndDate(Date validEndDate) { + this.validEndDate = validEndDate; + } + + 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; + } + HighCouponCodeOther other = (HighCouponCodeOther) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) + && (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId())) + && (this.getChildOrderId() == null ? other.getChildOrderId() == null : this.getChildOrderId().equals(other.getChildOrderId())) + && (this.getCouTypeCode() == null ? other.getCouTypeCode() == null : this.getCouTypeCode().equals(other.getCouTypeCode())) + && (this.getCouNo() == null ? other.getCouNo() == null : this.getCouNo().equals(other.getCouNo())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getActiveTime() == null ? other.getActiveTime() == null : this.getActiveTime().equals(other.getActiveTime())) + && (this.getValidStartDate() == null ? other.getValidStartDate() == null : this.getValidStartDate().equals(other.getValidStartDate())) + && (this.getValidEndDate() == null ? other.getValidEndDate() == null : this.getValidEndDate().equals(other.getValidEndDate())) + && (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 + ((getType() == null) ? 0 : getType().hashCode()); + result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode()); + result = prime * result + ((getChildOrderId() == null) ? 0 : getChildOrderId().hashCode()); + result = prime * result + ((getCouTypeCode() == null) ? 0 : getCouTypeCode().hashCode()); + result = prime * result + ((getCouNo() == null) ? 0 : getCouNo().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getActiveTime() == null) ? 0 : getActiveTime().hashCode()); + result = prime * result + ((getValidStartDate() == null) ? 0 : getValidStartDate().hashCode()); + result = prime * result + ((getValidEndDate() == null) ? 0 : getValidEndDate().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(", type=").append(type); + sb.append(", orderId=").append(orderId); + sb.append(", childOrderId=").append(childOrderId); + sb.append(", couTypeCode=").append(couTypeCode); + sb.append(", couNo=").append(couNo); + sb.append(", status=").append(status); + sb.append(", activeTime=").append(activeTime); + sb.append(", validStartDate=").append(validStartDate); + sb.append(", validEndDate=").append(validEndDate); + 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(); + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighCouponCodeOtherExample.java b/hai-service/src/main/java/com/hai/entity/HighCouponCodeOtherExample.java new file mode 100644 index 00000000..fb8b42fc --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighCouponCodeOtherExample.java @@ -0,0 +1,1113 @@ +package com.hai.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class HighCouponCodeOtherExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public HighCouponCodeOtherExample() { + oredCriteria = new ArrayList(); + } + + 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 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 criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List 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 values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List 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 andTypeIsNull() { + addCriterion("`type` is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("`type` is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(Integer value) { + addCriterion("`type` =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(Integer value) { + addCriterion("`type` <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(Integer value) { + addCriterion("`type` >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("`type` >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(Integer value) { + addCriterion("`type` <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(Integer value) { + addCriterion("`type` <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("`type` in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("`type` not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(Integer value1, Integer value2) { + addCriterion("`type` between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(Integer value1, Integer value2) { + addCriterion("`type` not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andOrderIdIsNull() { + addCriterion("order_id is null"); + return (Criteria) this; + } + + public Criteria andOrderIdIsNotNull() { + addCriterion("order_id is not null"); + return (Criteria) this; + } + + public Criteria andOrderIdEqualTo(Long value) { + addCriterion("order_id =", value, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdNotEqualTo(Long value) { + addCriterion("order_id <>", value, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdGreaterThan(Long value) { + addCriterion("order_id >", value, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdGreaterThanOrEqualTo(Long value) { + addCriterion("order_id >=", value, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdLessThan(Long value) { + addCriterion("order_id <", value, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdLessThanOrEqualTo(Long value) { + addCriterion("order_id <=", value, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdIn(List values) { + addCriterion("order_id in", values, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdNotIn(List values) { + addCriterion("order_id not in", values, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdBetween(Long value1, Long value2) { + addCriterion("order_id between", value1, value2, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdNotBetween(Long value1, Long value2) { + addCriterion("order_id not between", value1, value2, "orderId"); + return (Criteria) this; + } + + public Criteria andChildOrderIdIsNull() { + addCriterion("child_order_id is null"); + return (Criteria) this; + } + + public Criteria andChildOrderIdIsNotNull() { + addCriterion("child_order_id is not null"); + return (Criteria) this; + } + + public Criteria andChildOrderIdEqualTo(Long value) { + addCriterion("child_order_id =", value, "childOrderId"); + return (Criteria) this; + } + + public Criteria andChildOrderIdNotEqualTo(Long value) { + addCriterion("child_order_id <>", value, "childOrderId"); + return (Criteria) this; + } + + public Criteria andChildOrderIdGreaterThan(Long value) { + addCriterion("child_order_id >", value, "childOrderId"); + return (Criteria) this; + } + + public Criteria andChildOrderIdGreaterThanOrEqualTo(Long value) { + addCriterion("child_order_id >=", value, "childOrderId"); + return (Criteria) this; + } + + public Criteria andChildOrderIdLessThan(Long value) { + addCriterion("child_order_id <", value, "childOrderId"); + return (Criteria) this; + } + + public Criteria andChildOrderIdLessThanOrEqualTo(Long value) { + addCriterion("child_order_id <=", value, "childOrderId"); + return (Criteria) this; + } + + public Criteria andChildOrderIdIn(List values) { + addCriterion("child_order_id in", values, "childOrderId"); + return (Criteria) this; + } + + public Criteria andChildOrderIdNotIn(List values) { + addCriterion("child_order_id not in", values, "childOrderId"); + return (Criteria) this; + } + + public Criteria andChildOrderIdBetween(Long value1, Long value2) { + addCriterion("child_order_id between", value1, value2, "childOrderId"); + return (Criteria) this; + } + + public Criteria andChildOrderIdNotBetween(Long value1, Long value2) { + addCriterion("child_order_id not between", value1, value2, "childOrderId"); + return (Criteria) this; + } + + public Criteria andCouTypeCodeIsNull() { + addCriterion("cou_type_code is null"); + return (Criteria) this; + } + + public Criteria andCouTypeCodeIsNotNull() { + addCriterion("cou_type_code is not null"); + return (Criteria) this; + } + + public Criteria andCouTypeCodeEqualTo(String value) { + addCriterion("cou_type_code =", value, "couTypeCode"); + return (Criteria) this; + } + + public Criteria andCouTypeCodeNotEqualTo(String value) { + addCriterion("cou_type_code <>", value, "couTypeCode"); + return (Criteria) this; + } + + public Criteria andCouTypeCodeGreaterThan(String value) { + addCriterion("cou_type_code >", value, "couTypeCode"); + return (Criteria) this; + } + + public Criteria andCouTypeCodeGreaterThanOrEqualTo(String value) { + addCriterion("cou_type_code >=", value, "couTypeCode"); + return (Criteria) this; + } + + public Criteria andCouTypeCodeLessThan(String value) { + addCriterion("cou_type_code <", value, "couTypeCode"); + return (Criteria) this; + } + + public Criteria andCouTypeCodeLessThanOrEqualTo(String value) { + addCriterion("cou_type_code <=", value, "couTypeCode"); + return (Criteria) this; + } + + public Criteria andCouTypeCodeLike(String value) { + addCriterion("cou_type_code like", value, "couTypeCode"); + return (Criteria) this; + } + + public Criteria andCouTypeCodeNotLike(String value) { + addCriterion("cou_type_code not like", value, "couTypeCode"); + return (Criteria) this; + } + + public Criteria andCouTypeCodeIn(List values) { + addCriterion("cou_type_code in", values, "couTypeCode"); + return (Criteria) this; + } + + public Criteria andCouTypeCodeNotIn(List values) { + addCriterion("cou_type_code not in", values, "couTypeCode"); + return (Criteria) this; + } + + public Criteria andCouTypeCodeBetween(String value1, String value2) { + addCriterion("cou_type_code between", value1, value2, "couTypeCode"); + return (Criteria) this; + } + + public Criteria andCouTypeCodeNotBetween(String value1, String value2) { + addCriterion("cou_type_code not between", value1, value2, "couTypeCode"); + return (Criteria) this; + } + + public Criteria andCouNoIsNull() { + addCriterion("cou_no is null"); + return (Criteria) this; + } + + public Criteria andCouNoIsNotNull() { + addCriterion("cou_no is not null"); + return (Criteria) this; + } + + public Criteria andCouNoEqualTo(String value) { + addCriterion("cou_no =", value, "couNo"); + return (Criteria) this; + } + + public Criteria andCouNoNotEqualTo(String value) { + addCriterion("cou_no <>", value, "couNo"); + return (Criteria) this; + } + + public Criteria andCouNoGreaterThan(String value) { + addCriterion("cou_no >", value, "couNo"); + return (Criteria) this; + } + + public Criteria andCouNoGreaterThanOrEqualTo(String value) { + addCriterion("cou_no >=", value, "couNo"); + return (Criteria) this; + } + + public Criteria andCouNoLessThan(String value) { + addCriterion("cou_no <", value, "couNo"); + return (Criteria) this; + } + + public Criteria andCouNoLessThanOrEqualTo(String value) { + addCriterion("cou_no <=", value, "couNo"); + return (Criteria) this; + } + + public Criteria andCouNoLike(String value) { + addCriterion("cou_no like", value, "couNo"); + return (Criteria) this; + } + + public Criteria andCouNoNotLike(String value) { + addCriterion("cou_no not like", value, "couNo"); + return (Criteria) this; + } + + public Criteria andCouNoIn(List values) { + addCriterion("cou_no in", values, "couNo"); + return (Criteria) this; + } + + public Criteria andCouNoNotIn(List values) { + addCriterion("cou_no not in", values, "couNo"); + return (Criteria) this; + } + + public Criteria andCouNoBetween(String value1, String value2) { + addCriterion("cou_no between", value1, value2, "couNo"); + return (Criteria) this; + } + + public Criteria andCouNoNotBetween(String value1, String value2) { + addCriterion("cou_no not between", value1, value2, "couNo"); + 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; + } + + public Criteria andActiveTimeIsNull() { + addCriterion("active_time is null"); + return (Criteria) this; + } + + public Criteria andActiveTimeIsNotNull() { + addCriterion("active_time is not null"); + return (Criteria) this; + } + + public Criteria andActiveTimeEqualTo(Date value) { + addCriterion("active_time =", value, "activeTime"); + return (Criteria) this; + } + + public Criteria andActiveTimeNotEqualTo(Date value) { + addCriterion("active_time <>", value, "activeTime"); + return (Criteria) this; + } + + public Criteria andActiveTimeGreaterThan(Date value) { + addCriterion("active_time >", value, "activeTime"); + return (Criteria) this; + } + + public Criteria andActiveTimeGreaterThanOrEqualTo(Date value) { + addCriterion("active_time >=", value, "activeTime"); + return (Criteria) this; + } + + public Criteria andActiveTimeLessThan(Date value) { + addCriterion("active_time <", value, "activeTime"); + return (Criteria) this; + } + + public Criteria andActiveTimeLessThanOrEqualTo(Date value) { + addCriterion("active_time <=", value, "activeTime"); + return (Criteria) this; + } + + public Criteria andActiveTimeIn(List values) { + addCriterion("active_time in", values, "activeTime"); + return (Criteria) this; + } + + public Criteria andActiveTimeNotIn(List values) { + addCriterion("active_time not in", values, "activeTime"); + return (Criteria) this; + } + + public Criteria andActiveTimeBetween(Date value1, Date value2) { + addCriterion("active_time between", value1, value2, "activeTime"); + return (Criteria) this; + } + + public Criteria andActiveTimeNotBetween(Date value1, Date value2) { + addCriterion("active_time not between", value1, value2, "activeTime"); + return (Criteria) this; + } + + public Criteria andValidStartDateIsNull() { + addCriterion("valid_start_date is null"); + return (Criteria) this; + } + + public Criteria andValidStartDateIsNotNull() { + addCriterion("valid_start_date is not null"); + return (Criteria) this; + } + + public Criteria andValidStartDateEqualTo(Date value) { + addCriterion("valid_start_date =", value, "validStartDate"); + return (Criteria) this; + } + + public Criteria andValidStartDateNotEqualTo(Date value) { + addCriterion("valid_start_date <>", value, "validStartDate"); + return (Criteria) this; + } + + public Criteria andValidStartDateGreaterThan(Date value) { + addCriterion("valid_start_date >", value, "validStartDate"); + return (Criteria) this; + } + + public Criteria andValidStartDateGreaterThanOrEqualTo(Date value) { + addCriterion("valid_start_date >=", value, "validStartDate"); + return (Criteria) this; + } + + public Criteria andValidStartDateLessThan(Date value) { + addCriterion("valid_start_date <", value, "validStartDate"); + return (Criteria) this; + } + + public Criteria andValidStartDateLessThanOrEqualTo(Date value) { + addCriterion("valid_start_date <=", value, "validStartDate"); + return (Criteria) this; + } + + public Criteria andValidStartDateIn(List values) { + addCriterion("valid_start_date in", values, "validStartDate"); + return (Criteria) this; + } + + public Criteria andValidStartDateNotIn(List values) { + addCriterion("valid_start_date not in", values, "validStartDate"); + return (Criteria) this; + } + + public Criteria andValidStartDateBetween(Date value1, Date value2) { + addCriterion("valid_start_date between", value1, value2, "validStartDate"); + return (Criteria) this; + } + + public Criteria andValidStartDateNotBetween(Date value1, Date value2) { + addCriterion("valid_start_date not between", value1, value2, "validStartDate"); + return (Criteria) this; + } + + public Criteria andValidEndDateIsNull() { + addCriterion("valid_end_date is null"); + return (Criteria) this; + } + + public Criteria andValidEndDateIsNotNull() { + addCriterion("valid_end_date is not null"); + return (Criteria) this; + } + + public Criteria andValidEndDateEqualTo(Date value) { + addCriterion("valid_end_date =", value, "validEndDate"); + return (Criteria) this; + } + + public Criteria andValidEndDateNotEqualTo(Date value) { + addCriterion("valid_end_date <>", value, "validEndDate"); + return (Criteria) this; + } + + public Criteria andValidEndDateGreaterThan(Date value) { + addCriterion("valid_end_date >", value, "validEndDate"); + return (Criteria) this; + } + + public Criteria andValidEndDateGreaterThanOrEqualTo(Date value) { + addCriterion("valid_end_date >=", value, "validEndDate"); + return (Criteria) this; + } + + public Criteria andValidEndDateLessThan(Date value) { + addCriterion("valid_end_date <", value, "validEndDate"); + return (Criteria) this; + } + + public Criteria andValidEndDateLessThanOrEqualTo(Date value) { + addCriterion("valid_end_date <=", value, "validEndDate"); + return (Criteria) this; + } + + public Criteria andValidEndDateIn(List values) { + addCriterion("valid_end_date in", values, "validEndDate"); + return (Criteria) this; + } + + public Criteria andValidEndDateNotIn(List values) { + addCriterion("valid_end_date not in", values, "validEndDate"); + return (Criteria) this; + } + + public Criteria andValidEndDateBetween(Date value1, Date value2) { + addCriterion("valid_end_date between", value1, value2, "validEndDate"); + return (Criteria) this; + } + + public Criteria andValidEndDateNotBetween(Date value1, Date value2) { + addCriterion("valid_end_date not between", value1, value2, "validEndDate"); + 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 values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List 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 values) { + addCriterion("ext_1 in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotIn(List 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 values) { + addCriterion("ext_2 in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotIn(List 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 values) { + addCriterion("ext_3 in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotIn(List 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); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/service/HighCouponCodeOtherService.java b/hai-service/src/main/java/com/hai/service/HighCouponCodeOtherService.java new file mode 100644 index 00000000..97d377f4 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/HighCouponCodeOtherService.java @@ -0,0 +1,17 @@ +package com.hai.service; + +import com.hai.entity.HighCouponCodeOther; + +import java.util.List; +import java.util.Map; + +public interface HighCouponCodeOtherService { + + /** + * 查询列表 + * @param map + * @return + */ + List getList(Map map); + +} diff --git a/hai-service/src/main/java/com/hai/service/HighUserPayPasswordService.java b/hai-service/src/main/java/com/hai/service/HighUserPayPasswordService.java new file mode 100644 index 00000000..9ca191cb --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/HighUserPayPasswordService.java @@ -0,0 +1,23 @@ +package com.hai.service; + +import com.hai.entity.HighUserPayPassword; + +/** + * 用户支付密码 + */ +public interface HighUserPayPasswordService { + + /** + * 用户密码编辑 + * @param highUserPayPassword + */ + void editUserPayPwd(HighUserPayPassword highUserPayPassword); + + /** + * 根据用户查询密码 + * @param userId + * @return + */ + HighUserPayPassword getDetailByUser(Long userId); + +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeOtherServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeOtherServiceImpl.java new file mode 100644 index 00000000..d96fb8bb --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeOtherServiceImpl.java @@ -0,0 +1,38 @@ +package com.hai.service.impl; + +import com.hai.dao.HighCouponCodeOtherMapper; +import com.hai.entity.HighCouponCodeOther; +import com.hai.entity.HighCouponCodeOtherExample; +import com.hai.service.HighCouponCodeOtherService; +import org.apache.commons.collections4.MapUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +@Service("highCouponCodeOtherService") +public class HighCouponCodeOtherServiceImpl implements HighCouponCodeOtherService { + + @Resource + private HighCouponCodeOtherMapper highCouponCodeOtherMapper; + + @Override + public List getList(Map map) { + HighCouponCodeOtherExample example = new HighCouponCodeOtherExample(); + HighCouponCodeOtherExample.Criteria criteria = example.createCriteria(); + + if (MapUtils.getInteger(map,"type") != null) { + criteria.andTypeEqualTo(MapUtils.getInteger(map,"type")); + } + + if (MapUtils.getLong(map,"orderId") != null) { + criteria.andOrderIdEqualTo(MapUtils.getLong(map,"orderId")); + } + + if (MapUtils.getInteger(map,"childOrderId") != null) { + criteria.andChildOrderIdEqualTo(MapUtils.getLong(map,"childOrderId")); + } + return highCouponCodeOtherMapper.selectByExample(example); + } +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index 859ba8ca..0a69b04e 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -1,5 +1,6 @@ package com.hai.service.impl; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.hai.common.QRCodeGenerator; import com.hai.common.exception.ErrorCode; @@ -57,6 +58,9 @@ public class HighOrderServiceImpl implements HighOrderService { @Resource private HighCouponHandselService highCouponHandselService; + @Resource + private HighCouponCodeOtherMapper highCouponCodeOtherMapper; + @Resource private HighUserService highUserService; @@ -195,7 +199,24 @@ public class HighOrderServiceImpl implements HighOrderService { // 推送给高速 JSONObject returnParam = HuiLianTongConfig.couJointDist(tokenObject.getString("data"), coupon.getCouponKey(), highChildOrder.getSaleCount(), highUser.getPhone(), highUser.getUnionId()); - + if (returnParam != null && returnParam.getString("result").equals("success")) { + JSONArray dataArray = returnParam.getJSONArray("data"); + for (Object data : dataArray) { + JSONObject dataObject = (JSONObject) data; + HighCouponCodeOther couponCodeOther = new HighCouponCodeOther(); + couponCodeOther.setType(1); + couponCodeOther.setOrderId(highOrder.getId()); + couponCodeOther.setChildOrderId(highChildOrder.getId()); + couponCodeOther.setCouTypeCode(dataObject.getString("couTypeCode")); + couponCodeOther.setCouNo(dataObject.getString("couNo")); + couponCodeOther.setActiveTime(dataObject.getDate("activeTime")); + couponCodeOther.setValidStartDate(dataObject.getDate("validStartDate")); + couponCodeOther.setValidEndDate(dataObject.getDate("validEndDate")); + couponCodeOther.setStatus(20); + couponCodeOther.setCreateTime(new Date()); + highCouponCodeOtherMapper.insert(couponCodeOther); + } + } // 推送记录 HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); highGasOrderPush.setCreateTime(new Date()); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighUserPayPasswordServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighUserPayPasswordServiceImpl.java new file mode 100644 index 00000000..d03a4347 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/HighUserPayPasswordServiceImpl.java @@ -0,0 +1,41 @@ +package com.hai.service.impl; + +import com.hai.dao.HighUserPayPasswordMapper; +import com.hai.entity.HighUserPayPassword; +import com.hai.entity.HighUserPayPasswordExample; +import com.hai.service.HighUserPayPasswordService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +@Service("highUserPayPasswordService") +public class HighUserPayPasswordServiceImpl implements HighUserPayPasswordService { + + @Resource + private HighUserPayPasswordMapper highUserPayPasswordMapper; + + @Override + public void editUserPayPwd(HighUserPayPassword highUserPayPassword) { + if (highUserPayPassword.getId() != null) { + highUserPayPassword.setUpdateTime(new Date()); + highUserPayPasswordMapper.updateByPrimaryKey(highUserPayPassword); + } else { + highUserPayPassword.setCreateTime(new Date()); + highUserPayPassword.setUpdateTime(new Date()); + highUserPayPasswordMapper.insert(highUserPayPassword); + } + } + + @Override + public HighUserPayPassword getDetailByUser(Long userId) { + HighUserPayPasswordExample example = new HighUserPayPasswordExample(); + example.createCriteria().andUserIdEqualTo(userId); + List list = highUserPayPasswordMapper.selectByExample(example); + if (list.size() > 0) { + return list.get(0); + } + return null; + } +} diff --git a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java index b59f0059..c6d85b5a 100644 --- a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java @@ -1,5 +1,6 @@ package com.hai.service.pay.impl; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; @@ -10,6 +11,7 @@ import com.hai.common.utils.WxUtils; import com.hai.config.CommonSysConst; import com.hai.config.HuiLianTongConfig; import com.hai.config.TuanYouConfig; +import com.hai.dao.HighCouponCodeOtherMapper; import com.hai.dao.HighGasOrderPushMapper; import com.hai.dao.HighUserCouponMapper; import com.hai.entity.*; @@ -73,6 +75,9 @@ public class GoodsOrderServiceImpl implements PayService { @Resource private HighProfitSharingRecordService highProfitSharingRecordService; + @Resource + private HighCouponCodeOtherMapper highCouponCodeOtherMapper; + @Override @Transactional(propagation= Propagation.REQUIRES_NEW) public void paySuccess(Map map, String payType) throws Exception { @@ -126,6 +131,24 @@ public class GoodsOrderServiceImpl implements PayService { // 推送给高速 JSONObject returnParam = HuiLianTongConfig.couJointDist(tokenObject.getString("data"), coupon.getCouponKey(), highChildOrder.getSaleCount(), highUser.getPhone(), highUser.getUnionId()); + if (returnParam != null && returnParam.getString("result").equals("success")) { + JSONArray dataArray = returnParam.getJSONArray("data"); + for (Object data : dataArray) { + JSONObject dataObject = (JSONObject) data; + HighCouponCodeOther couponCodeOther = new HighCouponCodeOther(); + couponCodeOther.setType(1); + couponCodeOther.setOrderId(order.getId()); + couponCodeOther.setChildOrderId(highChildOrder.getId()); + couponCodeOther.setCouTypeCode(dataObject.getString("couTypeCode")); + couponCodeOther.setCouNo(dataObject.getString("couNo")); + couponCodeOther.setStatus(20); + couponCodeOther.setCreateTime(new Date()); + couponCodeOther.setActiveTime(dataObject.getDate("activeTime")); + couponCodeOther.setValidStartDate(dataObject.getDate("validStartDate")); + couponCodeOther.setValidEndDate(dataObject.getDate("validEndDate")); + highCouponCodeOtherMapper.insert(couponCodeOther); + } + } // 推送记录 HighGasOrderPush highGasOrderPush = new HighGasOrderPush();