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.
    -->
neo's avatar
neo 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="DECIMAL" property="stockAmount" />
    <result column="CAPITAL_AMOUNT" jdbcType="DECIMAL" property="capitalAmount" />
    <result column="CAPITAL_PERCENT" jdbcType="DECIMAL" 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.
    -->
neo's avatar
neo 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" />
neo's avatar
neo 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" />
neo's avatar
neo 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.
    -->
neo's avatar
neo 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.
    -->
neo's avatar
neo 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.
    -->
neo's avatar
neo committed
144 145 146
    insert into STOCK (ID, "NAME", CODE, 
      STOCK_AMOUNT, CAPITAL_AMOUNT, CAPITAL_PERCENT, 
      EFFECTIVE_DATE, EXPIRED_DATE, PARENT_ID
147
      )
neo's avatar
neo committed
148
    values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, 
149
      #{stockAmount,jdbcType=DECIMAL}, #{capitalAmount,jdbcType=DECIMAL}, #{capitalPercent,jdbcType=DECIMAL}, 
neo's avatar
neo committed
150
      #{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.
    -->
neo's avatar
neo committed
158
    insert into STOCK
159
    <trim prefix="(" suffix=")" suffixOverrides=",">
neo's avatar
neo committed
160
      <if test="id != null">
161 162 163
        ID,
      </if>
      <if test="name != null">
neo's avatar
neo committed
164
        "NAME",
165 166
      </if>
      <if test="code != null">
neo's avatar
neo committed
167
        CODE,
168 169
      </if>
      <if test="stockAmount != null">
neo's avatar
neo committed
170
        STOCK_AMOUNT,
171 172
      </if>
      <if test="capitalAmount != null">
neo's avatar
neo committed
173
        CAPITAL_AMOUNT,
174 175
      </if>
      <if test="capitalPercent != null">
neo's avatar
neo committed
176
        CAPITAL_PERCENT,
177 178
      </if>
      <if test="effectiveDate != null">
neo's avatar
neo committed
179
        EFFECTIVE_DATE,
180 181
      </if>
      <if test="expiredDate != null">
neo's avatar
neo committed
182
        EXPIRED_DATE,
183
      </if>
neo's avatar
neo committed
184 185
      <if test="parentId != null">
        PARENT_ID,
186 187 188
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
neo's avatar
neo committed
189 190
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="code != null">
        #{code,jdbcType=VARCHAR},
      </if>
      <if test="stockAmount != null">
        #{stockAmount,jdbcType=DECIMAL},
      </if>
      <if test="capitalAmount != null">
        #{capitalAmount,jdbcType=DECIMAL},
      </if>
      <if test="capitalPercent != null">
        #{capitalPercent,jdbcType=DECIMAL},
      </if>
      <if test="effectiveDate != null">
        #{effectiveDate,jdbcType=TIMESTAMP},
      </if>
      <if test="expiredDate != null">
        #{expiredDate,jdbcType=TIMESTAMP},
      </if>
neo's avatar
neo 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.
    -->
neo's avatar
neo 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.
    -->
neo's avatar
neo committed
233
    update STOCK
234
    <set>
neo's avatar
neo committed
235 236
      <if test="record.id != null">
        ID = #{record.id,jdbcType=VARCHAR},
237 238
      </if>
      <if test="record.name != null">
neo's avatar
neo committed
239
        "NAME" = #{record.name,jdbcType=VARCHAR},
240 241
      </if>
      <if test="record.code != null">
neo's avatar
neo committed
242
        CODE = #{record.code,jdbcType=VARCHAR},
243 244
      </if>
      <if test="record.stockAmount != null">
neo's avatar
neo committed
245
        STOCK_AMOUNT = #{record.stockAmount,jdbcType=DECIMAL},
246 247
      </if>
      <if test="record.capitalAmount != null">
neo's avatar
neo committed
248
        CAPITAL_AMOUNT = #{record.capitalAmount,jdbcType=DECIMAL},
249 250
      </if>
      <if test="record.capitalPercent != null">
neo's avatar
neo committed
251
        CAPITAL_PERCENT = #{record.capitalPercent,jdbcType=DECIMAL},
252 253
      </if>
      <if test="record.effectiveDate != null">
neo's avatar
neo committed
254
        EFFECTIVE_DATE = #{record.effectiveDate,jdbcType=TIMESTAMP},
255 256
      </if>
      <if test="record.expiredDate != null">
neo's avatar
neo committed
257
        EXPIRED_DATE = #{record.expiredDate,jdbcType=TIMESTAMP},
258
      </if>
neo's avatar
neo 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.
    -->
neo's avatar
neo 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=DECIMAL},
      CAPITAL_AMOUNT = #{record.capitalAmount,jdbcType=DECIMAL},
      CAPITAL_PERCENT = #{record.capitalPercent,jdbcType=DECIMAL},
      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.
    -->
neo's avatar
neo committed
291
    update STOCK
292 293
    <set>
      <if test="name != null">
neo's avatar
neo committed
294
        "NAME" = #{name,jdbcType=VARCHAR},
295 296
      </if>
      <if test="code != null">
neo's avatar
neo committed
297
        CODE = #{code,jdbcType=VARCHAR},
298 299
      </if>
      <if test="stockAmount != null">
neo's avatar
neo committed
300
        STOCK_AMOUNT = #{stockAmount,jdbcType=DECIMAL},
301 302
      </if>
      <if test="capitalAmount != null">
neo's avatar
neo committed
303
        CAPITAL_AMOUNT = #{capitalAmount,jdbcType=DECIMAL},
304 305
      </if>
      <if test="capitalPercent != null">
neo's avatar
neo committed
306
        CAPITAL_PERCENT = #{capitalPercent,jdbcType=DECIMAL},
307 308
      </if>
      <if test="effectiveDate != null">
neo's avatar
neo committed
309
        EFFECTIVE_DATE = #{effectiveDate,jdbcType=TIMESTAMP},
310 311
      </if>
      <if test="expiredDate != null">
neo's avatar
neo committed
312
        EXPIRED_DATE = #{expiredDate,jdbcType=TIMESTAMP},
313
      </if>
neo's avatar
neo committed
314 315
      <if test="parentId != null">
        PARENT_ID = #{parentId,jdbcType=VARCHAR},
316 317
      </if>
    </set>
neo's avatar
neo 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.
    -->
neo's avatar
neo 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=DECIMAL},
      CAPITAL_AMOUNT = #{capitalAmount,jdbcType=DECIMAL},
      CAPITAL_PERCENT = #{capitalPercent,jdbcType=DECIMAL},
      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" />
neo's avatar
neo 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>