kongzy
2024-07-01 47a751cb301d05276ae5d75145d57b2d090fe4e1
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
<?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.nanometer.smartlab.dao.EncodeReplaceDictMapper" >
  <resultMap id="BaseResultMap" type="com.nanometer.smartlab.entity.EncodeReplaceDict" >
    <!--          -->
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="type" property="type" typeHandler="com.nanometer.smartlab.entity.handler.ReplaceDictTypeHandler" />
    <result column="number" property="number" jdbcType="VARCHAR" />
    <result column="info" property="info" jdbcType="VARCHAR" />
    <result column="abbreviation" property="abbreviation" jdbcType="VARCHAR" />
    <result column="creator" property="creator" jdbcType="VARCHAR" />
    <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
    <result column="valid_flag" property="validFlag" jdbcType="INTEGER" />
  </resultMap>
  <sql id="Base_Column_List" >
    <!--          -->
    id, type, number, info, abbreviation, creator, update_time, valid_flag
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
    <!--          -->
    select 
    <include refid="Base_Column_List" />
    from sys_encode_replace_dict
    where id = #{id,jdbcType=BIGINT}
  </select>
  <select id="selectAll" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from sys_encode_replace_dict
    <where>
      valid_flag =1
      <if test="info != null and info != ''">
        and info like concat("%",#{info},"%")
      </if>
      <!--    精确查询      -->
      <if test="p_info != null and p_info != ''">
        and info = #{p_info}
      </if>
      <if test="number != null and number != ''">
        and number like concat("%",#{number},"%")
      </if>
      <!--    精确查询      -->
      <if test="p_number != null and p_number != ''">
        and number = #{p_number}
      </if>
      <if test="type != null">
        and type = #{type}
      </if>
    </where>
 
      order by update_time desc
    <if test="first != null and pageSize != null">
      limit #{first},#{pageSize}
    </if>
  </select>
  <select id="countAll" resultType="java.lang.Integer">
    select count(1)
    from sys_encode_replace_dict
    <where>
      valid_flag =1
      <if test="info != null and info != ''">
        and info like concat("%",#{info},"%")
      </if>
      <if test="number != null and number != ''">
        and number like concat("%",#{number},"%")
      </if>
      <if test="type != null">
        and type = #{type}
      </if>
    </where>
 
  </select>
  <select id="findByCondition" resultType="java.lang.Integer" parameterType="java.util.Map">
    select  count(1)
    from sys_encode_replace_dict
    <where>
      valid_flag =1
      <if test="info != null and info != ''">
        and info like concat("%",#{info},"%")
      </if>
      <if test="number != null and number != ''">
        and number like concat("%",#{number},"%")
      </if>
      <if test="type != null">
        and type = #{type}
      </if>
    </where>
  </select>
  <update id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    <!--          -->
    update  sys_encode_replace_dict set  valid_flag = 0
    where id = #{id,jdbcType=BIGINT}
  </update>
  <insert id="insert" parameterType="com.nanometer.smartlab.entity.EncodeReplaceDict" useGeneratedKeys = "true" keyProperty = "id">
    <!--          -->
    insert into sys_encode_replace_dict (type, number,
      info, abbreviation, creator, 
      update_time, valid_flag)
    values (#{type}, #{number,jdbcType=VARCHAR},
      #{info,jdbcType=VARCHAR}, #{abbreviation,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR}, 
      #{updateTime,jdbcType=TIMESTAMP}, 1)
  </insert>
  <insert id="insertSelective" parameterType="com.nanometer.smartlab.entity.EncodeReplaceDict" >
    <!--          -->
    insert into sys_encode_replace_dict
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="type != null" >
        type,
      </if>
      <if test="number != null" >
        number,
      </if>
      <if test="info != null" >
        info,
      </if>
      <if test="abbreviation != null" >
        abbreviation,
      </if>
      <if test="creator != null" >
        creator,
      </if>
      <if test="updateTime != null" >
        update_time,
      </if>
      <if test="validFlag != null" >
        valid_flag,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="type != null" >
        #{type},
      </if>
      <if test="number != null" >
        #{number,jdbcType=VARCHAR},
      </if>
      <if test="info != null" >
        #{info,jdbcType=VARCHAR},
      </if>
      <if test="abbreviation != null" >
        #{abbreviation,jdbcType=VARCHAR},
      </if>
      <if test="creator != null" >
        #{creator,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null" >
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="validFlag != null" >
        #{validFlag,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.nanometer.smartlab.entity.EncodeReplaceDict" >
    <!--          -->
    update sys_encode_replace_dict
    <set >
      <if test="type != null" >
        type = #{type},
      </if>
      <if test="number != null" >
        number = #{number,jdbcType=VARCHAR},
      </if>
      <if test="info != null" >
        info = #{info,jdbcType=VARCHAR},
      </if>
      <if test="abbreviation != null" >
        abbreviation = #{abbreviation,jdbcType=VARCHAR},
      </if>
      <if test="creator != null" >
        creator = #{creator,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null" >
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="validFlag != null" >
        valid_flag = #{validFlag,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.nanometer.smartlab.entity.EncodeReplaceDict" >
    <!--          -->
    update sys_encode_replace_dict
    set type = #{type},
      number = #{number,jdbcType=VARCHAR},
      info = #{info,jdbcType=VARCHAR},
      abbreviation = #{abbreviation,jdbcType=VARCHAR},
      creator = #{creator,jdbcType=VARCHAR},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      valid_flag = #{validFlag,jdbcType=INTEGER}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>