微信打卡
parent
67500d3f6e
commit
75b611e724
@ -0,0 +1,46 @@
|
||||
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.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;
|
||||
|
||||
/**
|
||||
* 打卡照片
|
||||
*/
|
||||
@NotNull(message = "请上传打卡图片")
|
||||
@Size(min = 1, max = 3, message = "打卡图片数限制在3张以内")
|
||||
List<String> clockImageList;
|
||||
|
||||
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,62 @@
|
||||
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);
|
||||
}
|
||||
@ -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,61 @@
|
||||
package com.flossom.common.core.mapper;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxClockLog;
|
||||
|
||||
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);
|
||||
}
|
||||
@ -0,0 +1,74 @@
|
||||
<?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="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,91 @@
|
||||
<?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" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWxClockLogVo">
|
||||
select id, user_id, instrument_id, instrument_name, clock_content, status, create_by, create_time from wx_clock_log
|
||||
</sql>
|
||||
|
||||
<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>
|
||||
|
||||
<insert id="insertWxClockLog" parameterType="WxClockLog" useGeneratedKeys="true" keyProperty="id">
|
||||
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>
|
||||
</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>
|
||||
</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>
|
||||
</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,10 @@
|
||||
package com.flossom.miniProgram.service;
|
||||
|
||||
import com.flossom.common.core.domain.req.WxClockLogReq;
|
||||
|
||||
public interface IWxClockLogService {
|
||||
|
||||
public void insertWxClockLog(WxClockLogReq wxClockLogReq);
|
||||
|
||||
void addClockInstrument(Long instrumentId);
|
||||
}
|
||||
Loading…
Reference in New Issue