InputVATInvoiceItemMapper.xml 15 KB
Newer Older
1 2
<?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">
3 4
<mapper namespace="pwc.taxtech.atms.vat.dao.InputVatInvoiceItemMapper">
  <resultMap id="BaseResultMap" type="pwc.taxtech.atms.vat.entity.InputVatInvoiceItem">
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 18 19 20
    <id column="ID" jdbcType="VARCHAR" property="id" />
    <result column="INPUT_V_A_T_INVOICE_ID" jdbcType="VARCHAR" property="inputVATInvoiceId" />
    <result column="PERIOD_ID" jdbcType="DECIMAL" property="periodId" />
    <result column="INVOICE_CODE" jdbcType="VARCHAR" property="invoiceCode" />
    <result column="INVOICE_NUMBER" jdbcType="VARCHAR" property="invoiceNumber" />
    <result column="AMOUNT" jdbcType="DECIMAL" property="amount" />
    <result column="TAX_AMOUNT" jdbcType="DECIMAL" property="taxAmount" />
    <result column="TAX_RATE" jdbcType="DECIMAL" property="taxRate" />
    <result column="PRODUCTION_NAME" jdbcType="VARCHAR" property="productionName" />
    <result column="CREATOR_ID" jdbcType="VARCHAR" property="creatorId" />
    <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
    <result column="PRODUCTION_CODE" jdbcType="VARCHAR" property="productionCode" />
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
  </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>
49
            </foreach>
50
          </trim>
51
        </if>
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
      </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>
84
        </if>
85 86 87 88 89 90 91 92
      </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
93 94
    ID, INPUT_V_A_T_INVOICE_ID, PERIOD_ID, INVOICE_CODE, INVOICE_NUMBER, AMOUNT, TAX_AMOUNT, 
    TAX_RATE, PRODUCTION_NAME, CREATOR_ID, CREATE_TIME, PRODUCTION_CODE
95
  </sql>
96
  <select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.InputVatInvoiceItemExample" resultMap="BaseResultMap">
97 98 99 100 101 102 103 104 105
    <!--
      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
106
    from INPUT_VAT_INVOICE_ITEM
107 108 109 110 111 112 113 114 115 116 117 118 119 120
    <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
121 122
    from INPUT_VAT_INVOICE_ITEM
    where ID = #{id,jdbcType=VARCHAR}
123 124 125 126 127 128
  </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
129 130
    delete from INPUT_VAT_INVOICE_ITEM
    where ID = #{id,jdbcType=VARCHAR}
131
  </delete>
132
  <delete id="deleteByExample" parameterType="pwc.taxtech.atms.vat.entity.InputVatInvoiceItemExample">
133 134 135 136
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
neo's avatar
neo committed
137
    delete from INPUT_VAT_INVOICE_ITEM
138 139 140 141
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
142
  <insert id="insert" parameterType="pwc.taxtech.atms.vat.entity.InputVatInvoiceItem">
143 144 145 146
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
neo's avatar
neo committed
147 148 149 150
    insert into INPUT_VAT_INVOICE_ITEM (ID, INPUT_V_A_T_INVOICE_ID, PERIOD_ID, 
      INVOICE_CODE, INVOICE_NUMBER, AMOUNT, 
      TAX_AMOUNT, TAX_RATE, PRODUCTION_NAME, 
      CREATOR_ID, CREATE_TIME, PRODUCTION_CODE
151
      )
neo's avatar
neo committed
152
    values (#{id,jdbcType=VARCHAR}, #{inputVATInvoiceId,jdbcType=VARCHAR}, #{periodId,jdbcType=DECIMAL}, 
153 154
      #{invoiceCode,jdbcType=VARCHAR}, #{invoiceNumber,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, 
      #{taxAmount,jdbcType=DECIMAL}, #{taxRate,jdbcType=DECIMAL}, #{productionName,jdbcType=VARCHAR}, 
neo's avatar
neo committed
155
      #{creatorId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{productionCode,jdbcType=VARCHAR}
156 157
      )
  </insert>
158
  <insert id="insertSelective" parameterType="pwc.taxtech.atms.vat.entity.InputVatInvoiceItem">
159 160 161 162
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
neo's avatar
neo committed
163
    insert into INPUT_VAT_INVOICE_ITEM
164
    <trim prefix="(" suffix=")" suffixOverrides=",">
neo's avatar
neo committed
165
      <if test="id != null">
166 167
        ID,
      </if>
neo's avatar
neo committed
168 169
      <if test="inputVATInvoiceId != null">
        INPUT_V_A_T_INVOICE_ID,
170
      </if>
neo's avatar
neo committed
171 172
      <if test="periodId != null">
        PERIOD_ID,
173 174
      </if>
      <if test="invoiceCode != null">
neo's avatar
neo committed
175
        INVOICE_CODE,
