|
@@ -2,11 +2,6 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<!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">
|
|
<mapper namespace="com.goafanti.common.dao.WorkingHoursMapper">
|
|
|
<resultMap id="BaseResultMap" type="com.goafanti.common.model.WorkingHours">
|
|
<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" />
|
|
<id column="id" jdbcType="INTEGER" property="id" />
|
|
|
<result column="name" jdbcType="VARCHAR" property="name" />
|
|
<result column="name" jdbcType="VARCHAR" property="name" />
|
|
|
<result column="type" jdbcType="INTEGER" property="type" />
|
|
<result column="type" jdbcType="INTEGER" property="type" />
|
|
@@ -15,59 +10,32 @@
|
|
|
<result column="rest_end" jdbcType="VARCHAR" property="restEnd" />
|
|
<result column="rest_end" jdbcType="VARCHAR" property="restEnd" />
|
|
|
<result column="end" jdbcType="VARCHAR" property="end" />
|
|
<result column="end" jdbcType="VARCHAR" property="end" />
|
|
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
|
|
+ <result column="min_hours" jdbcType="DOUBLE" property="minHours" />
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List">
|
|
<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
|
|
|
|
|
|
|
+ id, `name`, `type`, `start`, rest_start, rest_end, `end`, create_time, min_hours
|
|
|
</sql>
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
<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
|
|
|
|
|
|
|
+ select
|
|
|
<include refid="Base_Column_List" />
|
|
<include refid="Base_Column_List" />
|
|
|
from working_hours
|
|
from working_hours
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</select>
|
|
</select>
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
<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
|
|
delete from working_hours
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</delete>
|
|
</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 id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.WorkingHours" useGeneratedKeys="true">
|
|
|
|
|
+ insert into working_hours (`name`, `type`, `start`,
|
|
|
|
|
+ rest_start, rest_end, `end`,
|
|
|
|
|
+ create_time, min_hours)
|
|
|
|
|
+ values (#{name,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{start,jdbcType=VARCHAR},
|
|
|
|
|
+ #{restStart,jdbcType=VARCHAR}, #{restEnd,jdbcType=VARCHAR}, #{end,jdbcType=VARCHAR},
|
|
|
|
|
+ #{createTime,jdbcType=TIMESTAMP}, #{minHours,jdbcType=DOUBLE})
|
|
|
</insert>
|
|
</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 id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.WorkingHours" useGeneratedKeys="true">
|
|
|
insert into working_hours
|
|
insert into working_hours
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">
|
|
|
|
|
- id,
|
|
|
|
|
- </if>
|
|
|
|
|
<if test="name != null">
|
|
<if test="name != null">
|
|
|
`name`,
|
|
`name`,
|
|
|
</if>
|
|
</if>
|
|
@@ -89,11 +57,11 @@
|
|
|
<if test="createTime != null">
|
|
<if test="createTime != null">
|
|
|
create_time,
|
|
create_time,
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="minHours != null">
|
|
|
|
|
+ min_hours,
|
|
|
|
|
+ </if>
|
|
|
</trim>
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">
|
|
|
|
|
- #{id,jdbcType=INTEGER},
|
|
|
|
|
- </if>
|
|
|
|
|
<if test="name != null">
|
|
<if test="name != null">
|
|
|
#{name,jdbcType=VARCHAR},
|
|
#{name,jdbcType=VARCHAR},
|
|
|
</if>
|
|
</if>
|
|
@@ -115,14 +83,12 @@
|
|
|
<if test="createTime != null">
|
|
<if test="createTime != null">
|
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="minHours != null">
|
|
|
|
|
+ #{minHours,jdbcType=DOUBLE},
|
|
|
|
|
+ </if>
|
|
|
</trim>
|
|
</trim>
|
|
|
</insert>
|
|
</insert>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.WorkingHours">
|
|
<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
|
|
update working_hours
|
|
|
<set>
|
|
<set>
|
|
|
<if test="name != null">
|
|
<if test="name != null">
|
|
@@ -146,15 +112,13 @@
|
|
|
<if test="createTime != null">
|
|
<if test="createTime != null">
|
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="minHours != null">
|
|
|
|
|
+ min_hours = #{minHours,jdbcType=DOUBLE},
|
|
|
|
|
+ </if>
|
|
|
</set>
|
|
</set>
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
</update>
|
|
|
<update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.WorkingHours">
|
|
<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
|
|
update working_hours
|
|
|
set `name` = #{name,jdbcType=VARCHAR},
|
|
set `name` = #{name,jdbcType=VARCHAR},
|
|
|
`type` = #{type,jdbcType=INTEGER},
|
|
`type` = #{type,jdbcType=INTEGER},
|
|
@@ -162,18 +126,19 @@
|
|
|
rest_start = #{restStart,jdbcType=VARCHAR},
|
|
rest_start = #{restStart,jdbcType=VARCHAR},
|
|
|
rest_end = #{restEnd,jdbcType=VARCHAR},
|
|
rest_end = #{restEnd,jdbcType=VARCHAR},
|
|
|
`end` = #{end,jdbcType=VARCHAR},
|
|
`end` = #{end,jdbcType=VARCHAR},
|
|
|
- create_time = #{createTime,jdbcType=TIMESTAMP}
|
|
|
|
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
+ min_hours = #{minHours,jdbcType=DOUBLE}
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
</update>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
<select id="selectList" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
<select id="selectList" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
- select
|
|
|
|
|
|
|
+ select
|
|
|
<include refid="Base_Column_List" />
|
|
<include refid="Base_Column_List" />
|
|
|
from working_hours
|
|
from working_hours
|
|
|
</select>
|
|
</select>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
<select id="selectBydepId" resultType="com.goafanti.common.model.WorkingHours">
|
|
<select id="selectBydepId" resultType="com.goafanti.common.model.WorkingHours">
|
|
|
- select
|
|
|
|
|
|
|
+ select
|
|
|
a.id,a.name,a.`type`, a.`start`, a.rest_start restStart, a.rest_end restEnd, a.`end`, a.create_time createTime
|
|
a.id,a.name,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
|
|
from department d left join working_hours a on d.working_hours_type =a.type
|
|
|
where d.id = #{depId}
|
|
where d.id = #{depId}
|
|
@@ -181,11 +146,11 @@
|
|
|
<select id="getTypeCount" resultType="java.lang.Integer">
|
|
<select id="getTypeCount" resultType="java.lang.Integer">
|
|
|
select count(*) from working_hours where type= #{type}
|
|
select count(*) from working_hours where type= #{type}
|
|
|
</select>
|
|
</select>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
<select id="getDepTypeCount" resultType="java.lang.Integer">
|
|
<select id="getDepTypeCount" resultType="java.lang.Integer">
|
|
|
- select
|
|
|
|
|
|
|
+ select
|
|
|
count(*)
|
|
count(*)
|
|
|
from department d left join working_hours a on d.working_hours_type =a.type
|
|
from department d left join working_hours a on d.working_hours_type =a.type
|
|
|
where a.id= #{id}
|
|
where a.id= #{id}
|
|
|
</select>
|
|
</select>
|
|
|
-</mapper>
|
|
|
|
|
|
|
+</mapper>
|