dev-discount
胡锐 2 years ago
commit 2650933acb
  1. 100
      hai-bweb/src/main/java/com/bweb/config/msg/MerStoreAccountChgHandler.java
  2. 130
      hai-bweb/src/main/java/com/bweb/controller/BsMsgController.java
  3. 204
      hai-bweb/src/main/java/com/bweb/controller/CmsContentController.java
  4. 20
      hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java
  5. 13
      hai-bweb/src/main/resources/dev/application.yml
  6. 85
      hai-cweb/src/main/java/com/cweb/controller/CmsContentController.java
  7. 9
      hai-cweb/src/main/java/com/cweb/controller/CommonController.java
  8. 11
      hai-cweb/src/main/java/com/cweb/controller/HighUserController.java
  9. 38
      hai-cweb/src/main/java/com/cweb/controller/WechatController.java
  10. 46
      hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java
  11. 2
      hai-cweb/src/main/resources/dev/application.yml
  12. 2
      hai-order/src/main/java/com/web/controller/OrderPayController.java
  13. 2
      hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java
  14. 44
      hai-service/src/main/java/com/hai/common/utils/WxUtils.java
  15. 58
      hai-service/src/main/java/com/hai/config/CmsContentConfig.java
  16. 146
      hai-service/src/main/java/com/hai/dao/BsMsgMapper.java
  17. 7
      hai-service/src/main/java/com/hai/dao/BsMsgMapperExt.java
  18. 402
      hai-service/src/main/java/com/hai/dao/BsMsgSqlProvider.java
  19. 125
      hai-service/src/main/java/com/hai/dao/BsMsgUserMapper.java
  20. 7
      hai-service/src/main/java/com/hai/dao/BsMsgUserMapperExt.java
  21. 332
      hai-service/src/main/java/com/hai/dao/BsMsgUserSqlProvider.java
  22. 101
      hai-service/src/main/java/com/hai/dao/CmsCategoryMapper.java
  23. 21
      hai-service/src/main/java/com/hai/dao/CmsCategorySqlProvider.java
  24. 39
      hai-service/src/main/java/com/hai/dao/CmsContentMapper.java
  25. 5
      hai-service/src/main/java/com/hai/dao/CmsContentMapperExt.java
  26. 16
      hai-service/src/main/java/com/hai/dao/CmsContentSqlProvider.java
  27. 321
      hai-service/src/main/java/com/hai/entity/BsMsg.java
  28. 1313
      hai-service/src/main/java/com/hai/entity/BsMsgExample.java
  29. 241
      hai-service/src/main/java/com/hai/entity/BsMsgUser.java
  30. 993
      hai-service/src/main/java/com/hai/entity/BsMsgUserExample.java
  31. 17
      hai-service/src/main/java/com/hai/entity/CmsCategory.java
  32. 62
      hai-service/src/main/java/com/hai/entity/CmsCategoryExample.java
  33. 32
      hai-service/src/main/java/com/hai/entity/CmsContent.java
  34. 60
      hai-service/src/main/java/com/hai/entity/CmsContentExample.java
  35. 52
      hai-service/src/main/java/com/hai/enum_type/CmsContentDataEnum.java
  36. 53
      hai-service/src/main/java/com/hai/model/TextMessage.java
  37. 58
      hai-service/src/main/java/com/hai/service/BsMsgService.java
  38. 20
      hai-service/src/main/java/com/hai/service/CmsCategoryService.java
  39. 50
      hai-service/src/main/java/com/hai/service/CmsContentService.java
  40. 90
      hai-service/src/main/java/com/hai/service/impl/BsMsgServiceImpl.java
  41. 25
      hai-service/src/main/java/com/hai/service/impl/CmsCategoryServiceImpl.java
  42. 51
      hai-service/src/main/java/com/hai/service/impl/CmsContentServiceImpl.java
  43. 26
      hai-service/src/main/java/com/hai/service/impl/CommonServiceImpl.java
  44. 4
      hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java
  45. 2
      hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageServiceImpl.java
  46. 50
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  47. 19
      v1/src/main/java/com/v1/config/SysConfig.java
  48. 85
      v1/src/main/java/com/v1/config/WeChatQrcodeUtils.java
  49. 58
      v1/src/main/java/com/v1/config/WxConfig.java
  50. 230
      v1/src/main/java/com/v1/controller/WxMsgController.java
  51. 30
      v1/src/main/resources/dev/application.yml
  52. 3
      v1/src/main/resources/dev/config.properties
  53. 2
      v1/src/main/resources/prod/config.properties

@ -33,55 +33,55 @@ public class MerStoreAccountChgHandler {
@PostConstruct
public void init() {
new Thread(() -> {
{
//消息处理
while (true){
try {
//构建的队列为左进右出
Object o = redisTemplate.opsForList().rightPop(MsgTopic.MerStoreAccount.getName());
if (o != null) {
//处理消息
logger.info("消息通道:"+o);
Map<String, Object> param = (Map<String, Object>) o;
if (MapUtils.getInteger(param, "businessType").equals(MerStoreAmountTypeEnum.type1.getType())) {
Map<String, Object> otherParam = new HashMap<>();
otherParam.put("sourceType", MapUtils.getString(param, "sourceType"));
otherParam.put("sourceId", MapUtils.getString(param, "sourceId"));
otherParam.put("sourceContent", MapUtils.getString(param, "sourceContent"));
otherParam.put("opUserId", MapUtils.getLong(param, "opUserId"));
otherParam.put("opUserName", MapUtils.getString(param, "opUserName"));
merchantStoreAccountService.recharge(
MapUtils.getLong(param, "storeId"),
new BigDecimal(MapUtils.getString(param, "price")),
otherParam);
}
if (MapUtils.getInteger(param, "businessType").equals(MerStoreAmountTypeEnum.type2.getType())) {
Map<String, Object> otherParam = new HashMap<>();
otherParam.put("sourceType", MapUtils.getString(param, "sourceType"));
otherParam.put("sourceId", MapUtils.getString(param, "sourceId"));
otherParam.put("sourceContent", MapUtils.getString(param, "sourceContent"));
otherParam.put("opUserId", MapUtils.getLong(param, "opUserId"));
otherParam.put("opUserName", MapUtils.getString(param, "opUserName"));
merchantStoreAccountService.consume(
MapUtils.getLong(param, "storeId"),
new BigDecimal(MapUtils.getString(param, "price")),
otherParam);
}
} else {
Thread.sleep(1000);
}
}catch (Exception e){
logger.error("监听订单状态变更错误",e);
}
}
}
}).start();
// new Thread(() -> {
// {
// //消息处理
// while (true){
// try {
// //构建的队列为左进右出
// Object o = redisTemplate.opsForList().rightPop(MsgTopic.MerStoreAccount.getName());
// if (o != null) {
// //处理消息
// logger.info("消息通道:"+o);
//
// Map<String, Object> param = (Map<String, Object>) o;
//
// if (MapUtils.getInteger(param, "businessType").equals(MerStoreAmountTypeEnum.type1.getType())) {
// Map<String, Object> otherParam = new HashMap<>();
// otherParam.put("sourceType", MapUtils.getString(param, "sourceType"));
// otherParam.put("sourceId", MapUtils.getString(param, "sourceId"));
// otherParam.put("sourceContent", MapUtils.getString(param, "sourceContent"));
// otherParam.put("opUserId", MapUtils.getLong(param, "opUserId"));
// otherParam.put("opUserName", MapUtils.getString(param, "opUserName"));
//
// merchantStoreAccountService.recharge(
// MapUtils.getLong(param, "storeId"),
// new BigDecimal(MapUtils.getString(param, "price")),
// otherParam);
// }
//
// if (MapUtils.getInteger(param, "businessType").equals(MerStoreAmountTypeEnum.type2.getType())) {
// Map<String, Object> otherParam = new HashMap<>();
// otherParam.put("sourceType", MapUtils.getString(param, "sourceType"));
// otherParam.put("sourceId", MapUtils.getString(param, "sourceId"));
// otherParam.put("sourceContent", MapUtils.getString(param, "sourceContent"));
// otherParam.put("opUserId", MapUtils.getLong(param, "opUserId"));
// otherParam.put("opUserName", MapUtils.getString(param, "opUserName"));
//
// merchantStoreAccountService.consume(
// MapUtils.getLong(param, "storeId"),
// new BigDecimal(MapUtils.getString(param, "price")),
// otherParam);
// }
//
// } else {
// Thread.sleep(1000);
// }
// }catch (Exception e){
// logger.error("监听订单状态变更错误",e);
// }
// }
// }
// }).start();
}
}

