StockMapper.xml 12.5 KB
Newer Older
1 2 3
<?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="pwc.taxtech.atms.dao.StockMapper">
4
  <resultMap id="BaseResultMap" type="pwc.taxtech.atms.entity.Stock">
5 6 7 8
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
9 10 11 12 13 14 15 16 17
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="code" jdbcType="VARCHAR" property="code" />
    <result column="stock_amount" jdbcType="TINYINT" property="stockAmount" />
    <result column="capital_amount" jdbcType="TINYINT" property="capitalAmount" />
    <result column="capital_percent" jdbcType="TINYINT" property="capitalPercent" />
    <result column="effective_date" jdbcType="TIMESTAMP" property="effectiveDate" />
    <result column="expired_date" jdbcType="TIMESTAMP" property="expiredDate" />
    <result column="parent_id" jdbcType="VARCHAR" property="parentId" />
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
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
46
            </foreach>
47
          </trim>
48
        </if>
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
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
81
        </if>
82 83 84 85 86 87 88 89
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
90 91
    id, name, code, stock_amount, capital_amount, capital_percent, effective_date, expired_date, 
    parent_id
92
  </sql>
93
  <select id="selectByExample" parameterType="pwc.taxtech.atms.entity.StockExample" resultMap="BaseResultMap">
94 95 96 97 98 99 100 101 102
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
gary's avatar
gary committed
103
    from stock
104 105 106 107 108 109 110 111 112 113 114 115 116 117
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
gary's avatar
gary committed
118 119
    from stock
    where id = #{id,jdbcType=VARCHAR}
120 121 122 123 124 125
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
126 127
    delete from stock
    where id = #{id,jdbcType=VARCHAR}
128
  </delete>
129
  <delete id="deleteByExample" parameterType="pwc.taxtech.atms.entity.StockExample">
130 131 132 133
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
134
    delete from stock
135 136 137 138
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
139
  <insert id="insert" parameterType="pwc.taxtech.atms.entity.Stock">
140 141 142 143
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
144 145 146
    insert into stock (id, name, code, 
      stock_amount, capital_amount, capital_percent, 
      effective_date, expired_date, parent_id
147
      )
gary's avatar
gary committed
148 149 150
    values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, 
      #{stockAmount,jdbcType=TINYINT}, #{capitalAmount,jdbcType=TINYINT}, #{capitalPercent,jdbcType=TINYINT}, 
      #{effectiveDate,jdbcType=TIMESTAMP}, #{expiredDate,jdbcType=TIMESTAMP}, #{parentId,jdbcType=VARCHAR}
151 152
      )
  </insert>
153
  <insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.Stock">
154 155 156 157
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
158
    insert into stock
159
    <trim prefix="(" suffix=")" suffixOverrides=",">
gary's avatar
gary committed
160 161
      <if test="id != null">
        id,
162 163
      </if>
      <if test="name != null">
gary's avatar
gary committed
164
        name,
165 166
      </if>
      <if test="code != null">
gary's avatar
gary committed
167
        code,
168 169
      </if>
      <if test="stockAmount != null">
gary's avatar
gary committed
170
        stock_amount,
171 172
      </if>
      <if test="capitalAmount != null">
gary's avatar
gary committed
173
        capital_amount,
174 175
      </if>
      <if test="capitalPercent != null">
gary's avatar
gary committed
176
        capital_percent,
177 178
      </if>
      <if test="effectiveDate != null">
gary's avatar
gary committed
179
        effective_date,
180 181
      </if>
      <if test="expiredDate != null">
gary's avatar
gary committed
182
        expired_date,
183
      </if>
gary's avatar
gary committed
184 185
      <if test="parentId != null">
        parent_id,
186 187 188
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
gary's avatar
gary committed
189 190
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
191 192 193 194 195 196 197 198
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="code != null">
        #{code,jdbcType=VARCHAR},
      </if>
      <if test="stockAmount != null">
gary's avatar
gary committed
199
        #{stockAmount,jdbcType=TINYINT},
200 201
      </if>
      <if test="capitalAmount != null">
gary's avatar
gary committed
202
        #{capitalAmount,jdbcType=TINYINT},
203 204
      </if>
      <if test="capitalPercent != null">
gary's avatar
gary committed
205
        #{capitalPercent,jdbcType=TINYINT},
206 207 208 209 210 211 212
      </if>
      <if test="effectiveDate != null">
        #{effectiveDate,jdbcType=TIMESTAMP},
      </if>
      <if test="expiredDate != null">
        #{expiredDate,jdbcType=TIMESTAMP},
      </if>
gary's avatar
gary committed
213 214
      <if test="parentId != null">
        #{parentId,jdbcType=VARCHAR},
215 216 217
      </if>
    </trim>
  </insert>
218
  <select id="countByExample" parameterType="pwc.taxtech.atms.entity.StockExample" resultType="java.lang.Long">
