<?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.yifu.cloud.plus.v1.permission.mapper.EkpQiweiWorkovertimeMapper">

	<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.permission.entity.EkpQiwiWorkovertime">
		<id property="fdId" column="fd_ID" />
		<result property="fdSpNo" column="FD_SP_NO"/>
		<result property="fdApplyUserName" column="FD_APPLY_USER_NAME"/>
		<result property="fdApplyUserDept" column="FD_APPLY_USER_DEPT"/>
		<result property="fdApplyDate" column="FD_APPLY_DATE"/>
		<result property="fdWorkBegin" column="FD_WORK_BEGIN"/>
		<result property="fdWorkEnd" column="FD_WORK_END"/>
		<result property="fdReason" column="FD_REASON"/>
		<result property="fdTimeUse" column="FD_TIME_USE"/>
		<result property="fdPositionLevel" column="FD_POSITION_LEVEL"/>
		<result property="fdProjectName" column="FD_PROJECT_NAME"/>
		<result property="fdProjectCode" column="FD_PROJECT_CODE"/>
		<result property="fdWorkDuration" column="FD_WORK_DURATION"/>
		<result property="fdHolidayDuration" column="FD_HOLIDAY_DURATION"/>
		<result property="fdRestDuration" column="FD_REST_DURATION"/>
		<result property="fdSumDuration" column="FD_SUM_DURATION"/>
		<result property="fdIsAway" column="FD_IS_AWAY"/>
		<result property="fdOvertimePayStatus" column="FD_OVERTIME_PAY_STATUS"/>
		<result property="fdOvertimePayId" column="FD_OVERTIME_PAY_ID"/>
		<result property="fdOvertimePayCode" column="FD_OVERTIME_PAY_CODE"/>
		<result property="fdOvertimeFoodStatus" column="FD_OVERTIME_FOOD_STATUS"/>
		<result property="fdOvertimeFoodId" column="FD_OVERTIME_FOOD_ID"/>
		<result property="fdOvertimeFoodCode" column="FD_OVERTIME_FOOD_CODE"/>
		<result property="createTime" column="create_time"/>
		<result property="orgData" column="org_data"/>
	</resultMap>

	<sql id="Base_Column_List">
		a.FD_ID,
		a.FD_SP_NO,
		a.FD_APPLY_USER_NAME,
		a.FD_APPLY_USER_DEPT,
		a.FD_APPLY_DATE,
		a.FD_WORK_BEGIN,
		a.FD_WORK_END,
		a.FD_REASON,
		a.FD_TIME_USE,
		a.FD_POSITION_LEVEL,
		a.FD_PROJECT_NAME,
		a.FD_PROJECT_CODE,
		a.FD_WORK_DURATION,
		a.FD_HOLIDAY_DURATION,
		a.FD_REST_DURATION,
		a.FD_SUM_DURATION,
		a.FD_IS_AWAY,
		a.FD_OVERTIME_PAY_STATUS,
		a.FD_OVERTIME_PAY_ID,
		a.FD_OVERTIME_PAY_CODE,
		a.FD_OVERTIME_FOOD_STATUS,
		a.FD_OVERTIME_FOOD_ID,
		a.FD_OVERTIME_FOOD_CODE,
		a.create_time,
		a.org_data
	</sql>
	<!--获取全部的，用来： 拉取企业微信时，不覆盖数据 -->
	<select id="getWorkovertimeMapByTimeRange" resultMap="BaseResultMap">
		SELECT
		<include refid="Base_Column_List"/>
		FROM ekp_qiwei_workovertime a
		<where>
			a.FD_APPLY_DATE >= #{queryStartTime} and a.FD_APPLY_DATE <![CDATA[<=]]> #{queryEndTime}
		</where>
	</select>
</mapper>