@ -0,0 +1,130 @@
package com.bweb.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
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.utils.ResponseMsgUtil;
import com.hai.entity.BsMsg;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.service.BsMsgService;
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.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author sum1dream
*/
@Controller
@RequestMapping(value = "/bsMsg")
@Api(value = "站内信")
public class BsMsgController {
Logger log = LoggerFactory.getLogger(ApiProductController.class);
@Resource
private BsMsgService bsMsgService;
@Autowired
private UserCenter userCenter;
@RequestMapping(value = "/getMsgByList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询站内信列表")
public ResponseData getMsgByList(
@RequestParam(value = "type", required = false) Integer type,
@RequestParam(value = "jumpType", required = false) Integer jumpType,
@RequestParam(value = "msgType", required = false) Integer msgType,
@RequestParam(value = "title", required = false) String title,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request
) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
Map<String, Object> map = new HashMap<>(5);
map.put("type", type);
map.put("jumpType", jumpType);
map.put("msgType", msgType);
map.put("title", title);
map.put("companyId" , userInfoModel.getBsCompany().getId());
PageHelper.startPage(pageNum,pageSize);
List<BsMsg> list = bsMsgService.getMsgByList(map);
return ResponseMsgUtil.success(new PageInfo<>(list));
} catch (Exception e) {
log.error("BsMsgController --> getMsgByList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "insertMsg" , method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "新增站内信")
public ResponseData insertMsg(@RequestBody BsMsg bsMsg , HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
bsMsg.setCompanyId(userInfoModel.getBsCompany().getId());
bsMsg.setOpId(userInfoModel.getSecUser().getId());
bsMsg.setOpName(userInfoModel.getSecUser().getUserName());
bsMsg.setMsgType(2);
bsMsg.setStatus(1);
bsMsg.setCreateTime(new Date());
bsMsg.setUpdateTime(new Date());
bsMsgService.insertMsg(bsMsg , null);
return ResponseMsgUtil.success("新增成功");
} catch (Exception e) {
log.error("BsMsgController --> insertMsg() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/pushMsg", method = RequestMethod.GET)
@ApiOperation(value = "发布站内信")
@ResponseBody
public ResponseData pushMsg(@RequestParam(value = "id", required = true) Long id) {
try {
BsMsg bsMsg = bsMsgService.findMsg(id);
if (bsMsg == null) {
throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR, "为查询到相关内容!");
}
if (bsMsg.getStatus() !=1) {
throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "当前状态错误");
}
bsMsg.setStatus(2);
bsMsg.setUpdateTime(new Date());
bsMsgService.updateMsg(bsMsg);
return ResponseMsgUtil.success("发布成功");
} catch (Exception e) {
log.error("CmsContentController --> delContent() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -11,11 +11,12 @@ import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.ResponseMsgUtil;
import com.bweb.config.SysConfig;
import com.hai.entity.CmsContent;
import com.hai.entity.CmsPatch;
import com.hai.entity.*;
import com.hai.model.CmsContentModel;
import com.hai.model.OutRechargePriceModel;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.service.CmsCategoryService;
import com.hai.service.CmsContentService;
import com.hai.service.CmsPatchService;
import io.swagger.annotations.Api;
@ -28,6 +29,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.*;
@Controller
@ -45,9 +47,13 @@ public class CmsContentController {
@Resource
private CmsContentService cmsContentService;
@Resource
private CmsPatchService cmsPatchService;
@Resource
private CmsCategoryService cmsCategoryService;
@RequestMapping(value = "/addContent", method = RequestMethod.POST)
@ApiOperation(value = "创建内容")
@ResponseBody
@ -180,9 +186,10 @@ public class CmsContentController {
@ApiOperation(value = "查询内容列表(不包括附件)")
@ResponseBody
public ResponseData getListContent(@RequestParam(value = "title", required = false) String title,
@RequestParam(value = "category", required = false) Long category,
@RequestParam(value = "categoryId", required = false) Long categoryId,
@RequestParam(value = "categoryCode", required = false) String categoryCode,
@RequestParam(value = "tag", required = false) String tag,
@RequestParam(value = "platform", required = false) String platform,
@RequestParam(value = "status", required = false) Integer status,
@RequestParam(value = "companyId", required = false) Long companyId,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@ -192,8 +199,11 @@ public class CmsContentController {
if (StringUtils.isNotBlank(title)) {
paramsMap.put("title", title);
}
if (category != null) {
paramsMap.put("category", category.toString());
if (categoryId != null) {
paramsMap.put("categoryId", categoryId.toString());
}
if (platform != null) {
paramsMap.put("platform", platform);
}
if (categoryCode != null) {
paramsMap.put("categoryCode", categoryCode);
@ -216,7 +226,35 @@ public class CmsContentController {
}
}
@RequestMapping(value = "/getListCmsContent", method = RequestMethod.GET)
@ApiOperation(value = "查询内容列表(不包括附件)")
@ResponseBody
public ResponseData getListCmsContent(@RequestParam(value = "title", required = false) String title,
@RequestParam(value = "categoryId", required = false) Long categoryId,
@RequestParam(value = "platform", required = false) Integer platform,
@RequestParam(value = "status", required = false) Integer status,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
Map<String, Object> paramsMap = new HashMap<>();
paramsMap.put("title", title);
paramsMap.put("platform", platform);
paramsMap.put("categoryId", categoryId);
paramsMap.put("status", status);
paramsMap.put("companyId", userInfoModel.getBsCompany().getId());
PageHelper.startPage(pageNum, pageSize);
return ResponseMsgUtil.success(new PageInfo<>(cmsContentService.getListCmsContent(paramsMap)));
} catch (Exception e) {
log.error("CmsContentController --> getListContent() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/updateStatusOfContent", method = RequestMethod.POST)
@ApiOperation(value = "更新 内容发布状态")
@ -391,4 +429,160 @@ public class CmsContentController {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/insertCmsContent", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "新增CMS内容")
public ResponseData insertCmsContent(@RequestBody CmsContent cmsContent, HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (cmsContent == null ||
cmsContent.getCategoryId() == null ||
cmsContent.getTitle() == null ||
cmsContent.getSortId() == null ||
cmsContent.getDescription() == null
) {
log.error("CmsContentController -> insertPrice() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 获取分类信息
CmsCategory category = cmsCategoryService.getCategoryById(cmsContent.getCategoryId());
for (Integer platform : cmsContent.getPlatformArray()) {
cmsContent.setUpdateTime(new Date());
cmsContent.setCreateTime(new Date());
cmsContent.setStatus(1);
cmsContent.setPlatform(platform);
cmsContent.setCategoryCode(category.getCode());
cmsContent.setCompanyId(userInfoModel.getBsCompany().getId());
cmsContent.setCompanyName(userInfoModel.getBsCompany().getName());
cmsContent.setOpId(userInfoModel.getSecUser().getId());
cmsContent.setUserName(userInfoModel.getSecUser().getUserName());
cmsContent.setTag(category.getName());
cmsContentService.insertCmsContent(cmsContent);
}
return ResponseMsgUtil.success("新增成功");
} catch (Exception e) {
log.error("CmsContentController --> insertPrice() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/updateCmsContent", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "修改CMS内容")
public ResponseData updateCmsContent(@RequestBody CmsContent cmsContent, HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (cmsContent == null ||
cmsContent.getId() == null ||
cmsContent.getCategoryId() == null ||
cmsContent.getTitle() == null ||
cmsContent.getSortId() == null ||
cmsContent.getDescription() == null
) {
log.error("CmsContentController -> updateCmsContent() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
CmsContent content = cmsContentService.findById(cmsContent.getId());
// 获取分类信息
CmsCategory category = cmsCategoryService.getCategoryById(cmsContent.getCategoryId());
if (content == null) {
log.error("CmsContentController -> updateCmsContent() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR , "未找到匹配数据!");
}
cmsContent.setUpdateTime(new Date());
cmsContent.setStatus(1);
cmsContent.setCreateTime(content.getCreateTime());
cmsContent.setOpId(userInfoModel.getSecUser().getId());
cmsContent.setUserName(userInfoModel.getSecUser().getUserName());
cmsContent.setCompanyName(content.getCompanyName());
cmsContent.setCompanyId(content.getCompanyId());
cmsContent.setCategoryCode(category.getCode());
cmsContent.setTag(category.getName());
cmsContentService.updateCmsContent(cmsContent);
return ResponseMsgUtil.success("修改成功");
} catch (Exception e) {
log.error("CmsContentController --> updateCmsContent() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/updateContentStatus",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "修改内容状态")
public ResponseData updateContentStatus(@RequestParam(name = "id", required = true) Long id,
@RequestParam(name = "status", required = true) Integer status) {
try {
// 查询优惠券
CmsContent cmsContent = cmsContentService.findById(id);
if (cmsContent == null) {
log.error("CmsContentController -> updateContentStatus() error!","未找到相关信息");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到相关信息");
}
cmsContent.setStatus(status);
cmsContent.setUpdateTime(new Date());
cmsContentService.updateCmsContent(cmsContent);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighDiscountController -> updateDiscountStatus() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/findById", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据id查询详情")
public ResponseData findById(@RequestParam(value = "id", required = true) Long id) {
try {
return ResponseMsgUtil.success(cmsContentService.findById(id));
} catch (Exception e) {
log.error("CmsContentController --> findById() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/deleteById", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据id删除内容")
public ResponseData deleteById(@RequestParam(value = "id", required = true) Long id) {
try {
CmsContent content = cmsContentService.findById(id);
if (content == null) {
log.error("CmsContentController -> updateCmsContent() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR , "未找到匹配数据!");
}
if (content.getStatus() == 2) {
log.error("CmsContentController -> updateCmsContent() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR , "当前状态不可删除!");
}
content.setStatus(0);
cmsContentService.updateCmsContent(content);
return ResponseMsgUtil.success("删除成功");
} catch (Exception e) {
log.error("CmsContentController --> findById() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -10,6 +10,7 @@ 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.utils.HttpsUtils;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.CommonSysConst;
import com.hai.entity.BsCompany;
@ -363,5 +364,24 @@ public class HighMerchantStoreController {
}
}
@RequestMapping(value = "/getQrCode", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "生成推广二维码")
public ResponseData getQrCode(@RequestParam(name = "storeKey", required = false) String storeKey) {
try {
Map<String, Object> params = new HashMap<>();
params.put("type", "2");
params.put("code", storeKey);
return ResponseMsgUtil.success(HttpsUtils.doGet("https://hsg.dctpay.com/v1/wxMsg/createQrcode", params).getString("return_data"));
} catch (Exception e) {
log.error("HighOrderController --> getBackendToken() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -53,6 +53,12 @@ spring:
#MQTT默认的消息推送主题,实际可在调用接口是指定
# default:
# topic: topic
rocketmq:
name-server: 139.159.177.244:9876
producer:
#必须指定group
group: default-group
#配置日期返回至前台为时间戳
jackson:
serialization:
@ -62,13 +68,6 @@ mybatis:
- classpath*:sqlmap*/*.xml
type-aliases-package:
org.springboot.sample.entity
rocketmq:
name-server: 139.159.177.244:9876
producer:
#必须指定group
group: default-group
jetcache:
statIntervalMinutes: 15
areaInCacheName: false

@ -1,17 +1,16 @@
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.utils.ResponseMsgUtil;
import com.hai.entity.BsCompany;
import com.hai.entity.CmsContent;
import com.hai.entity.CmsPatch;
import com.hai.entity.SecRegion;
import com.hai.config.CmsContentConfig;
import com.hai.entity.*;
import com.hai.model.CmsContentModel;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.service.BsCompanyService;
import com.hai.service.CmsContentService;
import com.hai.service.CmsPatchService;
import com.hai.service.CommonService;
import com.hai.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
@ -37,28 +36,76 @@ public class CmsContentController {
@Resource
private CmsContentService cmsContentService;
@Resource
private CmsCategoryService cmsCategoryService;
@Resource
private BsCompanyService bsCompanyService;
@Resource
private CmsContentConfig cmsContentConfig;
@RequestMapping(value = "/getCmsContent", method = RequestMethod.GET)
@ApiOperation(value = "查询首页轮播图")
@ResponseBody
public ResponseData getCmsContent(@RequestParam(name = "regionId", required = true) String regionId,
public ResponseData getCmsContent(@RequestParam(name = "companyId", required = true) Long companyId,
@RequestParam(name = "platform", required = true) Integer platform,
@RequestParam(name = "categoryCode", required = true) String categoryCode) {
try {
SecRegion region = commonService.getParentByRegion(Long.parseLong(regionId));
if (region != null) {
BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString());
if (bsCompany != null) {
Map<String,String> map = new HashMap<>();
map.put("companyId", bsCompany.getId().toString());
map.put("status", "2");
map.put("categoryCode", categoryCode);
return ResponseMsgUtil.success(cmsContentService.getListContentByCrest(map));
CmsCategory category = cmsCategoryService.getCategoryByCode(categoryCode);
if (category == null) {
log.error("CmsContentController --> getCmsContent() error!");
throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "未找到当前信息");
}
if (category.getParentId() == null) {
List<CmsCategory> categoryList = cmsCategoryService.getCategoryByParentId(category.getId());
List<JSONObject> objectList = new ArrayList<>();
for (CmsCategory cmsCategory : categoryList) {
JSONObject object = new JSONObject();
// 1.小图一行四个 2.轮播图 3.消息通知 4.大图展示 5.一横图三小图 6.数据库数据 7.小图一行五个
if (cmsCategory.getType() == 1 || cmsCategory.getType() == 2 || cmsCategory.getType() == 4 || cmsCategory.getType() == 5|| cmsCategory.getType() == 7 || cmsCategory.getType() == 8 ) {
object.put("type" , cmsCategory.getType());
object.put("name" , cmsCategory.getName());
object.put("sort" , cmsCategory.getSort());
object.put("code" , cmsCategory.getCode());
object.put("childCategory" , cmsContentService.getListCmsContentByCategoryId(cmsCategory.getId() , companyId , platform));
} else if(cmsCategory.getType() == 6 || cmsCategory.getType() == 9) {
object.put("type" , cmsCategory.getType());
object.put("name" , cmsCategory.getName());
object.put("sort" , cmsCategory.getSort());
object.put("code" , cmsCategory.getCode());
List<CmsContent> cmsContent = cmsContentService.getListCmsContentByCategoryId(cmsCategory.getId() , companyId , platform);
object.put("jumpType" , cmsContent.get(0).getJumpType());
object.put("jumpUrl" , cmsContent.get(0).getJumpUrl());
object.put("childDate" , cmsContentConfig.getCmsContentData(cmsCategory.getName() , companyId));
} else if(cmsCategory.getType() == 3) {
object.put("type" , cmsCategory.getType());
object.put("name" , cmsCategory.getName());
object.put("sort" , cmsCategory.getSort());
object.put("code" , cmsCategory.getCode());
object.put("childDate" , null);
}
objectList.add(object);
}
return ResponseMsgUtil.success(objectList);
} else {
JSONObject object = new JSONObject();
object.put("type" , category.getType());
object.put("name" , category.getName());
object.put("sort" , category.getSort());
object.put("code" , category.getCode());
object.put("childCategory" , cmsContentService.getListCmsContentByCategoryId(category.getId() , companyId , platform));
return ResponseMsgUtil.success(object);
}
return ResponseMsgUtil.success(new ArrayList<>());
} catch (Exception e) {
log.error("CmsContentController --> getCorporateAdvertising() error!", e);
return ResponseMsgUtil.exception(e);

@ -287,8 +287,17 @@ public class CommonController {
) {
try {
JSONObject jsonObjectR = commonService.findByLatAndLng(lng , lat);
if (!jsonObjectR.getString("status").equals("0")) {
log.error("findByLatAndLng error!", "定位错误,请重新定位" );
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "定位错误,请重新定位");
}
JSONObject object = commonService.findByLatAndLng(lng , lat).getJSONObject("result").getJSONObject("addressComponent");
ApiCity apiCity = commonService.findCityByName(object.getString("city"));
if (apiCity == null) {

@ -8,13 +8,12 @@ import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.security.*;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.ImageUtils;
import com.hai.common.utils.RedisUtil;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.CommonConfig;
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;
@ -22,7 +21,6 @@ import com.hai.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.util.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -348,11 +346,12 @@ public class HighUserController {
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
String path = ImageUtils.QrCodeImg(SysConst.getSysConfig().getQrCodeUrl() , userInfoModel.getHighUser().getId().intValue());
Map<String, Object> params = new HashMap<>();
CommonConfig.overlapImage(path , userInfoModel.getHighUser().getId().toString());
params.put("type", "1");
params.put("code", userInfoModel.getHighUser().getId());
return ResponseMsgUtil.success(HttpsUtils.doGet("https://hsg.dctpay.com/v1/wxMsg/createQrcode", params).getString("return_data"));
return ResponseMsgUtil.success(SysConst.getSysConfig().getImgUrl() + path);
} catch (Exception e) {
log.error("HighOrderController --> getBackendToken() error!", e);
return ResponseMsgUtil.exception(e);

@ -15,10 +15,7 @@ import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.security.*;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.IDGenerator;
import com.hai.common.utils.RedisUtil;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.common.utils.*;
import com.hai.entity.HighUser;
import com.hai.model.HighUserModel;
import com.hai.model.ResponseData;
@ -371,4 +368,37 @@ public class WechatController {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/verifyWx", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "微信签名")
public ResponseData verifyWx(@RequestParam(value = "url", required = true) String url) {
try {
Map<String, Object> params = new HashMap<>();
params.put("appid", SysConst.getSysConfig().getWxH5AppId());
params.put("secret", SysConst.getSysConfig().getWxH5AppSecret());
params.put("grant_type", "client_credential");
JSONObject accessTokenObject = HttpsUtils.doGet("https://api.weixin.qq.com/cgi-bin/token", params);
Map<String, Object> map = new HashMap<>();
map.put("noncestr",WxUtils.makeNonStr());
map.put("jsapi_ticket",accessTokenObject.getString("ticket"));
map.put("timestamp", new Date().getTime());
map.put("url",url);
Map<String, Object> objectMap = new HashMap<>();
objectMap.put("appId" , params.get("appId"));
objectMap.put("timestamp" , map.get("timestamp"));
objectMap.put("nonceStr" , map.get("nonceStr"));
objectMap.put("signature" , WxUtils.getSHA1(map));
return ResponseMsgUtil.success(objectMap);
} catch (Exception e) {
return null;
}
}
}

@ -121,16 +121,19 @@ public class CzOrderController {
// 判断是否充值成功
if (dataObject.getInteger("status") == 3) {
new Thread(() -> {
HighUser highUser = highUserService.findByUserId(rechargeOrder.getUserId());
WxMsgConfig.rechargedSuccess(
rechargeOrder.getRechargeContent() + "充值成功",
String.valueOf(rechargeOrder.getPayRealPrice()),
rechargeOrder.getOrderNo(),
rechargeOrder.getFinishTime(),
RechargePayType.getNameByType(rechargeOrder.getPayType()),
highUser.getOpenId());
}).start();
if (rechargeOrder.getRechargeStatus() ==201) {
new Thread(() -> {
HighUser highUser = highUserService.findByUserId(rechargeOrder.getUserId());
WxMsgConfig.rechargedSuccess(
rechargeOrder.getRechargeContent() + "充值成功",
String.valueOf(rechargeOrder.getPayRealPrice()),
rechargeOrder.getOrderNo(),
rechargeOrder.getFinishTime(),
RechargePayType.getNameByType(rechargeOrder.getPayType()),
highUser.getOpenId());
}).start();
}
childOrder.setStatus(101);
rechargeOrder.setRechargeStatus(202);
rechargeOrder.setPayStatus(100);
@ -188,16 +191,19 @@ public class CzOrderController {
// 判断是否充值成功
if (state == 1) {
new Thread(() -> {
HighUser highUser = highUserService.findByUserId(rechargeOrder.getUserId());
WxMsgConfig.rechargedSuccess(
rechargeOrder.getRechargeContent() + "充值成功",
String.valueOf(rechargeOrder.getPayRealPrice()),
rechargeOrder.getOrderNo(),
rechargeOrder.getFinishTime(),
RechargePayType.getNameByType(rechargeOrder.getPayType()),
highUser.getOpenId());
}).start();
if (rechargeOrder.getRechargeStatus() ==201) {
new Thread(() -> {
HighUser highUser = highUserService.findByUserId(rechargeOrder.getUserId());
WxMsgConfig.rechargedSuccess(
rechargeOrder.getRechargeContent() + "充值成功",
String.valueOf(rechargeOrder.getPayRealPrice()),
rechargeOrder.getOrderNo(),
rechargeOrder.getFinishTime(),
RechargePayType.getNameByType(rechargeOrder.getPayType()),
highUser.getOpenId());
}).start();
}
childOrder.setStatus(101);
rechargeOrder.setRechargeStatus(202);
rechargeOrder.setPayStatus(100);

@ -9,7 +9,7 @@ debug: false
#datasource数据源设置
spring:
datasource:
url: jdbc:mysql://139.159.177.244:3306/hfkj?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
url: jdbc:mysql://139.159.177.244:3306/hsg_order?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource

@ -54,7 +54,7 @@ import java.util.concurrent.ThreadLocalRandom;
@Controller
@RequestMapping("/orderPay")
@Api(value = "订单支付")
public class OrderPayController {
public class OrderPayController {
private static Logger log = LoggerFactory.getLogger(OrderPayController.class);

@ -151,7 +151,7 @@ public class HighGasSchedule {
}
}
@Scheduled(cron = "0 1 0 * * ?") // 每日凌晨12点01分执行一次
@Scheduled(cron = "10 0 0 * * ?") // 每日凌晨00:00:10执行一次
public void getJiaHaoYouAllStation() throws Exception {
gasService.getJiaHaoYouAllStation();
}

@ -540,4 +540,48 @@ public class WxUtils {
}
}
/**
* 用SHA1算法生成安全签名
* @param data 数据
* @return 安全签名
* @throws Exception
*/
public static String getSHA1(final Map<String, Object> data) throws Exception
{
try {
Set<String> keySet = data.keySet();
String[] keyArray = keySet.toArray(new String[keySet.size()]);
Arrays.sort(keyArray);
StringBuilder sb = new StringBuilder();
for (String k : keyArray) {
if (k.equals(WXPayConstants.FIELD_SIGN) || k.equals("apiKey")) {
continue;
}
if (data.get(k) != null) // 参数值为空,则不参与签名
{
sb.append(k).append("=").append(data.get(k)).append("&");
}
}
String str = sb.substring(0 , sb.length()-1);
// SHA1签名生成
MessageDigest md = MessageDigest.getInstance("SHA-1");
md.update(str.getBytes());
byte[] digest = md.digest();
StringBuffer hexstr = new StringBuffer();
String shaHex = "";
for (int i = 0; i < digest.length; i++) {
shaHex = Integer.toHexString(digest[i] & 0xFF);
if (shaHex.length() < 2) {
hexstr.append(0);
}
hexstr.append(shaHex);
}
return hexstr.toString();
} catch (Exception e) {
e.printStackTrace();
throw new Exception(String.format("Invalid sign_type: %s"));
}
}
}

@ -0,0 +1,58 @@
package com.hai.config;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.HighCoupon;
import com.hai.enum_type.CmsContentDataEnum;
import com.hai.service.HighCouponService;
import com.hai.service.HighDiscountPackageService;
import com.itextpdf.tool.xml.html.head.Title;
import org.springframework.context.annotation.Configuration;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
/**
* @serviceName QrCodeUtilsConfig.java
* @author Sum1Dream
* @version 1.0.0
* @Description // CMS内容工具
* @createTime 09:54 2022/4/13
**/
@Configuration
public class CmsContentConfig {
@Resource
private HighCouponService highCouponService;
@Resource
private HighDiscountPackageService highDiscountPackageService;
public Object getCmsContentData(String title , Long companyId) throws Exception {
Map<String , Object> map = new HashMap<>();
// 判断是否是天天好券
if (CmsContentDataEnum.DISCOUNT.getName().equals(title)) {
map.put("companyId", companyId);
map.put("salesType" , 1);
map.put("status" , 1);
PageHelper.startPage(1, 3);
return new PageInfo<>( highDiscountPackageService.getDiscountPackageList(map)).getList();
} else {
map.put("companyId", companyId);
map.put("displayArea", CmsContentDataEnum.getTypeByName(title));
map.put("notCouponSource", 2);
map.put("status", 2);
PageHelper.startPage(1, 3);
return new PageInfo<>(highCouponService.getCouponList(map)).getList();
}
}
}

@ -0,0 +1,146 @@
package com.hai.dao;
import com.hai.entity.BsMsg;
import com.hai.entity.BsMsgExample;
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 BsMsgMapper extends BsMsgMapperExt {
@SelectProvider(type=BsMsgSqlProvider.class, method="countByExample")
long countByExample(BsMsgExample example);
@DeleteProvider(type=BsMsgSqlProvider.class, method="deleteByExample")
int deleteByExample(BsMsgExample example);
@Delete({
"delete from bs_msg",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_msg (title, `type`, ",
"jump_type, msg_type, ",
"object_id, image, ",
"content, update_time, ",
"op_name, company_id, ",
"create_time, op_id, ",
"`status`, ext_1, ext_2, ",
"ext_3)",
"values (#{title,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, ",
"#{jumpType,jdbcType=INTEGER}, #{msgType,jdbcType=INTEGER}, ",
"#{objectId,jdbcType=BIGINT}, #{image,jdbcType=VARCHAR}, ",
"#{content,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{opName,jdbcType=VARCHAR}, #{companyId,jdbcType=BIGINT}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{opId,jdbcType=BIGINT}, ",
"#{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ",
"#{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsMsg record);
@InsertProvider(type=BsMsgSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsMsg record);
@SelectProvider(type=BsMsgSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="jump_type", property="jumpType", jdbcType=JdbcType.INTEGER),
@Result(column="msg_type", property="msgType", jdbcType=JdbcType.INTEGER),
@Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT),
@Result(column="image", property="image", jdbcType=JdbcType.VARCHAR),
@Result(column="content", property="content", jdbcType=JdbcType.VARCHAR),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="op_name", property="opName", jdbcType=JdbcType.VARCHAR),
@Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="op_id", property="opId", jdbcType=JdbcType.BIGINT),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
List<BsMsg> selectByExample(BsMsgExample example);
@Select({
"select",
"id, title, `type`, jump_type, msg_type, object_id, image, content, update_time, ",
"op_name, company_id, create_time, op_id, `status`, ext_1, ext_2, ext_3",
"from bs_msg",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="jump_type", property="jumpType", jdbcType=JdbcType.INTEGER),
@Result(column="msg_type", property="msgType", jdbcType=JdbcType.INTEGER),
@Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT),
@Result(column="image", property="image", jdbcType=JdbcType.VARCHAR),
@Result(column="content", property="content", jdbcType=JdbcType.VARCHAR),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="op_name", property="opName", jdbcType=JdbcType.VARCHAR),
@Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="op_id", property="opId", jdbcType=JdbcType.BIGINT),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
BsMsg selectByPrimaryKey(Long id);
@UpdateProvider(type=BsMsgSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsMsg record, @Param("example") BsMsgExample example);
@UpdateProvider(type=BsMsgSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsMsg record, @Param("example") BsMsgExample example);
@UpdateProvider(type=BsMsgSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsMsg record);
@Update({
"update bs_msg",
"set title = #{title,jdbcType=VARCHAR},",
"`type` = #{type,jdbcType=INTEGER},",
"jump_type = #{jumpType,jdbcType=INTEGER},",
"msg_type = #{msgType,jdbcType=INTEGER},",
"object_id = #{objectId,jdbcType=BIGINT},",
"image = #{image,jdbcType=VARCHAR},",
"content = #{content,jdbcType=VARCHAR},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",
"op_name = #{opName,jdbcType=VARCHAR},",
"company_id = #{companyId,jdbcType=BIGINT},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"op_id = #{opId,jdbcType=BIGINT},",
"`status` = #{status,jdbcType=INTEGER},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(BsMsg record);
}

@ -0,0 +1,7 @@
package com.hai.dao;
/**
* mapper扩展类
*/
public interface BsMsgMapperExt {
}

@ -0,0 +1,402 @@
package com.hai.dao;
import com.hai.entity.BsMsg;
import com.hai.entity.BsMsgExample.Criteria;
import com.hai.entity.BsMsgExample.Criterion;
import com.hai.entity.BsMsgExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsMsgSqlProvider {
public String countByExample(BsMsgExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_msg");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsMsgExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_msg");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsMsg record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_msg");
if (record.getTitle() != null) {
sql.VALUES("title", "#{title,jdbcType=VARCHAR}");
}
if (record.getType() != null) {
sql.VALUES("`type`", "#{type,jdbcType=INTEGER}");
}
if (record.getJumpType() != null) {
sql.VALUES("jump_type", "#{jumpType,jdbcType=INTEGER}");
}
if (record.getMsgType() != null) {
sql.VALUES("msg_type", "#{msgType,jdbcType=INTEGER}");
}
if (record.getObjectId() != null) {
sql.VALUES("object_id", "#{objectId,jdbcType=BIGINT}");
}
if (record.getImage() != null) {
sql.VALUES("image", "#{image,jdbcType=VARCHAR}");
}
if (record.getContent() != null) {
sql.VALUES("content", "#{content,jdbcType=VARCHAR}");
}
if (record.getUpdateTime() != null) {
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getOpName() != null) {
sql.VALUES("op_name", "#{opName,jdbcType=VARCHAR}");
}
if (record.getCompanyId() != null) {
sql.VALUES("company_id", "#{companyId,jdbcType=BIGINT}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
if (record.getOpId() != null) {
sql.VALUES("op_id", "#{opId,jdbcType=BIGINT}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getExt1() != null) {
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}");
}
return sql.toString();
}
public String selectByExample(BsMsgExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("title");
sql.SELECT("`type`");
sql.SELECT("jump_type");
sql.SELECT("msg_type");
sql.SELECT("object_id");
sql.SELECT("image");
sql.SELECT("content");
sql.SELECT("update_time");
sql.SELECT("op_name");
sql.SELECT("company_id");
sql.SELECT("create_time");
sql.SELECT("op_id");
sql.SELECT("`status`");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("bs_msg");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String updateByExampleSelective(Map<String, Object> parameter) {
BsMsg record = (BsMsg) parameter.get("record");
BsMsgExample example = (BsMsgExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_msg");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getTitle() != null) {
sql.SET("title = #{record.title,jdbcType=VARCHAR}");
}
if (record.getType() != null) {
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
}
if (record.getJumpType() != null) {
sql.SET("jump_type = #{record.jumpType,jdbcType=INTEGER}");
}
if (record.getMsgType() != null) {
sql.SET("msg_type = #{record.msgType,jdbcType=INTEGER}");
}
if (record.getObjectId() != null) {
sql.SET("object_id = #{record.objectId,jdbcType=BIGINT}");
}
if (record.getImage() != null) {
sql.SET("image = #{record.image,jdbcType=VARCHAR}");
}
if (record.getContent() != null) {
sql.SET("content = #{record.content,jdbcType=VARCHAR}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
}
if (record.getOpName() != null) {
sql.SET("op_name = #{record.opName,jdbcType=VARCHAR}");
}
if (record.getCompanyId() != null) {
sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
if (record.getOpId() != null) {
sql.SET("op_id = #{record.opId,jdbcType=BIGINT}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
}
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExample(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("bs_msg");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("title = #{record.title,jdbcType=VARCHAR}");
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
sql.SET("jump_type = #{record.jumpType,jdbcType=INTEGER}");
sql.SET("msg_type = #{record.msgType,jdbcType=INTEGER}");
sql.SET("object_id = #{record.objectId,jdbcType=BIGINT}");
sql.SET("image = #{record.image,jdbcType=VARCHAR}");
sql.SET("content = #{record.content,jdbcType=VARCHAR}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
sql.SET("op_name = #{record.opName,jdbcType=VARCHAR}");
sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("op_id = #{record.opId,jdbcType=BIGINT}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
BsMsgExample example = (BsMsgExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsMsg record) {
SQL sql = new SQL();
sql.UPDATE("bs_msg");
if (record.getTitle() != null) {
sql.SET("title = #{title,jdbcType=VARCHAR}");
}
if (record.getType() != null) {
sql.SET("`type` = #{type,jdbcType=INTEGER}");
}
if (record.getJumpType() != null) {
sql.SET("jump_type = #{jumpType,jdbcType=INTEGER}");
}
if (record.getMsgType() != null) {
sql.SET("msg_type = #{msgType,jdbcType=INTEGER}");
}
if (record.getObjectId() != null) {
sql.SET("object_id = #{objectId,jdbcType=BIGINT}");
}
if (record.getImage() != null) {
sql.SET("image = #{image,jdbcType=VARCHAR}");
}
if (record.getContent() != null) {
sql.SET("content = #{content,jdbcType=VARCHAR}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getOpName() != null) {
sql.SET("op_name = #{opName,jdbcType=VARCHAR}");
}
if (record.getCompanyId() != null) {
sql.SET("company_id = #{companyId,jdbcType=BIGINT}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}
if (record.getOpId() != null) {
sql.SET("op_id = #{opId,jdbcType=BIGINT}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();
}
protected void applyWhere(SQL sql, BsMsgExample example, boolean includeExamplePhrase) {
if (example == null) {
return;
}
String parmPhrase1;
String parmPhrase1_th;
String parmPhrase2;
String parmPhrase2_th;
String parmPhrase3;
String parmPhrase3_th;
if (includeExamplePhrase) {
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
} else {
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
}
StringBuilder sb = new StringBuilder();
List<Criteria> oredCriteria = example.getOredCriteria();
boolean firstCriteria = true;
for (int i = 0; i < oredCriteria.size(); i++) {
Criteria criteria = oredCriteria.get(i);
if (criteria.isValid()) {
if (firstCriteria) {
firstCriteria = false;
} else {
sb.append(" or ");
}
sb.append('(');
List<Criterion> criterions = criteria.getAllCriteria();
boolean firstCriterion = true;
for (int j = 0; j < criterions.size(); j++) {
Criterion criterion = criterions.get(j);
if (firstCriterion) {
firstCriterion = false;
} else {
sb.append(" and ");
}
if (criterion.isNoValue()) {
sb.append(criterion.getCondition());
} else if (criterion.isSingleValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));
} else {
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));
}
} else if (criterion.isBetweenValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));
} else {
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));
}
} else if (criterion.isListValue()) {
sb.append(criterion.getCondition());
sb.append(" (");
List<?> listItems = (List<?>) criterion.getValue();
boolean comma = false;
for (int k = 0; k < listItems.size(); k++) {
if (comma) {
sb.append(", ");
} else {
comma = true;
}
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase3, i, j, k));
} else {
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));
}
}
sb.append(')');
}
}
sb.append(')');
}
}
if (sb.length() > 0) {
sql.WHERE(sb.toString());
}
}
}

@ -0,0 +1,125 @@
package com.hai.dao;
import com.hai.entity.BsMsgUser;
import com.hai.entity.BsMsgUserExample;
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 BsMsgUserMapper extends BsMsgUserMapperExt {
@SelectProvider(type=BsMsgUserSqlProvider.class, method="countByExample")
long countByExample(BsMsgUserExample example);
@DeleteProvider(type=BsMsgUserSqlProvider.class, method="deleteByExample")
int deleteByExample(BsMsgUserExample example);
@Delete({
"delete from bs_msg_user",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_msg_user (msg_id, user_id, ",
"user_name, user_phone, ",
"where_check, check_time, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{msgId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, ",
"#{userName,jdbcType=VARCHAR}, #{userPhone,jdbcType=VARCHAR}, ",
"#{whereCheck,jdbcType=BIT}, #{checkTime,jdbcType=TIMESTAMP}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsMsgUser record);
@InsertProvider(type=BsMsgUserSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsMsgUser record);
@SelectProvider(type=BsMsgUserSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="msg_id", property="msgId", jdbcType=JdbcType.BIGINT),
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
@Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
@Result(column="where_check", property="whereCheck", jdbcType=JdbcType.BIT),
@Result(column="check_time", property="checkTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
List<BsMsgUser> selectByExample(BsMsgUserExample example);
@Select({
"select",
"id, msg_id, user_id, user_name, user_phone, where_check, check_time, create_time, ",
"update_time, ext_1, ext_2, ext_3",
"from bs_msg_user",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="msg_id", property="msgId", jdbcType=JdbcType.BIGINT),
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
@Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
@Result(column="where_check", property="whereCheck", jdbcType=JdbcType.BIT),
@Result(column="check_time", property="checkTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
BsMsgUser selectByPrimaryKey(Long id);
@UpdateProvider(type=BsMsgUserSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsMsgUser record, @Param("example") BsMsgUserExample example);
@UpdateProvider(type=BsMsgUserSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsMsgUser record, @Param("example") BsMsgUserExample example);
@UpdateProvider(type=BsMsgUserSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsMsgUser record);
@Update({
"update bs_msg_user",
"set msg_id = #{msgId,jdbcType=BIGINT},",
"user_id = #{userId,jdbcType=BIGINT},",
"user_name = #{userName,jdbcType=VARCHAR},",
"user_phone = #{userPhone,jdbcType=VARCHAR},",
"where_check = #{whereCheck,jdbcType=BIT},",
"check_time = #{checkTime,jdbcType=TIMESTAMP},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(BsMsgUser record);
}

@ -0,0 +1,7 @@
package com.hai.dao;
/**
* mapper扩展类
*/
public interface BsMsgUserMapperExt {
}

@ -0,0 +1,332 @@
package com.hai.dao;
import com.hai.entity.BsMsgUser;
import com.hai.entity.BsMsgUserExample.Criteria;
import com.hai.entity.BsMsgUserExample.Criterion;
import com.hai.entity.BsMsgUserExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsMsgUserSqlProvider {
public String countByExample(BsMsgUserExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_msg_user");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsMsgUserExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_msg_user");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsMsgUser record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_msg_user");
if (record.getMsgId() != null) {
sql.VALUES("msg_id", "#{msgId,jdbcType=BIGINT}");
}
if (record.getUserId() != null) {
sql.VALUES("user_id", "#{userId,jdbcType=BIGINT}");
}
if (record.getUserName() != null) {
sql.VALUES("user_name", "#{userName,jdbcType=VARCHAR}");
}
if (record.getUserPhone() != null) {
sql.VALUES("user_phone", "#{userPhone,jdbcType=VARCHAR}");
}
if (record.getWhereCheck() != null) {
sql.VALUES("where_check", "#{whereCheck,jdbcType=BIT}");
}
if (record.getCheckTime() != null) {
sql.VALUES("check_time", "#{checkTime,jdbcType=TIMESTAMP}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}");
}
return sql.toString();
}
public String selectByExample(BsMsgUserExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("msg_id");
sql.SELECT("user_id");
sql.SELECT("user_name");
sql.SELECT("user_phone");
sql.SELECT("where_check");
sql.SELECT("check_time");
sql.SELECT("create_time");
sql.SELECT("update_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("bs_msg_user");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String updateByExampleSelective(Map<String, Object> parameter) {
BsMsgUser record = (BsMsgUser) parameter.get("record");
BsMsgUserExample example = (BsMsgUserExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_msg_user");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getMsgId() != null) {
sql.SET("msg_id = #{record.msgId,jdbcType=BIGINT}");
}
if (record.getUserId() != null) {
sql.SET("user_id = #{record.userId,jdbcType=BIGINT}");
}
if (record.getUserName() != null) {
sql.SET("user_name = #{record.userName,jdbcType=VARCHAR}");
}
if (record.getUserPhone() != null) {
sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}");
}
if (record.getWhereCheck() != null) {
sql.SET("where_check = #{record.whereCheck,jdbcType=BIT}");
}
if (record.getCheckTime() != null) {
sql.SET("check_time = #{record.checkTime,jdbcType=TIMESTAMP}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
}
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExample(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("bs_msg_user");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("msg_id = #{record.msgId,jdbcType=BIGINT}");
sql.SET("user_id = #{record.userId,jdbcType=BIGINT}");
sql.SET("user_name = #{record.userName,jdbcType=VARCHAR}");
sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}");
sql.SET("where_check = #{record.whereCheck,jdbcType=BIT}");
sql.SET("check_time = #{record.checkTime,jdbcType=TIMESTAMP}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
BsMsgUserExample example = (BsMsgUserExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsMsgUser record) {
SQL sql = new SQL();
sql.UPDATE("bs_msg_user");
if (record.getMsgId() != null) {
sql.SET("msg_id = #{msgId,jdbcType=BIGINT}");
}
if (record.getUserId() != null) {
sql.SET("user_id = #{userId,jdbcType=BIGINT}");
}
if (record.getUserName() != null) {
sql.SET("user_name = #{userName,jdbcType=VARCHAR}");
}
if (record.getUserPhone() != null) {
sql.SET("user_phone = #{userPhone,jdbcType=VARCHAR}");
}
if (record.getWhereCheck() != null) {
sql.SET("where_check = #{whereCheck,jdbcType=BIT}");
}
if (record.getCheckTime() != null) {
sql.SET("check_time = #{checkTime,jdbcType=TIMESTAMP}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();
}
protected void applyWhere(SQL sql, BsMsgUserExample example, boolean includeExamplePhrase) {
if (example == null) {
return;
}
String parmPhrase1;
String parmPhrase1_th;
String parmPhrase2;
String parmPhrase2_th;
String parmPhrase3;
String parmPhrase3_th;
if (includeExamplePhrase) {
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
} else {
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
}
StringBuilder sb = new StringBuilder();
List<Criteria> oredCriteria = example.getOredCriteria();
boolean firstCriteria = true;
for (int i = 0; i < oredCriteria.size(); i++) {
Criteria criteria = oredCriteria.get(i);
if (criteria.isValid()) {
if (firstCriteria) {
firstCriteria = false;
} else {
sb.append(" or ");
}
sb.append('(');
List<Criterion> criterions = criteria.getAllCriteria();
boolean firstCriterion = true;
for (int j = 0; j < criterions.size(); j++) {
Criterion criterion = criterions.get(j);
if (firstCriterion) {
firstCriterion = false;
} else {
sb.append(" and ");
}
if (criterion.isNoValue()) {
sb.append(criterion.getCondition());
} else if (criterion.isSingleValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));
} else {
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));
}
} else if (criterion.isBetweenValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));
} else {
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));
}
} else if (criterion.isListValue()) {
sb.append(criterion.getCondition());
sb.append(" (");
List<?> listItems = (List<?>) criterion.getValue();
boolean comma = false;
for (int k = 0; k < listItems.size(); k++) {
if (comma) {
sb.append(", ");
} else {
comma = true;
}
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase3, i, j, k));
} else {
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));
}
}
sb.append(')');
}
}
sb.append(')');
}
}
if (sb.length() > 0) {
sql.WHERE(sb.toString());
}
}
}

@ -2,12 +2,22 @@ package com.hai.dao;
import com.hai.entity.CmsCategory;
import com.hai.entity.CmsCategoryExample;
import org.apache.ibatis.annotations.*;
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;
import java.util.List;
/**
*
* 代码由工具生成,请勿修改!!!
@ -16,10 +26,10 @@ import java.util.List;
**/
@Repository
public interface CmsCategoryMapper extends CmsCategoryMapperExt {
@SelectProvider(type= CmsCategorySqlProvider.class, method="countByExample")
@SelectProvider(type=CmsCategorySqlProvider.class, method="countByExample")
long countByExample(CmsCategoryExample example);
@DeleteProvider(type= CmsCategorySqlProvider.class, method="deleteByExample")
@DeleteProvider(type=CmsCategorySqlProvider.class, method="deleteByExample")
int deleteByExample(CmsCategoryExample example);
@Delete({
@ -29,72 +39,77 @@ public interface CmsCategoryMapper extends CmsCategoryMapperExt {
int deleteByPrimaryKey(Long id);
@Insert({
"insert into cms_category (parent_id, `name`, ",
"code, sort, cover_img, ",
"`status`, remark, ",
"ext_1, ext_2, ext_3)",
"values (#{parentId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, ",
"#{code,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{coverImg,jdbcType=VARCHAR}, ",
"#{status,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"insert into cms_category (`type`, parent_id, ",
"`name`, code, sort, ",
"cover_img, `status`, ",
"remark, ext_1, ext_2, ",
"ext_3)",
"values (#{type,jdbcType=INTEGER}, #{parentId,jdbcType=BIGINT}, ",
"#{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, ",
"#{coverImg,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{remark,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ",
"#{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(CmsCategory record);
@InsertProvider(type= CmsCategorySqlProvider.class, method="insertSelective")
@InsertProvider(type=CmsCategorySqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(CmsCategory record);
@SelectProvider(type= CmsCategorySqlProvider.class, method="selectByExample")
@SelectProvider(type=CmsCategorySqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType= JdbcType.BIGINT, id=true),
@Result(column="parent_id", property="parentId", jdbcType= JdbcType.BIGINT),
@Result(column="name", property="name", jdbcType= JdbcType.VARCHAR),
@Result(column="code", property="code", jdbcType= JdbcType.VARCHAR),
@Result(column="sort", property="sort", jdbcType= JdbcType.INTEGER),
@Result(column="cover_img", property="coverImg", jdbcType= JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType= JdbcType.INTEGER),
@Result(column="remark", property="remark", jdbcType= JdbcType.VARCHAR),
@Result(column="ext_1", property="ext1", jdbcType= JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType= JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType= JdbcType.VARCHAR)
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="parent_id", property="parentId", jdbcType=JdbcType.BIGINT),
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
@Result(column="code", property="code", jdbcType=JdbcType.VARCHAR),
@Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER),
@Result(column="cover_img", property="coverImg", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR),
@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<CmsCategory> selectByExample(CmsCategoryExample example);
@Select({
"select",
"id, parent_id, `name`, code, sort, cover_img, `status`, remark, ext_1, ext_2, ",
"ext_3",
"id, `type`, parent_id, `name`, code, sort, cover_img, `status`, remark, ext_1, ",
"ext_2, ext_3",
"from cms_category",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType= JdbcType.BIGINT, id=true),
@Result(column="parent_id", property="parentId", jdbcType= JdbcType.BIGINT),
@Result(column="name", property="name", jdbcType= JdbcType.VARCHAR),
@Result(column="code", property="code", jdbcType= JdbcType.VARCHAR),
@Result(column="sort", property="sort", jdbcType= JdbcType.INTEGER),
@Result(column="cover_img", property="coverImg", jdbcType= JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType= JdbcType.INTEGER),
@Result(column="remark", property="remark", jdbcType= JdbcType.VARCHAR),
@Result(column="ext_1", property="ext1", jdbcType= JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType= JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType= JdbcType.VARCHAR)
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="parent_id", property="parentId", jdbcType=JdbcType.BIGINT),
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
@Result(column="code", property="code", jdbcType=JdbcType.VARCHAR),
@Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER),
@Result(column="cover_img", property="coverImg", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR),
@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)
})
CmsCategory selectByPrimaryKey(Long id);
@UpdateProvider(type= CmsCategorySqlProvider.class, method="updateByExampleSelective")
@UpdateProvider(type=CmsCategorySqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") CmsCategory record, @Param("example") CmsCategoryExample example);
@UpdateProvider(type= CmsCategorySqlProvider.class, method="updateByExample")
@UpdateProvider(type=CmsCategorySqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") CmsCategory record, @Param("example") CmsCategoryExample example);
@UpdateProvider(type= CmsCategorySqlProvider.class, method="updateByPrimaryKeySelective")
@UpdateProvider(type=CmsCategorySqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(CmsCategory record);
@Update({
"update cms_category",
"set parent_id = #{parentId,jdbcType=BIGINT},",
"set `type` = #{type,jdbcType=INTEGER},",
"parent_id = #{parentId,jdbcType=BIGINT},",
"`name` = #{name,jdbcType=VARCHAR},",
"code = #{code,jdbcType=VARCHAR},",
"sort = #{sort,jdbcType=INTEGER},",

@ -1,13 +1,12 @@
package com.hai.dao;
import com.hai.entity.CmsCategory;
import com.hai.entity.CmsCategoryExample;
import com.hai.entity.CmsCategoryExample.Criteria;
import com.hai.entity.CmsCategoryExample.Criterion;
import org.apache.ibatis.jdbc.SQL;
import com.hai.entity.CmsCategoryExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class CmsCategorySqlProvider {
@ -29,6 +28,10 @@ public class CmsCategorySqlProvider {
SQL sql = new SQL();
sql.INSERT_INTO("cms_category");
if (record.getType() != null) {
sql.VALUES("`type`", "#{type,jdbcType=INTEGER}");
}
if (record.getParentId() != null) {
sql.VALUES("parent_id", "#{parentId,jdbcType=BIGINT}");
}
@ -79,6 +82,7 @@ public class CmsCategorySqlProvider {
} else {
sql.SELECT("id");
}
sql.SELECT("`type`");
sql.SELECT("parent_id");
sql.SELECT("`name`");
sql.SELECT("code");
@ -110,6 +114,10 @@ public class CmsCategorySqlProvider {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getType() != null) {
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
}
if (record.getParentId() != null) {
sql.SET("parent_id = #{record.parentId,jdbcType=BIGINT}");
}
@ -159,6 +167,7 @@ public class CmsCategorySqlProvider {
sql.UPDATE("cms_category");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
sql.SET("parent_id = #{record.parentId,jdbcType=BIGINT}");
sql.SET("`name` = #{record.name,jdbcType=VARCHAR}");
sql.SET("code = #{record.code,jdbcType=VARCHAR}");
@ -179,6 +188,10 @@ public class CmsCategorySqlProvider {
SQL sql = new SQL();
sql.UPDATE("cms_category");
if (record.getType() != null) {
sql.SET("`type` = #{type,jdbcType=INTEGER}");
}
if (record.getParentId() != null) {
sql.SET("parent_id = #{parentId,jdbcType=BIGINT}");
}
@ -316,4 +329,4 @@ public class CmsCategorySqlProvider {
sql.WHERE(sb.toString());
}
}
}
}

@ -43,24 +43,24 @@ public interface CmsContentMapper extends CmsContentMapperExt {
"title, description, ",
"create_time, `status`, ",
"has_patch, visit_count, ",
"tag, img_data, jump_type, ",
"jump_name, jump_url, ",
"sort_id, update_time, ",
"recommend, company_id, ",
"company_name, user_name, ",
"op_id, ext_1, ext_2, ",
"ext_3, content)",
"platform, tag, img_data, ",
"jump_type, jump_name, ",
"jump_url, sort_id, ",
"update_time, recommend, ",
"company_id, company_name, ",
"user_name, op_id, ext_1, ",
"ext_2, ext_3, content)",
"values (#{categoryId,jdbcType=BIGINT}, #{categoryCode,jdbcType=VARCHAR}, ",
"#{title,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ",
"#{hasPatch,jdbcType=INTEGER}, #{visitCount,jdbcType=INTEGER}, ",
"#{tag,jdbcType=VARCHAR}, #{imgData,jdbcType=VARCHAR}, #{jumpType,jdbcType=INTEGER}, ",
"#{jumpName,jdbcType=VARCHAR}, #{jumpUrl,jdbcType=VARCHAR}, ",
"#{sortId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{recommend,jdbcType=BIT}, #{companyId,jdbcType=BIGINT}, ",
"#{companyName,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, ",
"#{opId,jdbcType=BIGINT}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ",
"#{ext3,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR})"
"#{platform,jdbcType=INTEGER}, #{tag,jdbcType=VARCHAR}, #{imgData,jdbcType=VARCHAR}, ",
"#{jumpType,jdbcType=INTEGER}, #{jumpName,jdbcType=VARCHAR}, ",
"#{jumpUrl,jdbcType=VARCHAR}, #{sortId,jdbcType=INTEGER}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{recommend,jdbcType=BIT}, ",
"#{companyId,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, ",
"#{userName,jdbcType=VARCHAR}, #{opId,jdbcType=BIGINT}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(CmsContent record);
@ -80,6 +80,7 @@ public interface CmsContentMapper extends CmsContentMapperExt {
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="has_patch", property="hasPatch", jdbcType=JdbcType.INTEGER),
@Result(column="visit_count", property="visitCount", jdbcType=JdbcType.INTEGER),
@Result(column="platform", property="platform", jdbcType=JdbcType.INTEGER),
@Result(column="tag", property="tag", jdbcType=JdbcType.VARCHAR),
@Result(column="img_data", property="imgData", jdbcType=JdbcType.VARCHAR),
@Result(column="jump_type", property="jumpType", jdbcType=JdbcType.INTEGER),
@ -110,6 +111,7 @@ public interface CmsContentMapper extends CmsContentMapperExt {
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="has_patch", property="hasPatch", jdbcType=JdbcType.INTEGER),
@Result(column="visit_count", property="visitCount", jdbcType=JdbcType.INTEGER),
@Result(column="platform", property="platform", jdbcType=JdbcType.INTEGER),
@Result(column="tag", property="tag", jdbcType=JdbcType.VARCHAR),
@Result(column="img_data", property="imgData", jdbcType=JdbcType.VARCHAR),
@Result(column="jump_type", property="jumpType", jdbcType=JdbcType.INTEGER),
@ -131,9 +133,9 @@ public interface CmsContentMapper extends CmsContentMapperExt {
@Select({
"select",
"id, category_id, category_code, title, description, create_time, `status`, has_patch, ",
"visit_count, tag, img_data, jump_type, jump_name, jump_url, sort_id, update_time, ",
"recommend, company_id, company_name, user_name, op_id, ext_1, ext_2, ext_3, ",
"content",
"visit_count, platform, tag, img_data, jump_type, jump_name, jump_url, sort_id, ",
"update_time, recommend, company_id, company_name, user_name, op_id, ext_1, ext_2, ",
"ext_3, content",
"from cms_content",
"where id = #{id,jdbcType=BIGINT}"
})
@ -147,6 +149,7 @@ public interface CmsContentMapper extends CmsContentMapperExt {
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="has_patch", property="hasPatch", jdbcType=JdbcType.INTEGER),
@Result(column="visit_count", property="visitCount", jdbcType=JdbcType.INTEGER),
@Result(column="platform", property="platform", jdbcType=JdbcType.INTEGER),
@Result(column="tag", property="tag", jdbcType=JdbcType.VARCHAR),
@Result(column="img_data", property="imgData", jdbcType=JdbcType.VARCHAR),
@Result(column="jump_type", property="jumpType", jdbcType=JdbcType.INTEGER),
@ -188,6 +191,7 @@ public interface CmsContentMapper extends CmsContentMapperExt {
"`status` = #{status,jdbcType=INTEGER},",
"has_patch = #{hasPatch,jdbcType=INTEGER},",
"visit_count = #{visitCount,jdbcType=INTEGER},",
"platform = #{platform,jdbcType=INTEGER},",
"tag = #{tag,jdbcType=VARCHAR},",
"img_data = #{imgData,jdbcType=VARCHAR},",
"jump_type = #{jumpType,jdbcType=INTEGER},",
@ -218,6 +222,7 @@ public interface CmsContentMapper extends CmsContentMapperExt {
"`status` = #{status,jdbcType=INTEGER},",
"has_patch = #{hasPatch,jdbcType=INTEGER},",
"visit_count = #{visitCount,jdbcType=INTEGER},",
"platform = #{platform,jdbcType=INTEGER},",
"tag = #{tag,jdbcType=VARCHAR},",
"img_data = #{imgData,jdbcType=VARCHAR},",
"jump_type = #{jumpType,jdbcType=INTEGER},",

@ -25,11 +25,14 @@ public interface CmsContentMapperExt {
" AND cc.title REGEXP #{title}",
"</if>",
"<if test=\"category != null\">",
" AND cc.category_id = #{category}",
" AND cc.category_id = #{categoryId}",
"</if>",
"<if test=\"categoryCode != null\">",
" AND cc.category_code = #{categoryCode}",
"</if>",
"<if test=\"platform != null\">",
" AND cc.platform = #{platform}",
"</if>",
"<if test=\"companyId != null\">",
" AND cc.company_id = #{companyId}",
"</if>",

@ -60,6 +60,10 @@ public class CmsContentSqlProvider {
sql.VALUES("visit_count", "#{visitCount,jdbcType=INTEGER}");
}
if (record.getPlatform() != null) {
sql.VALUES("platform", "#{platform,jdbcType=INTEGER}");
}
if (record.getTag() != null) {
sql.VALUES("tag", "#{tag,jdbcType=VARCHAR}");
}
@ -142,6 +146,7 @@ public class CmsContentSqlProvider {
sql.SELECT("`status`");
sql.SELECT("has_patch");
sql.SELECT("visit_count");
sql.SELECT("platform");
sql.SELECT("tag");
sql.SELECT("img_data");
sql.SELECT("jump_type");
@ -183,6 +188,7 @@ public class CmsContentSqlProvider {
sql.SELECT("`status`");
sql.SELECT("has_patch");
sql.SELECT("visit_count");
sql.SELECT("platform");
sql.SELECT("tag");
sql.SELECT("img_data");
sql.SELECT("jump_type");
@ -251,6 +257,10 @@ public class CmsContentSqlProvider {
sql.SET("visit_count = #{record.visitCount,jdbcType=INTEGER}");
}
if (record.getPlatform() != null) {
sql.SET("platform = #{record.platform,jdbcType=INTEGER}");
}
if (record.getTag() != null) {
sql.SET("tag = #{record.tag,jdbcType=VARCHAR}");
}
@ -332,6 +342,7 @@ public class CmsContentSqlProvider {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("has_patch = #{record.hasPatch,jdbcType=INTEGER}");
sql.SET("visit_count = #{record.visitCount,jdbcType=INTEGER}");
sql.SET("platform = #{record.platform,jdbcType=INTEGER}");
sql.SET("tag = #{record.tag,jdbcType=VARCHAR}");
sql.SET("img_data = #{record.imgData,jdbcType=VARCHAR}");
sql.SET("jump_type = #{record.jumpType,jdbcType=INTEGER}");
@ -367,6 +378,7 @@ public class CmsContentSqlProvider {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("has_patch = #{record.hasPatch,jdbcType=INTEGER}");
sql.SET("visit_count = #{record.visitCount,jdbcType=INTEGER}");
sql.SET("platform = #{record.platform,jdbcType=INTEGER}");
sql.SET("tag = #{record.tag,jdbcType=VARCHAR}");
sql.SET("img_data = #{record.imgData,jdbcType=VARCHAR}");
sql.SET("jump_type = #{record.jumpType,jdbcType=INTEGER}");
@ -424,6 +436,10 @@ public class CmsContentSqlProvider {
sql.SET("visit_count = #{visitCount,jdbcType=INTEGER}");
}
if (record.getPlatform() != null) {
sql.SET("platform = #{platform,jdbcType=INTEGER}");
}
if (record.getTag() != null) {
sql.SET("tag = #{tag,jdbcType=VARCHAR}");
}

@ -0,0 +1,321 @@
package com.hai.entity;
import java.io.Serializable;
import java.util.Date;
/**
* bs_msg
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsMsg implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 标题
*/
private String title;
/**
* 类型 1:服务通知 2支付信息 3客服信息
*/
private Integer type;
/**
* 跳转类型 1 订单详情 2 外部链接 3 内部链接 4 客服信息
*/
private Integer jumpType;
/**
* 消息类型1 个人信息 2 全局信息
*/
private Integer msgType;
/**
* 对象id
*/
private Long objectId;
/**
* 展示图片
*/
private String image;
/**
* 信息内容
*/
private String content;
/**
* 更新时间
*/
private Date updateTime;
/**
* 操作人员名称
*/
private String opName;
/**
* 公司id
*/
private Long companyId;
/**
* 创建时间
*/
private Date createTime;
/**
* 操作人员
*/
private Long opId;
/**
* 1:编辑中 2发布 0删除
*/
private Integer status;
/**
* ext_1
*/
private String ext1;
/**
* ext_2
*/
private String ext2;
/**
* ext_3
*/
private String ext3;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Integer getJumpType() {
return jumpType;
}
public void setJumpType(Integer jumpType) {
this.jumpType = jumpType;
}
public Integer getMsgType() {
return msgType;
}
public void setMsgType(Integer msgType) {
this.msgType = msgType;
}
public Long getObjectId() {
return objectId;
}
public void setObjectId(Long objectId) {
this.objectId = objectId;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getOpName() {
return opName;
}
public void setOpName(String opName) {
this.opName = opName;
}
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Long getOpId() {
return opId;
}
public void setOpId(Long opId) {
this.opId = opId;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getExt1() {
return ext1;
}
public void setExt1(String ext1) {
this.ext1 = ext1;
}
public String getExt2() {
return ext2;
}
public void setExt2(String ext2) {
this.ext2 = ext2;
}
public String getExt3() {
return ext3;
}
public void setExt3(String ext3) {
this.ext3 = ext3;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
BsMsg other = (BsMsg) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getJumpType() == null ? other.getJumpType() == null : this.getJumpType().equals(other.getJumpType()))
&& (this.getMsgType() == null ? other.getMsgType() == null : this.getMsgType().equals(other.getMsgType()))
&& (this.getObjectId() == null ? other.getObjectId() == null : this.getObjectId().equals(other.getObjectId()))
&& (this.getImage() == null ? other.getImage() == null : this.getImage().equals(other.getImage()))
&& (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getOpName() == null ? other.getOpName() == null : this.getOpName().equals(other.getOpName()))
&& (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getOpId() == null ? other.getOpId() == null : this.getOpId().equals(other.getOpId()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2()))
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getJumpType() == null) ? 0 : getJumpType().hashCode());
result = prime * result + ((getMsgType() == null) ? 0 : getMsgType().hashCode());
result = prime * result + ((getObjectId() == null) ? 0 : getObjectId().hashCode());
result = prime * result + ((getImage() == null) ? 0 : getImage().hashCode());
result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getOpName() == null) ? 0 : getOpName().hashCode());
result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getOpId() == null) ? 0 : getOpId().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode());
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", title=").append(title);
sb.append(", type=").append(type);
sb.append(", jumpType=").append(jumpType);
sb.append(", msgType=").append(msgType);
sb.append(", objectId=").append(objectId);
sb.append(", image=").append(image);
sb.append(", content=").append(content);
sb.append(", updateTime=").append(updateTime);
sb.append(", opName=").append(opName);
sb.append(", companyId=").append(companyId);
sb.append(", createTime=").append(createTime);
sb.append(", opId=").append(opId);
sb.append(", status=").append(status);
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);
sb.append(", ext3=").append(ext3);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,241 @@
package com.hai.entity;
import java.io.Serializable;
import java.util.Date;
/**
* bs_msg_user
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsMsgUser implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 站内信id
*/
private Long msgId;
/**
* 用户id
*/
private Long userId;
/**
* 用户名称
*/
private String userName;
/**
* 用户电话
*/
private String userPhone;
/**
* 是否查看
*/
private Boolean whereCheck;
/**
* 查看时间
*/
private Date checkTime;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* ext_1
*/
private String ext1;
/**
* ext_2
*/
private String ext2;
/**
* ext_3
*/
private String ext3;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getMsgId() {
return msgId;
}
public void setMsgId(Long msgId) {
this.msgId = msgId;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserPhone() {
return userPhone;
}
public void setUserPhone(String userPhone) {
this.userPhone = userPhone;
}
public Boolean getWhereCheck() {
return whereCheck;
}
public void setWhereCheck(Boolean whereCheck) {
this.whereCheck = whereCheck;
}
public Date getCheckTime() {
return checkTime;
}
public void setCheckTime(Date checkTime) {
this.checkTime = checkTime;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getExt1() {
return ext1;
}
public void setExt1(String ext1) {
this.ext1 = ext1;
}
public String getExt2() {
return ext2;
}
public void setExt2(String ext2) {
this.ext2 = ext2;
}
public String getExt3() {
return ext3;
}
public void setExt3(String ext3) {
this.ext3 = ext3;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
BsMsgUser other = (BsMsgUser) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getMsgId() == null ? other.getMsgId() == null : this.getMsgId().equals(other.getMsgId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName()))
&& (this.getUserPhone() == null ? other.getUserPhone() == null : this.getUserPhone().equals(other.getUserPhone()))
&& (this.getWhereCheck() == null ? other.getWhereCheck() == null : this.getWhereCheck().equals(other.getWhereCheck()))
&& (this.getCheckTime() == null ? other.getCheckTime() == null : this.getCheckTime().equals(other.getCheckTime()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2()))
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getMsgId() == null) ? 0 : getMsgId().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode());
result = prime * result + ((getUserPhone() == null) ? 0 : getUserPhone().hashCode());
result = prime * result + ((getWhereCheck() == null) ? 0 : getWhereCheck().hashCode());
result = prime * result + ((getCheckTime() == null) ? 0 : getCheckTime().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode());
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", msgId=").append(msgId);
sb.append(", userId=").append(userId);
sb.append(", userName=").append(userName);
sb.append(", userPhone=").append(userPhone);
sb.append(", whereCheck=").append(whereCheck);
sb.append(", checkTime=").append(checkTime);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);
sb.append(", ext3=").append(ext3);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

@ -0,0 +1,993 @@
package com.hai.entity;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class BsMsgUserExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
private Integer limit;
private Long offset;
public BsMsgUserExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
public void setLimit(Integer limit) {
this.limit = limit;
}
public Integer getLimit() {
return limit;
}
public void setOffset(Long offset) {
this.offset = offset;
}
public Long getOffset() {
return offset;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andMsgIdIsNull() {
addCriterion("msg_id is null");
return (Criteria) this;
}
public Criteria andMsgIdIsNotNull() {
addCriterion("msg_id is not null");
return (Criteria) this;
}
public Criteria andMsgIdEqualTo(Long value) {
addCriterion("msg_id =", value, "msgId");
return (Criteria) this;
}
public Criteria andMsgIdNotEqualTo(Long value) {
addCriterion("msg_id <>", value, "msgId");
return (Criteria) this;
}
public Criteria andMsgIdGreaterThan(Long value) {
addCriterion("msg_id >", value, "msgId");
return (Criteria) this;
}
public Criteria andMsgIdGreaterThanOrEqualTo(Long value) {
addCriterion("msg_id >=", value, "msgId");
return (Criteria) this;
}
public Criteria andMsgIdLessThan(Long value) {
addCriterion("msg_id <", value, "msgId");
return (Criteria) this;
}
public Criteria andMsgIdLessThanOrEqualTo(Long value) {
addCriterion("msg_id <=", value, "msgId");
return (Criteria) this;
}
public Criteria andMsgIdIn(List<Long> values) {
addCriterion("msg_id in", values, "msgId");
return (Criteria) this;
}
public Criteria andMsgIdNotIn(List<Long> values) {
addCriterion("msg_id not in", values, "msgId");
return (Criteria) this;
}
public Criteria andMsgIdBetween(Long value1, Long value2) {
addCriterion("msg_id between", value1, value2, "msgId");
return (Criteria) this;
}
public Criteria andMsgIdNotBetween(Long value1, Long value2) {
addCriterion("msg_id not between", value1, value2, "msgId");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserNameIsNull() {
addCriterion("user_name is null");
return (Criteria) this;
}
public Criteria andUserNameIsNotNull() {
addCriterion("user_name is not null");
return (Criteria) this;
}
public Criteria andUserNameEqualTo(String value) {
addCriterion("user_name =", value, "userName");
return (Criteria) this;
}
public Criteria andUserNameNotEqualTo(String value) {
addCriterion("user_name <>", value, "userName");
return (Criteria) this;
}
public Criteria andUserNameGreaterThan(String value) {
addCriterion("user_name >", value, "userName");
return (Criteria) this;
}
public Criteria andUserNameGreaterThanOrEqualTo(String value) {
addCriterion("user_name >=", value, "userName");
return (Criteria) this;
}
public Criteria andUserNameLessThan(String value) {
addCriterion("user_name <", value, "userName");
return (Criteria) this;
}
public Criteria andUserNameLessThanOrEqualTo(String value) {
addCriterion("user_name <=", value, "userName");
return (Criteria) this;
}
public Criteria andUserNameLike(String value) {
addCriterion("user_name like", value, "userName");
return (Criteria) this;
}
public Criteria andUserNameNotLike(String value) {
addCriterion("user_name not like", value, "userName");
return (Criteria) this;
}
public Criteria andUserNameIn(List<String> values) {
addCriterion("user_name in", values, "userName");
return (Criteria) this;
}
public Criteria andUserNameNotIn(List<String> values) {
addCriterion("user_name not in", values, "userName");
return (Criteria) this;
}
public Criteria andUserNameBetween(String value1, String value2) {
addCriterion("user_name between", value1, value2, "userName");
return (Criteria) this;
}
public Criteria andUserNameNotBetween(String value1, String value2) {
addCriterion("user_name not between", value1, value2, "userName");
return (Criteria) this;
}
public Criteria andUserPhoneIsNull() {
addCriterion("user_phone is null");
return (Criteria) this;
}
public Criteria andUserPhoneIsNotNull() {
addCriterion("user_phone is not null");
return (Criteria) this;
}
public Criteria andUserPhoneEqualTo(String value) {
addCriterion("user_phone =", value, "userPhone");
return (Criteria) this;
}
public Criteria andUserPhoneNotEqualTo(String value) {
addCriterion("user_phone <>", value, "userPhone");
return (Criteria) this;
}
public Criteria andUserPhoneGreaterThan(String value) {
addCriterion("user_phone >", value, "userPhone");
return (Criteria) this;
}
public Criteria andUserPhoneGreaterThanOrEqualTo(String value) {
addCriterion("user_phone >=", value, "userPhone");
return (Criteria) this;
}
public Criteria andUserPhoneLessThan(String value) {
addCriterion("user_phone <", value, "userPhone");
return (Criteria) this;
}
public Criteria andUserPhoneLessThanOrEqualTo(String value) {
addCriterion("user_phone <=", value, "userPhone");
return (Criteria) this;
}
public Criteria andUserPhoneLike(String value) {
addCriterion("user_phone like", value, "userPhone");
return (Criteria) this;
}
public Criteria andUserPhoneNotLike(String value) {
addCriterion("user_phone not like", value, "userPhone");
return (Criteria) this;
}
public Criteria andUserPhoneIn(List<String> values) {
addCriterion("user_phone in", values, "userPhone");
return (Criteria) this;
}
public Criteria andUserPhoneNotIn(List<String> values) {
addCriterion("user_phone not in", values, "userPhone");
return (Criteria) this;
}
public Criteria andUserPhoneBetween(String value1, String value2) {
addCriterion("user_phone between", value1, value2, "userPhone");
return (Criteria) this;
}
public Criteria andUserPhoneNotBetween(String value1, String value2) {
addCriterion("user_phone not between", value1, value2, "userPhone");
return (Criteria) this;
}
public Criteria andWhereCheckIsNull() {
addCriterion("where_check is null");
return (Criteria) this;
}
public Criteria andWhereCheckIsNotNull() {
addCriterion("where_check is not null");
return (Criteria) this;
}
public Criteria andWhereCheckEqualTo(Boolean value) {
addCriterion("where_check =", value, "whereCheck");
return (Criteria) this;
}
public Criteria andWhereCheckNotEqualTo(Boolean value) {
addCriterion("where_check <>", value, "whereCheck");
return (Criteria) this;
}
public Criteria andWhereCheckGreaterThan(Boolean value) {
addCriterion("where_check >", value, "whereCheck");
return (Criteria) this;
}
public Criteria andWhereCheckGreaterThanOrEqualTo(Boolean value) {
addCriterion("where_check >=", value, "whereCheck");
return (Criteria) this;
}
public Criteria andWhereCheckLessThan(Boolean value) {
addCriterion("where_check <", value, "whereCheck");
return (Criteria) this;
}
public Criteria andWhereCheckLessThanOrEqualTo(Boolean value) {
addCriterion("where_check <=", value, "whereCheck");
return (Criteria) this;
}
public Criteria andWhereCheckIn(List<Boolean> values) {
addCriterion("where_check in", values, "whereCheck");
return (Criteria) this;
}
public Criteria andWhereCheckNotIn(List<Boolean> values) {
addCriterion("where_check not in", values, "whereCheck");
return (Criteria) this;
}
public Criteria andWhereCheckBetween(Boolean value1, Boolean value2) {
addCriterion("where_check between", value1, value2, "whereCheck");
return (Criteria) this;
}
public Criteria andWhereCheckNotBetween(Boolean value1, Boolean value2) {
addCriterion("where_check not between", value1, value2, "whereCheck");
return (Criteria) this;
}
public Criteria andCheckTimeIsNull() {
addCriterion("check_time is null");
return (Criteria) this;
}
public Criteria andCheckTimeIsNotNull() {
addCriterion("check_time is not null");
return (Criteria) this;
}
public Criteria andCheckTimeEqualTo(Date value) {
addCriterion("check_time =", value, "checkTime");
return (Criteria) this;
}
public Criteria andCheckTimeNotEqualTo(Date value) {
addCriterion("check_time <>", value, "checkTime");
return (Criteria) this;
}
public Criteria andCheckTimeGreaterThan(Date value) {
addCriterion("check_time >", value, "checkTime");
return (Criteria) this;
}
public Criteria andCheckTimeGreaterThanOrEqualTo(Date value) {
addCriterion("check_time >=", value, "checkTime");
return (Criteria) this;
}
public Criteria andCheckTimeLessThan(Date value) {
addCriterion("check_time <", value, "checkTime");
return (Criteria) this;
}
public Criteria andCheckTimeLessThanOrEqualTo(Date value) {
addCriterion("check_time <=", value, "checkTime");
return (Criteria) this;
}
public Criteria andCheckTimeIn(List<Date> values) {
addCriterion("check_time in", values, "checkTime");
return (Criteria) this;
}
public Criteria andCheckTimeNotIn(List<Date> values) {
addCriterion("check_time not in", values, "checkTime");
return (Criteria) this;
}
public Criteria andCheckTimeBetween(Date value1, Date value2) {
addCriterion("check_time between", value1, value2, "checkTime");
return (Criteria) this;
}
public Criteria andCheckTimeNotBetween(Date value1, Date value2) {
addCriterion("check_time not between", value1, value2, "checkTime");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andExt1IsNull() {
addCriterion("ext_1 is null");
return (Criteria) this;
}
public Criteria andExt1IsNotNull() {
addCriterion("ext_1 is not null");
return (Criteria) this;
}
public Criteria andExt1EqualTo(String value) {
addCriterion("ext_1 =", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1NotEqualTo(String value) {
addCriterion("ext_1 <>", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1GreaterThan(String value) {
addCriterion("ext_1 >", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1GreaterThanOrEqualTo(String value) {
addCriterion("ext_1 >=", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1LessThan(String value) {
addCriterion("ext_1 <", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1LessThanOrEqualTo(String value) {
addCriterion("ext_1 <=", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1Like(String value) {
addCriterion("ext_1 like", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1NotLike(String value) {
addCriterion("ext_1 not like", value, "ext1");
return (Criteria) this;
}
public Criteria andExt1In(List<String> values) {
addCriterion("ext_1 in", values, "ext1");
return (Criteria) this;
}
public Criteria andExt1NotIn(List<String> values) {
addCriterion("ext_1 not in", values, "ext1");
return (Criteria) this;
}
public Criteria andExt1Between(String value1, String value2) {
addCriterion("ext_1 between", value1, value2, "ext1");
return (Criteria) this;
}
public Criteria andExt1NotBetween(String value1, String value2) {
addCriterion("ext_1 not between", value1, value2, "ext1");
return (Criteria) this;
}
public Criteria andExt2IsNull() {
addCriterion("ext_2 is null");
return (Criteria) this;
}
public Criteria andExt2IsNotNull() {
addCriterion("ext_2 is not null");
return (Criteria) this;
}
public Criteria andExt2EqualTo(String value) {
addCriterion("ext_2 =", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2NotEqualTo(String value) {
addCriterion("ext_2 <>", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2GreaterThan(String value) {
addCriterion("ext_2 >", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2GreaterThanOrEqualTo(String value) {
addCriterion("ext_2 >=", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2LessThan(String value) {
addCriterion("ext_2 <", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2LessThanOrEqualTo(String value) {
addCriterion("ext_2 <=", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2Like(String value) {
addCriterion("ext_2 like", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2NotLike(String value) {
addCriterion("ext_2 not like", value, "ext2");
return (Criteria) this;
}
public Criteria andExt2In(List<String> values) {
addCriterion("ext_2 in", values, "ext2");
return (Criteria) this;
}
public Criteria andExt2NotIn(List<String> values) {
addCriterion("ext_2 not in", values, "ext2");
return (Criteria) this;
}
public Criteria andExt2Between(String value1, String value2) {
addCriterion("ext_2 between", value1, value2, "ext2");
return (Criteria) this;
}
public Criteria andExt2NotBetween(String value1, String value2) {
addCriterion("ext_2 not between", value1, value2, "ext2");
return (Criteria) this;
}
public Criteria andExt3IsNull() {
addCriterion("ext_3 is null");
return (Criteria) this;
}
public Criteria andExt3IsNotNull() {
addCriterion("ext_3 is not null");
return (Criteria) this;
}
public Criteria andExt3EqualTo(String value) {
addCriterion("ext_3 =", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3NotEqualTo(String value) {
addCriterion("ext_3 <>", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3GreaterThan(String value) {
addCriterion("ext_3 >", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3GreaterThanOrEqualTo(String value) {
addCriterion("ext_3 >=", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3LessThan(String value) {
addCriterion("ext_3 <", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3LessThanOrEqualTo(String value) {
addCriterion("ext_3 <=", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3Like(String value) {
addCriterion("ext_3 like", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3NotLike(String value) {
addCriterion("ext_3 not like", value, "ext3");
return (Criteria) this;
}
public Criteria andExt3In(List<String> values) {
addCriterion("ext_3 in", values, "ext3");
return (Criteria) this;
}
public Criteria andExt3NotIn(List<String> values) {
addCriterion("ext_3 not in", values, "ext3");
return (Criteria) this;
}
public Criteria andExt3Between(String value1, String value2) {
addCriterion("ext_3 between", value1, value2, "ext3");
return (Criteria) this;
}
public Criteria andExt3NotBetween(String value1, String value2) {
addCriterion("ext_3 not between", value1, value2, "ext3");
return (Criteria) this;
}
}
/**
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

@ -6,7 +6,6 @@ import java.io.Serializable;
* cms_category
* @author
*/
/**
*
* 代码由工具生成
@ -18,6 +17,11 @@ public class CmsCategory implements Serializable {
*/
private Long id;
/**
* 类型: // 1.小图一行四个 2.轮播图 3.消息通知 4.大图展示 5.一横图三小图 6.数据库数据 7.小图一行五个 8 首页背景图
*/
private Integer type;
/**
* 父级分类
*/
@ -69,6 +73,14 @@ public class CmsCategory implements Serializable {
this.id = id;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Long getParentId() {
return parentId;
}
@ -162,6 +174,7 @@ public class CmsCategory implements Serializable {
}
CmsCategory other = (CmsCategory) 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.getParentId() == null ? other.getParentId() == null : this.getParentId().equals(other.getParentId()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
&& (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode()))
@ -179,6 +192,7 @@ public class CmsCategory implements Serializable {
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 + ((getParentId() == null) ? 0 : getParentId().hashCode());
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode());
@ -199,6 +213,7 @@ public class CmsCategory implements Serializable {
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", type=").append(type);
sb.append(", parentId=").append(parentId);
sb.append(", name=").append(name);
sb.append(", code=").append(code);

@ -184,6 +184,66 @@ public class CmsCategoryExample {
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("`type` is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("`type` is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(Integer value) {
addCriterion("`type` =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(Integer value) {
addCriterion("`type` <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(Integer value) {
addCriterion("`type` >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("`type` >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(Integer value) {
addCriterion("`type` <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(Integer value) {
addCriterion("`type` <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<Integer> values) {
addCriterion("`type` in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<Integer> values) {
addCriterion("`type` not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(Integer value1, Integer value2) {
addCriterion("`type` between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(Integer value1, Integer value2) {
addCriterion("`type` not between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andParentIdIsNull() {
addCriterion("parent_id is null");
return (Criteria) this;
@ -949,4 +1009,4 @@ public class CmsCategoryExample {
this(condition, value, secondValue, null);
}
}
}
}

@ -1,5 +1,7 @@
package com.hai.entity;
import com.alibaba.fastjson.JSONArray;
import java.io.Serializable;
import java.util.Date;
@ -58,6 +60,11 @@ public class CmsContent implements Serializable {
*/
private Integer visitCount;
/**
* 平台类型 1微信小程序 2h5 3银联小程序
*/
private Integer platform;
/**
* 标签格式为流行,古典
*/
@ -113,6 +120,17 @@ public class CmsContent implements Serializable {
*/
private String userName;
private Integer[] platformArray;
public Integer[] getPlatformArray() {
return platformArray;
}
public void setPlatformArray(Integer[] platformArray) {
this.platformArray = platformArray;
}
/**
* 操作人id
*/
@ -129,6 +147,7 @@ public class CmsContent implements Serializable {
*/
private String content;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -203,6 +222,14 @@ public class CmsContent implements Serializable {
this.visitCount = visitCount;
}
public Integer getPlatform() {
return platform;
}
public void setPlatform(Integer platform) {
this.platform = platform;
}
public String getTag() {
return tag;
}
@ -352,6 +379,7 @@ public class CmsContent implements Serializable {
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getHasPatch() == null ? other.getHasPatch() == null : this.getHasPatch().equals(other.getHasPatch()))
&& (this.getVisitCount() == null ? other.getVisitCount() == null : this.getVisitCount().equals(other.getVisitCount()))
&& (this.getPlatform() == null ? other.getPlatform() == null : this.getPlatform().equals(other.getPlatform()))
&& (this.getTag() == null ? other.getTag() == null : this.getTag().equals(other.getTag()))
&& (this.getImgData() == null ? other.getImgData() == null : this.getImgData().equals(other.getImgData()))
&& (this.getJumpType() == null ? other.getJumpType() == null : this.getJumpType().equals(other.getJumpType()))
@ -383,6 +411,7 @@ public class CmsContent implements Serializable {
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getHasPatch() == null) ? 0 : getHasPatch().hashCode());
result = prime * result + ((getVisitCount() == null) ? 0 : getVisitCount().hashCode());
result = prime * result + ((getPlatform() == null) ? 0 : getPlatform().hashCode());
result = prime * result + ((getTag() == null) ? 0 : getTag().hashCode());
result = prime * result + ((getImgData() == null) ? 0 : getImgData().hashCode());
result = prime * result + ((getJumpType() == null) ? 0 : getJumpType().hashCode());
@ -417,6 +446,7 @@ public class CmsContent implements Serializable {
sb.append(", status=").append(status);
sb.append(", hasPatch=").append(hasPatch);
sb.append(", visitCount=").append(visitCount);
sb.append(", platform=").append(platform);
sb.append(", tag=").append(tag);
sb.append(", imgData=").append(imgData);
sb.append(", jumpType=").append(jumpType);
@ -437,4 +467,4 @@ public class CmsContent implements Serializable {
sb.append("]");
return sb.toString();
}
}
}

@ -695,6 +695,66 @@ public class CmsContentExample {
return (Criteria) this;
}
public Criteria andPlatformIsNull() {
addCriterion("platform is null");
return (Criteria) this;
}
public Criteria andPlatformIsNotNull() {
addCriterion("platform is not null");
return (Criteria) this;
}
public Criteria andPlatformEqualTo(Integer value) {
addCriterion("platform =", value, "platform");
return (Criteria) this;
}
public Criteria andPlatformNotEqualTo(Integer value) {
addCriterion("platform <>", value, "platform");
return (Criteria) this;
}
public Criteria andPlatformGreaterThan(Integer value) {
addCriterion("platform >", value, "platform");
return (Criteria) this;
}
public Criteria andPlatformGreaterThanOrEqualTo(Integer value) {
addCriterion("platform >=", value, "platform");
return (Criteria) this;
}
public Criteria andPlatformLessThan(Integer value) {
addCriterion("platform <", value, "platform");
return (Criteria) this;
}
public Criteria andPlatformLessThanOrEqualTo(Integer value) {
addCriterion("platform <=", value, "platform");
return (Criteria) this;
}
public Criteria andPlatformIn(List<Integer> values) {
addCriterion("platform in", values, "platform");
return (Criteria) this;
}
public Criteria andPlatformNotIn(List<Integer> values) {
addCriterion("platform not in", values, "platform");
return (Criteria) this;
}
public Criteria andPlatformBetween(Integer value1, Integer value2) {
addCriterion("platform between", value1, value2, "platform");
return (Criteria) this;
}
public Criteria andPlatformNotBetween(Integer value1, Integer value2) {
addCriterion("platform not between", value1, value2, "platform");
return (Criteria) this;
}
public Criteria andTagIsNull() {
addCriterion("tag is null");
return (Criteria) this;

@ -0,0 +1,52 @@
package com.hai.enum_type;
import java.util.Objects;
/**
* @serviceName CmsContentDataEnum.java
* @author Sum1Dream
* @version 1.0.0
* @Description // CMS内容数据
* @createTime 09:22 2022/9/28
**/
public enum CmsContentDataEnum {
REFUEL(1 , "加油专区"),
INTEGRAL(2 , "积分专区"),
UNION_PAY(3 , "银联专区"),
PREFERABLY(4 , "优选商品"),
UNION_CARD(5 , "工会卡专区"),
DISCOUNT(6 , "天天好券"),
;
private Integer type;
private String name;
CmsContentDataEnum(int type , String name) {
this.type = type;
this.name = name;
}
public static Integer getTypeByName(String name) {
for (CmsContentDataEnum ele : values()) {
if(Objects.equals(name,ele.getName())) return ele.getType();
}
return null;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

@ -0,0 +1,53 @@
package com.hai.model;
/**
* @author sum1dream
*/
public class TextMessage {
private String toUserName;
private String fromUserName;
private String msgType;
private String content;
private Long createTime;
public String getToUserName() {
return toUserName;
}
public void setToUserName(String toUserName) {
this.toUserName = toUserName;
}
public String getFromUserName() {
return fromUserName;
}
public void setFromUserName(String fromUserName) {
this.fromUserName = fromUserName;
}
public String getMsgType() {
return msgType;
}
public void setMsgType(String msgType) {
this.msgType = msgType;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,58 @@
package com.hai.service;
import com.hai.entity.BsMsg;
import com.hai.entity.HighUser;
import java.util.List;
import java.util.Map;
/**
* @serviceName BsMsgService.java
* @author Sum1Dream
* @version 1.0.0
* @Description // 站内信接口
* @createTime 14:27 2022/9/20
**/
public interface BsMsgService {
/**
* @Author Sum1Dream
* @Name insertMsg
* @Description // 新增站内信
* @Date 14:30 2022/9/20
* @Param [bsMsg]
* @Return void
*/
void insertMsg(BsMsg bsMsg , HighUser user);
/**
* @Author Sum1Dream
* @Name updateMsg
* @Description //修改站内信
* @Date 14:30 2022/9/20
* @Param [bsMsg]
* @Return void
*/
void updateMsg(BsMsg bsMsg);
/**
* @Author Sum1Dream
* @Name findMsg
* @Description // 根据id查询站内信
* @Date 14:33 2022/9/20
* @Param [id]
* @Return com.hai.entity.BsMsg
*/
BsMsg findMsg(Long id);
/**
* @Author Sum1Dream
* @Name getMsgByList
* @Description // 查询站内信列表
* @Date 14:34 2022/9/20
* @Param [map]
* @Return java.util.List<com.hai.entity.BsMsg>
*/
List<BsMsg> getMsgByList(Map<String , Object> map);
}

@ -61,6 +61,26 @@ public interface CmsCategoryService {
*/
CmsCategory getCategoryById(Long id) throws Exception;
/**
* @Author Sum1Dream
* @Name getCategoryByCode
* @Description // 根据编码查询内容
* @Date 17:06 2022/9/27
* @Param [categoryCode]
* @Return com.hai.entity.CmsCategory
*/
CmsCategory getCategoryByCode(String categoryCode ) throws Exception;
/**
* @Author Sum1Dream
* @Name getCategoryByParentId
* @Description //
* @Date 17:22 2022/9/27
* @Param [parentId]
* @Return java.util.List<com.hai.entity.CmsCategory>
*/
List<CmsCategory> getCategoryByParentId(Long parentId);
/**
*
* @Title: getCategoryTree

@ -30,6 +30,7 @@ public interface CmsContentService {
*/
int addContent(CmsContent cmsContent, List<CmsPatch> patchList, Map<String, String> paramsMap, String cmsPath) throws Exception;
/**
*
* @Title: updateContent
@ -52,6 +53,36 @@ public interface CmsContentService {
*/
int delContent(Long id, String cmsPath) throws Exception;
/**
* @Author Sum1Dream
* @Name insertCmsContent
* @Description // 新增CMS内容
* @Date 16:42 2022/9/26
* @Param [cmsContent]
* @Return void
*/
void insertCmsContent(CmsContent cmsContent);
/**
* @Author Sum1Dream
* @Name updateCmsContent
* @Description // 修改CMS内容
* @Date 16:42 2022/9/26
* @Param [cmsContent]
* @Return void
*/
void updateCmsContent(CmsContent cmsContent);
/**
* @Author Sum1Dream
* @Name findById
* @Description // 根据id 查询内容
* @Date 16:44 2022/9/26
* @Param [id]
* @Return com.hai.entity.CmsContent
*/
CmsContent findById(Long id);
/**
*
* @Title: getContentById
@ -85,6 +116,25 @@ public interface CmsContentService {
*/
List<CmsContentModel> getListContent(Map<String, String> paramsMap) throws Exception;
/**
* @Author Sum1Dream
* @Name getListCmsContent
* @Description // 查询内容列表
* @Date 10:30 2022/9/27
* @Param [map]
* @Return java.util.List<com.hai.entity.CmsContent>
*/
List<CmsContent> getListCmsContent(Map<String , Object> map);
/**
* @Author Sum1Dream
* @Name getListCmsContentByCategoryId
* @Description // 根据编码id 查询内容
* @Date 17:59 2022/9/27
* @Param [categoryId]
* @Return java.util.List<com.hai.entity.CmsContent>
*/
List<CmsContent> getListCmsContentByCategoryId(Long categoryId , Long companyId , Integer platform);
/**
*

@ -0,0 +1,90 @@
package com.hai.service.impl;
import com.hai.dao.BsMsgMapper;
import com.hai.dao.BsMsgUserMapper;
import com.hai.entity.BsMsg;
import com.hai.entity.BsMsgExample;
import com.hai.entity.BsMsgUser;
import com.hai.entity.HighUser;
import com.hai.service.BsMsgService;
import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.beans.Transient;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.jar.JarEntry;
/**
* @author sum1dream
*/
@Service("bsMsgService")
public class BsMsgServiceImpl implements BsMsgService {
@Resource
private BsMsgMapper bsMsgMapper;
@Resource
private BsMsgUserMapper bsMsgUserMapper;
@Override
@Transactional
public void insertMsg(BsMsg bsMsg , HighUser user) {
bsMsgMapper.insert(bsMsg);
if (bsMsg.getMsgType()==1){
BsMsgUser bsMsgUser = new BsMsgUser();
bsMsgUser.setCreateTime(new Date());
bsMsgUser.setUpdateTime(new Date());
bsMsgUser.setMsgId(bsMsg.getId());
bsMsgUser.setUserName(user.getName());
bsMsgUser.setUserId(user.getId());
bsMsgUser.setUserPhone(user.getPhone());
bsMsgUser.setWhereCheck(false);
bsMsgUserMapper.insert(bsMsgUser);
}
}
@Override
public void updateMsg(BsMsg bsMsg) {
bsMsgMapper.updateByPrimaryKey(bsMsg);
}
@Override
public BsMsg findMsg(Long id) {
return bsMsgMapper.selectByPrimaryKey(id);
}
@Override
public List<BsMsg> getMsgByList(Map<String, Object> map) {
BsMsgExample example = new BsMsgExample();
BsMsgExample.Criteria criteria = example.createCriteria();
if (MapUtils.getInteger(map , "type") != null) {
criteria.andTypeEqualTo(MapUtils.getInteger(map , "type"));
}
if (MapUtils.getInteger(map , "jumpType") != null) {
criteria.andJumpTypeEqualTo(MapUtils.getInteger(map , "jumpType"));
}
if (MapUtils.getInteger(map , "msgType") != null) {
criteria.andMsgTypeEqualTo(MapUtils.getInteger(map , "msgType"));
}
if (MapUtils.getInteger(map , "title") != null) {
criteria.andTitleLike("%" + MapUtils.getString(map , "title") + "%" );
}
if (MapUtils.getLong(map , "companyId") != null) {
criteria.andCompanyIdEqualTo(MapUtils.getLong(map , "companyId"));
}
if (MapUtils.getInteger(map , "status") != null) {
criteria.andStatusEqualTo(MapUtils.getInteger(map , "status"));
} else {
criteria.andStatusNotEqualTo(0);
}
return bsMsgMapper.selectByExample(example);
}
}

@ -79,7 +79,6 @@ public class CmsCategoryServiceImpl implements CmsCategoryService {
if(cmsCategory.getStatus() == null){
cmsCategory.setStatus(category.getStatus());
}
cmsCategory.setCode(category.getCode());
cmsCategory.setParentId(category.getParentId());
cmsCategoryMapper.updateByPrimaryKey(cmsCategory);
@ -109,6 +108,30 @@ public class CmsCategoryServiceImpl implements CmsCategoryService {
return cmsCategoryMapper.selectByPrimaryKey(id);
}
@Override
public CmsCategory getCategoryByCode(String categoryCode) throws Exception {
CmsCategoryExample example = new CmsCategoryExample();
example.createCriteria().andCodeEqualTo(categoryCode).andStatusEqualTo(1);
List<CmsCategory> categoryList = cmsCategoryMapper.selectByExample(example);
if (categoryList.size() > 0) {
return categoryList.get(0);
}
return null;
}
@Override
public List<CmsCategory> getCategoryByParentId(Long parentId) {
CmsCategoryExample example = new CmsCategoryExample();
example.createCriteria().andParentIdEqualTo(parentId).andStatusEqualTo(1);
example.setOrderByClause("sort");
return cmsCategoryMapper.selectByExample(example);
}
@Override
public List<CmsCategoryTreeModel> getCategoryTree(Map<String, Object> paramsMap) throws Exception {
// 查询分类列表

@ -8,6 +8,7 @@ import com.hai.dao.CmsContentMapper;
import com.hai.entity.*;
import com.hai.model.CmsContentModel;
import com.hai.service.*;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@ -178,6 +179,42 @@ public class CmsContentServiceImpl implements CmsContentService {
return cmsContentMapper.getListContent(paramsMap);
}
@Override
public List<CmsContent> getListCmsContent(Map<String, Object> map) {
CmsContentExample example = new CmsContentExample();
CmsContentExample.Criteria criteria = example.createCriteria();
if (MapUtils.getString(map,"title") != null) {
criteria.andTitleLike("%" + MapUtils.getString(map,"title") + "%");
}
if (MapUtils.getLong(map,"categoryId") != null) {
criteria.andCategoryIdEqualTo(MapUtils.getLong(map,"categoryId"));
}
if (MapUtils.getInteger(map,"platform") != null) {
criteria.andPlatformEqualTo(MapUtils.getInteger(map,"platform"));
}
if (MapUtils.getInteger(map,"status") != null) {
criteria.andStatusEqualTo(MapUtils.getInteger(map,"status"));
}else {
criteria.andStatusNotEqualTo(0);
}
if (MapUtils.getLong(map,"companyId") != null) {
criteria.andCompanyIdEqualTo(MapUtils.getLong(map,"companyId"));
}
return cmsContentMapper.selectByExample(example);
}
@Override
public List<CmsContent> getListCmsContentByCategoryId(Long categoryId , Long companyId , Integer platform) {
CmsContentExample example = new CmsContentExample();
example.createCriteria().andCategoryIdEqualTo(categoryId).andStatusEqualTo(2).andCompanyIdEqualTo(companyId).andPlatformEqualTo(platform);
return cmsContentMapper.selectByExample(example);
}
@Override
public List<CmsContentModel> getListContentByCrest(Map<String, String> paramsMap) throws Exception {
return cmsContentMapper.getListContentByCrest(paramsMap);
@ -229,4 +266,18 @@ public class CmsContentServiceImpl implements CmsContentService {
return "/CMS/html/" + strContentId + ".html";
}
@Override
public void insertCmsContent(CmsContent cmsContent) {
cmsContentMapper.insert(cmsContent);
}
@Override
public void updateCmsContent(CmsContent cmsContent) {
cmsContentMapper.updateByPrimaryKey(cmsContent);
}
@Override
public CmsContent findById(Long id) {
return cmsContentMapper.selectByPrimaryKey(id);
}
}

@ -534,18 +534,20 @@ public class CommonServiceImpl implements CommonService {
@Override
public JSONObject findByLatAndLng(String lng, String lat) throws Exception {
Map<String,Object> map = new HashMap<>();//参数
map.put("ak", "SfrwGH7INvjPq7BwCrYrioBQZm9XXxrR");//申请百度开放平台KEY(ak)
map.put("output", "json");// 输出Json数据
map.put("extensions_town", "true");// 行政区划返回乡镇级数据(town),仅国内召回乡镇数据
map.put("coordtype", "wgs84ll"); // GPS 经纬度类型
map.put("location", lat+","+lng+"");//百度经纬度
String url = "http://api.map.baidu.com/reverse_geocoding/v3/";
System.out.println("请求经纬度========" + map);
return HttpsUtils.doGet(url , map);
//参数
Map<String,Object> map = new HashMap<>();
//申请百度开放平台KEY(ak)
map.put("ak", "SfrwGH7INvjPq7BwCrYrioBQZm9XXxrR");
// 输出Json数据
map.put("output", "json");
// 行政区划返回乡镇级数据(town),仅国内召回乡镇数据
map.put("extensions_town", "true");
// GPS 经纬度类型
map.put("coordtype", "wgs84ll");
//百度经纬度
map.put("location", lat+","+lng+"");
return HttpsUtils.doGet("http://api.map.baidu.com/reverse_geocoding/v3/" , map);
}

@ -59,15 +59,19 @@ public class HighCouponServiceImpl implements HighCouponService {
@Resource
private HighApproveService highApproveService;
@Autowired
private RedisTemplate redisTemplate;
@Resource
private HighAgentService highAgentService;
@Resource
private HighCouponAgentService highCouponAgentService;
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void insertCoupon(HighCoupon highCouponModel) {

@ -1,5 +1,6 @@
package com.hai.service.impl;
import com.github.pagehelper.PageHelper;
import com.google.common.base.Stopwatch;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
@ -116,7 +117,6 @@ public class HighDiscountPackageServiceImpl implements HighDiscountPackageServic
} else {
criteria.andStatusNotEqualTo(4);
}
example.setOrderByClause("created_time desc");
return highDiscountPackageMapper.selectByExample(example);

@ -75,9 +75,6 @@ public class HighOrderServiceImpl implements HighOrderService {
@Resource
private HighCouponCodeService highCouponCodeService;
@Resource
private ApiProductService apiProductService;
@Resource
private HighCouponService highCouponService;
@ -2140,7 +2137,6 @@ public class HighOrderServiceImpl implements HighOrderService {
return highOrderMapperExt.selectTest();
}
@Override
public List<Map<String, Object>> getFinishGasOrder() {
return highOrderMapper.selectFinishGasOrder();
@ -2153,7 +2149,6 @@ public class HighOrderServiceImpl implements HighOrderService {
return highChildOrderMapper.selectByExample(example).get(0);
}
@Override
public List<HighOrderModel> selectDiscountPackageOrderList(Map<String, Object> map) throws Exception {
@ -3306,50 +3301,7 @@ public class HighOrderServiceImpl implements HighOrderService {
@Override
public List<HighOrder> orderListByAgentId(Map<String, Object> map) throws Exception {
HighOrderExample example = new HighOrderExample();
HighOrderExample.Criteria criteria = example.createCriteria();
criteria.andOrderStatusEqualTo(3);
/* if (MapUtils.getLong(map , "agentId") != null) {
criteria.andIdentificationCodeEqualTo(MapUtils.getLong(map , "agentId"));
} else {
criteria.andIdentificationCodeIsNotNull();
}*/
List<HighOrder> list = highOrderMapper.selectByExample(example);
/* for (HighOrder order : list) {
HighUser user = highUserService.findByUserId(order.getIdentificationCode());
order.setTime(DateUtil.date2String(order.getCreateTime() , "MM月dd日 HH:mm"));
List<HighChildOrder> childOrder = getChildOrderByOrder(order.getId());
order.setGoodsTypeName("购买:" + GoodsType.getNameByType(childOrder.get(0).getGoodsType()));
order.setAgentName(user.getName());
}*/
/* criteria.andIdentificationCodeIsNotNull().andIdentificationCodeNotEqualTo(60L);
}
if (MapUtils.getLong(map , "code") != null) {
criteria.andIdentificationCodeEqualTo(MapUtils.getLong(map , "code"));
}
List<HighOrder> list = highOrderMapper.selectByExample(example);
if (list.size() > 0) {
for (HighOrder order : list) {
HighUser user = highUserService.findByUserId(order.getIdentificationCode());
order.setTime(DateUtil.date2String(order.getCreateTime() , "MM月dd日 HH:mm"));
List<HighChildOrder> childOrder = getChildOrderByOrder(order.getId());
order.setGoodsTypeName("购买:" + GoodsType.getNameByType(childOrder.get(0).getGoodsType()));
if (user != null) {
order.setAgentName(user.getName());
} else {
order.setAgentName("暂无推广人");
}
}
}*/
return list;
return null;
}
}

@ -12,6 +12,9 @@ public class SysConfig {
private String wxH5AppId;
private String wxH5AppSecret;
private String wxAppId;
private String wxAppSecret;
public String getWxH5AppId() {
return wxH5AppId;
}
@ -27,4 +30,20 @@ public class SysConfig {
public void setWxH5AppSecret(String wxH5AppSecret) {
this.wxH5AppSecret = wxH5AppSecret;
}
public String getWxAppId() {
return wxAppId;
}
public void setWxAppId(String wxAppId) {
this.wxAppId = wxAppId;
}
public String getWxAppSecret() {
return wxAppSecret;
}
public void setWxAppSecret(String wxAppSecret) {
this.wxAppSecret = wxAppSecret;
}
}

@ -1,6 +1,8 @@
package com.v1.config;
import com.alibaba.fastjson.JSONObject;
import com.hai.model.TextMessage;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.api.WxMpService;
@ -8,8 +10,8 @@ import me.chanjar.weixin.mp.bean.result.WxMpQrCodeTicket;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.io.File;
import java.util.Map;
/**
* @serviceName WeChatQrcodeUtils.java
@ -118,4 +120,85 @@ public class WeChatQrcodeUtils {
}
/**
* 处理 subscribe 类型的event
*
* @param map
* @return
*/
public String handleEventSubscribe(Map<String, String> map) {
String resXmlStr = getReturnMsgSubscribe(map);
return resXmlStr;
}
/**
* @Author Sum1Dream
* @Name getReturnMsgSubscribe
* @Description // 处理文本
* @Date 16:34 2022/9/21
* @Param [decryptMap]
* @Return java.lang.String
*/
public String getReturnMsgSubscribe(Map<String, String> decryptMap) {
TextMessage textMessage = new TextMessage();
textMessage.setToUserName(decryptMap.get("FromUserName"));
textMessage.setFromUserName(decryptMap.get("ToUserName"));
textMessage.setCreateTime(System.currentTimeMillis());
textMessage.setMsgType("text");
textMessage.setContent(decryptMap.get("content"));
return getXmlString(textMessage);
}
/**
* @Author Sum1Dream
* @Name getXmlString
* @Description // 处理xml文件
* @Date 16:34 2022/9/21
* @Param [textMessage]
* @Return java.lang.String
*/
public String getXmlString(TextMessage textMessage) {
String xml = "";
if (textMessage != null) {
xml = "<xml>";
xml += "<ToUserName><![CDATA[";
xml += textMessage.getToUserName();
xml += "]]></ToUserName>";
xml += "<FromUserName><![CDATA[";
xml += textMessage.getFromUserName();
xml += "]]></FromUserName>";
xml += "<CreateTime>";
xml += textMessage.getCreateTime();
xml += "</CreateTime>";
xml += "<MsgType><![CDATA[";
xml += textMessage.getMsgType();
xml += "]]></MsgType>";
xml += "<Content><![CDATA[";
xml += textMessage.getContent();
xml += "]]></Content>";
xml += "</xml>";
}
return xml;
}
/**
* @Author Sum1Dream
* @Name paramPars
* @Description // 微信二维码参数解析
* @Date 13:50 2022/9/22
* @Param [param]
* @Return com.alibaba.fastjson.JSONObject
*/
public JSONObject paramPars(String param) {
String[] paramArray = param.split("&");
JSONObject object = new JSONObject();
for (String s : paramArray) {
String[] array = s.split("=");
object.put(array[0] , array[1]);
}
return object;
}
}

@ -1,6 +1,7 @@
package com.v1.config;
import com.hai.config.CommonSysConst;
import com.hai.model.TextMessage;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
import me.chanjar.weixin.mp.config.WxMpConfigStorage;
@ -8,6 +9,8 @@ import me.chanjar.weixin.mp.config.impl.WxMpDefaultConfigImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Map;
/**
* @serviceName .java
* @author Sum1Dream
@ -48,4 +51,59 @@ public class WxConfig {
wxMpService.setWxMpConfigStorage(wxMpConfigStorage());
return wxMpService;
}
/**
* 处理 subscribe 类型的event
*
* @param map
* @param userOpenId
* @return
*/
private String handleEventSubscribe(Map<String, String> map, String userOpenId) {
String resXmlStr = getReturnMsgSubscribe(map);
return resXmlStr;
}
public String getReturnMsgSubscribe(Map<String, String> decryptMap) {
TextMessage textMessage = new TextMessage();
textMessage.setToUserName(decryptMap.get("FromUserName"));
textMessage.setFromUserName(decryptMap.get("ToUserName"));
textMessage.setCreateTime(System.currentTimeMillis());
textMessage.setMsgType("text");
textMessage.setContent("你好,欢迎关注XXX!\n" +
"\n" +
"关注XXX。立即登录PC端网址 \n" +
" 即可完成注册!\n" +
"\n" +
"或," +
"<a href='https://hsgcs.dctpay.com/hsgH5?accountId=000000&gasKey=11000697&staffCode='>点击这里立即完成注册</a>");
return getXmlString(textMessage);
}
public String getXmlString(TextMessage textMessage) {
String xml = "";
if (textMessage != null) {
xml = "<xml>";
xml += "<ToUserName><![CDATA[";
xml += textMessage.getToUserName();
xml += "]]></ToUserName>";
xml += "<FromUserName><![CDATA[";
xml += textMessage.getFromUserName();
xml += "]]></FromUserName>";
xml += "<CreateTime>";
xml += textMessage.getCreateTime();
xml += "</CreateTime>";
xml += "<MsgType><![CDATA[";
xml += textMessage.getMsgType();
xml += "]]></MsgType>";
xml += "<Content><![CDATA[";
xml += textMessage.getContent();
xml += "]]></Content>";
xml += "</xml>";
}
return xml;
}
}

@ -7,10 +7,13 @@ import com.hai.common.exception.SysCode;
import com.hai.common.pay.util.IOUtil;
import com.hai.common.pay.util.XmlUtil;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.RedisUtil;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.common.utils.WxUtils;
import com.hai.config.CommonSysConst;
import com.hai.model.HighMerchantStoreModel;
import com.hai.model.ResponseData;
import com.hai.service.CommonService;
import com.hai.service.HighMerchantStoreService;
import com.v1.config.SysConst;
import com.v1.config.WeChatQrcodeUtils;
import io.swagger.annotations.Api;
@ -29,10 +32,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Map;
import java.util.SortedMap;
import java.util.*;
/**
* @author sum1dream
@ -48,12 +50,42 @@ public class WxMsgController {
@Autowired
private WeChatQrcodeUtils weChatQrcodeUtils;
@Resource
private HighMerchantStoreService merchantStoreService;
@Resource
private RedisUtil redisUtil;
@RequestMapping(value = "/verifyWxToken", method = RequestMethod.GET)
// @RequestMapping(value = "/verifyWxToken", method = RequestMethod.GET)
// @ResponseBody
// @ApiOperation(value = "验证servlet")
// public String verifyWxToken(
// @RequestParam(name = "signature", required = false) String signature,
// @RequestParam(name = "timestamp", required = false) String timestamp,
// @RequestParam(name = "nonce", required = false) String nonce,
// @RequestParam(name = "echostr", required = false) String echostr
// ) {
//
// try {
//
// String signatureStr = WxUtils.getSHA1("RgAWdnR5oEOLBdyEjfr4" , timestamp , nonce);
// log.info("signatureStr!!!!!" + signatureStr);
// log.info("signature!!!!!" + signature);
// if (signature.equals(signatureStr)) {
// log.info("验证通过!!!!!");
// return echostr;
// }
// log.info("验证失败!!!!!");
// return null;
// } catch (Exception e) {
// return null;
// }
//
// }
@RequestMapping(value = "/verifyWxToken", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "验证servlet")
public String verifyWxToken(HttpServletRequest request) {
public void verifyWxToken(HttpServletRequest request , HttpServletResponse response) {
try {
log.info("进入公众号!!!!!!!");
@ -63,19 +95,96 @@ public class WxMsgController {
String notifyXml;
notifyXml = IOUtil.inputStreamToString(request.getInputStream(), "UTF-8");
log.info("微信支付系统发送的数据:" + notifyXml);
log.info("微信系统发送的数据:" + notifyXml);
SortedMap<String, String> map = XmlUtil.parseXmlToTreeMap(notifyXml, "UTF-8");
// openId
String userOpenId = map.get("FromUserName");
// 微信账号
String userName = map.get("ToUserName");
// 事件
String event = map.get("Event");
// 区分消息类型
String msgType = map.get("MsgType");
log.info("微信支付系统发送的数据:" + msgType);
return null;
// 二维码参数
String eventKey = map.get("EventKey");
String linkContent;
String content = null;
if (eventKey != null && eventKey.length() != 0) {
JSONObject object = weChatQrcodeUtils.paramPars(eventKey);
// type = 1 推广扫码 type = 2
if (Objects.equals(object.getString("qrscene_type"), "1") || Objects.equals(object.getString("type"), "1")) {
linkContent = "<a href='" + CommonSysConst.getSysConfig().getHsgDomainName() + "/hsgH5?accountId=0000010&key=&code=" + object.getString("code") + "'>点击查看更多优惠</a>\n\n";
} else {
// 商户门店
HighMerchantStoreModel store = merchantStoreService.getMerchantStoreByKey(object.getString("code"));
linkContent = "<a href='"+CommonSysConst.getSysConfig().getHsgDomainName()+"/hsgH5?accountId=000000&gasKey=" + object.getString("code") + "&staffCode='>欢迎来到" + store.getStoreName()+"</a>" + "[哇][哇][哇]\n\n<a href='"+CommonSysConst.getSysConfig().getHsgDomainName()+"/hsgH5?accountId=000000&gasKey=" + object.getString("code") + "&staffCode='>点击这里一键加油</a>\n\n";
}
} else {
linkContent = "<a href='" + CommonSysConst.getSysConfig().getHsgDomainName() + "/hsgH5'>点击查看更多优惠</a>\n\n";
}
log.info("二维码参数:" + eventKey);
// 普通消息
if ("text".equals(msgType)) {
// todo 处理文本消息
} else if ("image".equals(msgType)) {
// todo 处理图片消息
} else if ("voice".equals(msgType)) {
// todo 处理语音消息
} else if ("video".equals(msgType)) {
// todo 处理视频消息
}
// 事件推送消息
else if ("event".equals(msgType)) {
// 用户关注公众号
if ("subscribe".equals(event)) {
log.info("进入扫码关注流程:" + event);
// todo 业务处理
content =
"终于等到你,还好我没放弃[玫瑰][玫瑰][玫瑰]\n\n" +
"您好,感谢关注嗨森逛商城!\n\n" +
linkContent +
"在线等你来撩~[哇][哇][哇]\n\n" +
"特意为您奉上" +
"<a href='" + CommonSysConst.getSysConfig().getHsgDomainName() + "/hsgH5'>5张优惠券</a>" +
",放在您的"+
"<a href='" + CommonSysConst.getSysConfig().getHsgDomainName() + "/hsgH5'>优惠券</a>"+
"里面,记得及时使用哦[爱心][爱心][爱心]\n\n" +
"【如遇任何问题请致电客服:400-678-0738】"
;
// todo 业务处理
}
// 用户扫码进入公众号
else if ("SCAN".equals(event)) {
// todo 业务处理
content =
"油价很贵,诗和远方也很贵[可怜]\n\n" +
"“一键加油”有”油“惠[红包][红包][红包]\n\n" +
linkContent +
"多重好礼为您助力\n\n" +
"加油的时候少点心疼,踩油门的时候多点豪横![得意][得意][得意]\n\n" +
"【如遇任何问题请致电客服:400-678-0738】"
;
}else if ("unsubscribe".equals(event)) {
// todo 取消关注 业务处理
}
map.put("content" , content);
String mapToXml = weChatQrcodeUtils.handleEventSubscribe(map);
response.setCharacterEncoding("UTF-8");
response.getWriter().print(mapToXml);
}
} catch (Exception e) {
return null;
// return null;
}
}
@RequestMapping(value = "/getWxToken", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "获取微信token")
@ -110,9 +219,15 @@ public class WxMsgController {
@RequestMapping(value = "/createQrcode", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "创建生成二维码")
public ResponseData createQrcode(@RequestParam(name = "sceneId", required = false) Integer sceneId) {
public ResponseData createQrcode(@RequestParam(name = "type", required = false) String type,
@RequestParam(name = "code", required = false) String code) {
try {
return ResponseMsgUtil.success(weChatQrcodeUtils.qrCodeCreateLastTicket(sceneId));
String sceneId = "type=" + type + "&code=" + code;
String ticket = weChatQrcodeUtils.qrCodeCreateLastTicket(sceneId).getTicket();
return ResponseMsgUtil.success(weChatQrcodeUtils.qrCodePictureUrl(ticket));
} catch (WxErrorException e) {
return ResponseMsgUtil.exception(e);
}
@ -136,5 +251,96 @@ public class WxMsgController {
}
}
@RequestMapping(value = "/verifyWx", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "微信签名")
public ResponseData verifyWx(@RequestParam(value = "url", required = true) String url) {
try {
// 获取access_token
Map<String, Object> params = new HashMap<>();
params.put("appid", SysConst.getSysConfig().getWxH5AppId());
params.put("secret", SysConst.getSysConfig().getWxH5AppSecret());
params.put("grant_type", "client_credential");
JSONObject accessTokenObject = HttpsUtils.doGet("https://api.weixin.qq.com/cgi-bin/token", params);
// 获取ticket
Map<String, Object> ticketParams = new HashMap<>();
ticketParams.put("access_token", accessTokenObject.getString("access_token"));
ticketParams.put("type", "jsapi");
JSONObject jsapiTicket = HttpsUtils.doGet("https://api.weixin.qq.com/cgi-bin/ticket/getticket", ticketParams);
// 拼接签名
Map<String, Object> map = new HashMap<>();
map.put("noncestr", WxUtils.makeNonStr());
map.put("jsapi_ticket",jsapiTicket.getString("ticket"));
map.put("timestamp", new Date().getTime());
map.put("url",url);
Map<String, Object> objectMap = new HashMap<>();
objectMap.put("appId" , SysConst.getSysConfig().getWxH5AppId());
objectMap.put("timestamp" , map.get("timestamp"));
objectMap.put("nonceStr" , map.get("noncestr"));
objectMap.put("signature" , WxUtils.getSHA1(map));
return ResponseMsgUtil.success(objectMap);
} catch (Exception e) {
return null;
}
}
@RequestMapping(value = "/getScheme", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取小程序scheme码")
public ResponseData getSchemeCode() {
try {
// 获取access_token
Map<String, Object> params = new HashMap<>();
params.put("appid", SysConst.getSysConfig().getWxAppId());
params.put("secret", SysConst.getSysConfig().getWxAppSecret());
params.put("grant_type", "client_credential");
JSONObject accessTokenObject = HttpsUtils.doGet("https://api.weixin.qq.com/cgi-bin/token", params);
JSONObject postObject = new JSONObject();
postObject.put("expire_type" ,1);
postObject.put("expire_interval" ,30);
JSONObject object = HttpsUtils.doPost("https://api.weixin.qq.com/wxa/generate_urllink?access_token=" + accessTokenObject.getString("access_token"), postObject);
return ResponseMsgUtil.success(object);
} catch (Exception e) {
return null;
}
}
// @RequestMapping(value = "/verifyWx", method = RequestMethod.GET)
// @ResponseBody
// @ApiOperation(value = "微信签名")
// public String verifyWx() {
//
// try {
//
// Map<String, Object> params = new HashMap<>();
// params.put("appid", SysConst.getSysConfig().getWxH5AppId());
// params.put("secret", SysConst.getSysConfig().getWxH5AppSecret());
// params.put("grant_type", "client_credential");
//
// JSONObject accessTokenObject = HttpsUtils.doGet("https://api.weixin.qq.com/cgi-bin/token", params);
//
// Map<String, Object> map = new HashMap<>();
// map.put("noncestr","Wm3WZYTPz0wzccnW");
// map.put("jsapi_ticket",accessTokenObject.getString("ticket"));
// map.put("timestamp","1414587457");
// map.put("url","http://mp.weixin.qq.com?params=value");
//
// return WxUtils.getSHA1(map);
// } catch (Exception e) {
// return null;
// }
//
// }
}

@ -50,18 +50,44 @@ spring:
#客户端id(不能重复)
# client:
# id: provider-id
#MQTT默认的消息推送主题,实际可在调用接口是指定
#MQTT默认的消息推送主题,实际可在调用接口是指定
# default:
# topic: topic
rocketmq:
name-server: 139.159.177.244:9876
producer:
#必须指定group
group: default-group
#配置日期返回至前台为时间戳
jackson:
serialization:
write-dates-as-timestamps: true
mybatis:
mapperLocations:
- classpath*:sqlmap*/*.xml
- classpath*:sqlmap*/*.xml
type-aliases-package:
org.springboot.sample.entity
jetcache:
statIntervalMinutes: 15
areaInCacheName: false
local:
default:
type: linkedhashmap
keyConvertor: fastjson
remote:
default:
type: redis
host: 139.159.177.244
port: 36379
password: HF123456.Redis
keyConvertor: fastjson
broadcastChannel: projectA
valueEncoder: java
valueDecoder: java
poolConfig:
minIdle: 5
maxIdle: 20
maxTotal: 50
pagehelper:
helperDialect: mysql

@ -1,2 +1,5 @@
wxH5AppId=wxa075e8509802f826
wxH5AppSecret=0e606fc1378d35e359fcf3f15570b2c5
wxAppId=wx8d49e2f83025229d
wxAppSecret=d8d6dcaef77d3b659258a01b5ddba5df

@ -0,0 +1,2 @@
wxH5AppId=wxa075e8509802f826
wxH5AppSecret=0e606fc1378d35e359fcf3f15570b2c5
Loading…
Cancel
Save