219 220 221 222
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
223
    select count(*) from stock
224 225 226 227 228 229 230 231 232
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
233
    update stock
234
    <set>
gary's avatar
gary committed
235 236
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
237 238
      </if>
      <if test="record.name != null">
gary's avatar
gary committed
239
        name = #{record.name,jdbcType=VARCHAR},
240 241
      </if>
      <if test="record.code != null">
gary's avatar
gary committed
242
        code = #{record.code,jdbcType=VARCHAR},
243 244
      </if>
      <if test="record.stockAmount != null">
gary's avatar
gary committed
245
        stock_amount = #{record.stockAmount,jdbcType=TINYINT},
246 247
      </if>
      <if test="record.capitalAmount != null">
gary's avatar
gary committed
248
        capital_amount = #{record.capitalAmount,jdbcType=TINYINT},
249 250
      </if>
      <if test="record.capitalPercent != null">
gary's avatar
gary committed
251
        capital_percent = #{record.capitalPercent,jdbcType=TINYINT},
252 253
      </if>
      <if test="record.effectiveDate != null">
gary's avatar
gary committed
254
        effective_date = #{record.effectiveDate,jdbcType=TIMESTAMP},
255 256
      </if>
      <if test="record.expiredDate != null">
gary's avatar
gary committed
257
        expired_date = #{record.expiredDate,jdbcType=TIMESTAMP},
258
      </if>
gary's avatar
gary committed
259 260
      <if test="record.parentId != null">
        parent_id = #{record.parentId,jdbcType=VARCHAR},
261 262 263 264 265 266 267 268 269 270 271
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
272 273 274 275 276 277 278 279 280 281
    update stock
    set id = #{record.id,jdbcType=VARCHAR},
      name = #{record.name,jdbcType=VARCHAR},
      code = #{record.code,jdbcType=VARCHAR},
      stock_amount = #{record.stockAmount,jdbcType=TINYINT},
      capital_amount = #{record.capitalAmount,jdbcType=TINYINT},
      capital_percent = #{record.capitalPercent,jdbcType=TINYINT},
      effective_date = #{record.effectiveDate,jdbcType=TIMESTAMP},
      expired_date = #{record.expiredDate,jdbcType=TIMESTAMP},
      parent_id = #{record.parentId,jdbcType=VARCHAR}
282 283 284 285
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
286
  <update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.entity.Stock">
287 288 289 290
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
291
    update stock
292 293
    <set>
      <if test="name != null">
gary's avatar
gary committed
294
        name = #{name,jdbcType=VARCHAR},
295 296
      </if>
      <if test="code != null">
gary's avatar
gary committed
297
        code = #{code,jdbcType=VARCHAR},
298 299
      </if>
      <if test="stockAmount != null">
gary's avatar
gary committed
300
        stock_amount = #{stockAmount,jdbcType=TINYINT},
301 302
      </if>
      <if test="capitalAmount != null">
gary's avatar
gary committed
303
        capital_amount = #{capitalAmount,jdbcType=TINYINT},
304 305
      </if>
      <if test="capitalPercent != null">
gary's avatar
gary committed
306
        capital_percent = #{capitalPercent,jdbcType=TINYINT},
307 308
      </if>
      <if test="effectiveDate != null">
gary's avatar
gary committed
309
        effective_date = #{effectiveDate,jdbcType=TIMESTAMP},
310 311
      </if>
      <if test="expiredDate != null">
gary's avatar
gary committed
312
        expired_date = #{expiredDate,jdbcType=TIMESTAMP},
313
      </if>
gary's avatar
gary committed
314 315
      <if test="parentId != null">
        parent_id = #{parentId,jdbcType=VARCHAR},
316 317
      </if>
    </set>
gary's avatar
gary committed
318
    where id = #{id,jdbcType=VARCHAR}
319
  </update>
320
  <update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.entity.Stock">
321 322 323 324
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
gary's avatar
gary committed
325 326 327 328 329 330 331 332 333 334
    update stock
    set name = #{name,jdbcType=VARCHAR},
      code = #{code,jdbcType=VARCHAR},
      stock_amount = #{stockAmount,jdbcType=TINYINT},
      capital_amount = #{capitalAmount,jdbcType=TINYINT},
      capital_percent = #{capitalPercent,jdbcType=TINYINT},
      effective_date = #{effectiveDate,jdbcType=TIMESTAMP},
      expired_date = #{expiredDate,jdbcType=TIMESTAMP},
      parent_id = #{parentId,jdbcType=VARCHAR}
    where id = #{id,jdbcType=VARCHAR}
335
  </update>
336
  <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.entity.StockExample" resultMap="BaseResultMap">
337 338 339 340 341 342 343 344 345
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
gary's avatar
gary committed
346
    from stock
347 348 349 350 351 352 353
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
354
</mapper>