InvoiceMappingMapper.xml 11.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.vat.dao.InvoiceMappingMapper">
4 5 6 7 8
  <resultMap id="BaseResultMap" type="pwc.taxtech.atms.vat.entity.InvoiceMapping">
    <!--
      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
    <id column="ID" jdbcType="VARCHAR" property="id" />
    <result column="TRAN_CODE" jdbcType="VARCHAR" property="tranCode" />
    <result column="INVOICE_CODE" jdbcType="VARCHAR" property="invoiceCode" />
    <result column="INVOICE_NUMBER" jdbcType="VARCHAR" property="invoiceNumber" />
    <result column="PERIOD" jdbcType="DECIMAL" property="period" />
    <result column="CREATOR_ID" jdbcType="VARCHAR" property="creatorId" />
    <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
16 17 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
  </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>
44
            </foreach>
45
          </trim>
46
        </if>
47 48 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
      </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>
79
        </if>
80 81 82 83 84 85 86 87
      </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
88
    ID, TRAN_CODE, INVOICE_CODE, INVOICE_NUMBER, PERIOD, CREATOR_ID, CREATE_TIME
89 90 91 92 93 94 95 96 97 98 99
  </sql>
  <select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.InvoiceMappingExample" 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
100
    from INVOICE_MAPPING
101 102 103 104 105 106 107 108 109 110 111 112 113 114
    <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
115 116
    from INVOICE_MAPPING
    where ID = #{id,jdbcType=VARCHAR}
117 118 119 120 121 122
  </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
123 124
    delete from INVOICE_MAPPING
    where ID = #{id,jdbcType=VARCHAR}
125 126 127 128 129 130
  </delete>
  <delete id="deleteByExample" parameterType="pwc.taxtech.atms.vat.entity.InvoiceMappingExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
neo's avatar
neo committed
131
    delete from INVOICE_MAPPING
132 133 134 135 136 137 138 139 140
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="pwc.taxtech.atms.vat.entity.InvoiceMapping">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
neo's avatar
neo committed
141 142 143 144 145
    insert into INVOICE_MAPPING (ID, TRAN_CODE, INVOICE_CODE, 
      INVOICE_NUMBER, PERIOD, CREATOR_ID, 
      CREATE_TIME)
    values (#{id,jdbcType=VARCHAR}, #{tranCode,jdbcType=VARCHAR}, #{invoiceCode,jdbcType=VARCHAR}, 
      #{invoiceNumber,jdbcType=VARCHAR}, #{period,jdbcType=DECIMAL}, #{creatorId,jdbcType=VARCHAR}, 
146 147 148 149 150 151 152
      #{createTime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="pwc.taxtech.atms.vat.entity.InvoiceMapping">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
neo's avatar
neo committed
153
    insert into INVOICE_MAPPING
154
    <trim prefix="(" suffix=")" suffixOverrides=",">
neo's avatar
neo committed
155
      <if test="id != null">
156 157 158
        ID,
      </if>
      <if test="tranCode != null">
neo's avatar
neo committed
159
        TRAN_CODE,
160 161
      </if>
      <if test="invoiceCode != null">
neo's avatar
neo committed
162
        INVOICE_CODE,
163 164
      </if>
      <if test="invoiceNumber != null">
neo's avatar
neo committed
165
        INVOICE_NUMBER,
166 167
      </if>
      <if test="period != null">
neo's avatar
neo committed
168
        PERIOD,
169
      </if>
neo's avatar
neo committed
170 171
      <if test="creatorId != null">
        CREATOR_ID,
172 173
      </if>
      <if test="createTime != null">
neo's avatar
neo committed
174
        CREATE_TIME,
175 176 177
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
neo's avatar
neo committed
178 179
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
180 181 182 183 184 185 186 187 188 189 190
      </if>
      <if test="tranCode != null">
        #{tranCode,jdbcType=VARCHAR},
      </if>
      <if test="invoiceCode != null">
        #{invoiceCode,jdbcType=VARCHAR},
      </if>
      <if test="invoiceNumber != null">
        #{invoiceNumber,jdbcType=VARCHAR},
      </if>
      <if test="period != null">
neo's avatar
neo committed
191
        #{period,jdbcType=DECIMAL},
192
      </if>
neo's avatar
neo committed
193 194
      <if test="creatorId != null">
        #{creatorId,jdbcType=VARCHAR},
195 196 197 198 199 200 201 202 203 204 205
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="pwc.taxtech.atms.vat.entity.InvoiceMappingExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
neo's avatar
neo committed
206
    select count(*) from INVOICE_MAPPING
207 208 209 210 211 212 213 214 215
    <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
216
    update INVOICE_MAPPING
217
    <set>
neo's avatar
neo committed
218 219
      <if test="record.id != null">
        ID = #{record.id,jdbcType=VARCHAR},
220 221
      </if>
      <if test="record.tranCode != null">
neo's avatar
neo committed
222
        TRAN_CODE = #{record.tranCode,jdbcType=VARCHAR},
223 224
      </if>
      <if test="record.invoiceCode != null">
neo's avatar
neo committed
225
        INVOICE_CODE = #{record.invoiceCode,jdbcType=VARCHAR},
226 227
      </if>
      <if test="record.invoiceNumber != null">
neo's avatar
neo committed
228
        INVOICE_NUMBER = #{record.invoiceNumber,jdbcType=VARCHAR},
229 230
      </if>
      <if test="record.period != null">
neo's avatar
neo committed
231
        PERIOD = #{record.period,jdbcType=DECIMAL},
232
      </if>
neo's avatar
neo committed
233 234
      <if test="record.creatorId != null">
        CREATOR_ID = #{record.creatorId,jdbcType=VARCHAR},
235 236
      </if>
      <if test="record.createTime != null">
neo's avatar
neo committed
237
        CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP},
