<?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.gkhy.safePlatform.account.repository.schedule.WorkTimePeriodInfoRepository" >
|
|
<resultMap id="workTimePeriod" type="com.gkhy.safePlatform.account.entity.schedule.WorkTimePeriodInfo">
|
<result property="id" column="id"/>
|
<result property="name" column="name"/>
|
<result property="info" column="info" />
|
<result property="startHour" column="start_hour" />
|
<result property="startMin" column="start_min" />
|
<result property="endHour" column="end_hour" />
|
<result property="endMin" column="end_min" />
|
<result property="workHours" column="work_hours" />
|
<result property="enableAcrossDay" column="enable_across_day" />
|
<result property="gmtCreate" column="gmt_create" />
|
<result property="createBy" column="create_by" />
|
<result property="createUid" column="create_uid" />
|
<result property="gmtModified" column="gmt_modified"/>
|
<result property="editBy" column="edit_by"/>
|
<result property="editUid" column="edit_uid"/>
|
<result property="status" column="status" />
|
</resultMap>
|
|
|
<resultMap id="WorkTimePeriodInfoDO" type="com.gkhy.safePlatform.account.entity.schedule.WorkTimePeriodInfoDO">
|
<result property="id" column="id"/>
|
<result property="name" column="name"/>
|
<result property="info" column="info" />
|
<result property="startHour" column="start_hour" />
|
<result property="startMin" column="start_min" />
|
<result property="endHour" column="end_hour" />
|
<result property="endMin" column="end_min" />
|
<result property="workHours" column="work_hours" />
|
<result property="enableAcrossDay" column="enable_across_day" />
|
<result property="status" column="status" />
|
</resultMap>
|
|
<!--新增-->
|
<insert id="saveWorkTimePeriodInfo"
|
keyProperty="id"
|
useGeneratedKeys="true"
|
parameterType="com.gkhy.safePlatform.account.entity.schedule.WorkTimePeriodInfo"
|
>
|
insert into schedule_work_time_period
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="name != null">
|
name,
|
</if>
|
<if test="info != null">
|
info,
|
</if>
|
<if test="startHour != null">
|
start_hour,
|
</if>
|
<if test="startMin != null">
|
start_min,
|
</if>
|
<if test="endHour != null">
|
end_hour,
|
</if>
|
<if test="endMin != null">
|
end_Min,
|
</if>
|
<if test="workHours != null">
|
work_Hours,
|
</if>
|
<if test="enableAcrossDay != null">
|
enable_across_day,
|
</if>
|
<if test="gmtCreate != null">
|
gmt_create,
|
</if>
|
<if test="createBy != null">
|
create_by,
|
</if>
|
<if test="createUid != null">
|
create_uid,
|
</if>
|
<if test="gmtModified != null">
|
gmt_modified,
|
</if>
|
<if test="editBy != null">
|
edit_by,
|
</if>
|
<if test="editUid != null">
|
edit_uid,
|
</if>
|
<if test="status != null">
|
status,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="name != null">
|
{name},
|
</if>
|
<if test="info != null">
|
#{nfo},
|
</if>
|
<if test="startHour != null">
|
#{startHour},
|
</if>
|
<if test="startMin != null">
|
#{startMin},
|
</if>
|
<if test="endHour != null">
|
#{endHour},
|
</if>
|
<if test="endMin != null">
|
#{endMin},
|
</if>
|
<if test="workHours != null">
|
#{workHours},
|
</if>
|
<if test="enableAcrossDay != null">
|
#{enableAcrossDay},
|
</if>
|
<if test="gmtCreate != null">
|
#{gmtCreate},
|
</if>
|
<if test="createBy != null">
|
#{createBy},
|
</if>
|
<if test="createUid != null">
|
#{createUid},
|
</if>
|
<if test="gmtModified != null">
|
#{gmtModified},
|
</if>
|
<if test="editBy != null">
|
#{editBy},
|
</if>
|
<if test="editUid != null">
|
#{editUid},
|
</if>
|
<if test="status != null">
|
#{status},
|
</if>
|
</trim>
|
</insert>
|
|
<!--更新-->
|
<update id="updateWorkTimePeriod" parameterType="com.gkhy.safePlatform.account.entity.schedule.WorkTimePeriodInfo">
|
update schedule_work_time_period
|
<set>
|
<if test="name != null">
|
name = #{name},
|
</if>
|
<if test="info != null">
|
info = #{info},
|
</if>
|
<if test="startHour != null">
|
start_hour = #{startHour},
|
</if>
|
<if test="startMin != null">
|
start_min = #{startMin},
|
</if>
|
<if test="endHour != null">
|
end_hour = #{endHour},
|
</if>
|
<if test="endMin != null">
|
end_min = #{endMin},
|
</if>
|
<if test="workHours != null">
|
work_hours = #{workHours},
|
</if>
|
<if test="enableAcrossDay != null">
|
enable_across_day#{enableAcrossDay},
|
</if>
|
<if test="gmtCreate != null">
|
gmt_create = #{gmtCreate},
|
</if>
|
<if test="createBy != null">
|
create_by = #{createBy},
|
</if>
|
<if test="createUid != null">
|
create_uid = #{createUid},
|
</if>
|
<if test="gmtModified != null">
|
gmt_modified = #{gmtModified},
|
</if>
|
<if test="editBy != null">
|
edit_by = #{editBy},
|
</if>
|
<if test="editUid != null">
|
edit_uid = #{editUid},
|
</if>
|
<if test="status != null">
|
status = #{status},
|
</if>
|
</set>
|
where id = #{id}
|
</update>
|
|
<!--查询-->
|
<select id="getWorkTimePeriod" parameterType="com.gkhy.safePlatform.account.entity.schedule.WorkTimePeriodInfo" resultMap="workTimePeriod">
|
select
|
id,
|
name,
|
info,
|
status,
|
start_hour,
|
start_min,
|
end_hour,
|
end_min,
|
work_hours,
|
enable_across_day,
|
gmt_create,
|
create_by,
|
create_uid,
|
gmt_modified,
|
edit_by,
|
edit_uid
|
from schedule_work_time_period
|
where 1 = 1
|
<if test="query.name != null and query.name != ''">
|
and name like concat("%",#{query.name},"%")
|
</if>
|
<if test="query.id != null ">
|
and id = #{query.id}
|
</if>
|
<if test="query.status != null">
|
and status = #{query.status}
|
</if>
|
|
</select>
|
<select id="getWorkTimePeriodsByWorkTimeGroupId"
|
parameterType="long"
|
resultMap="WorkTimePeriodInfoDO">
|
select
|
workTimePeriod.id,
|
workTimePeriod.name,
|
workTimePeriod.info,
|
workTimePeriod.start_hour,
|
workTimePeriod.start_min,
|
workTimePeriod.end_hour,
|
workTimePeriod.end_min,
|
workTimePeriod.work_hours,
|
workTimePeriod.enable_across_day,
|
workTimePeriod.status
|
from schedule_work_time_group as workTimeGroup
|
inner join schedule_work_time_group_and_period_relation as relations on relations.work_time_group_id = workTimeGroup.id
|
inner join schedule_work_time_period as workTimePeriod on workTimePeriod.id = relations.work_time_period_id
|
where workTimePeriod.status = 1
|
and workTimeGroup.id = #{workTimeGroupId}
|
order by workTimePeriod.start_hour asc
|
|
</select>
|
|
|
<!--逻辑删除-->
|
<update id="deleteWorkTimePeriod">
|
update schedule_work_time_period
|
set status = #{status}
|
where id = #{id}
|
</update>
|
|
|
|
|
</mapper>
|