<?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="resources/basecode.CClientTypeRelaDataMapper">
  <resultMap id="BaseResultMap" type="com.ag.dynamicmodule.basecode.pojo.CClientTypeRelaData">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="ID" jdbcType="VARCHAR" property="id" />
    <result column="TENANCY_ID" jdbcType="VARCHAR" property="tenancyId" />
    <result column="CLIENT_TYPE_CODE" jdbcType="VARCHAR" property="clientTypeCode" />
    <result column="CLIENT_CODE" jdbcType="VARCHAR" property="clientCode" />
    <result column="CHECK_FLAG" jdbcType="VARCHAR" property="checkFlag" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    ID, TENANCY_ID, CLIENT_TYPE_CODE, CLIENT_CODE, CHECK_FLAG
  </sql>
  <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" />
    from c_client_type_rela_data
    where ID = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from c_client_type_rela_data
    where ID = #{id,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.ag.dynamicmodule.basecode.pojo.CClientTypeRelaData">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into c_client_type_rela_data (ID, TENANCY_ID, CLIENT_TYPE_CODE, 
      CLIENT_CODE, CHECK_FLAG)
    values (#{id,jdbcType=VARCHAR}, #{tenancyId,jdbcType=VARCHAR}, #{clientTypeCode,jdbcType=VARCHAR}, 
      #{clientCode,jdbcType=VARCHAR}, #{checkFlag,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.ag.dynamicmodule.basecode.pojo.CClientTypeRelaData">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into c_client_type_rela_data
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        ID,
      </if>
      <if test="tenancyId != null">
        TENANCY_ID,
      </if>
      <if test="clientTypeCode != null">
        CLIENT_TYPE_CODE,
      </if>
      <if test="clientCode != null">
        CLIENT_CODE,
      </if>
      <if test="checkFlag != null">
        CHECK_FLAG,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="tenancyId != null">
        #{tenancyId,jdbcType=VARCHAR},
      </if>
      <if test="clientTypeCode != null">
        #{clientTypeCode,jdbcType=VARCHAR},
      </if>
      <if test="clientCode != null">
        #{clientCode,jdbcType=VARCHAR},
      </if>
      <if test="checkFlag != null">
        #{checkFlag,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.ag.dynamicmodule.basecode.pojo.CClientTypeRelaData">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update c_client_type_rela_data
    <set>
      <if test="tenancyId != null">
        TENANCY_ID = #{tenancyId,jdbcType=VARCHAR},
      </if>
      <if test="clientTypeCode != null">
        CLIENT_TYPE_CODE = #{clientTypeCode,jdbcType=VARCHAR},
      </if>
      <if test="clientCode != null">
        CLIENT_CODE = #{clientCode,jdbcType=VARCHAR},
      </if>
      <if test="checkFlag != null">
        CHECK_FLAG = #{checkFlag,jdbcType=VARCHAR},
      </if>
    </set>
    where ID = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.ag.dynamicmodule.basecode.pojo.CClientTypeRelaData">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update c_client_type_rela_data
    set TENANCY_ID = #{tenancyId,jdbcType=VARCHAR},
      CLIENT_TYPE_CODE = #{clientTypeCode,jdbcType=VARCHAR},
      CLIENT_CODE = #{clientCode,jdbcType=VARCHAR},
      CHECK_FLAG = #{checkFlag,jdbcType=VARCHAR}
    where ID = #{id,jdbcType=VARCHAR}
  </update>

  <!--删除客户关联关系-->
  <delete id="deleteByClientCode" parameterType="java.lang.String">
    delete from C_CLIENT_TYPE_RELA_DATA
    where CLIENT_CODE = #{ids,jdbcType=VARCHAR}
  </delete>
</mapper>