<?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="org.springblade.modules.activities.mapper.SignInMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="signInResultMap" type="org.springblade.modules.activities.entity.SignIn">
        <result column="id" property="id"/>
        <result column="is_delete" property="isDelete"/>
        <result column="create_user_id" property="createUserId"/>
        <result column="create_time" property="createTime"/>
        <result column="update_user_id" property="updateUserId"/>
        <result column="update_time" property="updateTime"/>
        <result column="user_id" property="userId"/>
        <result column="days" property="days"/>
        <result column="last_sign_in_time" property="lastSignInTime"/>
    </resultMap>


    <select id="selectSignInPage" resultMap="signInResultMap">
        select * from biz_sign_in where is_deleted = 0
    </select>

    <select id="getNotContinuous" resultType="org.springblade.modules.activities.entity.SignIn">
        SELECT *
        FROM biz_sign_in WHERE days > 0 and TIMESTAMPDIFF(DAY,last_sign_in_time,NOW()) > 0
    </select>

</mapper>
