Merge remote-tracking branch 'origin/feature-20240104' into feature-20240104
commit
826b51d50d
@ -0,0 +1,45 @@
|
||||
package com.flossom.common.core.domain.req;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户打卡对象 wx_clock_log
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-27
|
||||
*/
|
||||
public class WxClockLogReq {
|
||||
|
||||
/**
|
||||
* 打卡心得
|
||||
*/
|
||||
@NotBlank(message = "请输入打卡心得")
|
||||
@Size(min = 1, max = 120, message = "内容限制120个字符以内")
|
||||
private String clockContent;
|
||||
|
||||
/**
|
||||
* 打卡照片
|
||||
*/
|
||||
List<String> clockImageList = new ArrayList<>();
|
||||
|
||||
public String getClockContent() {
|
||||
return clockContent;
|
||||
}
|
||||
|
||||
public void setClockContent(String clockContent) {
|
||||
this.clockContent = clockContent;
|
||||
}
|
||||
|
||||
public List<String> getClockImageList() {
|
||||
return clockImageList;
|
||||
}
|
||||
|
||||
public void setClockImageList(List<String> clockImageList) {
|
||||
this.clockImageList = clockImageList;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,103 @@
|
||||
package com.flossom.common.core.domain.req;
|
||||
|
||||
import com.flossom.common.core.annotation.Excel;
|
||||
import com.flossom.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalTime;
|
||||
|
||||
/**
|
||||
* 用户护理日志对象 wx_nursing_log
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-29
|
||||
*/
|
||||
public class WxNursingLogReq {
|
||||
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
@NotNull(message = "请选择设备")
|
||||
private Long instrumentId;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@NotNull(message = "请选择设备")
|
||||
private String instrumentName;
|
||||
|
||||
/**
|
||||
* 模式ID
|
||||
*/
|
||||
@NotNull(message = "请选择护理模式")
|
||||
private Long modeId;
|
||||
|
||||
/**
|
||||
* 模式名称
|
||||
*/
|
||||
@NotBlank(message = "请选择护理模式")
|
||||
private String modeName;
|
||||
|
||||
/**
|
||||
* 护理总时长
|
||||
*/
|
||||
@NotNull(message = "护理时长不能为空")
|
||||
private LocalTime nursingTime;
|
||||
|
||||
/**
|
||||
* 完成度
|
||||
*/
|
||||
private Double completionPercentage;
|
||||
|
||||
|
||||
public void setInstrumentId(Long instrumentId) {
|
||||
this.instrumentId = instrumentId;
|
||||
}
|
||||
|
||||
public Long getInstrumentId() {
|
||||
return instrumentId;
|
||||
}
|
||||
|
||||
public void setModeId(Long modeId) {
|
||||
this.modeId = modeId;
|
||||
}
|
||||
|
||||
public Long getModeId() {
|
||||
return modeId;
|
||||
}
|
||||
|
||||
public void setModeName(String modeName) {
|
||||
this.modeName = modeName;
|
||||
}
|
||||
|
||||
public String getModeName() {
|
||||
return modeName;
|
||||
}
|
||||
|
||||
public void setNursingTime(LocalTime nursingTime) {
|
||||
this.nursingTime = nursingTime;
|
||||
}
|
||||
|
||||
public LocalTime getNursingTime() {
|
||||
return nursingTime;
|
||||
}
|
||||
|
||||
public String getInstrumentName() {
|
||||
return instrumentName;
|
||||
}
|
||||
|
||||
public void setInstrumentName(String instrumentName) {
|
||||
this.instrumentName = instrumentName;
|
||||
}
|
||||
|
||||
public Double getCompletionPercentage() {
|
||||
return completionPercentage;
|
||||
}
|
||||
|
||||
public void setCompletionPercentage(Double completionPercentage) {
|
||||
this.completionPercentage = completionPercentage;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,98 @@
|
||||
package com.flossom.common.core.domain.ret;
|
||||
|
||||
import com.flossom.common.core.annotation.Excel;
|
||||
import com.flossom.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户打卡对象 wx_clock_log
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-29
|
||||
*/
|
||||
public class WxClockLogRet extends BaseEntity {
|
||||
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 微信用户
|
||||
*/
|
||||
@Excel(name = "微信用户")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 当天使用过的仪器
|
||||
*/
|
||||
@Excel(name = "当天使用过的仪器")
|
||||
private String instrumentId;
|
||||
|
||||
/**
|
||||
* 当天使用过的仪器
|
||||
*/
|
||||
@Excel(name = "当天使用过的仪器")
|
||||
private String instrumentName;
|
||||
|
||||
/**
|
||||
* 打卡心得
|
||||
*/
|
||||
@Excel(name = "打卡心得")
|
||||
private String clockContent;
|
||||
|
||||
private List<String> clockImg = new ArrayList<>();
|
||||
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setInstrumentId(String instrumentId) {
|
||||
this.instrumentId = instrumentId;
|
||||
}
|
||||
|
||||
public String getInstrumentId() {
|
||||
return instrumentId;
|
||||
}
|
||||
|
||||
public void setInstrumentName(String instrumentName) {
|
||||
this.instrumentName = instrumentName;
|
||||
}
|
||||
|
||||
public String getInstrumentName() {
|
||||
return instrumentName;
|
||||
}
|
||||
|
||||
public void setClockContent(String clockContent) {
|
||||
this.clockContent = clockContent;
|
||||
}
|
||||
|
||||
public String getClockContent() {
|
||||
return clockContent;
|
||||
}
|
||||
|
||||
public List<String> getClockImg() {
|
||||
return clockImg;
|
||||
}
|
||||
|
||||
public void setClockImg(List<String> clockImg) {
|
||||
this.clockImg = clockImg;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package com.flossom.common.core.domain.ret;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.flossom.common.core.annotation.Excel;
|
||||
|
||||
import java.time.LocalTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 当月护理记录统计信息
|
||||
*/
|
||||
public class WxNursingStatisticsRet {
|
||||
|
||||
/**
|
||||
* 当月护理天数
|
||||
*/
|
||||
private Integer nursingNum;
|
||||
|
||||
/**
|
||||
* 当月护理时长
|
||||
*/
|
||||
private LocalTime nursingTime;
|
||||
|
||||
public WxNursingStatisticsRet() {
|
||||
}
|
||||
|
||||
public WxNursingStatisticsRet(Integer nursingNum, LocalTime nursingTime) {
|
||||
this.nursingNum = nursingNum;
|
||||
this.nursingTime = nursingTime;
|
||||
}
|
||||
|
||||
public Integer getNursingNum() {
|
||||
return nursingNum;
|
||||
}
|
||||
|
||||
public void setNursingNum(Integer nursingNum) {
|
||||
this.nursingNum = nursingNum;
|
||||
}
|
||||
|
||||
public LocalTime getNursingTime() {
|
||||
return nursingTime;
|
||||
}
|
||||
|
||||
public void setNursingTime(LocalTime nursingTime) {
|
||||
this.nursingTime = nursingTime;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package com.flossom.common.core.enums;
|
||||
|
||||
public enum InstrumentHttpCodeEnum {
|
||||
|
||||
TWO_HUNDRED_AND_ONE(201, "可以绑定,但是不立即绑定,页面需要询问用户是否绑定"),
|
||||
TWO_HUNDRED_AND_TWO(202, "绑定过该类型仪器,但当前扫码的序列号与以前绑定的仪器的序列号不一致,询问用户是否换绑仪器"),
|
||||
TWO_HUNDRED_AND_THREE(203, "当前序列码被别人绑定了,联系客服"),
|
||||
TWO_HUNDRED_AND_FOUR(204, "用户选择的仪器与序列号对应的仪器不一致"),
|
||||
TWO_HUNDRED_AND_FIVE(205, "序列号不存在,联系客服"),
|
||||
TWO_HUNDRED_AND_SIX(206, "绑定失败,不存在该仪器,请联系客服"),
|
||||
;
|
||||
|
||||
private final Integer code;
|
||||
private final String info;
|
||||
|
||||
InstrumentHttpCodeEnum(Integer code, String info) {
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo() {
|
||||
return info;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package com.flossom.common.core.mapper;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxClockImg;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 用户打卡图片关联Mapper接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-27
|
||||
*/
|
||||
public interface WxClockImgMapper {
|
||||
/**
|
||||
* 查询用户打卡图片关联
|
||||
*
|
||||
* @param id 用户打卡图片关联主键
|
||||
* @return 用户打卡图片关联
|
||||
*/
|
||||
public WxClockImg selectWxClockImgById(Long id);
|
||||
|
||||
/**
|
||||
* 查询用户打卡图片关联列表
|
||||
*
|
||||
* @param wxClockImg 用户打卡图片关联
|
||||
* @return 用户打卡图片关联集合
|
||||
*/
|
||||
public List<WxClockImg> selectWxClockImgList(WxClockImg wxClockImg);
|
||||
|
||||
/**
|
||||
* 新增用户打卡图片关联
|
||||
*
|
||||
* @param wxClockImg 用户打卡图片关联
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWxClockImg(WxClockImg wxClockImg);
|
||||
|
||||
/**
|
||||
* 修改用户打卡图片关联
|
||||
*
|
||||
* @param wxClockImg 用户打卡图片关联
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWxClockImg(WxClockImg wxClockImg);
|
||||
|
||||
/**
|
||||
* 删除用户打卡图片关联
|
||||
*
|
||||
* @param id 用户打卡图片关联主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxClockImgById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除用户打卡图片关联
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxClockImgByIds(Long[] ids);
|
||||
|
||||
void deleteByUserClockId(Long userClockId);
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package com.flossom.common.core.mapper;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxClockInstrumentLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 微信用户使用仪器记录Mapper接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-29
|
||||
*/
|
||||
public interface WxClockInstrumentLogMapper {
|
||||
/**
|
||||
* 查询微信用户使用仪器记录
|
||||
*
|
||||
* @param id 微信用户使用仪器记录主键
|
||||
* @return 微信用户使用仪器记录
|
||||
*/
|
||||
public WxClockInstrumentLog selectWxClockInstrumentLogById(Long id);
|
||||
|
||||
/**
|
||||
* 查询微信用户使用仪器记录列表
|
||||
*
|
||||
* @param wxClockInstrumentLog 微信用户使用仪器记录
|
||||
* @return 微信用户使用仪器记录集合
|
||||
*/
|
||||
public List<WxClockInstrumentLog> selectWxClockInstrumentLogList(WxClockInstrumentLog wxClockInstrumentLog);
|
||||
|
||||
/**
|
||||
* 新增微信用户使用仪器记录
|
||||
*
|
||||
* @param wxClockInstrumentLog 微信用户使用仪器记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWxClockInstrumentLog(WxClockInstrumentLog wxClockInstrumentLog);
|
||||
|
||||
/**
|
||||
* 修改微信用户使用仪器记录
|
||||
*
|
||||
* @param wxClockInstrumentLog 微信用户使用仪器记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWxClockInstrumentLog(WxClockInstrumentLog wxClockInstrumentLog);
|
||||
|
||||
/**
|
||||
* 删除微信用户使用仪器记录
|
||||
*
|
||||
* @param id 微信用户使用仪器记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxClockInstrumentLogById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除微信用户使用仪器记录
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxClockInstrumentLogByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
package com.flossom.common.core.mapper;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxClockLog;
|
||||
import com.flossom.common.core.domain.ret.WxClockLogRet;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户打卡Mapper接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-29
|
||||
*/
|
||||
public interface WxClockLogMapper {
|
||||
/**
|
||||
* 查询用户打卡
|
||||
*
|
||||
* @param id 用户打卡主键
|
||||
* @return 用户打卡
|
||||
*/
|
||||
public WxClockLog selectWxClockLogById(Long id);
|
||||
|
||||
/**
|
||||
* 查询用户打卡列表
|
||||
*
|
||||
* @param wxClockLog 用户打卡
|
||||
* @return 用户打卡集合
|
||||
*/
|
||||
public List<WxClockLog> selectWxClockLogList(WxClockLog wxClockLog);
|
||||
|
||||
/**
|
||||
* 新增用户打卡
|
||||
*
|
||||
* @param wxClockLog 用户打卡
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWxClockLog(WxClockLog wxClockLog);
|
||||
|
||||
/**
|
||||
* 修改用户打卡
|
||||
*
|
||||
* @param wxClockLog 用户打卡
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWxClockLog(WxClockLog wxClockLog);
|
||||
|
||||
/**
|
||||
* 删除用户打卡
|
||||
*
|
||||
* @param id 用户打卡主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxClockLogById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除用户打卡
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxClockLogByIds(Long[] ids);
|
||||
|
||||
Integer selectCountByUserId(WxClockLog queryClockLog);
|
||||
|
||||
List<WxClockLogRet> selectWxClockImgRetList(WxClockLog queryClockLog);
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
package com.flossom.common.core.mapper;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxClockStatistics;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 用户打卡统计信息Mapper接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-30
|
||||
*/
|
||||
public interface WxClockStatisticsMapper {
|
||||
/**
|
||||
* 查询用户打卡统计信息
|
||||
*
|
||||
* @param id 用户打卡统计信息主键
|
||||
* @return 用户打卡统计信息
|
||||
*/
|
||||
public WxClockStatistics selectWxClockStatisticsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询用户打卡统计信息列表
|
||||
*
|
||||
* @param wxClockStatistics 用户打卡统计信息
|
||||
* @return 用户打卡统计信息集合
|
||||
*/
|
||||
public List<WxClockStatistics> selectWxClockStatisticsList(WxClockStatistics wxClockStatistics);
|
||||
|
||||
/**
|
||||
* 新增用户打卡统计信息
|
||||
*
|
||||
* @param wxClockStatistics 用户打卡统计信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWxClockStatistics(WxClockStatistics wxClockStatistics);
|
||||
|
||||
/**
|
||||
* 修改用户打卡统计信息
|
||||
*
|
||||
* @param wxClockStatistics 用户打卡统计信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWxClockStatistics(WxClockStatistics wxClockStatistics);
|
||||
|
||||
/**
|
||||
* 删除用户打卡统计信息
|
||||
*
|
||||
* @param id 用户打卡统计信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxClockStatisticsById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除用户打卡统计信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxClockStatisticsByIds(Long[] ids);
|
||||
|
||||
List<WxClockStatistics> selectByUserIdAndYearMonth(@Param("userIdList") List<Long> userIdList, @Param("year") int year, @Param("month") int month);
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.flossom.common.core.mapper;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxNursingLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户护理日志Mapper接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-29
|
||||
*/
|
||||
public interface WxNursingLogMapper {
|
||||
/**
|
||||
* 查询用户护理日志
|
||||
*
|
||||
* @param id 用户护理日志主键
|
||||
* @return 用户护理日志
|
||||
*/
|
||||
public WxNursingLog selectWxNursingLogById(Long id);
|
||||
|
||||
/**
|
||||
* 查询用户护理日志列表
|
||||
*
|
||||
* @param wxNursingLog 用户护理日志
|
||||
* @return 用户护理日志集合
|
||||
*/
|
||||
public List<WxNursingLog> selectWxNursingLogList(WxNursingLog wxNursingLog);
|
||||
|
||||
/**
|
||||
* 新增用户护理日志
|
||||
*
|
||||
* @param wxNursingLog 用户护理日志
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWxNursingLog(WxNursingLog wxNursingLog);
|
||||
|
||||
/**
|
||||
* 修改用户护理日志
|
||||
*
|
||||
* @param wxNursingLog 用户护理日志
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWxNursingLog(WxNursingLog wxNursingLog);
|
||||
|
||||
/**
|
||||
* 删除用户护理日志
|
||||
*
|
||||
* @param id 用户护理日志主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxNursingLogById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除用户护理日志
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxNursingLogByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,78 @@
|
||||
<?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.flossom.common.core.mapper.WxClockImgMapper">
|
||||
|
||||
<resultMap type="WxClockImg" id="WxClockImgResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userClockId" column="user_clock_id" />
|
||||
<result property="clockImg" column="clock_img" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWxClockImgVo">
|
||||
select id, user_clock_id, clock_img, status, create_by, create_time from wx_clock_img
|
||||
</sql>
|
||||
|
||||
<select id="selectWxClockImgList" parameterType="WxClockImg" resultMap="WxClockImgResult">
|
||||
<include refid="selectWxClockImgVo"/>
|
||||
<where>
|
||||
<if test="userClockId != null "> and user_clock_id = #{userClockId}</if>
|
||||
<if test="clockImg != null and clockImg != ''"> and clock_img = #{clockImg}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWxClockImgById" parameterType="Long" resultMap="WxClockImgResult">
|
||||
<include refid="selectWxClockImgVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertWxClockImg" parameterType="WxClockImg" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into wx_clock_img
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userClockId != null">user_clock_id,</if>
|
||||
<if test="clockImg != null">clock_img,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userClockId != null">#{userClockId},</if>
|
||||
<if test="clockImg != null">#{clockImg},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWxClockImg" parameterType="WxClockImg">
|
||||
update wx_clock_img
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userClockId != null">user_clock_id = #{userClockId},</if>
|
||||
<if test="clockImg != null">clock_img = #{clockImg},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWxClockImgById" parameterType="Long">
|
||||
delete from wx_clock_img where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByUserClockId" parameterType="Long">
|
||||
delete from wx_clock_img where user_clock_id = #{userClockId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWxClockImgByIds" parameterType="String">
|
||||
delete from wx_clock_img where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -0,0 +1,85 @@
|
||||
<?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.flossom.common.core.mapper.WxClockInstrumentLogMapper">
|
||||
|
||||
<resultMap type="WxClockInstrumentLog" id="WxClockInstrumentLogResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="instrumentId" column="instrument_id" />
|
||||
<result property="instrumentName" column="instrument_name" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWxClockInstrumentLogVo">
|
||||
select id, user_id, instrument_id, instrument_name, status, create_by, create_time from wx_clock_instrument_log
|
||||
</sql>
|
||||
|
||||
<select id="selectWxClockInstrumentLogList" parameterType="WxClockInstrumentLog" resultMap="WxClockInstrumentLogResult">
|
||||
<include refid="selectWxClockInstrumentLogVo"/>
|
||||
<where>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="instrumentId != null "> and instrument_id = #{instrumentId}</if>
|
||||
<if test="instrumentName != null and instrumentName != ''"> and instrument_name like concat('%', #{instrumentName}, '%')</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="params != null and params.beginTime != null">
|
||||
and create_time >= #{params.beginTime}
|
||||
</if>
|
||||
<if test="params != null and params.endTime != null">
|
||||
and create_time <= #{params.endTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWxClockInstrumentLogById" parameterType="Long" resultMap="WxClockInstrumentLogResult">
|
||||
<include refid="selectWxClockInstrumentLogVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertWxClockInstrumentLog" parameterType="WxClockInstrumentLog" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into wx_clock_instrument_log
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="instrumentId != null">instrument_id,</if>
|
||||
<if test="instrumentName != null">instrument_name,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="instrumentId != null">#{instrumentId},</if>
|
||||
<if test="instrumentName != null">#{instrumentName},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWxClockInstrumentLog" parameterType="WxClockInstrumentLog">
|
||||
update wx_clock_instrument_log
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="instrumentId != null">instrument_id = #{instrumentId},</if>
|
||||
<if test="instrumentName != null">instrument_name = #{instrumentName},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWxClockInstrumentLogById" parameterType="Long">
|
||||
delete from wx_clock_instrument_log where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWxClockInstrumentLogByIds" parameterType="String">
|
||||
delete from wx_clock_instrument_log where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -0,0 +1,141 @@
|
||||
<?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.flossom.common.core.mapper.WxClockLogMapper">
|
||||
|
||||
<resultMap type="WxClockLog" id="WxClockLogResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="instrumentId" column="instrument_id" />
|
||||
<result property="instrumentName" column="instrument_name" />
|
||||
<result property="clockContent" column="clock_content" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="WxClockLogRet" id="WxClockLogRetResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="instrumentId" column="instrument_id" />
|
||||
<result property="instrumentName" column="instrument_name" />
|
||||
<result property="clockContent" column="clock_content" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWxClockLogVo">
|
||||
select id, user_id, instrument_id, instrument_name, clock_content, status, create_by, create_time, update_by, update_time from wx_clock_log
|
||||
</sql>
|
||||
|
||||
<select id="selectCountByUserId" parameterType="WxClockLog" resultType="Integer">
|
||||
select count(1) from wx_clock_log
|
||||
where
|
||||
user_id = #{userId}
|
||||
and create_time >= #{params.beginTime}
|
||||
and create_time <= #{params.endTime}
|
||||
</select>
|
||||
|
||||
<select id="selectWxClockLogList" parameterType="WxClockLog" resultMap="WxClockLogResult">
|
||||
<include refid="selectWxClockLogVo"/>
|
||||
<where>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="instrumentId != null and instrumentId != ''"> and instrument_id = #{instrumentId}</if>
|
||||
<if test="instrumentName != null and instrumentName != ''"> and instrument_name like concat('%', #{instrumentName}, '%')</if>
|
||||
<if test="clockContent != null and clockContent != ''"> and clock_content = #{clockContent}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="params != null and params.beginTime != null">
|
||||
and create_time >= #{params.beginTime}
|
||||
</if>
|
||||
<if test="params != null and params.endTime != null">
|
||||
and create_time <= #{params.endTime}
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectWxClockLogById" parameterType="Long" resultMap="WxClockLogResult">
|
||||
<include refid="selectWxClockLogVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectWxClockImgRetList" parameterType="WxClockLog" resultMap="WxClockLogRetResult">
|
||||
<include refid="selectWxClockLogVo"/>
|
||||
<where>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="instrumentId != null and instrumentId != ''"> and instrument_id = #{instrumentId}</if>
|
||||
<if test="instrumentName != null and instrumentName != ''"> and instrument_name like concat('%', #{instrumentName}, '%')</if>
|
||||
<if test="clockContent != null and clockContent != ''"> and clock_content = #{clockContent}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="params != null and params.beginTime != null">
|
||||
and create_time >= #{params.beginTime}
|
||||
</if>
|
||||
<if test="params != null and params.endTime != null">
|
||||
and create_time <= #{params.endTime}
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<insert id="insertWxClockLog" parameterType="WxClockLog" useGeneratedKeys="true" keyProperty="id">
|
||||
<selectKey keyProperty="id" resultType="Long" order="AFTER">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into wx_clock_log
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="instrumentId != null">instrument_id,</if>
|
||||
<if test="instrumentName != null">instrument_name,</if>
|
||||
<if test="clockContent != null">clock_content,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="instrumentId != null">#{instrumentId},</if>
|
||||
<if test="instrumentName != null">#{instrumentName},</if>
|
||||
<if test="clockContent != null">#{clockContent},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWxClockLog" parameterType="WxClockLog">
|
||||
update wx_clock_log
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="instrumentId != null">instrument_id = #{instrumentId},</if>
|
||||
<if test="instrumentName != null">instrument_name = #{instrumentName},</if>
|
||||
<if test="clockContent != null">clock_content = #{clockContent},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWxClockLogById" parameterType="Long">
|
||||
delete from wx_clock_log where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWxClockLogByIds" parameterType="String">
|
||||
delete from wx_clock_log where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -0,0 +1,112 @@
|
||||
<?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.flossom.common.core.mapper.WxClockStatisticsMapper">
|
||||
|
||||
<resultMap type="WxClockStatistics" id="WxClockStatisticsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="year" column="year" />
|
||||
<result property="month" column="month" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="clockNum" column="clock_num" />
|
||||
<result property="percentage" column="percentage" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWxClockStatisticsVo">
|
||||
select id, `year`, `month`, user_id, clock_num, percentage, status, create_by, create_time, update_by, update_time from wx_clock_statistics
|
||||
</sql>
|
||||
|
||||
<select id="selectWxClockStatisticsList" parameterType="WxClockStatistics" resultMap="WxClockStatisticsResult">
|
||||
<include refid="selectWxClockStatisticsVo"/>
|
||||
<where>
|
||||
<if test="year != null "> and `year` = #{year}</if>
|
||||
<if test="month != null "> and `month` = #{month}</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="clockNum != null "> and clock_num = #{clockNum}</if>
|
||||
<if test="percentage != null "> and percentage = #{percentage}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWxClockStatisticsById" parameterType="Long" resultMap="WxClockStatisticsResult">
|
||||
<include refid="selectWxClockStatisticsVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectByUserIdAndYearMonth" resultMap="WxClockStatisticsResult">
|
||||
<include refid="selectWxClockStatisticsVo"/>
|
||||
<where>
|
||||
`year` = #{year} and `month` = #{month}
|
||||
<if test="userIdList != null and userIdList.size > 0">
|
||||
and user_id in
|
||||
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<insert id="insertWxClockStatistics" parameterType="WxClockStatistics" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into wx_clock_statistics
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="year != null">`year`,</if>
|
||||
<if test="month != null">`month`,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="clockNum != null">clock_num,</if>
|
||||
<if test="percentage != null">percentage,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="year != null">#{year},</if>
|
||||
<if test="month != null">#{month},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="clockNum != null">#{clockNum},</if>
|
||||
<if test="percentage != null">#{percentage},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWxClockStatistics" parameterType="WxClockStatistics">
|
||||
update wx_clock_statistics
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="year != null">`year` = #{year},</if>
|
||||
<if test="month != null">`month` = #{month},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="clockNum != null">clock_num = #{clockNum},</if>
|
||||
<if test="percentage != null">percentage = #{percentage},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWxClockStatisticsById" parameterType="Long">
|
||||
delete from wx_clock_statistics where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWxClockStatisticsByIds" parameterType="String">
|
||||
delete from wx_clock_statistics where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -0,0 +1,119 @@
|
||||
<?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.flossom.common.core.mapper.WxNursingLogMapper">
|
||||
|
||||
<resultMap type="WxNursingLog" id="WxNursingLogResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="instrumentId" column="instrument_id" />
|
||||
<result property="instrumentName" column="instrument_name" />
|
||||
<result property="online" column="online" />
|
||||
<result property="modeId" column="mode_id" />
|
||||
<result property="modeName" column="mode_name" />
|
||||
<result property="nursingTime" column="nursing_time" />
|
||||
<result property="completionPercentage" column="completion_percentage" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWxNursingLogVo">
|
||||
select id, user_id, instrument_id, instrument_name, online, mode_id, mode_name, nursing_time, completion_percentage, status, create_by, create_time, update_by, update_time from wx_nursing_log
|
||||
</sql>
|
||||
|
||||
<select id="selectWxNursingLogList" parameterType="WxNursingLog" resultMap="WxNursingLogResult">
|
||||
<include refid="selectWxNursingLogVo"/>
|
||||
<where>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="instrumentId != null "> and instrument_id = #{instrumentId}</if>
|
||||
<if test="instrumentName != null "> and instrument_name = #{instrumentName}</if>
|
||||
<if test="online != null "> and online = #{online}</if>
|
||||
<if test="modeId != null "> and mode_id = #{modeId}</if>
|
||||
<if test="modeName != null and modeName != ''"> and mode_name like concat('%', #{modeName}, '%')</if>
|
||||
<if test="nursingTime != null "> and nursing_time = #{nursingTime}</if>
|
||||
<if test="completionPercentage != null "> and completion_percentage = #{completionPercentage}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="params != null and params.beginTime != null">
|
||||
and create_time >= #{params.beginTime}
|
||||
</if>
|
||||
<if test="params != null and params.endTime != null">
|
||||
and create_time <= #{params.endTime}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY update_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectWxNursingLogById" parameterType="Long" resultMap="WxNursingLogResult">
|
||||
<include refid="selectWxNursingLogVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertWxNursingLog" parameterType="WxNursingLog" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into wx_nursing_log
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="instrumentId != null">instrument_id,</if>
|
||||
<if test="instrumentName != null">instrument_name,</if>
|
||||
<if test="online != null">online,</if>
|
||||
<if test="modeId != null">mode_id,</if>
|
||||
<if test="modeName != null">mode_name,</if>
|
||||
<if test="nursingTime != null">nursing_time,</if>
|
||||
<if test="completionPercentage != null">completion_percentage,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="instrumentId != null">#{instrumentId},</if>
|
||||
<if test="instrumentName != null">#{instrumentName},</if>
|
||||
<if test="online != null">#{online},</if>
|
||||
<if test="modeId != null">#{modeId},</if>
|
||||
<if test="modeName != null">#{modeName},</if>
|
||||
<if test="nursingTime != null">#{nursingTime},</if>
|
||||
<if test="completionPercentage != null">#{completionPercentage},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWxNursingLog" parameterType="WxNursingLog">
|
||||
update wx_nursing_log
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="instrumentId != null">instrument_id = #{instrumentId},</if>
|
||||
<if test="instrumentName != null">instrument_name = #{instrumentName},</if>
|
||||
<if test="online != null">online = #{online},</if>
|
||||
<if test="modeId != null">mode_id = #{modeId},</if>
|
||||
<if test="modeName != null">mode_name = #{modeName},</if>
|
||||
<if test="nursingTime != null">nursing_time = #{nursingTime},</if>
|
||||
<if test="completionPercentage != null">completion_percentage = #{completionPercentage},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWxNursingLogById" parameterType="Long">
|
||||
delete from wx_nursing_log where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWxNursingLogByIds" parameterType="String">
|
||||
delete from wx_nursing_log where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -0,0 +1,60 @@
|
||||
package com.flossom.miniProgram.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.flossom.common.core.domain.R;
|
||||
import com.flossom.common.core.domain.entity.WxNursingLog;
|
||||
import com.flossom.common.core.domain.req.WxNursingLogReq;
|
||||
import com.flossom.common.core.web.controller.BaseController;
|
||||
import com.flossom.common.core.web.domain.AjaxResult;
|
||||
import com.flossom.common.core.web.page.TableDataInfo;
|
||||
import com.flossom.miniProgram.service.IWxNursingLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 用户护理日志Controller
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-29
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/nursingLog")
|
||||
public class WxNursingLogController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IWxNursingLogService wxNursingLogService;
|
||||
|
||||
/**
|
||||
* 查询用户护理记录
|
||||
*/
|
||||
@GetMapping("/record")
|
||||
public TableDataInfo record(@NotNull(message = "请选择仪器")
|
||||
@RequestParam(value = "instrumentId", required = false) Long instrumentId) {
|
||||
startPage();
|
||||
List<WxNursingLog> list = wxNursingLogService.selectWxNursingLogList(instrumentId);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户护理记录的当月统计信息
|
||||
*/
|
||||
@GetMapping("/statistics")
|
||||
public R statistics(@NotNull(message = "请选择仪器") @RequestParam(value = "instrumentId") Long instrumentId) {
|
||||
return R.ok(wxNursingLogService.statistics(instrumentId));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增用户护理日志
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public R add(@Validated @RequestBody WxNursingLogReq wxNursingLogReq) {
|
||||
wxNursingLogService.insertWxNursingLog(wxNursingLogReq);
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package com.flossom.miniProgram.service;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxClockLog;
|
||||
import com.flossom.common.core.domain.entity.WxClockStatistics;
|
||||
import com.flossom.common.core.domain.req.WxClockLogReq;
|
||||
import com.flossom.common.core.domain.ret.WxClockLogRet;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IWxClockLogService {
|
||||
|
||||
public void insertWxClockLog(WxClockLogReq wxClockLogReq);
|
||||
|
||||
void addClockInstrument(Long instrumentId);
|
||||
|
||||
WxClockLogRet latestClockRecord();
|
||||
|
||||
List<WxClockLogRet> selectWxClockLogList();
|
||||
|
||||
List<WxClockStatistics> clockStatistics(WxClockStatistics wxClockStatistics, Integer pageNum);
|
||||
|
||||
void clockStatisticsTimedTask(List<Long> userIdList, Integer year, Integer month);
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package com.flossom.miniProgram.service;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxNursingLog;
|
||||
import com.flossom.common.core.domain.req.WxNursingLogReq;
|
||||
import com.flossom.common.core.domain.ret.WxNursingStatisticsRet;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 用户护理日志Service接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-29
|
||||
*/
|
||||
public interface IWxNursingLogService {
|
||||
|
||||
/**
|
||||
* 查询用户护理日志列表
|
||||
*/
|
||||
public List<WxNursingLog> selectWxNursingLogList(Long instrumentId);
|
||||
|
||||
/**
|
||||
* 新增用户护理日志
|
||||
*/
|
||||
public void insertWxNursingLog(WxNursingLogReq wxNursingLogReq);
|
||||
|
||||
WxNursingStatisticsRet statistics(Long instrumentId);
|
||||
}
|
||||
@ -0,0 +1,189 @@
|
||||
package com.flossom.miniProgram.service.impl;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.temporal.TemporalAdjusters;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.flossom.common.core.domain.entity.*;
|
||||
import com.flossom.common.core.domain.req.WxNursingLogReq;
|
||||
import com.flossom.common.core.domain.ret.WxNursingStatisticsRet;
|
||||
import com.flossom.common.core.enums.Status;
|
||||
import com.flossom.common.core.exception.ServiceException;
|
||||
import com.flossom.common.core.mapper.WxInstrumentMapper;
|
||||
import com.flossom.common.core.mapper.WxModeMapper;
|
||||
import com.flossom.common.core.mapper.WxNursingLogMapper;
|
||||
import com.flossom.common.core.utils.DateUtils;
|
||||
import com.flossom.common.core.utils.StringUtils;
|
||||
import com.flossom.common.security.utils.DictUtils;
|
||||
import com.flossom.common.security.utils.SecurityUtils;
|
||||
import com.flossom.miniProgram.service.IWxNursingLogService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 用户护理日志Service业务层处理
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-29
|
||||
*/
|
||||
@Service
|
||||
public class WxNursingLogServiceImpl implements IWxNursingLogService {
|
||||
|
||||
@Autowired
|
||||
private WxNursingLogMapper wxNursingLogMapper;
|
||||
|
||||
@Autowired
|
||||
private WxInstrumentMapper wxInstrumentMapper;
|
||||
|
||||
@Autowired
|
||||
private WxModeMapper wxModeMapper;
|
||||
|
||||
@Override
|
||||
public WxNursingStatisticsRet statistics(Long instrumentId) {
|
||||
// 排序:最新的护理记录在最上方;图片由后台模式管理-模式封面图片进行配置;
|
||||
WxNursingLog queryNursingLog = new WxNursingLog();
|
||||
queryNursingLog.setInstrumentId(instrumentId);
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
queryNursingLog.getParams().put("beginTime", now.with(TemporalAdjusters.firstDayOfMonth()).with(LocalTime.MIN));
|
||||
queryNursingLog.getParams().put("endTime", now.with(TemporalAdjusters.lastDayOfMonth()).with(LocalTime.MAX));
|
||||
List<WxNursingLog> wxNursingLogList = wxNursingLogMapper.selectWxNursingLogList(queryNursingLog);
|
||||
if (wxNursingLogList != null && wxNursingLogList.size() > 0) {
|
||||
WxNursingStatisticsRet wxNursingStatisticsRet = new WxNursingStatisticsRet();
|
||||
Map<LocalDate, Long> collect = wxNursingLogList.stream().collect(
|
||||
Collectors.groupingBy(
|
||||
log -> log.getCreateTime().toInstant()
|
||||
.atZone(ZoneId.systemDefault()).toLocalDate(), Collectors.counting()
|
||||
)
|
||||
);
|
||||
wxNursingStatisticsRet.setNursingNum(collect.size());
|
||||
Integer totalNursingSecond = 0;
|
||||
for (WxNursingLog wxNursingLog : wxNursingLogList) {
|
||||
if (wxNursingLog.getNursingTime() != null) {
|
||||
totalNursingSecond += wxNursingLog.getNursingTime().toSecondOfDay();
|
||||
}
|
||||
}
|
||||
wxNursingStatisticsRet.setNursingTime(LocalTime.ofSecondOfDay(totalNursingSecond));
|
||||
return wxNursingStatisticsRet;
|
||||
}
|
||||
return new WxNursingStatisticsRet(0, LocalTime.ofSecondOfDay(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户护理日志列表
|
||||
*/
|
||||
@Override
|
||||
public List<WxNursingLog> selectWxNursingLogList(Long instrumentId) {
|
||||
// 排序:最新的护理记录在最上方;图片由后台模式管理-模式封面图片进行配置;
|
||||
WxNursingLog wxNursingLog = new WxNursingLog();
|
||||
wxNursingLog.setInstrumentId(instrumentId);
|
||||
List<WxNursingLog> wxNursingLogList = wxNursingLogMapper.selectWxNursingLogList(wxNursingLog);
|
||||
if (wxNursingLogList != null && wxNursingLogList.size() > 0) {
|
||||
for (WxNursingLog nursingLog : wxNursingLogList) {
|
||||
WxMode wxMode = wxModeMapper.selectWxModeById(nursingLog.getModeId());
|
||||
if (wxMode != null) {
|
||||
nursingLog.setModeImage(wxMode.getModeBanner());
|
||||
}
|
||||
}
|
||||
}
|
||||
return wxNursingLogList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户护理日志
|
||||
*/
|
||||
@Override
|
||||
public void insertWxNursingLog(WxNursingLogReq wxNursingLogReq) {
|
||||
/* 查询 同一仪器,同一模式 下,是否有相同的记录,如果有合并护理时间 */
|
||||
WxInstrument wxInstrument = wxInstrumentMapper.selectWxInstrumentById(wxNursingLogReq.getInstrumentId());
|
||||
if (wxInstrument == null) {
|
||||
throw new ServiceException("保存失败");
|
||||
}
|
||||
WxNursingLog queryNursingLog = new WxNursingLog();
|
||||
queryNursingLog.setUserId(SecurityUtils.getLoginUser().getWxUserMember().getId());
|
||||
queryNursingLog.setInstrumentId(wxNursingLogReq.getInstrumentId());
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
queryNursingLog.getParams().put("beginTime", LocalDateTime.of(now.toLocalDate(), LocalTime.MIN));
|
||||
queryNursingLog.getParams().put("endTime", LocalDateTime.of(now.toLocalDate(), LocalTime.MAX));
|
||||
List<WxNursingLog> wxNursingLogList = wxNursingLogMapper.selectWxNursingLogList(queryNursingLog);
|
||||
|
||||
if (wxNursingLogList != null && wxNursingLogList.size() > 0) {
|
||||
// 存在,修改
|
||||
WxNursingLog updateNursingLog = new WxNursingLog();
|
||||
WxNursingLog wxNursingLog = wxNursingLogList.get(0);
|
||||
// 非IOT仪器没有护理时间
|
||||
if (wxNursingLog.getNursingTime() != null) {
|
||||
if (wxNursingLogReq.getNursingTime() != null) {
|
||||
updateNursingLog.setNursingTime(wxNursingLog.getNursingTime().plusSeconds(wxNursingLogReq.getNursingTime().toSecondOfDay()));
|
||||
}
|
||||
} else {
|
||||
updateNursingLog.setNursingTime(wxNursingLogReq.getNursingTime());
|
||||
}
|
||||
LocalTime nursingTime = wxInstrument.getNursingTime();
|
||||
if (nursingTime != null) {
|
||||
Integer userNursingTime = updateNursingLog.getNursingTime().toSecondOfDay();
|
||||
Integer instrumentNursingTime = nursingTime.toSecondOfDay();
|
||||
if (userNursingTime != null && userNursingTime > instrumentNursingTime) {
|
||||
updateNursingLog.setCompletionPercentage(1.0);
|
||||
} else {
|
||||
if (instrumentNursingTime != null && instrumentNursingTime != 0) {
|
||||
updateNursingLog.setCompletionPercentage(Double.valueOf(userNursingTime) / instrumentNursingTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
updateNursingLog.setId(wxNursingLog.getId());
|
||||
updateNursingLog.setUpdateBy(SecurityUtils.getLoginUser().getWxUserMember().getNickname());
|
||||
updateNursingLog.setUpdateTime(DateUtils.getNowDate());
|
||||
wxNursingLogMapper.updateWxNursingLog(updateNursingLog);
|
||||
} else {
|
||||
// 不存在,新增
|
||||
WxNursingLog wxNursingLog = new WxNursingLog();
|
||||
BeanUtils.copyProperties(wxNursingLogReq, wxNursingLog);
|
||||
wxNursingLog.setUserId(SecurityUtils.getLoginUser().getWxUserMember().getId());
|
||||
// 非IOT仪器没有护理时间
|
||||
LocalTime nursingTime = wxInstrument.getNursingTime();
|
||||
if (nursingTime != null) {
|
||||
Integer instrumentNursingTime = nursingTime.toSecondOfDay();
|
||||
Integer userNursingTime = wxNursingLog.getNursingTime().toSecondOfDay();
|
||||
if (instrumentNursingTime != null && instrumentNursingTime != 0) {
|
||||
wxNursingLog.setCompletionPercentage(Double.valueOf(userNursingTime) / instrumentNursingTime);
|
||||
}
|
||||
}
|
||||
// 离线状态/在线状态
|
||||
Boolean online = true;
|
||||
List<SysDictData> nursingOfflineInstrumentModelDict = DictUtils.getDictCache("nursing_offline_instrument_model");
|
||||
if (nursingOfflineInstrumentModelDict != null && nursingOfflineInstrumentModelDict.size() > 0) {
|
||||
for (SysDictData sysDictData : nursingOfflineInstrumentModelDict) {
|
||||
if (StringUtils.equals(sysDictData.getDictType(), wxInstrument.getModel())) {
|
||||
List<SysDictData> nursingOfflineInstrumentModeDict = DictUtils.getDictCache("nursing_offline_instrument_mode");
|
||||
if (nursingOfflineInstrumentModeDict != null && nursingOfflineInstrumentModeDict.size() > 0) {
|
||||
for (SysDictData dictData : nursingOfflineInstrumentModeDict) {
|
||||
if (StringUtils.equals(dictData.getDictType(), wxNursingLogReq.getModeName())) {
|
||||
// 离线
|
||||
online = false;
|
||||
wxNursingLog.setOnline(2L);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (online) {
|
||||
// 在线
|
||||
wxNursingLog.setOnline(1L);
|
||||
}
|
||||
wxNursingLog.setCreateBy(SecurityUtils.getLoginUser().getWxUserMember().getNickname());
|
||||
wxNursingLog.setCreateTime(DateUtils.getNowDate());
|
||||
wxNursingLog.setUpdateBy(SecurityUtils.getLoginUser().getWxUserMember().getNickname());
|
||||
wxNursingLog.setUpdateTime(DateUtils.getNowDate());
|
||||
wxNursingLog.setStatus(Status.OK.getCode().longValue());
|
||||
wxNursingLogMapper.insertWxNursingLog(wxNursingLog);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue