<?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="jnpf.attendance.mapper.InitializationMapper" >
<!--    初始化存休表-->
    <delete id="truncatStorageRest">
        delete FROM ftb_attendance_storage_rest
    </delete>
<!--    获取所有的用户劵逻辑-->
    <select id="getBalanceRecord" resultType="jnpf.model.attendance.vo.AttendanceBalanceRecordVo">
        SELECT F_Id id, F_Name `name`, F_User_Id userId, F_Balance balance, F_Total total, F_Unit unit, IFNULL(F_Expire_Time,DATE_FORMAT('2999-1-1','%Y-%m-%d')) expireTime, F_Grant_Way grantWay,
               F_State `state`, F_Over `over`, F_Paid paid, F_CreatorUserId creatoruserid, F_CreatorTime creatortime ,DATE_FORMAT(F_CreatorTime, '%Y-%m') creatorTimeStr
        FROM ftb_attendance_balance_record
    </select>
<!--    获取所有的用户劵逻辑-->
    <select id="getAllBalanceUseRecord" resultType="jnpf.model.attendance.vo.attendance.BalanceUseRecordVo">
        SELECT
            F_Balance_Id balanceId,
            F_Quota quota,
            F_Unit unit,
            F_Start_Time startTime,
            F_End_Time endTime,
            F_CreatorTime creatorTime
        FROM ftb_attendance_balance_use_record
    </select>


</mapper>