TdCBusinessAcctMapper.xml 13.9 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.business.mapper.TdCBusinessAcctMapper">
  <resultMap id="BaseResultMap" type="com.zteits.business.domain.TdCBusinessAcct">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="acct_id" jdbcType="VARCHAR" property="acctId" />
    <result column="business_id" jdbcType="VARCHAR" property="businessId" />
    <result column="business_name" jdbcType="VARCHAR" property="businessName" />
    <result column="user_phone" jdbcType="VARCHAR" property="userPhone" />
    <result column="acct_type" jdbcType="INTEGER" property="acctType" />
    <result column="acct_balance" jdbcType="DECIMAL" property="acctBalance" />
    <result column="acct_name" jdbcType="VARCHAR" property="acctName" />
    <result column="acct_order" jdbcType="INTEGER" property="acctOrder" />
    <result column="org_id" jdbcType="BIGINT" property="orgId" />
    <result column="data_state" jdbcType="INTEGER" property="dataState" />
    <result column="create_empid" jdbcType="VARCHAR" property="createEmpid" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="modify_empid" jdbcType="VARCHAR" property="modifyEmpid" />
    <result column="modify_date" jdbcType="TIMESTAMP" property="modifyDate" />
  </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, acct_id, business_id, business_name, user_phone, acct_type, acct_balance, acct_name, 
    acct_order, org_id, data_state, create_empid, create_date, modify_empid, modify_date
  </sql>
  <select id="selectByExample" parameterType="com.zteits.business.domain.TdCBusinessAcctExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from td_c_business_acct
    <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_c_business_acct
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from td_c_business_acct
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.business.domain.TdCBusinessAcctExample">
    delete from td_c_business_acct
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.business.domain.TdCBusinessAcct">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_c_business_acct (acct_id, business_id, business_name, 
      user_phone, acct_type, acct_balance, 
      acct_name, acct_order, org_id, 
      data_state, create_empid, create_date, 
      modify_empid, modify_date)
    values (#{acctId,jdbcType=VARCHAR}, #{businessId,jdbcType=VARCHAR}, #{businessName,jdbcType=VARCHAR}, 
      #{userPhone,jdbcType=VARCHAR}, #{acctType,jdbcType=INTEGER}, #{acctBalance,jdbcType=DECIMAL}, 
      #{acctName,jdbcType=VARCHAR}, #{acctOrder,jdbcType=INTEGER}, #{orgId,jdbcType=BIGINT}, 
      #{dataState,jdbcType=INTEGER}, #{createEmpid,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, 
      #{modifyEmpid,jdbcType=VARCHAR}, #{modifyDate,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.business.domain.TdCBusinessAcct">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_c_business_acct
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="acctId != null">
        acct_id,
      </if>
      <if test="businessId != null">
        business_id,
      </if>
      <if test="businessName != null">
        business_name,
      </if>
      <if test="userPhone != null">
        user_phone,
      </if>
      <if test="acctType != null">
        acct_type,
      </if>
      <if test="acctBalance != null">
        acct_balance,
      </if>
      <if test="acctName != null">
        acct_name,
      </if>
      <if test="acctOrder != null">
        acct_order,
      </if>
      <if test="orgId != null">
        org_id,
      </if>
      <if test="dataState != null">
        data_state,
      </if>
      <if test="createEmpid != null">
        create_empid,
      </if>
      <if test="createDate != null">
        create_date,
      </if>
      <if test="modifyEmpid != null">
        modify_empid,
      </if>
      <if test="modifyDate != null">
        modify_date,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="acctId != null">
        #{acctId,jdbcType=VARCHAR},
      </if>
      <if test="businessId != null">
        #{businessId,jdbcType=VARCHAR},
      </if>
      <if test="businessName != null">
        #{businessName,jdbcType=VARCHAR},
      </if>
      <if test="userPhone != null">
        #{userPhone,jdbcType=VARCHAR},
      </if>
      <if test="acctType != null">
        #{acctType,jdbcType=INTEGER},
      </if>
      <if test="acctBalance != null">
        #{acctBalance,jdbcType=DECIMAL},
      </if>
      <if test="acctName != null">
        #{acctName,jdbcType=VARCHAR},
      </if>
      <if test="acctOrder != null">
        #{acctOrder,jdbcType=INTEGER},
      </if>
      <if test="orgId != null">
        #{orgId,jdbcType=BIGINT},
      </if>
      <if test="dataState != null">
        #{dataState,jdbcType=INTEGER},
      </if>
      <if test="createEmpid != null">
        #{createEmpid,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyEmpid != null">
        #{modifyEmpid,jdbcType=VARCHAR},
      </if>
      <if test="modifyDate != null">
        #{modifyDate,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.business.domain.TdCBusinessAcctExample" resultType="java.lang.Long">
    select count(*) from td_c_business_acct
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update td_c_business_acct
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.acctId != null">
        acct_id = #{record.acctId,jdbcType=VARCHAR},
      </if>
      <if test="record.businessId != null">
        business_id = #{record.businessId,jdbcType=VARCHAR},
      </if>
      <if test="record.businessName != null">
        business_name = #{record.businessName,jdbcType=VARCHAR},
      </if>
      <if test="record.userPhone != null">
        user_phone = #{record.userPhone,jdbcType=VARCHAR},
      </if>
      <if test="record.acctType != null">
        acct_type = #{record.acctType,jdbcType=INTEGER},
      </if>
      <if test="record.acctBalance != null">
        acct_balance = #{record.acctBalance,jdbcType=DECIMAL},
      </if>
      <if test="record.acctName != null">
        acct_name = #{record.acctName,jdbcType=VARCHAR},
      </if>
      <if test="record.acctOrder != null">
        acct_order = #{record.acctOrder,jdbcType=INTEGER},
      </if>
      <if test="record.orgId != null">
        org_id = #{record.orgId,jdbcType=BIGINT},
      </if>
      <if test="record.dataState != null">
        data_state = #{record.dataState,jdbcType=INTEGER},
      </if>
      <if test="record.createEmpid != null">
        create_empid = #{record.createEmpid,jdbcType=VARCHAR},
      </if>
      <if test="record.createDate != null">
        create_date = #{record.createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.modifyEmpid != null">
        modify_empid = #{record.modifyEmpid,jdbcType=VARCHAR},
      </if>
      <if test="record.modifyDate != null">
        modify_date = #{record.modifyDate,jdbcType=TIMESTAMP},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update td_c_business_acct
    set id = #{record.id,jdbcType=BIGINT},
      acct_id = #{record.acctId,jdbcType=VARCHAR},
      business_id = #{record.businessId,jdbcType=VARCHAR},
      business_name = #{record.businessName,jdbcType=VARCHAR},
      user_phone = #{record.userPhone,jdbcType=VARCHAR},
      acct_type = #{record.acctType,jdbcType=INTEGER},
      acct_balance = #{record.acctBalance,jdbcType=DECIMAL},
      acct_name = #{record.acctName,jdbcType=VARCHAR},
      acct_order = #{record.acctOrder,jdbcType=INTEGER},
      org_id = #{record.orgId,jdbcType=BIGINT},
      data_state = #{record.dataState,jdbcType=INTEGER},
      create_empid = #{record.createEmpid,jdbcType=VARCHAR},
      create_date = #{record.createDate,jdbcType=TIMESTAMP},
      modify_empid = #{record.modifyEmpid,jdbcType=VARCHAR},
      modify_date = #{record.modifyDate,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.business.domain.TdCBusinessAcct">
    update td_c_business_acct
    <set>
      <if test="acctId != null">
        acct_id = #{acctId,jdbcType=VARCHAR},
      </if>
      <if test="businessId != null">
        business_id = #{businessId,jdbcType=VARCHAR},
      </if>
      <if test="businessName != null">
        business_name = #{businessName,jdbcType=VARCHAR},
      </if>
      <if test="userPhone != null">
        user_phone = #{userPhone,jdbcType=VARCHAR},
      </if>
      <if test="acctType != null">
        acct_type = #{acctType,jdbcType=INTEGER},
      </if>
      <if test="acctBalance != null">
        acct_balance = #{acctBalance,jdbcType=DECIMAL},
      </if>
      <if test="acctName != null">
        acct_name = #{acctName,jdbcType=VARCHAR},
      </if>
      <if test="acctOrder != null">
        acct_order = #{acctOrder,jdbcType=INTEGER},
      </if>
      <if test="orgId != null">
        org_id = #{orgId,jdbcType=BIGINT},
      </if>
      <if test="dataState != null">
        data_state = #{dataState,jdbcType=INTEGER},
      </if>
      <if test="createEmpid != null">
        create_empid = #{createEmpid,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        create_date = #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyEmpid != null">
        modify_empid = #{modifyEmpid,jdbcType=VARCHAR},
      </if>
      <if test="modifyDate != null">
        modify_date = #{modifyDate,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.business.domain.TdCBusinessAcct">
    update td_c_business_acct
    set acct_id = #{acctId,jdbcType=VARCHAR},
      business_id = #{businessId,jdbcType=VARCHAR},
      business_name = #{businessName,jdbcType=VARCHAR},
      user_phone = #{userPhone,jdbcType=VARCHAR},
      acct_type = #{acctType,jdbcType=INTEGER},
      acct_balance = #{acctBalance,jdbcType=DECIMAL},
      acct_name = #{acctName,jdbcType=VARCHAR},
      acct_order = #{acctOrder,jdbcType=INTEGER},
      org_id = #{orgId,jdbcType=BIGINT},
      data_state = #{dataState,jdbcType=INTEGER},
      create_empid = #{createEmpid,jdbcType=VARCHAR},
      create_date = #{createDate,jdbcType=TIMESTAMP},
      modify_empid = #{modifyEmpid,jdbcType=VARCHAR},
      modify_date = #{modifyDate,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>