郑永安
2023-06-19 7a6abd05683528032687c75e80e0bd2030a3e46c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?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.BreakTimeGroupInfoReposity" >
 
    <resultMap id="breakTimeGroup" type="com.gkhy.safePlatform.account.entity.schedule.BreakTimeGroupInfo">
        <result property="id" column="id"/>
        <result property="name" column="name"/>
        <result property="info" column="info" />
        <result property="gmtCreate" column="gmt_create" />
        <result property="createBy" column="create_y" />
        <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="BreakTimeRuleInfoDO" type="com.gkhy.safePlatform.account.entity.schedule.BreakTimeRuleInfoDO">
        <result property="id" column="id"/>
        <result property="name" column="name"/>
        <result property="info" column="info"/>
        <result property="type" column="type"/>
        <result property="rule" column="rule"/>
        <result property="ruleNumber" column="rule_number"/>
        <result property="status" column="status"/>
    </resultMap>
 
    <!--查询-->
    <select id="getAllBreakTimeGroup" parameterType="com.gkhy.safePlatform.account.entity.schedule.WorkTimeGroupInfo" resultMap="breakTimeGroup">
        select
          id,
          name,
          info,
          gmt_create,
          create_by,
          create_uid,
          gmt_modified,
          edit_by,
          edit_uid
        from schedule_break_time_group
        where 1=1
        <if test="query.status != null">
            and status = #{query.status}
 
        </if>
        <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>
 
    </select>
 
 
    <select id="getBreakTimeRuleDOsByBeakTimeGroupId"
            parameterType="long"
            resultMap="BreakTimeRuleInfoDO">
        select
        breakTimeRule.id,
        breakTimeRule.name,
        breakTimeRule.info,
        breakTimeRule.type,
        breakTimeRule.rule,
        breakTimeRule.rule_number,
        breakTimeRule.status
        from  schedule_break_time_group as breakTimeGroup
        inner join schedule_break_time_group_and_rule_relation as relations on relations.break_time_group_id = breakTimeGroup.id
        inner join schedule_break_time_rule as breakTimeRule  on relations.break_time_rule_id = breakTimeRule.id and breakTimeRule.status = 1
        where breakTimeGroup.status = 1
        and breakTimeGroup.id = #{breakTimeGroupId}
    </select>
 
</mapper>