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