176 177
      </if>
      <if test="invoiceNumber != null">
neo's avatar
neo committed
178
        INVOICE_NUMBER,
179 180
      </if>
      <if test="amount != null">
neo's avatar
neo committed
181
        AMOUNT,
182 183
      </if>
      <if test="taxAmount != null">
neo's avatar
neo committed
184
        TAX_AMOUNT,
185 186
      </if>
      <if test="taxRate != null">
neo's avatar
neo committed
187
        TAX_RATE,
188 189
      </if>
      <if test="productionName != null">
neo's avatar
neo committed
190
        PRODUCTION_NAME,
191
      </if>
neo's avatar
neo committed
192 193
      <if test="creatorId != null">
        CREATOR_ID,
194 195
      </if>
      <if test="createTime != null">
neo's avatar
neo committed
196
        CREATE_TIME,
197 198
      </if>
      <if test="productionCode != null">
neo's avatar
neo committed
199
        PRODUCTION_CODE,
200 201 202
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
neo's avatar
neo committed
203 204
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
205
      </if>
neo's avatar
neo committed
206 207
      <if test="inputVATInvoiceId != null">
        #{inputVATInvoiceId,jdbcType=VARCHAR},
208
      </if>
neo's avatar
neo committed
209 210
      <if test="periodId != null">
        #{periodId,jdbcType=DECIMAL},
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
      </if>
      <if test="invoiceCode != null">
        #{invoiceCode,jdbcType=VARCHAR},
      </if>
      <if test="invoiceNumber != null">
        #{invoiceNumber,jdbcType=VARCHAR},
      </if>
      <if test="amount != null">
        #{amount,jdbcType=DECIMAL},
      </if>
      <if test="taxAmount != null">
        #{taxAmount,jdbcType=DECIMAL},
      </if>
      <if test="taxRate != null">
        #{taxRate,jdbcType=DECIMAL},
      </if>
      <if test="productionName != null">
        #{productionName,jdbcType=VARCHAR},
      </if>
neo's avatar
neo committed
230 231
      <if test="creatorId != null">
        #{creatorId,jdbcType=VARCHAR},
232 233 234 235 236 237 238 239 240
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="productionCode != null">
        #{productionCode,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
241
  <select id="countByExample" parameterType="pwc.taxtech.atms.vat.entity.InputVatInvoiceItemExample" resultType="java.lang.Long">
242 243 244 245
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
neo's avatar
neo committed
246
    select count(*) from INPUT_VAT_INVOICE_ITEM
247 248 249 250 251 252 253 254 255
    <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
256
    update INPUT_VAT_INVOICE_ITEM
257
    <set>
neo's avatar
neo committed
258 259
      <if test="record.id != null">
        ID = #{record.id,jdbcType=VARCHAR},
260
      </if>
neo's avatar
neo committed
261 262
      <if test="record.inputVATInvoiceId != null">
        INPUT_V_A_T_INVOICE_ID = #{record.inputVATInvoiceId,jdbcType=VARCHAR},
263
      </if>
neo's avatar
neo committed
264 265
      <if test="record.periodId != null">
        PERIOD_ID = #{record.periodId,jdbcType=DECIMAL},
266 267
      </if>
      <if test="record.invoiceCode != null">
neo's avatar
neo committed
268
        INVOICE_CODE = #{record.invoiceCode,jdbcType=VARCHAR},
269 270
      </if>
      <if test="record.invoiceNumber != null">
neo's avatar
neo committed
271
        INVOICE_NUMBER = #{record.invoiceNumber,jdbcType=VARCHAR},
272 273
      </if>
      <if test="record.amount != null">
neo's avatar
neo committed
274
        AMOUNT = #{record.amount,jdbcType=DECIMAL},
275 276
      </if>
      <if test="record.taxAmount != null">
neo's avatar
neo committed
277
        TAX_AMOUNT = #{record.taxAmount,jdbcType=DECIMAL},
278 279
      </if>
      <if test="record.taxRate != null">
neo's avatar
neo committed
280
        TAX_RATE = #{record.taxRate,jdbcType=DECIMAL},
281 282
      </if>
      <if test="record.productionName != null">
neo's avatar
neo committed
283
        PRODUCTION_NAME = #{record.productionName,jdbcType=VARCHAR},
284
      </if>
neo's avatar
neo committed
285 286
      <if test="record.creatorId != null">
        CREATOR_ID = #{record.creatorId,jdbcType=VARCHAR},
287 288
      </if>
      <if test="record.createTime != null">
neo's avatar
neo committed
289
        CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP},
290 291
      </if>
      <if test="record.productionCode != null">
neo's avatar
neo committed
292
        PRODUCTION_CODE = #{record.productionCode,jdbcType=VARCHAR},
293 294 295 296 297 298 299 300 301 302 303
      </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
