|
@@ -0,0 +1,184 @@
|
|
|
|
|
+<?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.goafanti.common.dao.WorkingHoursMapper">
|
|
|
|
|
+ <resultMap id="BaseResultMap" type="com.goafanti.common.model.WorkingHours">
|
|
|
|
|
+ <!--
|
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
+ This element was generated on Fri Jul 09 11:31:02 CST 2021.
|
|
|
|
|
+ -->
|
|
|
|
|
+ <id column="id" jdbcType="INTEGER" property="id" />
|
|
|
|
|
+ <result column="name" jdbcType="VARCHAR" property="name" />
|
|
|
|
|
+ <result column="type" jdbcType="INTEGER" property="type" />
|
|
|
|
|
+ <result column="start" jdbcType="VARCHAR" property="start" />
|
|
|
|
|
+ <result column="rest_start" jdbcType="VARCHAR" property="restStart" />
|
|
|
|
|
+ <result column="rest_end" jdbcType="VARCHAR" property="restEnd" />
|
|
|
|
|
+ <result column="end" jdbcType="VARCHAR" property="end" />
|
|
|
|
|
+ <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+ <sql id="Base_Column_List">
|
|
|
|
|
+ <!--
|
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
+ This element was generated on Fri Jul 09 11:31:02 CST 2021.
|
|
|
|
|
+ -->
|
|
|
|
|
+ id, `name`, `type`, `start`, rest_start, rest_end, `end`, create_time
|
|
|
|
|
+ </sql>
|
|
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
|
|
+ <!--
|
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
+ This element was generated on Fri Jul 09 11:31:02 CST 2021.
|
|
|
|
|
+ -->
|
|
|
|
|
+ select
|
|
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
|
|
+ from working_hours
|
|
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
|
|
+ <!--
|
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
+ This element was generated on Fri Jul 09 11:31:02 CST 2021.
|
|
|
|
|
+ -->
|
|
|
|
|
+ delete from working_hours
|
|
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
|
|
+ </delete>
|
|
|
|
|
+ <insert id="insert" parameterType="com.goafanti.common.model.WorkingHours">
|
|
|
|
|
+ <!--
|
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
+ This element was generated on Fri Jul 09 11:31:02 CST 2021.
|
|
|
|
|
+ -->
|
|
|
|
|
+ insert into working_hours (id, `name`, `type`,
|
|
|
|
|
+ `start`, rest_start, rest_end,
|
|
|
|
|
+ `end`, create_time)
|
|
|
|
|
+ values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER},
|
|
|
|
|
+ #{start,jdbcType=VARCHAR}, #{restStart,jdbcType=VARCHAR}, #{restEnd,jdbcType=VARCHAR},
|
|
|
|
|
+ #{end,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
|
|
|
|
|
+ </insert>
|
|
|
|
|
+ <insert id="insertSelective" parameterType="com.goafanti.common.model.WorkingHours">
|
|
|
|
|
+ <!--
|
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
+ This element was generated on Fri Jul 09 11:31:02 CST 2021.
|
|
|
|
|
+ -->
|
|
|
|
|
+ insert into working_hours
|
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="id != null">
|
|
|
|
|
+ id,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="name != null">
|
|
|
|
|
+ `name`,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="type != null">
|
|
|
|
|
+ `type`,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="start != null">
|
|
|
|
|
+ `start`,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="restStart != null">
|
|
|
|
|
+ rest_start,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="restEnd != null">
|
|
|
|
|
+ rest_end,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="end != null">
|
|
|
|
|
+ `end`,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="createTime != null">
|
|
|
|
|
+ create_time,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="id != null">
|
|
|
|
|
+ #{id,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="name != null">
|
|
|
|
|
+ #{name,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="type != null">
|
|
|
|
|
+ #{type,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="start != null">
|
|
|
|
|
+ #{start,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="restStart != null">
|
|
|
|
|
+ #{restStart,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="restEnd != null">
|
|
|
|
|
+ #{restEnd,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="end != null">
|
|
|
|
|
+ #{end,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="createTime != null">
|
|
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ </insert>
|
|
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.WorkingHours">
|
|
|
|
|
+ <!--
|
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
+ This element was generated on Fri Jul 09 11:31:02 CST 2021.
|
|
|
|
|
+ -->
|
|
|
|
|
+ update working_hours
|
|
|
|
|
+ <set>
|
|
|
|
|
+ <if test="name != null">
|
|
|
|
|
+ `name` = #{name,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="type != null">
|
|
|
|
|
+ `type` = #{type,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="start != null">
|
|
|
|
|
+ `start` = #{start,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="restStart != null">
|
|
|
|
|
+ rest_start = #{restStart,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="restEnd != null">
|
|
|
|
|
+ rest_end = #{restEnd,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="end != null">
|
|
|
|
|
+ `end` = #{end,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="createTime != null">
|
|
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </set>
|
|
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
|
|
+ </update>
|
|
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.WorkingHours">
|
|
|
|
|
+ <!--
|
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
+ This element was generated on Fri Jul 09 11:31:02 CST 2021.
|
|
|
|
|
+ -->
|
|
|
|
|
+ update working_hours
|
|
|
|
|
+ set `name` = #{name,jdbcType=VARCHAR},
|
|
|
|
|
+ `type` = #{type,jdbcType=INTEGER},
|
|
|
|
|
+ `start` = #{start,jdbcType=VARCHAR},
|
|
|
|
|
+ rest_start = #{restStart,jdbcType=VARCHAR},
|
|
|
|
|
+ rest_end = #{restEnd,jdbcType=VARCHAR},
|
|
|
|
|
+ `end` = #{end,jdbcType=VARCHAR},
|
|
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP}
|
|
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
|
|
+ </update>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectList" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
|
|
+ select
|
|
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
|
|
+ from working_hours
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectBydepId" resultType="com.goafanti.common.model.WorkingHours">
|
|
|
|
|
+ select
|
|
|
|
|
+ a.id,a.`type`, a.`start`, a.rest_start restStart, a.rest_end restEnd, a.`end`, a.create_time createTime
|
|
|
|
|
+ from department d left join working_hours a on d.working_hours_type =a.type
|
|
|
|
|
+ where d.id = #{depId}
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select id="getTypeCount" resultType="java.lang.Integer">
|
|
|
|
|
+ select count(*) from working_hours where type= #{type}
|
|
|
|
|
+ </select>
|
|
|
|
|
+</mapper>
|