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