TdClCompanyAccFlowMapper.xml 12.4 KB
<?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="com.zteits.order.mapper.TdClCompanyAccFlowMapper">
  <resultMap id="BaseResultMap" type="com.zteits.order.domain.TdClCompanyAccFlow">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="pay_order_id" jdbcType="VARCHAR" property="payOrderId" />
    <result column="acc_code" jdbcType="VARCHAR" property="accCode" />
    <result column="trade_type" jdbcType="CHAR" property="tradeType" />
    <result column="trade_fee" jdbcType="BIGINT" property="tradeFee" />
    <result column="trade_balance" jdbcType="BIGINT" property="tradeBalance" />
    <result column="trade_time" jdbcType="TIMESTAMP" property="tradeTime" />
    <result column="trade_name" jdbcType="VARCHAR" property="tradeName" />
    <result column="pl_no" jdbcType="VARCHAR" property="plNo" />
    <result column="pl_name" jdbcType="VARCHAR" property="plName" />
    <result column="rlt_order_id" jdbcType="VARCHAR" property="rltOrderId" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <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>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <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>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    id, pay_order_id, acc_code, trade_type, trade_fee, trade_balance, trade_time, trade_name, 
    pl_no, pl_name, rlt_order_id, remark
  </sql>
  <select id="selectByExample" parameterType="com.zteits.order.domain.TdClCompanyAccFlowExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from td_cl_company_acc_flow
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>

    <select id="selectByDtoExample" parameterType="com.zteits.order.domain.TdClCompanyAccFlowExample" resultMap="BaseResultMap">
        select
        <if test="distinct">
            distinct
        </if>
        <include refid="Base_Column_List" />
        from td_cl_company_acc_flow
        <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.Long" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from td_cl_company_acc_flow
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from td_cl_company_acc_flow
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.order.domain.TdClCompanyAccFlowExample">
    delete from td_cl_company_acc_flow
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.order.domain.TdClCompanyAccFlow">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_cl_company_acc_flow (pay_order_id, acc_code, trade_type, 
      trade_fee, trade_balance, trade_time, 
      trade_name, pl_no, pl_name, 
      rlt_order_id, remark)
    values (#{payOrderId,jdbcType=VARCHAR}, #{accCode,jdbcType=VARCHAR}, #{tradeType,jdbcType=CHAR}, 
      #{tradeFee,jdbcType=BIGINT}, #{tradeBalance,jdbcType=BIGINT}, #{tradeTime,jdbcType=TIMESTAMP}, 
      #{tradeName,jdbcType=VARCHAR}, #{plNo,jdbcType=VARCHAR}, #{plName,jdbcType=VARCHAR}, 
      #{rltOrderId,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.order.domain.TdClCompanyAccFlow">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_cl_company_acc_flow
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="payOrderId != null">
        pay_order_id,
      </if>
      <if test="accCode != null">
        acc_code,
      </if>
      <if test="tradeType != null">
        trade_type,
      </if>
      <if test="tradeFee != null">
        trade_fee,
      </if>
      <if test="tradeBalance != null">
        trade_balance,
      </if>
      <if test="tradeTime != null">
        trade_time,
      </if>
      <if test="tradeName != null">
        trade_name,
      </if>
      <if test="plNo != null">
        pl_no,
      </if>
      <if test="plName != null">
        pl_name,
      </if>
      <if test="rltOrderId != null">
        rlt_order_id,
      </if>
      <if test="remark != null">
        remark,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="payOrderId != null">
        #{payOrderId,jdbcType=VARCHAR},
      </if>
      <if test="accCode != null">
        #{accCode,jdbcType=VARCHAR},
      </if>
      <if test="tradeType != null">
        #{tradeType,jdbcType=CHAR},
      </if>
      <if test="tradeFee != null">
        #{tradeFee,jdbcType=BIGINT},
      </if>
      <if test="tradeBalance != null">
        #{tradeBalance,jdbcType=BIGINT},
      </if>
      <if test="tradeTime != null">
        #{tradeTime,jdbcType=TIMESTAMP},
      </if>
      <if test="tradeName != null">
        #{tradeName,jdbcType=VARCHAR},
      </if>
      <if test="plNo != null">
        #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="plName != null">
        #{plName,jdbcType=VARCHAR},
      </if>
      <if test="rltOrderId != null">
        #{rltOrderId,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.order.domain.TdClCompanyAccFlowExample" resultType="java.lang.Long">
    select count(*) from td_cl_company_acc_flow
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update td_cl_company_acc_flow
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.payOrderId != null">
        pay_order_id = #{record.payOrderId,jdbcType=VARCHAR},
      </if>
      <if test="record.accCode != null">
        acc_code = #{record.accCode,jdbcType=VARCHAR},
      </if>
      <if test="record.tradeType != null">
        trade_type = #{record.tradeType,jdbcType=CHAR},
      </if>
      <if test="record.tradeFee != null">
        trade_fee = #{record.tradeFee,jdbcType=BIGINT},
      </if>
      <if test="record.tradeBalance != null">
        trade_balance = #{record.tradeBalance,jdbcType=BIGINT},
      </if>
      <if test="record.tradeTime != null">
        trade_time = #{record.tradeTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.tradeName != null">
        trade_name = #{record.tradeName,jdbcType=VARCHAR},
      </if>
      <if test="record.plNo != null">
        pl_no = #{record.plNo,jdbcType=VARCHAR},
      </if>
      <if test="record.plName != null">
        pl_name = #{record.plName,jdbcType=VARCHAR},
      </if>
      <if test="record.rltOrderId != null">
        rlt_order_id = #{record.rltOrderId,jdbcType=VARCHAR},
      </if>
      <if test="record.remark != null">
        remark = #{record.remark,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update td_cl_company_acc_flow
    set id = #{record.id,jdbcType=BIGINT},
      pay_order_id = #{record.payOrderId,jdbcType=VARCHAR},
      acc_code = #{record.accCode,jdbcType=VARCHAR},
      trade_type = #{record.tradeType,jdbcType=CHAR},
      trade_fee = #{record.tradeFee,jdbcType=BIGINT},
      trade_balance = #{record.tradeBalance,jdbcType=BIGINT},
      trade_time = #{record.tradeTime,jdbcType=TIMESTAMP},
      trade_name = #{record.tradeName,jdbcType=VARCHAR},
      pl_no = #{record.plNo,jdbcType=VARCHAR},
      pl_name = #{record.plName,jdbcType=VARCHAR},
      rlt_order_id = #{record.rltOrderId,jdbcType=VARCHAR},
      remark = #{record.remark,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.order.domain.TdClCompanyAccFlow">
    update td_cl_company_acc_flow
    <set>
      <if test="payOrderId != null">
        pay_order_id = #{payOrderId,jdbcType=VARCHAR},
      </if>
      <if test="accCode != null">
        acc_code = #{accCode,jdbcType=VARCHAR},
      </if>
      <if test="tradeType != null">
        trade_type = #{tradeType,jdbcType=CHAR},
      </if>
      <if test="tradeFee != null">
        trade_fee = #{tradeFee,jdbcType=BIGINT},
      </if>
      <if test="tradeBalance != null">
        trade_balance = #{tradeBalance,jdbcType=BIGINT},
      </if>
      <if test="tradeTime != null">
        trade_time = #{tradeTime,jdbcType=TIMESTAMP},
      </if>
      <if test="tradeName != null">
        trade_name = #{tradeName,jdbcType=VARCHAR},
      </if>
      <if test="plNo != null">
        pl_no = #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="plName != null">
        pl_name = #{plName,jdbcType=VARCHAR},
      </if>
      <if test="rltOrderId != null">
        rlt_order_id = #{rltOrderId,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.order.domain.TdClCompanyAccFlow">
    update td_cl_company_acc_flow
    set pay_order_id = #{payOrderId,jdbcType=VARCHAR},
      acc_code = #{accCode,jdbcType=VARCHAR},
      trade_type = #{tradeType,jdbcType=CHAR},
      trade_fee = #{tradeFee,jdbcType=BIGINT},
      trade_balance = #{tradeBalance,jdbcType=BIGINT},
      trade_time = #{tradeTime,jdbcType=TIMESTAMP},
      trade_name = #{tradeName,jdbcType=VARCHAR},
      pl_no = #{plNo,jdbcType=VARCHAR},
      pl_name = #{plName,jdbcType=VARCHAR},
      rlt_order_id = #{rltOrderId,jdbcType=VARCHAR},
      remark = #{remark,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>