<?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.WorkTimeGroupAndPeriodRelationInfoRepository" >
|
<resultMap id="workTimeGroupAndPeriodRelationMap" type="com.gkhy.safePlatform.account.entity.schedule.WorkTimeGroupAndPeriodRelationInfo">
|
<result property="id" column="id" jdbcType="BIGINT"></result>
|
<result property="workTimeGroupId" column="work_time_group_id" jdbcType="BIGINT"></result>
|
<result property="workTimePeriodId" column="work_time_period_id" jdbcType="BIGINT"></result>
|
</resultMap>
|
|
|
<!--查询-->
|
<select id="getWorkTimeGroupAndPeriodRelation" parameterType="com.gkhy.safePlatform.account.entity.schedule.WorkTimeGroupAndPeriodRelationInfo" resultMap="workTimeGroupAndPeriodRelationMap">
|
select
|
id,
|
work_time_group_id,
|
work_time_period_id
|
from schedule_work_time_group_and_period_relation
|
where 1=1
|
<if test="workTimeGroupId != null and workTimeGroupId != ''">
|
and work_time_group_id = #{workTimeGroupId}
|
</if>
|
<if test="workTimePeriodId != null and workTimePeriodId != ''">
|
and work_time_period_id = #{workTimePeriodId}
|
</if>
|
</select>
|
<!--删除绑定-->
|
<delete id="deleteWtgAprByWorkTimeGroupId" parameterType="java.lang.Long">
|
delete from schedule_work_time_group_and_period_relation where work_time_group_id = #{workTimeGroupId}
|
</delete>
|
|
<!--查询关系表和工作时间段关联数据-->
|
<select id="getWorkTimePeriodRelation" resultType="com.gkhy.safePlatform.account.entity.schedule.WorkTimePeriodRelationDO">
|
SELECT
|
r.id AS relationId,
|
r.work_time_group_id AS workTimeGroupId,
|
r.work_time_period_id AS workTimePeriodId,
|
p.NAME,
|
p.info,
|
p.start_hour,
|
p.start_min,
|
p.end_hour,
|
p.end_min,
|
p.work_hours,
|
p.enable_across_day,
|
p.create_by,
|
p.gmt_create,
|
p.create_uid,
|
p.edit_by,
|
p.edit_uid,
|
p.gmt_modified
|
FROM schedule_work_time_group_and_period_relation r
|
LEFT JOIN schedule_work_time_period p
|
ON r.work_time_period_id = p.id
|
WHERE
|
p.STATUS = 1
|
<if test="workTimeGroupId != null">
|
and work_time_group_id = #{workTimeGroupId}
|
</if>
|
</select>
|
</mapper>
|