暂存
This commit is contained in:
parent
b1305e4e79
commit
90f79a689c
@ -76,12 +76,14 @@ public class WechatAppletController extends BaseController {
|
||||
private ISysServicesTopicService iSysServicesTopicService;
|
||||
@Autowired
|
||||
private ISysVideoClassifyService sysVideoClassifyService;
|
||||
|
||||
@Autowired
|
||||
private ISysWxBannerImageService sysWxBannerImageService;
|
||||
|
||||
@Autowired
|
||||
private ISysPunchThumbsupService sysPunchThumbsupService;
|
||||
@Autowired
|
||||
private ISysCustomerHealthyService sysCustomerHealthyService;
|
||||
@Autowired
|
||||
private ISysCustomerPhysicalSignsService sysCustomerPhysicalSignsService;
|
||||
|
||||
/**
|
||||
* 查询微信小程序中展示的客户案例
|
||||
@ -446,9 +448,20 @@ public class WechatAppletController extends BaseController {
|
||||
return AjaxResult.error(5001, "信息缺失或者过期需要重新登录");
|
||||
}
|
||||
|
||||
SysCustomerHealthy customerHealthy = sysCustomerHealthyService.selectSysCustomerHealthyByCustomerId(curWxUserInfo.getCusId());
|
||||
if (customerHealthy == null) {
|
||||
SysCustomerPhysicalSigns customerPhysicalSigns = sysCustomerPhysicalSignsService.selectSysCustomerPhysicalSignsByCusId(curWxUserInfo.getCusId());
|
||||
if (customerPhysicalSigns != null) {
|
||||
curWxUserInfo.setSex(customerPhysicalSigns.getSex().toString());
|
||||
}
|
||||
} else {
|
||||
curWxUserInfo.setSex(customerHealthy.getSex().toString());
|
||||
}
|
||||
|
||||
curWxUserInfo.setCustomerId(AesUtils.encrypt(curWxUserInfo.getCusId().toString()));
|
||||
curWxUserInfo.setCusId(null);
|
||||
|
||||
|
||||
// 并返回一系列登录后的数据
|
||||
return AjaxResult.success(curWxUserInfo);
|
||||
}
|
||||
@ -715,16 +728,19 @@ public class WechatAppletController extends BaseController {
|
||||
public TableDataInfo getCommunityPunch() {
|
||||
startPage();
|
||||
List<CommunityPunchReponse> list = sysWxUserLogService.getCommunityPunch(new SysWxUserLog());
|
||||
// if (list != null && list.size() > 0) {
|
||||
// for (CommunityPunchReponse comm : list) {
|
||||
// comm.setId(AesUtils.encrypt(comm.getId()));
|
||||
// comm.setCusId(AesUtils.encrypt(comm.getCusId()));
|
||||
// comm.setThumbsupNum(comm.getThumbsupOpenid() != null ? comm.getThumbsupOpenid().size() : 0);
|
||||
// }
|
||||
// }
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@GetMapping("/getCustomerActivity")
|
||||
public TableDataInfo getCustomerActivity(@RequestParam String openid){
|
||||
startPage();
|
||||
return getDataTable(sysWxUserLogService.getCommunityPunchByOpenid(openid));
|
||||
}
|
||||
|
||||
/**
|
||||
* 打卡社区点赞
|
||||
*
|
||||
|
@ -3,7 +3,6 @@ package com.stdiet.custom.domain;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.stdiet.common.annotation.Excel;
|
||||
import com.stdiet.common.core.domain.BaseEntity;
|
||||
import com.stdiet.common.utils.StringUtils;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@ -65,6 +64,9 @@ public class SysWxUserLog extends BaseEntity {
|
||||
|
||||
private String sportDesc;
|
||||
|
||||
@Excel(name = "是否生理期", readConverterExp = "Y=是,N=否")
|
||||
private String menstrualPeriod;
|
||||
|
||||
/**
|
||||
* 用户头像
|
||||
*/
|
||||
@ -89,155 +91,126 @@ public class SysWxUserLog extends BaseEntity {
|
||||
*/
|
||||
@Excel(name = "排便情况", readConverterExp = "Y=是,N=否")
|
||||
private String defecation;
|
||||
|
||||
public void setDefecation(String defecation) {
|
||||
if (defecation.equals("Y") || defecation.equals("N")) {
|
||||
this.defecation = defecation.equals("Y") ? "是" : "否";
|
||||
// this.defecation = defecation.equals("Y") ? "顺畅" : "其他";
|
||||
} else {
|
||||
this.defecation = defecation;
|
||||
}
|
||||
}
|
||||
|
||||
private String defecationDesc;
|
||||
|
||||
/**
|
||||
* 饮水量
|
||||
*/
|
||||
@Excel(name = "饮水量")
|
||||
private Long water;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date logTime;
|
||||
|
||||
//客户ID
|
||||
private Long customerId;
|
||||
|
||||
//建议
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 非持久化字段,客户姓名
|
||||
*/
|
||||
@Excel(name = "姓名")
|
||||
private String customerName;
|
||||
|
||||
//营养师ID
|
||||
private Long nutritionistId;
|
||||
|
||||
/**
|
||||
* 非持久化字段,营养师
|
||||
*/
|
||||
@Excel(name = "营养师")
|
||||
private String nutritionist;
|
||||
|
||||
/**
|
||||
* 情绪
|
||||
*/
|
||||
@Excel(name = "情绪")
|
||||
private String emotion;
|
||||
|
||||
private String emotionDesc;
|
||||
|
||||
/**
|
||||
* 食谱之外的食物
|
||||
*/
|
||||
@Excel(name = "食谱之外的食物")
|
||||
private String slyEatFood;
|
||||
|
||||
/**
|
||||
* 是否便秘(Y是 N否)
|
||||
*/
|
||||
@Excel(name = "是否便秘", readConverterExp = "Y=是,N=否")
|
||||
private String constipation;
|
||||
|
||||
/**
|
||||
* 食材描述
|
||||
*/
|
||||
@Excel(name = "食材描述")
|
||||
private String ingredientDesc;
|
||||
|
||||
/**
|
||||
* 早餐照片
|
||||
*/
|
||||
@Excel(name = "早餐照片")
|
||||
private String breakfastImages;
|
||||
|
||||
/**
|
||||
* 午餐照片
|
||||
*/
|
||||
@Excel(name = "午餐照片")
|
||||
private String lunchImages;
|
||||
|
||||
/**
|
||||
* 午餐照片
|
||||
*/
|
||||
@Excel(name = "午餐照片")
|
||||
private String dinnerImages;
|
||||
|
||||
/**
|
||||
* 加餐照片
|
||||
*/
|
||||
@Excel(name = "加餐照片")
|
||||
private String extraMealImages;
|
||||
|
||||
/**
|
||||
* 体型对比照
|
||||
*/
|
||||
@Excel(name = "体型对比照")
|
||||
private String bodyImages;
|
||||
|
||||
private String bodyDesc;
|
||||
|
||||
/**
|
||||
* 服务建议
|
||||
*/
|
||||
@Excel(name = "服务建议")
|
||||
private String suggest;
|
||||
|
||||
/**
|
||||
* 目标体重
|
||||
*/
|
||||
@Excel(name = "目标体重")
|
||||
private BigDecimal targetWeight;
|
||||
|
||||
/**
|
||||
* 执行评分,五分制
|
||||
*/
|
||||
@Excel(name = "执行评分,五分制")
|
||||
private BigDecimal executionScore;
|
||||
|
||||
/**
|
||||
* 点评
|
||||
*/
|
||||
@Excel(name = "点评")
|
||||
private String comment;
|
||||
|
||||
/**
|
||||
* 点赞数量
|
||||
*/
|
||||
@Excel(name = "点赞数量")
|
||||
private Long thumbsupNum;
|
||||
|
||||
/**
|
||||
* 健康宣言
|
||||
*/
|
||||
@Excel(name = "健康宣言")
|
||||
private String healthManifesto;
|
||||
|
||||
/**
|
||||
* 删除标识 0未删除 1已删除
|
||||
*/
|
||||
private Long delFlag;
|
||||
|
||||
//售后营养师ID
|
||||
private Long afterNutritionistId;
|
||||
|
||||
//售后营养师
|
||||
@Excel(name = "售后营养师")
|
||||
private String afterNutritionist;
|
||||
|
||||
//图片预览路径
|
||||
private Map<String, List<String>> imagesUrl;
|
||||
|
||||
public void setDefecation(String defecation) {
|
||||
if (defecation.equals("Y") || defecation.equals("N")) {
|
||||
// this.defecation = defecation.equals("Y") ? "是" : "否";
|
||||
this.defecation = defecation.equals("Y") ? "顺畅" : "其他";
|
||||
} else {
|
||||
this.defecation = defecation;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -100,6 +100,8 @@ public interface SysWxUserLogMapper
|
||||
*/
|
||||
List<CommunityPunchReponse> getCommunityPunch(SysWxUserLog sysWxUserLog);
|
||||
|
||||
List<CommunityPunchReponse> getCommunityPunchByOpenid(String openid);
|
||||
|
||||
/**
|
||||
* 根据打卡社区
|
||||
* @param sysWxUserLog
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.stdiet.custom.page;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.stdiet.common.utils.StringUtils;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@ -53,6 +52,11 @@ public class WxLogInfo {
|
||||
*/
|
||||
private String constipation;
|
||||
|
||||
/**
|
||||
* 是否生理期
|
||||
*/
|
||||
private String menstrualPeriod;
|
||||
|
||||
/**
|
||||
* 食材描述
|
||||
*/
|
||||
@ -123,8 +127,8 @@ public class WxLogInfo {
|
||||
|
||||
public void setDefecation(String defecation) {
|
||||
if (defecation.equals("Y") || defecation.equals("N")) {
|
||||
this.defecation = defecation.equals("Y") ? "是" : "否";
|
||||
// this.defecation = defecation.equals("Y") ? "顺畅" : "其他";
|
||||
// this.defecation = defecation.equals("Y") ? "是" : "否";
|
||||
this.defecation = defecation.equals("Y") ? "顺畅" : "其他";
|
||||
} else {
|
||||
this.defecation = defecation;
|
||||
}
|
||||
@ -146,4 +150,8 @@ public class WxLogInfo {
|
||||
this.constipation = constipation.equals("Y") ? "是" : "否";
|
||||
}
|
||||
|
||||
public void setMenstrualPeriod(String menstrualPeriod) {
|
||||
this.menstrualPeriod = menstrualPeriod.equals("Y") ? "是" : "否";
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -102,6 +102,8 @@ public interface ISysWxUserLogService
|
||||
*/
|
||||
List<CommunityPunchReponse> getCommunityPunch(SysWxUserLog sysWxUserLog);
|
||||
|
||||
List<CommunityPunchReponse> getCommunityPunchByOpenid(String openid);
|
||||
|
||||
/**
|
||||
* 根据打卡社区
|
||||
* @param sysWxUserLog
|
||||
|
@ -1,25 +1,14 @@
|
||||
package com.stdiet.custom.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.stdiet.common.config.AliyunOSSConfig;
|
||||
import com.stdiet.common.exception.file.FileNameLengthLimitExceededException;
|
||||
import com.stdiet.common.utils.DateUtils;
|
||||
import com.stdiet.common.utils.file.FileUploadUtils;
|
||||
import com.stdiet.common.utils.file.MimeTypeUtils;
|
||||
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.domain.SysWxUserLog;
|
||||
import com.stdiet.custom.dto.response.CommunityPunchReponse;
|
||||
import com.stdiet.custom.mapper.SysWxUserLogMapper;
|
||||
import com.stdiet.custom.page.WxLogInfo;
|
||||
import com.stdiet.custom.service.ISysMessageNoticeService;
|
||||
import com.stdiet.custom.service.ISysWxUserLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.stdiet.custom.mapper.SysWxUserLogMapper;
|
||||
import com.stdiet.custom.domain.SysWxUserLog;
|
||||
import com.stdiet.custom.service.ISysWxUserLogService;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 微信用户记录Service业务层处理
|
||||
@ -110,6 +99,7 @@ public class SysWxUserLogServiceImpl implements ISysWxUserLogService {
|
||||
|
||||
/**
|
||||
* 根据openid和手机号查询打卡记录
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@ -119,6 +109,7 @@ public class SysWxUserLogServiceImpl implements ISysWxUserLogService {
|
||||
|
||||
/**
|
||||
* 根据日期和openid查询打卡记录
|
||||
*
|
||||
* @param sysWxUserLog
|
||||
* @return
|
||||
*/
|
||||
@ -128,6 +119,7 @@ public class SysWxUserLogServiceImpl implements ISysWxUserLogService {
|
||||
|
||||
/**
|
||||
* 根据客户ID查询对应打卡体重数据
|
||||
*
|
||||
* @param sysWxUserLog
|
||||
* @return
|
||||
*/
|
||||
@ -137,6 +129,7 @@ public class SysWxUserLogServiceImpl implements ISysWxUserLogService {
|
||||
|
||||
/**
|
||||
* 根据ID查询打卡详情
|
||||
*
|
||||
* @param sysWxUserLog
|
||||
* @return
|
||||
*/
|
||||
@ -146,6 +139,7 @@ public class SysWxUserLogServiceImpl implements ISysWxUserLogService {
|
||||
|
||||
/**
|
||||
* 查询打卡社区记录
|
||||
*
|
||||
* @param sysWxUserLog
|
||||
* @return
|
||||
*/
|
||||
@ -153,8 +147,14 @@ public class SysWxUserLogServiceImpl implements ISysWxUserLogService {
|
||||
return sysWxUserLogMapper.getCommunityPunch(sysWxUserLog);
|
||||
}
|
||||
|
||||
public List<CommunityPunchReponse> getCommunityPunchByOpenid(String openid) {
|
||||
return sysWxUserLogMapper.getCommunityPunchByOpenid(openid);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据打卡社区
|
||||
*
|
||||
* @param sysWxUserLog
|
||||
* @return
|
||||
*/
|
||||
@ -164,6 +164,7 @@ public class SysWxUserLogServiceImpl implements ISysWxUserLogService {
|
||||
|
||||
/**
|
||||
* 查询打卡社区总共打卡人数
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getPunchCustomerTotalNum() {
|
||||
|
@ -8,9 +8,9 @@
|
||||
<result property="id" column="id"/>
|
||||
<result property="customerId" column="customer_id"/>
|
||||
<!-- 非持久化字段,客户姓名 -->
|
||||
<result property="name" column="name"></result>
|
||||
<result property="name" column="name"/>
|
||||
<!-- 非持久化字段,客户手机号 -->
|
||||
<result property="phone" column="phone"></result>
|
||||
<result property="phone" column="phone"/>
|
||||
<result property="conditioningProjectId" column="conditioning_project_id"/>
|
||||
<!-- 非持久化字段,调理项目名称 -->
|
||||
<result property="conditioningProject" column="conditioning_project"/>
|
||||
@ -111,7 +111,7 @@
|
||||
<result property="otherPhysicalSigns" column="other_physical_signs"/>
|
||||
<result property="bloodData" column="blood_data"/>
|
||||
<result property="moistureDate" column="moisture_date"/>
|
||||
<result property="remark" column="remark"></result>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="guidance" column="guidance"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
@ -121,7 +121,7 @@
|
||||
<result property="avoidFood" column="avoid_food" typeHandler="com.stdiet.custom.typehandler.ArrayJsonHandler"/>
|
||||
<!-- column是传的参数, select是调用的查询 -->
|
||||
<association property="signList" column="physical_signs_id" select="getSignByIds"/>
|
||||
<association property="healthyExtend" column="id" select="getHealthyExtendedByHealthyId"></association>
|
||||
<association property="healthyExtend" column="id" select="getHealthyExtendedByHealthyId"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysCustomerHealthyVo">
|
||||
@ -134,7 +134,8 @@
|
||||
<include refid="selectSysCustomerHealthyVo"/>,sc.name,sc.phone,cp.dict_label as conditioning_project
|
||||
from sys_customer_healthy as sch
|
||||
LEFT JOIN sys_customer sc on sc.id = sch.customer_id
|
||||
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'conditioning_project') AS cp ON cp.dict_value = sch.conditioning_project_id
|
||||
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'conditioning_project') AS cp ON
|
||||
cp.dict_value = sch.conditioning_project_id
|
||||
where sch.del_flag = 0 and sc.del_flag = 0
|
||||
<if test="conditioningProjectId != null ">and sch.conditioning_project_id = #{conditioningProjectId}</if>
|
||||
<if test="name != null and name != ''">
|
||||
@ -147,7 +148,8 @@
|
||||
<include refid="selectSysCustomerHealthyVo"/>,sc.name,sc.phone,cp.dict_label as conditioning_project
|
||||
from sys_customer_healthy as sch
|
||||
left join sys_customer sc on sc.id = sch.customer_id
|
||||
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'conditioning_project') AS cp ON cp.dict_value = sch.conditioning_project_id
|
||||
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'conditioning_project') AS cp ON
|
||||
cp.dict_value = sch.conditioning_project_id
|
||||
where sch.del_flag = 0 and sc.del_flag = 0 and sch.id = #{id}
|
||||
</select>
|
||||
|
||||
@ -156,7 +158,8 @@
|
||||
<include refid="selectSysCustomerHealthyVo"/>,sc.name,sc.phone,cp.dict_label as conditioning_project
|
||||
from sys_customer_healthy as sch
|
||||
left join sys_customer sc on sc.id = sch.customer_id
|
||||
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'conditioning_project') AS cp ON cp.dict_value = sch.conditioning_project_id
|
||||
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'conditioning_project') AS cp ON
|
||||
cp.dict_value = sch.conditioning_project_id
|
||||
where sch.del_flag = 0 and sc.del_flag = 0 and sch.customer_id = #{customerId} order by sch.id desc limit 1
|
||||
</select>
|
||||
|
||||
@ -380,7 +383,9 @@
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="avoidFood != null">#{avoid_food, jdbcType=OTHER, typeHandler=com.stdiet.custom.typehandler.ArrayJsonHandler},</if>
|
||||
<if test="avoidFood != null">
|
||||
#{avoid_food, jdbcType=OTHER, typeHandler=com.stdiet.custom.typehandler.ArrayJsonHandler},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -450,7 +455,9 @@
|
||||
<if test="motionTime != null">motion_time = #{motionTime},</if>
|
||||
<if test="aerobicMotionClassify != null">aerobic_motion_classify = #{aerobicMotionClassify},</if>
|
||||
<if test="anaerobicMotionClassify != null">anaerobic_motion_classify = #{anaerobicMotionClassify},</if>
|
||||
<if test="anaerobicAerobicMotionClassify != null">anaerobic_aerobic_motion_classify = #{anaerobicAerobicMotionClassify},</if>
|
||||
<if test="anaerobicAerobicMotionClassify != null">anaerobic_aerobic_motion_classify =
|
||||
#{anaerobicAerobicMotionClassify},
|
||||
</if>
|
||||
<if test="otherMotionClassify != null">other_motion_classify = #{otherMotionClassify},</if>
|
||||
<if test="motionField != null">motion_field = #{motionField},</if>
|
||||
<if test="otherMotionField != null">other_motion_field = #{otherMotionField},</if>
|
||||
@ -461,7 +468,8 @@
|
||||
<if test="stayupLateFlag != null">stayup_late_flag = #{stayupLateFlag},</if>
|
||||
<if test="stayupLateWeekNum != null">stayup_late_week_num = #{stayupLateWeekNum},</if>
|
||||
<if test="familyIllnessHistory != null">family_illness_history = #{familyIllnessHistory},</if>
|
||||
<if test="otherFamilyIllnessHistory != null">other_family_illness_history = #{otherFamilyIllnessHistory},</if>
|
||||
<if test="otherFamilyIllnessHistory != null">other_family_illness_history = #{otherFamilyIllnessHistory},
|
||||
</if>
|
||||
<if test="operationHistory != null">operation_history = #{operationHistory},</if>
|
||||
<if test="otherOperationHistory != null">other_operation_history = #{otherOperationHistory},</if>
|
||||
<if test="nearOperationFlag != null">near_operation_flag = #{nearOperationFlag},</if>
|
||||
@ -493,7 +501,9 @@
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="avoidFood != null">avoid_food = #{avoidFood, jdbcType=OTHER, typeHandler=com.stdiet.custom.typehandler.ArrayJsonHandler},</if>
|
||||
<if test="avoidFood != null">avoid_food =
|
||||
#{avoidFood, jdbcType=OTHER, typeHandler=com.stdiet.custom.typehandler.ArrayJsonHandler},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@ -537,8 +547,10 @@
|
||||
<select id="selectDictDataByTypeAndValue" parameterType="SysDictData" resultMap="SysDictDataResult">
|
||||
select dict_code, dict_sort, dict_label, dict_value, dict_type from sys_dict_data
|
||||
where status = '0' and dict_type = #{dictType}
|
||||
and dict_value in <foreach collection="dictValueList" item="item" index="index"
|
||||
open="(" separator="," close=")">#{item}</foreach>
|
||||
and dict_value in
|
||||
<foreach collection="dictValueList" item="item" index="index"
|
||||
open="(" separator="," close=")">#{item}
|
||||
</foreach>
|
||||
order by dict_sort asc
|
||||
</select>
|
||||
|
||||
|
@ -46,11 +46,12 @@
|
||||
<result property="thumbsupNum" column="thumbsup_num"/>
|
||||
<result property="healthManifesto" column="health_manifesto"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="menstrualPeriod" column="menstrual_period"/>
|
||||
<!-- 非持久字段 -->
|
||||
<result property="customerName" column="customer_name"></result>
|
||||
<result property="customerName" column="customer_name"/>
|
||||
<!-- 营养师 -->
|
||||
<result property="nutritionist" column="nutritionist"></result>
|
||||
<result property="afterNutritionist" column="after_nutritionist"></result>
|
||||
<result property="nutritionist" column="nutritionist"/>
|
||||
<result property="afterNutritionist" column="after_nutritionist"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.stdiet.custom.page.WxLogInfo" id="WxLogInfo">
|
||||
@ -74,15 +75,20 @@
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="ingredientDesc" column="ingredient_desc"/>
|
||||
<!-- <result property="breakfastImages" column="breakfast_images"/>-->
|
||||
<result property="breakfastImagesUrl" column="breakfast_images" typeHandler="com.stdiet.custom.typehandler.ImagesHandler"/>
|
||||
<result property="breakfastImagesUrl" column="breakfast_images"
|
||||
typeHandler="com.stdiet.custom.typehandler.ImagesHandler"/>
|
||||
<!-- <result property="lunchImages" column="lunch_images"/>-->
|
||||
<result property="lunchImagesUrl" column="lunch_images" typeHandler="com.stdiet.custom.typehandler.ImagesHandler"/>
|
||||
<result property="lunchImagesUrl" column="lunch_images"
|
||||
typeHandler="com.stdiet.custom.typehandler.ImagesHandler"/>
|
||||
<!-- <result property="dinnerImages" column="dinner_images"/>-->
|
||||
<result property="dinnerImagesUrl" column="dinner_images" typeHandler="com.stdiet.custom.typehandler.ImagesHandler"/>
|
||||
<result property="dinnerImagesUrl" column="dinner_images"
|
||||
typeHandler="com.stdiet.custom.typehandler.ImagesHandler"/>
|
||||
<!-- <result property="extraMealImages" column="extra_meal_images"/>-->
|
||||
<result property="extraMealImagesUrl" column="extra_meal_images" typeHandler="com.stdiet.custom.typehandler.ImagesHandler"/>
|
||||
<result property="extraMealImagesUrl" column="extra_meal_images"
|
||||
typeHandler="com.stdiet.custom.typehandler.ImagesHandler"/>
|
||||
<!-- <result property="bodyImages" column="body_images"/>-->
|
||||
<result property="bodyImagesUrl" column="body_images" typeHandler="com.stdiet.custom.typehandler.ImagesHandler"/>
|
||||
<result property="bodyImagesUrl" column="body_images"
|
||||
typeHandler="com.stdiet.custom.typehandler.ImagesHandler"/>
|
||||
<result property="bodyDesc" column="body_desc"/>
|
||||
<result property="suggest" column="suggest"/>
|
||||
<result property="targetWeight" column="target_weight"/>
|
||||
@ -90,11 +96,12 @@
|
||||
<result property="comment" column="comment"/>
|
||||
<result property="thumbsupNum" column="thumbsup_num"/>
|
||||
<result property="healthManifesto" column="health_manifesto"/>
|
||||
<result property="menstrualPeriod" column="menstrual_period"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysWxUserLogVo">
|
||||
select id,openid, weight, appid, phone, log_time, sleep_time, wakeup_time, sport, sport_desc, avatar_url, diet, diet_desc, insomnia, defecation, defecation_desc, water, create_by, create_time, update_by, update_time, remark,
|
||||
emotion, emotion_desc,sly_eat_food,constipation,ingredient_desc,breakfast_images,lunch_images,dinner_images,extra_meal_images,body_images,body_desc,suggest,execution_score,comment,health_manifesto
|
||||
emotion, emotion_desc,sly_eat_food,constipation,ingredient_desc,breakfast_images,lunch_images,dinner_images,extra_meal_images,body_images,body_desc,suggest,execution_score,comment,health_manifesto,menstrual_period
|
||||
from sys_wx_user_log
|
||||
</sql>
|
||||
|
||||
@ -106,8 +113,10 @@
|
||||
<select id="selectSysWxUserLogList" parameterType="SysWxUserLog" resultMap="SysWxUserLogResult">
|
||||
SELECT
|
||||
wxlog.id,wxinfo.appid,wxinfo.openid,wxinfo.avatar_url,wxinfo.phone,wxlog.weight,wxlog.log_time,wxlog.sleep_time,
|
||||
wxlog.wakeup_time,wxlog.defecation, wxlog.defecation_desc, wxlog.water, wxlog.insomnia,wxlog.sport, wxlog.sport_desc,wxlog.diet, wxlog.diet_desc,wxlog.remark,
|
||||
wxlog.emotion, wxlog.emotion_desc,wxlog.sly_eat_food,wxlog.constipation,wxlog.ingredient_desc,wxlog.breakfast_images,
|
||||
wxlog.wakeup_time,wxlog.defecation, wxlog.defecation_desc, wxlog.water, wxlog.insomnia,wxlog.sport,
|
||||
wxlog.sport_desc,wxlog.diet, wxlog.diet_desc,wxlog.remark,
|
||||
wxlog.emotion, wxlog.menstrual_period,
|
||||
wxlog.emotion_desc,wxlog.sly_eat_food,wxlog.constipation,wxlog.ingredient_desc,wxlog.breakfast_images,
|
||||
wxlog.lunch_images,wxlog.dinner_images,wxlog.extra_meal_images,wxlog.body_images,wxlog.body_desc,
|
||||
wxlog.suggest,wxlog.execution_score,wxlog.comment,sc.name as customer_name, su.nick_name as nutritionist,
|
||||
su_atferSale.nick_name as after_nutritionist, wxlog.health_manifesto, wxlog.log_time
|
||||
@ -205,6 +214,7 @@
|
||||
<if test="thumbsupNum != null">thumbsup_num,</if>
|
||||
<if test="healthManifesto != null">health_manifesto,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="menstrualPeriod != null">menstrual_period,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="openid != null">#{openid},</if>
|
||||
@ -246,6 +256,7 @@
|
||||
<if test="thumbsupNum != null">#{thumbsupNum},</if>
|
||||
<if test="healthManifesto != null">#{healthManifesto},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="menstrualPeriod != null">menstrual_period = #{menstrualPeriod},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -288,6 +299,7 @@
|
||||
<if test="thumbsupNum != null">thumbsup_num = #{thumbsupNum},</if>
|
||||
<if test="healthManifesto != null">health_manifesto = #{healthManifesto},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="menstrualPeriod != null">menstrual_period = #{menstrualPeriod},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@ -305,9 +317,11 @@
|
||||
|
||||
<!-- 根据openid和手机号查询对应打卡记录 -->
|
||||
<select id="getWxLogInfoList" parameterType="SysWxUserLog" resultMap="WxLogInfo">
|
||||
SELECT wxlog.id,wxlog.weight,wxlog.log_time,wxlog.sleep_time, wxlog.wakeup_time,wxlog.defecation, wxlog.defecation_desc, wxlog.water, wxlog.insomnia,wxlog.sport, wxlog.sport_desc,wxlog.diet, wxlog.diet_desc,
|
||||
wxlog.emotion, wxlog.emotion_desc,wxlog.sly_eat_food,wxlog.constipation,wxlog.ingredient_desc,wxlog.breakfast_images,wxlog.lunch_images,wxlog.dinner_images,wxlog.extra_meal_images,wxlog.body_images, wxlog.body_desc
|
||||
,wxlog.remark,wxlog.execution_score,wxlog.comment, wxlog.health_manifesto
|
||||
SELECT wxlog.id,wxlog.weight,wxlog.log_time,wxlog.sleep_time, wxlog.wakeup_time,wxlog.defecation, wxlog.defecation_desc,
|
||||
wxlog.water, wxlog.insomnia,wxlog.sport, wxlog.sport_desc,wxlog.diet, wxlog.diet_desc,
|
||||
wxlog.emotion, wxlog.emotion_desc,wxlog.sly_eat_food,wxlog.constipation,wxlog.ingredient_desc,wxlog.breakfast_images,
|
||||
wxlog.lunch_images,wxlog.dinner_images,wxlog.extra_meal_images,wxlog.body_images, wxlog.body_desc,
|
||||
wxlog.remark,wxlog.execution_score,wxlog.comment, wxlog.health_manifesto, wxlog.menstrual_period
|
||||
FROM sys_wx_user_log wxlog
|
||||
where wxlog.del_flag = 0 and wxlog.openid = #{openid}
|
||||
order by wxlog.log_time asc
|
||||
@ -350,9 +364,11 @@
|
||||
|
||||
<!-- 根据openid和手机号查询对应打卡记录 -->
|
||||
<select id="getWxLogInfoDetailById" parameterType="SysWxUserLog" resultMap="WxLogInfo">
|
||||
SELECT wxlog.id,wxlog.weight,wxlog.log_time,wxlog.sleep_time, wxlog.wakeup_time,wxlog.defecation, wxlog.defecation_desc, wxlog.water, wxlog.insomnia,wxlog.sport, wxlog.sport_desc,wxlog.diet, wxlog.diet_desc,
|
||||
wxlog.emotion, wxlog.emotion_desc,wxlog.sly_eat_food,wxlog.constipation,wxlog.ingredient_desc,wxlog.breakfast_images,wxlog.lunch_images,wxlog.dinner_images,wxlog.extra_meal_images,wxlog.body_images, wxlog.body_desc
|
||||
,wxlog.remark,wxlog.execution_score,wxlog.comment
|
||||
SELECT wxlog.id,wxlog.weight,wxlog.log_time,wxlog.sleep_time, wxlog.wakeup_time,wxlog.defecation, wxlog.defecation_desc,
|
||||
wxlog.water, wxlog.insomnia,wxlog.sport, wxlog.sport_desc,wxlog.diet, wxlog.diet_desc,
|
||||
wxlog.emotion, wxlog.emotion_desc,wxlog.sly_eat_food,wxlog.constipation,wxlog.ingredient_desc,wxlog.breakfast_images,
|
||||
wxlog.lunch_images,wxlog.dinner_images,wxlog.extra_meal_images,wxlog.body_images, wxlog.body_desc,
|
||||
wxlog.remark,wxlog.execution_score,wxlog.comment,wxlog.menstrual_period
|
||||
FROM sys_wx_user_log wxlog left join sys_wx_user_info wxinfo on wxinfo.openid = wxlog.openid
|
||||
where wxlog.del_flag = 0 and wxlog.id = #{id}
|
||||
order by wxlog.log_time desc
|
||||
@ -365,11 +381,10 @@
|
||||
<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="healthManifesto" column="health_manifesto"/>
|
||||
<association property="thumbsupNum" column="id" select="getPunchThumbsupCount"/>
|
||||
<!-- 查询最近五天体重 -->
|
||||
<!-- 查询体重 -->
|
||||
<association property="weightData" column="{id=openid}" select="getRecentWeight"/>
|
||||
<!-- 查询点赞的openid -->
|
||||
<association property="thumbsupUser" column="id" select="getPunchThumbsupList"/>
|
||||
@ -378,7 +393,33 @@
|
||||
<!-- 查询打卡社区内容 -->
|
||||
<select id="getCommunityPunch" resultMap="punchReponseMap" parameterType="SysWxUserLog">
|
||||
SELECT * FROM
|
||||
(SELECT id, openid, `comment`, health_manifesto, log_time FROM sys_wx_user_log WHERE TO_DAYS(log_time) = TO_DAYS(NOW()) AND del_flag = 0) AS wxlog
|
||||
(SELECT id, openid, `comment`, health_manifesto, log_time FROM sys_wx_user_log
|
||||
WHERE TO_DAYS(log_time) = TO_DAYS(NOW()) AND del_flag = 0) AS wxlog
|
||||
LEFT JOIN (SELECT openid, nick_name, avatar_url FROM sys_wx_user_info) AS wxinfo
|
||||
USING(openid)
|
||||
ORDER BY log_time DESC
|
||||
</select>
|
||||
|
||||
<resultMap id="punchReponseMap2" type="com.stdiet.custom.dto.response.CommunityPunchReponse">
|
||||
<result property="id" column="id" typeHandler="com.stdiet.custom.typehandler.EncryptedIdHandler"/>
|
||||
<result property="openid" column="openid"/>
|
||||
<result property="nickName" column="nick_name"/>
|
||||
<result property="avatarUrl" column="avatar_url"/>
|
||||
<result property="logTime" column="log_time"/>
|
||||
<result property="comment" column="comment"/>
|
||||
<result property="healthManifesto" column="health_manifesto"/>
|
||||
<association property="thumbsupNum" column="id" select="getPunchThumbsupCount"/>
|
||||
<!-- 查询体重 -->
|
||||
<!-- <association property="weightData" column="{id=openid}" select="getRecentWeight"/>-->
|
||||
<!-- 查询点赞的openid -->
|
||||
<association property="thumbsupUser" column="id" select="getPunchThumbsupList"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 客户活动-->
|
||||
<select id="getCommunityPunchByOpenid" resultMap="punchReponseMap2" parameterType="String">
|
||||
SELECT * FROM
|
||||
(SELECT id, openid, `comment`, health_manifesto, log_time FROM sys_wx_user_log
|
||||
WHERE openid = #{openid} AND del_flag = 0) AS wxlog
|
||||
LEFT JOIN (SELECT openid, nick_name, avatar_url FROM sys_wx_user_info) AS wxinfo
|
||||
USING(openid)
|
||||
ORDER BY log_time DESC
|
||||
|
Loading…
x
Reference in New Issue
Block a user