RuleAttendanceMainMapper.xml 5.19 KB
<?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.ruoyi.mapper.RuleAttendanceMainMapper">

    <resultMap id="BaseResultMap" type="com.ruoyi.domain.RuleAttendanceMain">
            <id property="id" column="id" jdbcType="INTEGER"/>
            <result property="name" column="name" jdbcType="VARCHAR"/>
            <result property="jobCode" column="job_code" jdbcType="VARCHAR"/>
            <result property="workingHourPlan" column="working_hour_plan" jdbcType="INTEGER"/>
            <result property="workingHourType" column="working_hour_type" jdbcType="TINYINT"/>
            <result property="firstWorkSignInTime" column="first_work_sign_in_time" jdbcType="TIMESTAMP"/>
            <result property="firstSignInWorkingRange" column="first_sign_in_working_range" jdbcType="INTEGER"/>
            <result property="firstQuittingSignInTime" column="first_quitting_sign_in_time" jdbcType="TIMESTAMP"/>
            <result property="firstSignInQuittingRange" column="first_sign_in_quitting_range" jdbcType="INTEGER"/>
            <result property="signInTimeOutRange" column="sign_in_time_out_range" jdbcType="INTEGER"/>
            <result property="secondWorkSignInTime" column="second_work_sign_in_time" jdbcType="TIMESTAMP"/>
            <result property="secondSignInWorkingRange" column="second_sign_in_working_range" jdbcType="INTEGER"/>
            <result property="secondQuittingSignInTime" column="second_quitting_sign_in_time" jdbcType="TIMESTAMP"/>
            <result property="secondSignInQuittingRange" column="second_sign_in_quitting_range" jdbcType="INTEGER"/>
            <result property="schedulingDate" column="scheduling_date" jdbcType="DATE"/>
            <result property="posts" column="posts" jdbcType="VARCHAR"/>
            <result property="ruleDictName" column="rule_dict_name" jdbcType="VARCHAR"/>
            <result property="workFlag" column="work_flag" jdbcType="INTEGER"/>
    </resultMap>

    <sql id="Base_Column_List">
        id,`name`,job_code,
        working_hour_plan,working_hour_type,first_work_sign_in_time,
        first_sign_in_working_range,first_quitting_sign_in_time,first_sign_in_quitting_range,
        sign_in_time_out_range,second_work_sign_in_time,second_sign_in_working_range,
        second_quitting_sign_in_time,second_sign_in_quitting_range,scheduling_date,work_flag
    </sql>
    <update id="updateByIdTotalQuantity">
        <foreach collection="mainList" item="main" index="index" separator=";">
            update rule_attendance_main set
            working_hour_plan = #{main.workingHourPlan},
            working_hour_type = #{main.workingHourType},
            first_work_sign_in_time = #{main.firstWorkSignInTime},
            first_sign_in_working_range = #{main.firstSignInWorkingRange},
            first_quitting_sign_in_time = #{main.firstQuittingSignInTime},
            first_sign_in_quitting_range = #{main.firstSignInQuittingRange},
            sign_in_time_out_range = #{main.signInTimeOutRange},
            second_work_sign_in_time = #{main.secondWorkSignInTime},
            second_sign_in_working_range = #{main.secondSignInWorkingRange},
            second_quitting_sign_in_time = #{main.secondQuittingSignInTime},
            second_sign_in_quitting_range = #{main.secondSignInQuittingRange},
            work_flag = #{main.workFlag}
            where
            job_code IN
            <foreach collection="vo.jobCode" index="index" item="item" open="(" close=")" separator=",">
                #{item}
            </foreach>
            and scheduling_date = #{main.schedulingDate}
        </foreach>
    </update>
    <delete id="deleteByJobCodeTotalRecord">
        delete from rule_attendance_main
           where job_code IN
                 <foreach collection="jobCode" index="index" item="item" separator="," open="(" close=")">
                     #{item}
                 </foreach>
                   and scheduling_date &gt;= #{startDate}
                   and scheduling_date &lt;= #{endDate}
    </delete>
    <select id="queryNowMonthDate" resultType="com.ruoyi.domain.RuleAttendanceMain">
        select job_code,name,posts,first_work_sign_in_time,first_quitting_sign_in_time,second_work_sign_in_time,second_quitting_sign_in_time,scheduling_date,work_flag
        from rule_attendance_main
        <where>
            DATE_FORMAT(scheduling_date,'%Y-%m') = #{vo.date}
            <if test="vo.jobCode != null and vo.jobCode != ''">
                and job_code = #{vo.jobCode}
            </if>
            <if test="vo.name != null and vo.name != ''">
                and `name` = #{vo.name}
            </if>
            <if test="vo.fleetName != null and vo.fleetName != ''">
                and fleet_name = #{vo.fleetName}
            </if>
            <if test="vo.posts != null and vo.posts != ''">
                and posts = #{vo.posts}
            </if>
            <if test="jobCodes!=null and jobCodes.size() > 0">
                and job_code IN
            <foreach collection="jobCodes" item="item" open="(" close=")" separator="," index="index">
                #{item}
            </foreach>
            </if>
        </where>
    </select>
</mapper>