304 305 306 307 308 309 310 311 312 313 314 315 316
    update INPUT_VAT_INVOICE_ITEM
    set ID = #{record.id,jdbcType=VARCHAR},
      INPUT_V_A_T_INVOICE_ID = #{record.inputVATInvoiceId,jdbcType=VARCHAR},
      PERIOD_ID = #{record.periodId,jdbcType=DECIMAL},
      INVOICE_CODE = #{record.invoiceCode,jdbcType=VARCHAR},
      INVOICE_NUMBER = #{record.invoiceNumber,jdbcType=VARCHAR},
      AMOUNT = #{record.amount,jdbcType=DECIMAL},
      TAX_AMOUNT = #{record.taxAmount,jdbcType=DECIMAL},
      TAX_RATE = #{record.taxRate,jdbcType=DECIMAL},
      PRODUCTION_NAME = #{record.productionName,jdbcType=VARCHAR},
      CREATOR_ID = #{record.creatorId,jdbcType=VARCHAR},
      CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP},
      PRODUCTION_CODE = #{record.productionCode,jdbcType=VARCHAR}
317 318 319 320
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
321
  <update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.vat.entity.InputVatInvoiceItem">
322 323 324 325
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
neo's avatar
neo committed
326
    update INPUT_VAT_INVOICE_ITEM
327
    <set>
neo's avatar
neo committed
328 329
      <if test="inputVATInvoiceId != null">
        INPUT_V_A_T_INVOICE_ID = #{inputVATInvoiceId,jdbcType=VARCHAR},
330
      </if>
neo's avatar
neo committed
331 332
      <if test="periodId != null">
        PERIOD_ID = #{periodId,jdbcType=DECIMAL},
333 334
      </if>
      <if test="invoiceCode != null">
neo's avatar
neo committed
335
        INVOICE_CODE = #{invoiceCode,jdbcType=VARCHAR},
336 337
      </if>
      <if test="invoiceNumber != null">
neo's avatar
neo committed
338
        INVOICE_NUMBER = #{invoiceNumber,jdbcType=VARCHAR},
339 340
      </if>
      <if test="amount != null">
neo's avatar
neo committed
341
        AMOUNT = #{amount,jdbcType=DECIMAL},
342 343
      </if>
      <if test="taxAmount != null">
neo's avatar
neo committed
344
        TAX_AMOUNT = #{taxAmount,jdbcType=DECIMAL},
345 346
      </if>
      <if test="taxRate != null">
neo's avatar
neo committed
347
        TAX_RATE = #{taxRate,jdbcType=DECIMAL},
348 349
      </if>
      <if test="productionName != null">
neo's avatar
neo committed
350
        PRODUCTION_NAME = #{productionName,jdbcType=VARCHAR},
351
      </if>
neo's avatar
neo committed
352 353
      <if test="creatorId != null">
        CREATOR_ID = #{creatorId,jdbcType=VARCHAR},
354 355
      </if>
      <if test="createTime != null">
neo's avatar
neo committed
356
        CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
357 358
      </if>
      <if test="productionCode != null">
neo's avatar
neo committed
359
        PRODUCTION_CODE = #{productionCode,jdbcType=VARCHAR},
360 361
      </if>
    </set>
neo's avatar
neo committed
362
    where ID = #{id,jdbcType=VARCHAR}
363
  </update>
364
  <update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.vat.entity.InputVatInvoiceItem">
365 366 367 368
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
neo's avatar
neo committed
369 370 371 372 373 374 375 376 377 378 379 380 381
    update INPUT_VAT_INVOICE_ITEM
    set INPUT_V_A_T_INVOICE_ID = #{inputVATInvoiceId,jdbcType=VARCHAR},
      PERIOD_ID = #{periodId,jdbcType=DECIMAL},
      INVOICE_CODE = #{invoiceCode,jdbcType=VARCHAR},
      INVOICE_NUMBER = #{invoiceNumber,jdbcType=VARCHAR},
      AMOUNT = #{amount,jdbcType=DECIMAL},
      TAX_AMOUNT = #{taxAmount,jdbcType=DECIMAL},
      TAX_RATE = #{taxRate,jdbcType=DECIMAL},
      PRODUCTION_NAME = #{productionName,jdbcType=VARCHAR},
      CREATOR_ID = #{creatorId,jdbcType=VARCHAR},
      CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
      PRODUCTION_CODE = #{productionCode,jdbcType=VARCHAR}
    where ID = #{id,jdbcType=VARCHAR}
382
  </update>
383
  <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.vat.entity.InputVatInvoiceItemExample" resultMap="BaseResultMap">
384 385 386 387 388 389 390 391 392
    <!--
      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
393
    from INPUT_VAT_INVOICE_ITEM
394 395 396 397 398 399 400
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
401
</mapper>