客户档案加上打卡记录以及体重趋势图
This commit is contained in:
@ -73,6 +73,9 @@ public class SysWxUserLog extends BaseEntity
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date logTime;
|
||||
|
||||
//客户ID
|
||||
private Long customerId;
|
||||
|
||||
/**
|
||||
* 非持久化字段,客户姓名
|
||||
*/
|
||||
|
@ -78,4 +78,11 @@ public interface SysWxUserLogMapper
|
||||
*/
|
||||
SysWxUserLog selectSysWxUserLogByDateAndOpenId(SysWxUserLog sysWxUserLog);
|
||||
|
||||
/**
|
||||
* 根据客户ID查询对应打卡体重数据
|
||||
* @param sysWxUserLog
|
||||
* @return
|
||||
*/
|
||||
List<SysWxUserLog> getWxUserLogListByCustomerId(SysWxUserLog sysWxUserLog);
|
||||
|
||||
}
|
@ -80,4 +80,11 @@ public interface ISysWxUserLogService
|
||||
*/
|
||||
SysWxUserLog selectSysWxUserLogByDateAndOpenId(SysWxUserLog sysWxUserLog);
|
||||
|
||||
/**
|
||||
* 根据客户ID查询对应打卡体重数据
|
||||
* @param sysWxUserLog
|
||||
* @return
|
||||
*/
|
||||
List<SysWxUserLog> getWxUserLogListByCustomerId(SysWxUserLog sysWxUserLog);
|
||||
|
||||
}
|
@ -124,4 +124,13 @@ public class SysWxUserLogServiceImpl implements ISysWxUserLogService {
|
||||
return sysWxUserLogMapper.selectSysWxUserLogByDateAndOpenId(sysWxUserLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据客户ID查询对应打卡体重数据
|
||||
* @param sysWxUserLog
|
||||
* @return
|
||||
*/
|
||||
public List<SysWxUserLog> getWxUserLogListByCustomerId(SysWxUserLog sysWxUserLog){
|
||||
return sysWxUserLogMapper.getWxUserLogListByCustomerId(sysWxUserLog);
|
||||
}
|
||||
|
||||
}
|
@ -84,6 +84,9 @@
|
||||
<if test="id != null">
|
||||
and wxlog.id = #{id}
|
||||
</if>
|
||||
<if test="customerId != null">
|
||||
and sc.id = #{customerId}
|
||||
</if>
|
||||
<if test="phone != null and phone != ''">and (sc.name like concat('%',#{phone},'%') or wxinfo.phone like concat('%',#{phone},'%') )</if>
|
||||
<if test="appid != null">
|
||||
and wxinfo.appid = #{appid}
|
||||
@ -94,7 +97,9 @@
|
||||
<if test="afterNutritionistId != null">
|
||||
and su_atferSale.user_id = #{afterNutritionistId}
|
||||
</if>
|
||||
order by wxlog.create_time desc
|
||||
<if test="beginTime != null and beginTime != ''">and date_format(wxlog.log_time,'%y%m%d') >= date_format(#{beginTime},'%y%m%d')</if>
|
||||
<if test="endTime != null and endTime != ''">and date_format(wxlog.log_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')</if>
|
||||
order by wxlog.log_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectWxLogInfoList" parameterType="SysWxUserLog" resultMap="WxLogInfo">
|
||||
@ -251,4 +256,15 @@
|
||||
) sss GROUP BY yearMonth,day_cha LIMIT 2
|
||||
</select>
|
||||
|
||||
<!-- 后台根据用户ID查询该用户的打卡体重 -->
|
||||
<select id="getWxUserLogListByCustomerId" parameterType="SysWxUserLog" resultMap="SysWxUserLogResult">
|
||||
SELECT wxlog.id,wxlog.log_time,wxlog.weight FROM sys_wx_user_log wxlog
|
||||
left join sys_wx_user_info wxinfo on wxinfo.openid = wxlog.openid
|
||||
left join sys_customer sc on sc.phone = wxinfo.phone and sc.del_flag = 0
|
||||
where wxinfo.phone is not null and sc.id = #{customerId}
|
||||
<if test="beginTime != null and beginTime != ''">and date_format(wxlog.log_time,'%y%m%d') >= date_format(#{beginTime},'%y%m%d')</if>
|
||||
<if test="endTime != null and endTime != ''">and date_format(wxlog.log_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')</if>
|
||||
order by wxlog.log_time asc
|
||||
</select>
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user