打卡统计
parent
07dc468c11
commit
b8a8d1962a
@ -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,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>
|
||||||
Loading…
Reference in New Issue