238 239 240 241 242 243 244 245 246 247 248
      </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
249 250 251 252 253 254 255 256
    update INVOICE_MAPPING
    set ID = #{record.id,jdbcType=VARCHAR},
      TRAN_CODE = #{record.tranCode,jdbcType=VARCHAR},
      INVOICE_CODE = #{record.invoiceCode,jdbcType=VARCHAR},
      INVOICE_NUMBER = #{record.invoiceNumber,jdbcType=VARCHAR},
      PERIOD = #{record.period,jdbcType=DECIMAL},
      CREATOR_ID = #{record.creatorId,jdbcType=VARCHAR},
      CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP}
257 258 259 260 261 262 263 264 265
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.vat.entity.InvoiceMapping">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
neo's avatar
neo committed
266
    update INVOICE_MAPPING
267 268
    <set>
      <if test="tranCode != null">
neo's avatar
neo committed
269
        TRAN_CODE = #{tranCode,jdbcType=VARCHAR},
270 271
      </if>
      <if test="invoiceCode != null">
neo's avatar
neo committed
272
        INVOICE_CODE = #{invoiceCode,jdbcType=VARCHAR},
273 274
      </if>
      <if test="invoiceNumber != null">
neo's avatar
neo committed
275
        INVOICE_NUMBER = #{invoiceNumber,jdbcType=VARCHAR},
276 277
      </if>
      <if test="period != null">
neo's avatar
neo committed
278
        PERIOD = #{period,jdbcType=DECIMAL},
279
      </if>
neo's avatar
neo committed
280 281
      <if test="creatorId != null">
        CREATOR_ID = #{creatorId,jdbcType=VARCHAR},
282 283
      </if>
      <if test="createTime != null">
neo's avatar
neo committed
284
        CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
285 286
      </if>
    </set>
neo's avatar
neo committed
287
    where ID = #{id,jdbcType=VARCHAR}
288 289 290 291 292 293
  </update>
  <update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.vat.entity.InvoiceMapping">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
neo's avatar
neo committed
294 295 296 297 298 299 300 301
    update INVOICE_MAPPING
    set TRAN_CODE = #{tranCode,jdbcType=VARCHAR},
      INVOICE_CODE = #{invoiceCode,jdbcType=VARCHAR},
      INVOICE_NUMBER = #{invoiceNumber,jdbcType=VARCHAR},
      PERIOD = #{period,jdbcType=DECIMAL},
      CREATOR_ID = #{creatorId,jdbcType=VARCHAR},
      CREATE_TIME = #{createTime,jdbcType=TIMESTAMP}
    where ID = #{id,jdbcType=VARCHAR}
302 303 304 305 306 307 308 309 310 311 312
  </update>
  <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.vat.entity.InvoiceMappingExample" 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
313
    from INVOICE_MAPPING
314 315 316 317 318 319 320
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
321
</mapper>