chenlu
5 天以前 047545d48c78f39e8cf4082dbcdd2be15654470f
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?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.example.erp.mapper.sd.BasicGlassTypeMapper">
    <select id="getOneLevel">
        select
            *
        from
            basic_glass_type as a
        where a.level=1
    </select>
    <select id="getTwoLevel">
        select
            *
        from
            basic_glass_type as a
        where a.level=2
        ORDER BY  a.id ;
    </select>
 
    <select id="selectMaxType">
        select
            *
        from
            basic_glass_type  as a
        where a.level=1
        ORDER BY  a.id  desc limit 1;
 
    </select>
 
    <select id="selectMaxTowLevelType">
        select
            *
        from
            basic_glass_type  as a
        where
            a.level=2
            and a.belong = #{type}
 
        ORDER BY  a.id  desc limit 1;
    </select>
    
    <update id="updateGlassTypeName" parameterType="com.example.erp.entity.sd.BasicGlassType" >
        update
            basic_glass_type as a
        set a.type_name = #{basicGlassType.typeName}
        where a.id = #{basicGlassType.id}
    </update>
 
 
    <select id="getFindAllConfig">
        select
            *
        from
            process_attribute_config
    </select>
 
    <select id="getOneLevelListMapConfig">
        select
            *
        from
            process_attribute_config
        where level=1
    </select>
 
    <select id="selectMaxTypeConfig">
        select
            *
        from
            process_attribute_config  as a
        where a.level=1
        ORDER BY  a.id  desc limit 1;
 
    </select>
 
    <select id="selectMaxTowLevelTypeConfig">
        select
            *
        from
            process_attribute_config  as a
        where
            a.level=2
          and a.belong = #{type}
 
        ORDER BY  a.id  desc limit 1;
    </select>
 
    <update id="updateProcessAttributeConfig" parameterType="com.example.erp.entity.sd.ProcessAttributeConfig" >
        update
            process_attribute_config as a
        set a.process_type = #{processAttributeConfig.processType},
            a.process_name = #{processAttributeConfig.processName},
            a.input_type = #{processAttributeConfig.inputType},
        where a.id = #{processAttributeConfig.id}
    </update>
 
    <insert id="insertProcessAttributeConfig"  useGeneratedKeys="true" >
        insert into sd.process_attribute_config (level,process_type,process_name,input_type,belong)
        values (
                   #{processAttributeConfig.level}, #{processAttributeConfig.processType}, #{processAttributeConfig.processName},
                   #{processAttributeConfig.inputType}, #{processAttributeConfig.belong}
               )
    </insert>
 
    <delete id="deleteProcessAttributeConfig"  >
        delete from
            process_attribute_config as a
            where a.id = #{id}
    </delete>
 
</mapper>