TdCCustBusinessPicMapper.xml 10.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.business.mapper.TdCCustBusinessPicMapper">
  <resultMap id="BaseResultMap" type="com.zteits.business.domain.TdCCustBusinessPic">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="business_id" jdbcType="VARCHAR" property="businessId" />
    <result column="pic_type" jdbcType="INTEGER" property="picType" />
    <result column="pic_path" jdbcType="VARCHAR" property="picPath" />
    <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, business_id, pic_type, pic_path, data_state, create_empid, create_date, modify_empid, 
    modify_date
  </sql>
  <select id="selectByExample" parameterType="com.zteits.business.domain.TdCCustBusinessPicExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from td_c_cust_business_pic
    <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_cust_business_pic
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from td_c_cust_business_pic
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.business.domain.TdCCustBusinessPicExample">
    delete from td_c_cust_business_pic
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.business.domain.TdCCustBusinessPic">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_c_cust_business_pic (business_id, pic_type, pic_path, 
      data_state, create_empid, create_date, 
      modify_empid, modify_date)
    values (#{businessId,jdbcType=VARCHAR}, #{picType,jdbcType=INTEGER}, #{picPath,jdbcType=VARCHAR}, 
      #{dataState,jdbcType=INTEGER}, #{createEmpid,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, 
      #{modifyEmpid,jdbcType=VARCHAR}, #{modifyDate,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.business.domain.TdCCustBusinessPic">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_c_cust_business_pic
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="businessId != null">
        business_id,
      </if>
      <if test="picType != null">
        pic_type,
      </if>
      <if test="picPath != null">
        pic_path,
      </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="businessId != null">
        #{businessId,jdbcType=VARCHAR},
      </if>
      <if test="picType != null">
        #{picType,jdbcType=INTEGER},
      </if>
      <if test="picPath != null">
        #{picPath,jdbcType=VARCHAR},
      </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.TdCCustBusinessPicExample" resultType="java.lang.Long">
    select count(*) from td_c_cust_business_pic
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update td_c_cust_business_pic
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.businessId != null">
        business_id = #{record.businessId,jdbcType=VARCHAR},
      </if>
      <if test="record.picType != null">
        pic_type = #{record.picType,jdbcType=INTEGER},
      </if>
      <if test="record.picPath != null">
        pic_path = #{record.picPath,jdbcType=VARCHAR},
      </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_cust_business_pic
    set id = #{record.id,jdbcType=BIGINT},
      business_id = #{record.businessId,jdbcType=VARCHAR},
      pic_type = #{record.picType,jdbcType=INTEGER},
      pic_path = #{record.picPath,jdbcType=VARCHAR},
      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.TdCCustBusinessPic">
    update td_c_cust_business_pic
    <set>
      <if test="businessId != null">
        business_id = #{businessId,jdbcType=VARCHAR},
      </if>
      <if test="picType != null">
        pic_type = #{picType,jdbcType=INTEGER},
      </if>
      <if test="picPath != null">
        pic_path = #{picPath,jdbcType=VARCHAR},
      </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.TdCCustBusinessPic">
    update td_c_cust_business_pic
    set business_id = #{businessId,jdbcType=VARCHAR},
      pic_type = #{picType,jdbcType=INTEGER},
      pic_path = #{picPath,jdbcType=VARCHAR},
      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>