|
@@ -0,0 +1,102 @@
|
|
|
+<?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.manage.mapper.ClockHolidaysMapper">
|
|
|
+
|
|
|
+ <resultMap type="ClockHolidays" id="ClockHolidaysResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="year" column="year" />
|
|
|
+ <result property="month" column="month" />
|
|
|
+ <result property="holidayDate" column="holiday_date" />
|
|
|
+ <result property="type" column="type" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectClockHolidaysVo">
|
|
|
+ select id, year,month, holiday_date, type, create_by, create_time, update_by, update_time, remark from clock_holidays
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectClockHolidaysList" parameterType="ClockHolidays" resultMap="ClockHolidaysResult">
|
|
|
+ <include refid="selectClockHolidaysVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="year != null and year != ''"> and year = #{year}</if>
|
|
|
+ <if test="month != null and month != ''"> and month = #{month}</if>
|
|
|
+ <if test="holidayDate != null and holidayDate != ''"> and holiday_date = #{holidayDate}</if>
|
|
|
+ <if test="type != null and type != ''"> and type = #{type}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectClockHolidaysById" parameterType="Long" resultMap="ClockHolidaysResult">
|
|
|
+ <include refid="selectClockHolidaysVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+ <select id="selectClockHolidaysMonthList" parameterType="ClockHolidays" resultMap="ClockHolidaysResult">
|
|
|
+ <include refid="selectClockHolidaysVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="year != null and year != ''"> and year = #{year}</if>
|
|
|
+ <if test="month != null and month != ''"> and month = #{month}</if>
|
|
|
+ <if test="holidayDate != null and holidayDate != ''">
|
|
|
+ and date_format(holiday_date,'%Y%m') = date_format(#{holidayDate},'%Y%m')
|
|
|
+ </if>
|
|
|
+ <if test="type != null and type != ''"> and type = #{type}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertClockHolidays" parameterType="ClockHolidays" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into clock_holidays
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="year != null and year != ''">year,</if>
|
|
|
+ <if test="month != null and month != ''">month,</if>
|
|
|
+ <if test="holidayDate != null">holiday_date,</if>
|
|
|
+ <if test="type != null and type != ''">type,</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>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="year != null and year != ''">#{year},</if>
|
|
|
+ <if test="month != null and month != ''"> {month},</if>
|
|
|
+ <if test="holidayDate != null">#{holidayDate},</if>
|
|
|
+ <if test="type != null and type != ''">#{type},</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>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateClockHolidays" parameterType="ClockHolidays">
|
|
|
+ update clock_holidays
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="year != null and year != ''">year = #{year},</if>
|
|
|
+ <if test="month != null and month != ''">month = #{month},</if>
|
|
|
+ <if test="holidayDate != null">holiday_date = #{holidayDate},</if>
|
|
|
+ <if test="type != null and type != ''">type = #{type},</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>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteClockHolidaysById" parameterType="Long">
|
|
|
+ delete from clock_holidays where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteClockHolidaysByIds" parameterType="String">
|
|
|
+ delete from clock_holidays where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|