Administrator
2024-08-05 e84b3255aa6888aca2695e1b8e5ccc6236d60919
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<?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.dy.pipIrrGlobal.daoBa.BaDictItemMapper">
  <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoBa.BaDictItem">
    <!--@mbg.generated-->
    <!--@Table ba_dict_item-->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="dict_code" jdbcType="VARCHAR" property="dictCode" />
    <result column="value" jdbcType="VARCHAR" property="value" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="status" jdbcType="TINYINT" property="status" />
    <result column="attributes" jdbcType="LONGVARCHAR" property="attributes" />
    <result column="sort" jdbcType="INTEGER" property="sort" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
    <result column="deleted" jdbcType="BIGINT" property="deleted" />
    <result column="create_by" jdbcType="INTEGER" property="createBy" />
    <result column="update_by" jdbcType="INTEGER" property="updateBy" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, dict_code, `value`, `name`, `status`, `attributes`, sort, remarks, deleted, create_by, 
    update_by, create_time, update_time
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select 
    <include refid="Base_Column_List" />
    from ba_dict_item
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    <!--@mbg.generated-->
    delete from ba_dict_item
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoBa.BaDictItem" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into ba_dict_item (dict_code, `value`, `name`, 
      `status`, `attributes`, sort, 
      remarks, deleted, create_by, 
      update_by, create_time, update_time
      )
    values (#{dictCode,jdbcType=VARCHAR}, #{value,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, 
      #{status,jdbcType=TINYINT}, #{attributes,jdbcType=LONGVARCHAR}, #{sort,jdbcType=INTEGER}, 
      #{remarks,jdbcType=VARCHAR}, #{deleted,jdbcType=BIGINT}, #{createBy,jdbcType=INTEGER}, 
      #{updateBy,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoBa.BaDictItem" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into ba_dict_item
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="dictCode != null">
        dict_code,
      </if>
      <if test="value != null">
        `value`,
      </if>
      <if test="name != null">
        `name`,
      </if>
      <if test="status != null">
        `status`,
      </if>
      <if test="attributes != null">
        `attributes`,
      </if>
      <if test="sort != null">
        sort,
      </if>
      <if test="remarks != null">
        remarks,
      </if>
      <if test="deleted != null">
        deleted,
      </if>
      <if test="createBy != null">
        create_by,
      </if>
      <if test="updateBy != null">
        update_by,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="dictCode != null">
        #{dictCode,jdbcType=VARCHAR},
      </if>
      <if test="value != null">
        #{value,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=TINYINT},
      </if>
      <if test="attributes != null">
        #{attributes,jdbcType=LONGVARCHAR},
      </if>
      <if test="sort != null">
        #{sort,jdbcType=INTEGER},
      </if>
      <if test="remarks != null">
        #{remarks,jdbcType=VARCHAR},
      </if>
      <if test="deleted != null">
        #{deleted,jdbcType=BIGINT},
      </if>
      <if test="createBy != null">
        #{createBy,jdbcType=INTEGER},
      </if>
      <if test="updateBy != null">
        #{updateBy,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoBa.BaDictItem">
    <!--@mbg.generated-->
    update ba_dict_item
    <set>
      <if test="dictCode != null">
        dict_code = #{dictCode,jdbcType=VARCHAR},
      </if>
      <if test="value != null">
        `value` = #{value,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        `name` = #{name,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        `status` = #{status,jdbcType=TINYINT},
      </if>
      <if test="attributes != null">
        `attributes` = #{attributes,jdbcType=LONGVARCHAR},
      </if>
      <if test="sort != null">
        sort = #{sort,jdbcType=INTEGER},
      </if>
      <if test="remarks != null">
        remarks = #{remarks,jdbcType=VARCHAR},
      </if>
      <if test="deleted != null">
        deleted = #{deleted,jdbcType=BIGINT},
      </if>
      <if test="createBy != null">
        create_by = #{createBy,jdbcType=INTEGER},
      </if>
      <if test="updateBy != null">
        update_by = #{updateBy,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoBa.BaDictItem">
    <!--@mbg.generated-->
    update ba_dict_item
    set dict_code = #{dictCode,jdbcType=VARCHAR},
      `value` = #{value,jdbcType=VARCHAR},
      `name` = #{name,jdbcType=VARCHAR},
      `status` = #{status,jdbcType=TINYINT},
      `attributes` = #{attributes,jdbcType=LONGVARCHAR},
      sort = #{sort,jdbcType=INTEGER},
      remarks = #{remarks,jdbcType=VARCHAR},
      deleted = #{deleted,jdbcType=BIGINT},
      create_by = #{createBy,jdbcType=INTEGER},
      update_by = #{updateBy,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
 
  <!--根据字典Code获取字典项-->
  <select id="getDictItemsByDictCode" resultType="com.dy.pipIrrGlobal.voBa.VoDictItem">
    SELECT
        id AS dictItemId,
        name,
        value
    FROM ba_dict_item
    WHERE deleted = 0 AND status = 1 AND dict_code = #{dictCode}
    ORDER BY sort
  </select>
</mapper>