食谱计划生成优化、小程序接口
This commit is contained in:
@ -93,6 +93,9 @@ public class SysCustomer extends BaseEntity
|
||||
|
||||
private Long salesman;
|
||||
|
||||
//售中
|
||||
private Long onSaleId;
|
||||
|
||||
/** 负责人 */
|
||||
@Excel(name = "负责人")
|
||||
private Long chargePerson;
|
||||
@ -118,4 +121,6 @@ public class SysCustomer extends BaseEntity
|
||||
//病史体征ID
|
||||
private String physicalSignsId;
|
||||
|
||||
private Long loginUserId;
|
||||
|
||||
}
|
@ -296,4 +296,7 @@ public class SysOrder extends BaseEntity {
|
||||
//食谱计划是否连续上个订单
|
||||
private Integer recipesPlanContinue;
|
||||
|
||||
//登录用户ID
|
||||
private Long loginUserId;
|
||||
|
||||
}
|
@ -159,4 +159,8 @@ public class SysRecipesPlan {
|
||||
private Integer subSend;
|
||||
|
||||
private Integer smsSend;
|
||||
|
||||
/** 食谱计划总共几天,大于0小于等于7 */
|
||||
@Excel(name = "食谱计划总共几天,大于0小于等于7")
|
||||
private Integer totalNumDay;
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package com.stdiet.custom.domain;
|
||||
|
||||
import com.stdiet.common.annotation.Excel;
|
||||
import com.stdiet.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 小程序banner图对象 sys_wx_banner_image
|
||||
*
|
||||
* @author xzj
|
||||
* @date 2021-07-13
|
||||
*/
|
||||
@Data
|
||||
public class SysWxBannerImage extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** banner图标题 */
|
||||
@Excel(name = "banner图标题")
|
||||
private String title;
|
||||
|
||||
/** banner图内容 */
|
||||
@Excel(name = "banner图内容")
|
||||
private String content;
|
||||
|
||||
/** banner图片地址 */
|
||||
@Excel(name = "banner图片地址")
|
||||
private String bannerUrl;
|
||||
|
||||
/** 点击跳转地址 */
|
||||
@Excel(name = "点击跳转地址")
|
||||
private String jumpUrl;
|
||||
|
||||
/** 展示标识 0不展示 1展示 */
|
||||
@Excel(name = "展示标识 0不展示 1展示")
|
||||
private Long showFlag;
|
||||
|
||||
/** 顺序优先级,0-100 */
|
||||
@Excel(name = "顺序优先级,0-100")
|
||||
private Long orderNum;
|
||||
|
||||
/** 删除标识 0未删除 1已删除 */
|
||||
private Long delFlag;
|
||||
}
|
@ -74,6 +74,10 @@ public class SysWxUserInfo {
|
||||
@Excel(name = "国家")
|
||||
private String country;
|
||||
|
||||
/** 健康宣言 */
|
||||
@Excel(name = "健康宣言")
|
||||
private String healthManifesto;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private String createBy;
|
||||
|
@ -0,0 +1,28 @@
|
||||
package com.stdiet.custom.dto.response;
|
||||
|
||||
import com.stdiet.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class BannerResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** banner图标题 */
|
||||
@Excel(name = "banner图标题")
|
||||
private String title;
|
||||
|
||||
/** banner图内容 */
|
||||
@Excel(name = "banner图内容")
|
||||
private String content;
|
||||
|
||||
/** banner图片地址 */
|
||||
@Excel(name = "banner图片地址")
|
||||
private String bannerUrl;
|
||||
|
||||
/** 点击跳转地址 */
|
||||
@Excel(name = "点击跳转地址")
|
||||
private String jumpUrl;
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package com.stdiet.custom.dto.response;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@ -36,6 +37,7 @@ public class CommunityPunchReponse {
|
||||
/**
|
||||
* 打卡日期时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date logTime;
|
||||
|
||||
/**
|
||||
@ -51,7 +53,7 @@ public class CommunityPunchReponse {
|
||||
/**
|
||||
* 点赞数
|
||||
*/
|
||||
private String thumbsupNum;
|
||||
private Integer thumbsupNum;
|
||||
|
||||
/**
|
||||
* 健康宣言
|
||||
|
@ -0,0 +1,68 @@
|
||||
package com.stdiet.custom.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.stdiet.custom.domain.SysWxBannerImage;
|
||||
import com.stdiet.custom.dto.response.BannerResponse;
|
||||
|
||||
/**
|
||||
* 小程序banner图Mapper接口
|
||||
*
|
||||
* @author xzj
|
||||
* @date 2021-07-13
|
||||
*/
|
||||
public interface SysWxBannerImageMapper
|
||||
{
|
||||
/**
|
||||
* 查询小程序banner图
|
||||
*
|
||||
* @param id 小程序banner图ID
|
||||
* @return 小程序banner图
|
||||
*/
|
||||
public SysWxBannerImage selectSysWxBannerImageById(Long id);
|
||||
|
||||
/**
|
||||
* 查询小程序banner图列表
|
||||
*
|
||||
* @param sysWxBannerImage 小程序banner图
|
||||
* @return 小程序banner图集合
|
||||
*/
|
||||
public List<SysWxBannerImage> selectSysWxBannerImageList(SysWxBannerImage sysWxBannerImage);
|
||||
|
||||
/**
|
||||
* 新增小程序banner图
|
||||
*
|
||||
* @param sysWxBannerImage 小程序banner图
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysWxBannerImage(SysWxBannerImage sysWxBannerImage);
|
||||
|
||||
/**
|
||||
* 修改小程序banner图
|
||||
*
|
||||
* @param sysWxBannerImage 小程序banner图
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysWxBannerImage(SysWxBannerImage sysWxBannerImage);
|
||||
|
||||
/**
|
||||
* 删除小程序banner图
|
||||
*
|
||||
* @param id 小程序banner图ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysWxBannerImageById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除小程序banner图
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysWxBannerImageByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 根据优先级排序获取banner图
|
||||
* @return
|
||||
*/
|
||||
List<BannerResponse> getBannerListOrderByOrderNum(SysWxBannerImage sysWxBannerImage);
|
||||
}
|
@ -77,4 +77,11 @@ public interface SysWxUserInfoMapper
|
||||
* @return
|
||||
*/
|
||||
public int removeCusIdByOpenId(@Param("openid")String openid);
|
||||
|
||||
/**
|
||||
* 根据cusId更新健康减脂宣言
|
||||
* @param sysWxUserInfo
|
||||
* @return
|
||||
*/
|
||||
public int updateHealthManifestoByCusId(SysWxUserInfo sysWxUserInfo);
|
||||
}
|
@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import com.stdiet.custom.domain.SysWxUserInfo;
|
||||
import com.stdiet.custom.domain.SysWxUserLog;
|
||||
import com.stdiet.custom.dto.response.CommunityPunchReponse;
|
||||
import com.stdiet.custom.page.WxLogInfo;
|
||||
|
||||
/**
|
||||
@ -92,4 +93,24 @@ public interface SysWxUserLogMapper
|
||||
*/
|
||||
WxLogInfo getWxLogInfoDetailById(SysWxUserLog sysWxUserLog);
|
||||
|
||||
/**
|
||||
* 查询打卡社区记录
|
||||
* @param sysWxUserLog
|
||||
* @return
|
||||
*/
|
||||
List<CommunityPunchReponse> getCommunityPunch(SysWxUserLog sysWxUserLog);
|
||||
|
||||
/**
|
||||
* 根据打卡社区
|
||||
* @param sysWxUserLog
|
||||
* @return
|
||||
*/
|
||||
int getPunchTotalNum(SysWxUserLog sysWxUserLog);
|
||||
|
||||
/**
|
||||
* 查询打卡社区总共打卡人数
|
||||
* @return
|
||||
*/
|
||||
int getPunchCustomerTotalNum();
|
||||
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.stdiet.custom.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.stdiet.custom.domain.SysWxBannerImage;
|
||||
import com.stdiet.custom.dto.response.BannerResponse;
|
||||
|
||||
/**
|
||||
* 小程序banner图Service接口
|
||||
*
|
||||
* @author xzj
|
||||
* @date 2021-07-13
|
||||
*/
|
||||
public interface ISysWxBannerImageService
|
||||
{
|
||||
/**
|
||||
* 查询小程序banner图
|
||||
*
|
||||
* @param id 小程序banner图ID
|
||||
* @return 小程序banner图
|
||||
*/
|
||||
public SysWxBannerImage selectSysWxBannerImageById(Long id);
|
||||
|
||||
/**
|
||||
* 查询小程序banner图列表
|
||||
*
|
||||
* @param sysWxBannerImage 小程序banner图
|
||||
* @return 小程序banner图集合
|
||||
*/
|
||||
public List<SysWxBannerImage> selectSysWxBannerImageList(SysWxBannerImage sysWxBannerImage);
|
||||
|
||||
/**
|
||||
* 新增小程序banner图
|
||||
*
|
||||
* @param sysWxBannerImage 小程序banner图
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysWxBannerImage(SysWxBannerImage sysWxBannerImage);
|
||||
|
||||
/**
|
||||
* 修改小程序banner图
|
||||
*
|
||||
* @param sysWxBannerImage 小程序banner图
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysWxBannerImage(SysWxBannerImage sysWxBannerImage);
|
||||
|
||||
/**
|
||||
* 批量删除小程序banner图
|
||||
*
|
||||
* @param ids 需要删除的小程序banner图ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysWxBannerImageByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除小程序banner图信息
|
||||
*
|
||||
* @param id 小程序banner图ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysWxBannerImageById(Long id);
|
||||
|
||||
/**
|
||||
* 根据优先级排序获取banner图
|
||||
* @return
|
||||
*/
|
||||
List<BannerResponse> getBannerListOrderByOrderNum(SysWxBannerImage sysWxBannerImage);
|
||||
}
|
@ -77,5 +77,12 @@ public interface ISysWxUserInfoService
|
||||
*/
|
||||
public int removeCusIdByOpenId(String openid);
|
||||
|
||||
/**
|
||||
* 根据cusId更新健康减脂宣言
|
||||
* @param sysWxUserInfo
|
||||
* @return
|
||||
*/
|
||||
public int updateHealthManifestoByCusId(SysWxUserInfo sysWxUserInfo);
|
||||
|
||||
|
||||
}
|
@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import com.stdiet.custom.domain.SysWxUserInfo;
|
||||
import com.stdiet.custom.domain.SysWxUserLog;
|
||||
import com.stdiet.custom.dto.response.CommunityPunchReponse;
|
||||
import com.stdiet.custom.page.WxLogInfo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@ -94,4 +95,24 @@ public interface ISysWxUserLogService
|
||||
*/
|
||||
WxLogInfo getWxLogInfoDetailById(SysWxUserLog sysWxUserLog);
|
||||
|
||||
/**
|
||||
* 查询打卡社区记录
|
||||
* @param sysWxUserLog
|
||||
* @return
|
||||
*/
|
||||
List<CommunityPunchReponse> getCommunityPunch(SysWxUserLog sysWxUserLog);
|
||||
|
||||
/**
|
||||
* 根据打卡社区
|
||||
* @param sysWxUserLog
|
||||
* @return
|
||||
*/
|
||||
int getPunchTotalNum(SysWxUserLog sysWxUserLog);
|
||||
|
||||
/**
|
||||
* 查询打卡社区总共打卡人数
|
||||
* @return
|
||||
*/
|
||||
int getPunchCustomerTotalNum();
|
||||
|
||||
}
|
@ -191,7 +191,7 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
||||
pauseParam.setCusId(sysOrder.getCusId());
|
||||
List<SysOrderPause> pauseList = sysOrderPauseService.getPauseListByCusIdAndOrderId(pauseParam);
|
||||
|
||||
List<SysRecipesPlan> planList = generatePlan(sysOrder, DateUtils.dateToLocalDate(sysOrder.getStartTime()), DateUtils.dateToLocalDate(sysOrder.getServerEndTime()), pauseList);
|
||||
List<SysRecipesPlan> planList = generatePlan(sysOrder, DateUtils.dateToLocalDate(sysOrder.getStartTime()), DateUtils.dateToLocalDate(sysOrder.getServerEndTime()), pauseList, oldRecipesPlanList);
|
||||
if (oldRecipesPlanList != null && oldRecipesPlanList.size() > 0) {
|
||||
updateOrAddRecipesPlan(oldRecipesPlanList, planList);
|
||||
} else {
|
||||
@ -328,13 +328,15 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
||||
* @param pauseList 暂停列表
|
||||
* @return
|
||||
*/
|
||||
private List<SysRecipesPlan> generatePlan(SysOrder sysOrder, LocalDate serverStartDate, LocalDate serverEndDate, List<SysOrderPause> pauseList) {
|
||||
private List<SysRecipesPlan> generatePlan(SysOrder sysOrder, LocalDate serverStartDate, LocalDate serverEndDate, List<SysOrderPause> pauseList, List<SysRecipesPlan> oldRecipesPlanList) {
|
||||
//查询在上一个订单最后一条食谱计划
|
||||
SysRecipesPlan beforeOrderLastPlan = getLastDayRecipesPlan(sysOrder.getCusId(), sysOrder.getOrderTime());
|
||||
int startNumDay = 0;
|
||||
//System.out.println(sysOrder.getRecipesPlanContinue() == null);
|
||||
int totalDays = (beforeOrderLastPlan != null ? beforeOrderLastPlan.getEndNumDay() : 0) + Integer.parseInt(ChronoUnit.DAYS.between(DateUtils.dateToLocalDate(sysOrder.getStartTime()), DateUtils.dateToLocalDate(sysOrder.getServerEndTime()))+"") + 1;
|
||||
//System.out.println(totalDays);
|
||||
//每条食谱计划日期相差的天数
|
||||
int totalNumDay = 6;
|
||||
//之前是否存在食谱以及该订单食谱计划是否需要连续
|
||||
if (beforeOrderLastPlan != null && sysOrder.getRecipesPlanContinue().intValue() == 1) {
|
||||
long differDay = ChronoUnit.DAYS.between(DateUtils.dateToLocalDate(beforeOrderLastPlan.getEndDate()), serverStartDate);
|
||||
@ -342,21 +344,14 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
||||
if (differDay <= 1) {
|
||||
//判断前一个订单食谱是否满七天,不满则需要接上
|
||||
int differNum = beforeOrderLastPlan.getEndNumDay() - beforeOrderLastPlan.getStartNumDay();
|
||||
if (differNum < 6) {
|
||||
totalNumDay = beforeOrderLastPlan.getTotalNumDay() - 1;
|
||||
if (differNum != totalNumDay) {
|
||||
//更新该食谱计划
|
||||
beforeOrderLastPlan.setEndNumDay(beforeOrderLastPlan.getStartNumDay() + 6);
|
||||
//
|
||||
String[] pauseResult = dealPlanPause(DateUtils.dateToLocalDate(beforeOrderLastPlan.getEndDate()).plusDays(1), DateUtils.dateToLocalDate(beforeOrderLastPlan.getEndDate()).plusDays(6-differNum), pauseList);
|
||||
beforeOrderLastPlan.setEndNumDay(beforeOrderLastPlan.getStartNumDay() + totalNumDay);
|
||||
String[] pauseResult = dealPlanPause(DateUtils.dateToLocalDate(beforeOrderLastPlan.getEndDate()).plusDays(1), DateUtils.dateToLocalDate(beforeOrderLastPlan.getEndDate()).plusDays(totalNumDay-differNum), pauseList, totalNumDay);
|
||||
//LocalDate planStartDate = DateUtils.stringToLocalDate(pauseResult[0], "yyyyMMdd");
|
||||
LocalDate planEndDate = DateUtils.stringToLocalDate(pauseResult[1], "yyyyMMdd");
|
||||
beforeOrderLastPlan.setEndDate(DateUtils.localDateToDate(planEndDate));
|
||||
|
||||
//beforeOrderLastPlan.setEndDate(DateUtils.localDateToDate(DateUtils.dateToLocalDate(beforeOrderLastPlan.getEndDate()).plusDays(6 - differNum)));
|
||||
//
|
||||
/*String[] pauseResult = dealPlanPause(DateUtils.dateToLocalDate(beforeOrderLastPlan.getStartDate()), DateUtils.dateToLocalDate(beforeOrderLastPlan.getEndDate()), pauseList);
|
||||
//LocalDate planStartDate = DateUtils.stringToLocalDate(pauseResult[0], "yyyyMMdd");
|
||||
LocalDate planEndDate = DateUtils.stringToLocalDate(pauseResult[1], "yyyyMMdd");
|
||||
beforeOrderLastPlan.setEndDate(DateUtils.localDateToDate(planEndDate));*/
|
||||
sysRecipesPlanMapper.updateSysRecipesPlan(beforeOrderLastPlan);
|
||||
serverStartDate = DateUtils.dateToLocalDate(beforeOrderLastPlan.getEndDate()).plusDays(1);
|
||||
}
|
||||
@ -368,15 +363,17 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
||||
LocalDate planStartDate = null;
|
||||
LocalDate planEndDate = serverStartDate.plusDays(-1);
|
||||
boolean breakFlag = true;
|
||||
Map<String,Integer> totalDayNumMap = getOldEveryPlanTotalNumDay(oldRecipesPlanList);
|
||||
do {
|
||||
totalNumDay = totalDayNumMap.containsKey(startNumDay+1+"") ? totalDayNumMap.get(startNumDay+1+"") : 6;
|
||||
SysRecipesPlan sysRecipesPlan = new SysRecipesPlan();
|
||||
planStartDate = planEndDate.plusDays(1);
|
||||
planEndDate = planStartDate.plusDays(6);
|
||||
planEndDate = planStartDate.plusDays(totalNumDay);
|
||||
//判断是否大于服务到期时间
|
||||
if (ChronoUnit.DAYS.between(planEndDate, serverEndDate) <= 0) {
|
||||
planEndDate = serverEndDate;
|
||||
}
|
||||
String[] pauseResult = dealPlanPause(planStartDate, planEndDate, pauseList);
|
||||
String[] pauseResult = dealPlanPause(planStartDate, planEndDate, pauseList,totalNumDay);
|
||||
//根据暂停结果返回的数据更新计划开始、结束时间
|
||||
planStartDate = DateUtils.stringToLocalDate(pauseResult[0], "yyyyMMdd");
|
||||
planEndDate = DateUtils.stringToLocalDate(pauseResult[1], "yyyyMMdd");
|
||||
@ -402,7 +399,7 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
||||
startNumDay += 1;
|
||||
sysRecipesPlan.setStartNumDay(startNumDay);
|
||||
long dayNumber = ChronoUnit.DAYS.between(planStartDate, planEndDate);
|
||||
startNumDay += dayNumber > 6 ? 6 : dayNumber;
|
||||
startNumDay += dayNumber > totalNumDay ? totalNumDay : dayNumber;
|
||||
sysRecipesPlan.setEndNumDay(startNumDay > totalDays ? totalDays : startNumDay);//
|
||||
//添加暂停范围内的日期
|
||||
planList.add(sysRecipesPlan);
|
||||
@ -411,6 +408,14 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
||||
return planList;
|
||||
}
|
||||
|
||||
public Map<String, Integer> getOldEveryPlanTotalNumDay(List<SysRecipesPlan> oldRecipesPlanList){
|
||||
Map<String, Integer> map = new HashMap<>();
|
||||
for (SysRecipesPlan plan : oldRecipesPlanList) {
|
||||
map.put(plan.getStartNumDay()+"", plan.getTotalNumDay()-1);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据食谱开始时间、结束时间、暂停列表获取在食谱计划范围内的暂停天数,以及返回调整之后的计划开始、结束时间,以及暂停日期
|
||||
*
|
||||
@ -419,7 +424,7 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
||||
* @param pauseList 暂停列表集合
|
||||
* @return
|
||||
*/
|
||||
private String[] dealPlanPause(LocalDate planStartDate, LocalDate planEndDate, List<SysOrderPause> pauseList) {
|
||||
private String[] dealPlanPause(LocalDate planStartDate, LocalDate planEndDate, List<SysOrderPause> pauseList, int totalNumDay) {
|
||||
//分别为计划开始时间、计划结束时间,范围内暂停天数,具体暂停日期,使用|隔开
|
||||
String[] result = {"", "", "0", ""};
|
||||
long pauseDay = 0;
|
||||
@ -443,7 +448,7 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
||||
//判断暂停记录是否从食谱计划开始时间开始的
|
||||
if (ChronoUnit.DAYS.between(pauseStartDate, planStartDate) == 0) {
|
||||
planStartDate = pauseEndDate.plusDays(1);
|
||||
planEndDate = planStartDate.plusDays(6);
|
||||
planEndDate = planStartDate.plusDays(totalNumDay);
|
||||
} else {
|
||||
planEndDate = planEndDate.plusDays(ChronoUnit.DAYS.between(pauseStartDate, pauseEndDate) + 1);
|
||||
pauseDateString.addAll(getPauseDateString(pauseStartDate, pauseEndDate));
|
||||
|
@ -0,0 +1,106 @@
|
||||
package com.stdiet.custom.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.stdiet.common.utils.DateUtils;
|
||||
import com.stdiet.custom.dto.response.BannerResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.stdiet.custom.mapper.SysWxBannerImageMapper;
|
||||
import com.stdiet.custom.domain.SysWxBannerImage;
|
||||
import com.stdiet.custom.service.ISysWxBannerImageService;
|
||||
|
||||
/**
|
||||
* 小程序banner图Service业务层处理
|
||||
*
|
||||
* @author xzj
|
||||
* @date 2021-07-13
|
||||
*/
|
||||
@Service
|
||||
public class SysWxBannerImageServiceImpl implements ISysWxBannerImageService
|
||||
{
|
||||
@Autowired
|
||||
private SysWxBannerImageMapper sysWxBannerImageMapper;
|
||||
|
||||
/**
|
||||
* 查询小程序banner图
|
||||
*
|
||||
* @param id 小程序banner图ID
|
||||
* @return 小程序banner图
|
||||
*/
|
||||
@Override
|
||||
public SysWxBannerImage selectSysWxBannerImageById(Long id)
|
||||
{
|
||||
return sysWxBannerImageMapper.selectSysWxBannerImageById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询小程序banner图列表
|
||||
*
|
||||
* @param sysWxBannerImage 小程序banner图
|
||||
* @return 小程序banner图
|
||||
*/
|
||||
@Override
|
||||
public List<SysWxBannerImage> selectSysWxBannerImageList(SysWxBannerImage sysWxBannerImage)
|
||||
{
|
||||
return sysWxBannerImageMapper.selectSysWxBannerImageList(sysWxBannerImage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增小程序banner图
|
||||
*
|
||||
* @param sysWxBannerImage 小程序banner图
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysWxBannerImage(SysWxBannerImage sysWxBannerImage)
|
||||
{
|
||||
sysWxBannerImage.setCreateTime(DateUtils.getNowDate());
|
||||
return sysWxBannerImageMapper.insertSysWxBannerImage(sysWxBannerImage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改小程序banner图
|
||||
*
|
||||
* @param sysWxBannerImage 小程序banner图
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSysWxBannerImage(SysWxBannerImage sysWxBannerImage)
|
||||
{
|
||||
sysWxBannerImage.setUpdateTime(DateUtils.getNowDate());
|
||||
return sysWxBannerImageMapper.updateSysWxBannerImage(sysWxBannerImage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除小程序banner图
|
||||
*
|
||||
* @param ids 需要删除的小程序banner图ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysWxBannerImageByIds(Long[] ids)
|
||||
{
|
||||
return sysWxBannerImageMapper.deleteSysWxBannerImageByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除小程序banner图信息
|
||||
*
|
||||
* @param id 小程序banner图ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysWxBannerImageById(Long id)
|
||||
{
|
||||
return sysWxBannerImageMapper.deleteSysWxBannerImageById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据优先级排序获取banner图
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<BannerResponse> getBannerListOrderByOrderNum(SysWxBannerImage sysWxBannerImage){
|
||||
return sysWxBannerImageMapper.getBannerListOrderByOrderNum(sysWxBannerImage);
|
||||
}
|
||||
}
|
@ -115,4 +115,13 @@ public class SysWxUserInfoServiceImpl implements ISysWxUserInfoService {
|
||||
public int removeCusIdByOpenId(String openid){
|
||||
return sysWxUserInfoMapper.removeCusIdByOpenId(openid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据cusId更新健康减脂宣言
|
||||
* @param sysWxUserInfo
|
||||
* @return
|
||||
*/
|
||||
public int updateHealthManifestoByCusId(SysWxUserInfo sysWxUserInfo){
|
||||
return sysWxUserInfoMapper.updateHealthManifestoByCusId(sysWxUserInfo);
|
||||
}
|
||||
}
|
@ -11,6 +11,7 @@ import com.stdiet.common.utils.oss.AliyunOSSUtils;
|
||||
import com.stdiet.custom.domain.SysMessageNotice;
|
||||
import com.stdiet.custom.domain.SysWxUserInfo;
|
||||
import com.stdiet.custom.domain.entityEnum.MessageNoticeEnum;
|
||||
import com.stdiet.custom.dto.response.CommunityPunchReponse;
|
||||
import com.stdiet.custom.page.WxLogInfo;
|
||||
import com.stdiet.custom.service.ISysMessageNoticeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -145,4 +146,30 @@ public class SysWxUserLogServiceImpl implements ISysWxUserLogService {
|
||||
return sysWxUserLogMapper.getWxLogInfoDetailById(sysWxUserLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询打卡社区记录
|
||||
* @param sysWxUserLog
|
||||
* @return
|
||||
*/
|
||||
public List<CommunityPunchReponse> getCommunityPunch(SysWxUserLog sysWxUserLog){
|
||||
return sysWxUserLogMapper.getCommunityPunch(sysWxUserLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据打卡社区
|
||||
* @param sysWxUserLog
|
||||
* @return
|
||||
*/
|
||||
public int getPunchTotalNum(SysWxUserLog sysWxUserLog){
|
||||
return sysWxUserLogMapper.getPunchTotalNum(sysWxUserLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询打卡社区总共打卡人数
|
||||
* @return
|
||||
*/
|
||||
public int getPunchCustomerTotalNum(){
|
||||
return sysWxUserLogMapper.getPunchCustomerTotalNum();
|
||||
}
|
||||
|
||||
}
|
@ -28,6 +28,7 @@
|
||||
<result property="assistantDietitian" column="assistant_dietitian"/>
|
||||
<result property="afterDietitian" column="after_dietitian"/>
|
||||
<result property="salesman" column="salesman"/>
|
||||
<result property="onSaleId" column="on_sale_id" />
|
||||
|
||||
<association property="dietitianName" column="{id=main_dietitian}" select="selectUserName"/>
|
||||
<association property="assDietitianName" column="{id=assistant_dietitian}" select="selectUserName"/>
|
||||
@ -40,14 +41,23 @@
|
||||
</select>
|
||||
|
||||
<sql id="selectSysCustomerVo">
|
||||
select id, name, phone, email, fans_time, fans_channel, address, pay_date, start_date, purchase_num, pay_total, main_dietitian, assistant_dietitian, after_dietitian, salesman, charge_person, follow_status, create_time, create_by, update_time, update_by, channel_id from sys_customer
|
||||
select id, name, phone, email, fans_time, fans_channel, address, pay_date, start_date, purchase_num, pay_total, main_dietitian, assistant_dietitian, after_dietitian, salesman, on_sale_id, charge_person, follow_status, create_time, create_by, update_time, update_by, channel_id from sys_customer
|
||||
</sql>
|
||||
|
||||
<sql id="searchLoginUserId">
|
||||
<if test="loginUserId != null">
|
||||
and (
|
||||
sc.main_dietitian = #{loginUserId} or sc.assistant_dietitian = #{loginUserId} or sc.after_dietitian = #{loginUserId} or sc.salesman = #{loginUserId}
|
||||
or sc.on_sale_id = #{loginUserId}
|
||||
)
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="selectSysCustomerList" parameterType="SysCustomer" resultMap="SysCustomerResult">
|
||||
select
|
||||
sc.id, sc.name, sc.phone, sc.email, sc.fans_time, sc.fans_channel, sc.address, sc.pay_date, sc.start_date,
|
||||
sc.purchase_num, sc.pay_total, sc.main_dietitian,
|
||||
sc.assistant_dietitian, sc.after_dietitian, sc.salesman, sc.charge_person, sc.follow_status,
|
||||
sc.assistant_dietitian, sc.after_dietitian, sc.on_sale_id, sc.salesman, sc.charge_person, sc.follow_status,
|
||||
sc.create_time,sc.channel_id
|
||||
from sys_customer sc
|
||||
left join sys_customer_healthy as sch
|
||||
@ -60,6 +70,7 @@
|
||||
<if test="mainDietitian == 0">and (isnull(sc.main_dietitian) or sc.main_dietitian=0)</if>
|
||||
<if test="salesman != null and salesman != ''">and sc.salesman = #{salesman}</if>
|
||||
<if test="salesman == 0">and (isnull(sc.salesman) or sc.salesman=0)</if>
|
||||
<if test="onSaleId != null">and sc.on_sale_id = #{onSaleId}</if>
|
||||
<if test="afterDietitian != null and afterDietitian != ''">and sc.after_dietitian = #{afterDietitian}</if>
|
||||
<if test="afterDietitian == 0">and (isnull(sc.after_dietitian) or sc.after_dietitian=0)</if>
|
||||
<if test="assistantDietitian != null and assistantDietitian != ''">and sc.assistant_dietitian =
|
||||
@ -82,6 +93,9 @@
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<include refid="searchLoginUserId">
|
||||
<property name="loginUserId" value="#{loginUserId}"/>
|
||||
</include>
|
||||
order by sc.create_time desc
|
||||
</select>
|
||||
|
||||
@ -107,6 +121,7 @@
|
||||
<if test="assistantDietitian != null">assistant_dietitian,</if>
|
||||
<if test="afterDietitian != null">after_dietitian,</if>
|
||||
<if test="salesman != null">salesman,</if>
|
||||
<if test="onSaleId != null">on_sale_id,</if>
|
||||
<if test="chargePerson != null">charge_person,</if>
|
||||
<if test="followStatus != null">follow_status,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
@ -130,6 +145,7 @@
|
||||
<if test="assistantDietitian != null">#{assistantDietitian},</if>
|
||||
<if test="afterDietitian != null">#{afterDietitian},</if>
|
||||
<if test="salesman != null">#{salesman},</if>
|
||||
<if test="onSaleId != null">#{onSaleId},</if>
|
||||
<if test="chargePerson != null">#{chargePerson},</if>
|
||||
<if test="followStatus != null">#{followStatus},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
@ -157,6 +173,7 @@
|
||||
<if test="assistantDietitian != null">assistant_dietitian = #{assistantDietitian},</if>
|
||||
<if test="afterDietitian != null">after_dietitian = #{afterDietitian},</if>
|
||||
<if test="salesman != null">salesman = #{salesman},</if>
|
||||
<if test="onSaleId != null">on_sale_id = #{onSaleId},</if>
|
||||
<if test="chargePerson != null">charge_person = #{chargePerson},</if>
|
||||
<if test="followStatus != null">follow_status = #{followStatus},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
|
@ -95,28 +95,97 @@
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<sql id="searchLoginUserId">
|
||||
<if test="loginUserId != null">
|
||||
and (
|
||||
sc.main_dietitian = #{loginUserId} or sc.assistant_dietitian = #{loginUserId} or sc.after_dietitian = #{loginUserId} or sc.salesman = #{loginUserId}
|
||||
or o.pre_sale_id = #{loginUserId} or o.on_sale_id = #{loginUserId} or o.after_sale_id = #{loginUserId} or o.nutritionist_id = #{loginUserId} or
|
||||
o.nutri_assis_id = #{loginUserId}
|
||||
)
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="selectAllOrderAmount" parameterType="SysOrder" resultType="BigDecimal">
|
||||
SELECT SUM(amount) FROM sys_order
|
||||
SELECT SUM(amount) FROM sys_order o LEFT JOIN sys_customer sc ON sc.id = o.cus_id
|
||||
<where>
|
||||
<if test="orderId != null and orderId != ''">and order_id = #{orderId}</if>
|
||||
<if test="orderId != null and orderId != ''">and o.order_id = #{orderId}</if>
|
||||
<if test="customer != null and customer != ''">
|
||||
and (customer like concat('%',#{customer},'%') or phone like concat('%',#{customer},'%'))
|
||||
and (o.customer like concat('%',#{customer},'%') or o.phone like concat('%',#{customer},'%'))
|
||||
</if>
|
||||
<if test="accRange != null">
|
||||
and account_id in
|
||||
and o.account_id in
|
||||
<foreach collection="accRange" separator="," item="acc" open="(" close=")" >
|
||||
#{acc}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="cusId != null and cusId != ''">and cus_id = #{cusId}</if>
|
||||
<if test="cusId != null and cusId != ''">and o.cus_id = #{cusId}</if>
|
||||
<!-- <if test="phone != null and phone != ''">and phone = #{phone}</if>-->
|
||||
<if test="status != null ">and o.status = #{status}</if>
|
||||
<if test="payTypeId != null ">and o.pay_type_id = #{payTypeId}</if>
|
||||
<if test="preSaleId != null ">and o.pre_sale_id = #{preSaleId}</if>
|
||||
<if test="pushPreSaleId != null ">and o.push_pre_sale_id = #{pushPreSaleId}</if>
|
||||
<if test="onSaleId != null">
|
||||
and o.on_sale_id = #{onSaleId}
|
||||
</if>
|
||||
<if test="afterSaleId != null ">and o.after_sale_id = #{afterSaleId}</if>
|
||||
<if test="nutritionistId != null ">and o.nutritionist_id = #{nutritionistId}</if>
|
||||
<if test="nutriAssisId != null ">and o.nutri_assis_id = #{nutriAssisId}</if>
|
||||
<if test="accountId != null ">and o.account_id = #{accountId}</if>
|
||||
<if test="plannerId != null ">and o.planner_id = #{plannerId}</if>
|
||||
<if test="plannerAssisId != null ">and o.planner_assis_id = #{plannerAssisId}</if>
|
||||
<if test="operatorId != null ">and o.operator_id = #{operatorId}</if>
|
||||
<if test="operatorAssisId != null ">and o.operator_assis_id = #{operatorAssisId}</if>
|
||||
<if test="recommender != null and recommender != ''">and o.recommender = #{recommender}</if>
|
||||
<if test="beginTime != null and beginTime != ''">and date_format(o.order_time,'%y%m%d') >=
|
||||
date_format(#{beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">and date_format(o.order_time,'%y%m%d') <=
|
||||
date_format(#{endTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="serveTimeId != null ">and o.serve_time_id = #{serveTimeId}</if>
|
||||
<if test="reviewStatus != null ">and o.review_status = #{reviewStatus}</if>
|
||||
<if test="amountFlag != null">
|
||||
<if test="amountFlag == 0">
|
||||
and o.amount >= 0
|
||||
</if>
|
||||
<if test="amountFlag == 1">
|
||||
and 0 > o.amount
|
||||
</if>
|
||||
</if>
|
||||
<include refid="searchOrderType">
|
||||
<property name="reviewStatus" value="#{searchOrderTypeArray}"/>
|
||||
</include>
|
||||
<include refid="searchLoginUserId">
|
||||
<property name="loginUserId" value="#{loginUserId}"/>
|
||||
</include>
|
||||
<if test="true">and o.del_flag = 0</if>
|
||||
<!-- 计算总额时需要除去二开售后提成单 -->
|
||||
AND o.after_sale_commiss_order = 0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysOrderList" parameterType="SysOrder" resultMap="SysOrderResult">
|
||||
<include refid="selectSysOrderVo"/>
|
||||
<where>
|
||||
<if test="orderId != null and orderId != ''">and sc.order_id = #{orderId}</if>
|
||||
<if test="customer != null and customer != ''">
|
||||
and (sc.name like concat('%',#{customer},'%') or sc.phone like concat('%',#{customer},'%'))
|
||||
</if>
|
||||
<if test="accRange != null">
|
||||
and account_id in
|
||||
<foreach collection="accRange" separator="," item="acc" open="(" close=")">
|
||||
#{acc}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="cusId != null and cusId != ''">and cus_id = #{cusId}</if>
|
||||
<if test="phone != null and phone != ''">and sc.phone = #{phone}</if>
|
||||
<if test="status != null ">and status = #{status}</if>
|
||||
<if test="payTypeId != null ">and pay_type_id = #{payTypeId}</if>
|
||||
<if test="preSaleId != null ">and pre_sale_id = #{preSaleId}</if>
|
||||
<if test="pushPreSaleId != null ">and push_pre_sale_id = #{pushPreSaleId}</if>
|
||||
<if test="onSaleId != null">
|
||||
and on_sale_id = #{onSaleId}
|
||||
and o.on_sale_id = #{onSaleId}
|
||||
</if>
|
||||
<if test="preSaleId != null ">and pre_sale_id = #{preSaleId}</if>
|
||||
<if test="afterSaleId != null ">and after_sale_id = #{afterSaleId}</if>
|
||||
<if test="nutritionistId != null ">and nutritionist_id = #{nutritionistId}</if>
|
||||
<if test="nutriAssisId != null ">and nutri_assis_id = #{nutriAssisId}</if>
|
||||
@ -145,61 +214,8 @@
|
||||
<include refid="searchOrderType">
|
||||
<property name="reviewStatus" value="#{searchOrderTypeArray}"/>
|
||||
</include>
|
||||
<if test="true">and del_flag = 0</if>
|
||||
<!-- 计算总额时需要除去二开售后提成单 -->
|
||||
AND after_sale_commiss_order = 0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysOrderList" parameterType="SysOrder" resultMap="SysOrderResult">
|
||||
<include refid="selectSysOrderVo"/>
|
||||
<where>
|
||||
<if test="orderId != null and orderId != ''">and order_id = #{orderId}</if>
|
||||
<if test="customer != null and customer != ''">
|
||||
and (sc.name like concat('%',#{customer},'%') or sc.phone like concat('%',#{customer},'%'))
|
||||
</if>
|
||||
<if test="accRange != null">
|
||||
and account_id in
|
||||
<foreach collection="accRange" separator="," item="acc" open="(" close=")">
|
||||
#{acc}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="cusId != null and cusId != ''">and cus_id = #{cusId}</if>
|
||||
<if test="phone != null and phone != ''">and sc.phone = #{phone}</if>
|
||||
<if test="status != null ">and status = #{status}</if>
|
||||
<if test="payTypeId != null ">and pay_type_id = #{payTypeId}</if>
|
||||
<if test="pushPreSaleId != null ">and push_pre_sale_id = #{pushPreSaleId}</if>
|
||||
<if test="onSaleId != null">
|
||||
and on_sale_id = #{onSaleId}
|
||||
</if>
|
||||
<if test="preSaleId != null ">and pre_sale_id = #{preSaleId}</if>
|
||||
<if test="afterSaleId != null ">and after_sale_id = #{afterSaleId}</if>
|
||||
<if test="nutritionistId != null ">and nutritionist_id = #{nutritionistId}</if>
|
||||
<if test="nutriAssisId != null ">and nutri_assis_id = #{nutriAssisId}</if>
|
||||
<if test="accountId != null ">and account_id = #{accountId}</if>
|
||||
<if test="plannerId != null ">and planner_id = #{plannerId}</if>
|
||||
<if test="plannerAssisId != null ">and planner_assis_id = #{plannerAssisId}</if>
|
||||
<if test="operatorId != null ">and operator_id = #{operatorId}</if>
|
||||
<if test="operatorAssisId != null ">and operator_assis_id = #{operatorAssisId}</if>
|
||||
<if test="recommender != null and recommender != ''">and recommender = #{recommender}</if>
|
||||
<if test="beginTime != null and beginTime != ''">and date_format(order_time,'%y%m%d') >=
|
||||
date_format(#{beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">and date_format(order_time,'%y%m%d') <=
|
||||
date_format(#{endTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="serveTimeId != null ">and serve_time_id = #{serveTimeId}</if>
|
||||
<if test="reviewStatus != null ">and review_status = #{reviewStatus}</if>
|
||||
<if test="amountFlag != null">
|
||||
<if test="amountFlag == 0">
|
||||
and amount >= 0
|
||||
</if>
|
||||
<if test="amountFlag == 1">
|
||||
and 0 > amount
|
||||
</if>
|
||||
</if>
|
||||
<include refid="searchOrderType">
|
||||
<property name="reviewStatus" value="#{searchOrderTypeArray}"/>
|
||||
<include refid="searchLoginUserId">
|
||||
<property name="loginUserId" value="#{loginUserId}"/>
|
||||
</include>
|
||||
<if test="true">and o.del_flag = 0</if>
|
||||
</where>
|
||||
|
@ -25,6 +25,7 @@
|
||||
<result property="outId" column="out_id"/>
|
||||
<result property="subSend" column="sub_send"/>
|
||||
<result property="smsSend" column="sms_send"/>
|
||||
<result property="totalNumDay" column="total_num_day" />
|
||||
<!-- 非持久化字段 -->
|
||||
<!-- <result property="customerId" column="cus_id"></result><!– 客户ID –>-->
|
||||
<result property="customer" column="customer"/><!-- 客户姓名 -->
|
||||
@ -41,7 +42,7 @@
|
||||
|
||||
|
||||
<sql id="selectSysRecipesPlanVo">
|
||||
select id, order_id, cus_id, out_id, start_date, end_date, start_num_day, end_num_day, recipes_id, send_flag, send_time, pause_date, create_time, create_by, update_time, update_by, del_flag, review_status, sub_send, sms_send, subscribed, remark
|
||||
select id, order_id, cus_id, out_id, start_date, end_date, start_num_day, end_num_day, recipes_id, send_flag, send_time, pause_date, create_time, create_by, update_time, update_by, del_flag, review_status, sub_send, sms_send, subscribed, remark,total_num_day
|
||||
from sys_recipes_plan
|
||||
</sql>
|
||||
|
||||
@ -96,6 +97,7 @@
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="reviewStatus != null">review_status,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="totalNumDay != null">total_num_day,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="orderId != null">#{orderId},</if>
|
||||
@ -116,6 +118,7 @@
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="reviewStatus != null">#{reviewStatus},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="totalNumDay != null">#{totalNumDay},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -144,6 +147,7 @@
|
||||
<if test="subSend != null">sub_send = #{subSend},</if>
|
||||
<if test="smsSend != null">sms_send = #{smsSend},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="totalNumDay != null">total_num_day = #{totalNumDay},</if>
|
||||
</trim>
|
||||
where id = #{id} and del_flag = 0
|
||||
</update>
|
||||
@ -226,7 +230,7 @@
|
||||
|
||||
<!-- 根据订单ID查询食谱计划 -->
|
||||
<select id="selectPlanListByOrderId" parameterType="SysRecipesPlan" resultMap="SysRecipesPlanResult">
|
||||
SELECT srp.id,srp.order_id,sr.customer,sr.phone, srp.start_date,srp.end_date,srp.send_flag,srp.send_time
|
||||
SELECT srp.id,srp.order_id,sr.customer,sr.phone, srp.start_date,srp.end_date,srp.send_flag,srp.send_time,srp.total_num_day
|
||||
FROM sys_recipes_plan srp
|
||||
LEFT JOIN sys_order sr ON sr.order_id = srp.order_id
|
||||
WHERE srp.del_flag = 0 AND sr.del_flag = 0 AND srp.order_id = #{orderId}
|
||||
|
@ -0,0 +1,104 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.stdiet.custom.mapper.SysWxBannerImageMapper">
|
||||
|
||||
<resultMap type="SysWxBannerImage" id="SysWxBannerImageResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="title" column="title" />
|
||||
<result property="content" column="content" />
|
||||
<result property="bannerUrl" column="banner_url" />
|
||||
<result property="jumpUrl" column="jump_url" />
|
||||
<result property="showFlag" column="show_flag" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysWxBannerImageVo">
|
||||
select id, title, content, banner_url, jump_url, show_flag, order_num, create_time, create_by, update_time, update_by, del_flag from sys_wx_banner_image
|
||||
</sql>
|
||||
|
||||
<select id="selectSysWxBannerImageList" parameterType="SysWxBannerImage" resultMap="SysWxBannerImageResult">
|
||||
<include refid="selectSysWxBannerImageVo"/> where del_flag = 0
|
||||
</select>
|
||||
|
||||
<select id="selectSysWxBannerImageById" parameterType="Long" resultMap="SysWxBannerImageResult">
|
||||
<include refid="selectSysWxBannerImageVo"/>
|
||||
where id = #{id} and del_flag = 0
|
||||
</select>
|
||||
|
||||
<insert id="insertSysWxBannerImage" parameterType="SysWxBannerImage" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_wx_banner_image
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="title != null">title,</if>
|
||||
<if test="content != null">content,</if>
|
||||
<if test="bannerUrl != null">banner_url,</if>
|
||||
<if test="jumpUrl != null">jump_url,</if>
|
||||
<if test="showFlag != null">show_flag,</if>
|
||||
<if test="orderNum != null">order_num,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="title != null">#{title},</if>
|
||||
<if test="content != null">#{content},</if>
|
||||
<if test="bannerUrl != null">#{bannerUrl},</if>
|
||||
<if test="jumpUrl != null">#{jumpUrl},</if>
|
||||
<if test="showFlag != null">#{showFlag},</if>
|
||||
<if test="orderNum != null">#{orderNum},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysWxBannerImage" parameterType="SysWxBannerImage">
|
||||
update sys_wx_banner_image
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="title != null">title = #{title},</if>
|
||||
<if test="content != null">content = #{content},</if>
|
||||
<if test="bannerUrl != null">banner_url = #{bannerUrl},</if>
|
||||
<if test="jumpUrl != null">jump_url = #{jumpUrl},</if>
|
||||
<if test="showFlag != null">show_flag = #{showFlag},</if>
|
||||
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteSysWxBannerImageById" parameterType="Long">
|
||||
update sys_wx_banner_image set del_flag = 1 where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteSysWxBannerImageByIds" parameterType="String">
|
||||
update sys_wx_banner_image set del_flag = 1 where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- 按照优先级顺序获取banner图 -->
|
||||
<select id="getBannerListOrderByOrderNum" parameterType="SysWxBannerImage" resultType="com.stdiet.custom.dto.response.BannerResponse">
|
||||
select title, content, banner_url as bannerUrl, jump_url as jumpUrl from sys_wx_banner_image
|
||||
where del_flag = 0
|
||||
<if test="showFlag != null">
|
||||
and show_flag = #{showFlag}
|
||||
</if>
|
||||
order by order_num desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -21,6 +21,7 @@
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="language" column="language"/>
|
||||
<result property="healthManifesto" column="health_manifesto" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysWxUserInfoVo">
|
||||
@ -75,6 +76,7 @@
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="language != null">language,</if>
|
||||
<if test="healthManifesto != null">health_manifesto,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="openid != null">#{openid},</if>
|
||||
@ -93,6 +95,7 @@
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="language != null">#{language},</if>
|
||||
<if test="healthManifesto != null">#{healthManifesto},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -114,6 +117,7 @@
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="language != null">language = #{language},</if>
|
||||
<if test="healthManifesto != null">health_manifesto = #{healthManifesto},</if>
|
||||
</trim>
|
||||
where openid = #{openid}
|
||||
</update>
|
||||
@ -140,4 +144,9 @@
|
||||
update sys_wx_user_info set cus_id = null where openid = #{openid}
|
||||
</update>
|
||||
|
||||
<!-- 根据客户ID更新健康减脂宣言 -->
|
||||
<update id="updateHealthManifestoByCusId" parameterType="SysWxUserInfo">
|
||||
update sys_wx_user_info set health_manifesto = #{healthManifesto} where cus_id = #{cusId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
@ -318,17 +318,47 @@
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<resultMap id="punchReponseMap" type="com.stdiet.custom.dto.response.CommunityPunchReponse">
|
||||
<result property="openid" column="openid" />
|
||||
<result property="cusId" column="cus_id"/>
|
||||
<result property="nickName" column="nick_name"/>
|
||||
<result property="avatarUrl" column="avatar_url"/>
|
||||
<result property="logTime" column="log_time"/>
|
||||
<result property="weight" column="weight"/>
|
||||
<result property="comment" column="comment"/>
|
||||
<result property="thumbsupNum" column="thumbsup_num"/>
|
||||
<result property="healthManifesto" column="health_manifesto"/>
|
||||
<!-- 查询最近五天体重 -->
|
||||
<association property="recentWeight" column="{cusId=cus_id,logTime=log_time}" select="getRecentWeight"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 查询打卡社区内容 -->
|
||||
<!--<select id="">
|
||||
<select id="getCommunityPunch" resultMap="punchReponseMap" parameterType="SysWxUserLog">
|
||||
select wxinfo.openid,wxinfo.cus_id,wxinfo.nick_name,wxinfo.avatar_url,wxlog.log_time,wxlog.weight,wxlog.comment,wxlog.thumbsup_num,wxlog.health_manifesto from sys_wx_user_log wxlog
|
||||
left join sys_wx_user_info wxinfo on wxinfo.openid = wxlog.openid
|
||||
where wxlog.del_flag = 0
|
||||
<if test="logTime">
|
||||
and wxlog.log_time >= #{logTime}
|
||||
</if>
|
||||
order by wxlog.log_time desc
|
||||
</select>-->
|
||||
</select>
|
||||
|
||||
<!-- 查询最近一周的打卡体重 -->
|
||||
<select id="getRecentWeight" resultType="Map">
|
||||
select DATE_FORMAT(wxlog.log_time,'%Y-%m-%d') as logTime,wxlog.weight as weight from sys_wx_user_log wxlog
|
||||
left join sys_wx_user_info wxinfo on wxinfo.openid = wxlog.openid
|
||||
where wxlog.del_flag = 0 and wxinfo.cus_id = #{cusId} and #{logTime} >= wxlog.log_time
|
||||
order by wxlog.log_time desc limit 7
|
||||
</select>
|
||||
|
||||
<!-- 根据客户ID查询总共打卡次数 -->
|
||||
<select id="getPunchTotalNum" parameterType="SysWxUserLog" resultType="int">
|
||||
select count(1) from sys_wx_user_log wxlog
|
||||
left join sys_wx_user_info wxinfo on wxinfo.openid = wxlog.openid
|
||||
where wxlog.del_flag = 0 and wxinfo.cus_id = #{customerId}
|
||||
</select>
|
||||
|
||||
<!-- 查询打卡社区总共几个人在打卡 -->
|
||||
<select id="getPunchCustomerTotalNum" resultType="int">
|
||||
select count(1) from (select openid from sys_wx_user_log wxlog where wxlog.del_flag = 0 group by openid) num_table
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user