<?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.CClientMapper">
  <resultMap id="BaseResultMap" type="com.ag.dynamicmodule.basecode.pojo.CClient">
    <!--
      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_CODE" jdbcType="VARCHAR" property="clientCode" />
    <result column="CLIENT_NAME" jdbcType="VARCHAR" property="clientName" />
    <result column="EN_CLIENT_NAME" jdbcType="VARCHAR" property="enClientName" />
    <result column="CLIENT_SHORT" jdbcType="VARCHAR" property="clientShort" />
    <result column="CLIENT_SHORT_EN" jdbcType="VARCHAR" property="clientShortEn" />
    <result column="CLIENT_TYPE" jdbcType="VARCHAR" property="clientType" />
    <result column="CREATED_BY" jdbcType="VARCHAR" property="createdBy" />
    <result column="CREATED_ON" jdbcType="TIMESTAMP" property="createdOn" />
    <result column="UPDATED_BY" jdbcType="VARCHAR" property="updatedBy" />
    <result column="UPDATED_ON" jdbcType="TIMESTAMP" property="updatedOn" />
    <result column="INVALID_FLAG" jdbcType="DECIMAL" property="invalidFlag" />
    <result column="INVALID_BY" jdbcType="VARCHAR" property="invalidBy" />
    <result column="INVALID_ON" jdbcType="TIMESTAMP" property="invalidOn" />
    <result column="INITIALS" jdbcType="VARCHAR" property="initials" />
    <result column="COUNT_CLIENT_CODE" jdbcType="VARCHAR" property="countClientCode" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    ID, TENANCY_ID, CLIENT_CODE, CLIENT_NAME, EN_CLIENT_NAME, CLIENT_SHORT, CLIENT_SHORT_EN, 
    CLIENT_TYPE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, INVALID_FLAG, INVALID_BY, 
    INVALID_ON, INITIALS, COUNT_CLIENT_CODE
  </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
    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
    where ID = #{id,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.ag.dynamicmodule.basecode.pojo.CClient">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into c_client (ID, TENANCY_ID, CLIENT_CODE, 
      CLIENT_NAME, EN_CLIENT_NAME, CLIENT_SHORT, 
      CLIENT_SHORT_EN, CLIENT_TYPE, CREATED_BY, 
      CREATED_ON, UPDATED_BY, UPDATED_ON, 
      INVALID_FLAG, INVALID_BY, INVALID_ON, 
      INITIALS, COUNT_CLIENT_CODE)
    values (#{id,jdbcType=VARCHAR}, #{tenancyId,jdbcType=VARCHAR}, #{clientCode,jdbcType=VARCHAR}, 
      #{clientName,jdbcType=VARCHAR}, #{enClientName,jdbcType=VARCHAR}, #{clientShort,jdbcType=VARCHAR}, 
      #{clientShortEn,jdbcType=VARCHAR}, #{clientType,jdbcType=VARCHAR}, #{createdBy,jdbcType=VARCHAR}, 
      #{createdOn,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=VARCHAR}, #{updatedOn,jdbcType=TIMESTAMP}, 
      #{invalidFlag,jdbcType=DECIMAL}, #{invalidBy,jdbcType=VARCHAR}, #{invalidOn,jdbcType=TIMESTAMP}, 
      #{initials,jdbcType=VARCHAR}, #{countClientCode,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.ag.dynamicmodule.basecode.pojo.CClient">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into c_client
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        ID,
      </if>
      <if test="tenancyId != null">
        TENANCY_ID,
      </if>
      <if test="clientCode != null">
        CLIENT_CODE,
      </if>
      <if test="clientName != null">
        CLIENT_NAME,
      </if>
      <if test="enClientName != null">
        EN_CLIENT_NAME,
      </if>
      <if test="clientShort != null">
        CLIENT_SHORT,
      </if>
      <if test="clientShortEn != null">
        CLIENT_SHORT_EN,
      </if>
      <if test="clientType != null">
        CLIENT_TYPE,
      </if>
      <if test="createdBy != null">
        CREATED_BY,
      </if>
      <if test="createdOn != null">
        CREATED_ON,
      </if>
      <if test="updatedBy != null">
        UPDATED_BY,
      </if>
      <if test="updatedOn != null">
        UPDATED_ON,
      </if>
      <if test="invalidFlag != null">
        INVALID_FLAG,
      </if>
      <if test="invalidBy != null">
        INVALID_BY,
      </if>
      <if test="invalidOn != null">
        INVALID_ON,
      </if>
      <if test="initials != null">
        INITIALS,
      </if>
      <if test="countClientCode != null">
        COUNT_CLIENT_CODE,
      </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="clientCode != null">
        #{clientCode,jdbcType=VARCHAR},
      </if>
      <if test="clientName != null">
        #{clientName,jdbcType=VARCHAR},
      </if>
      <if test="enClientName != null">
        #{enClientName,jdbcType=VARCHAR},
      </if>
      <if test="clientShort != null">
        #{clientShort,jdbcType=VARCHAR},
      </if>
      <if test="clientShortEn != null">
        #{clientShortEn,jdbcType=VARCHAR},
      </if>
      <if test="clientType != null">
        #{clientType,jdbcType=VARCHAR},
      </if>
      <if test="createdBy != null">
        #{createdBy,jdbcType=VARCHAR},
      </if>
      <if test="createdOn != null">
        #{createdOn,jdbcType=TIMESTAMP},
      </if>
      <if test="updatedBy != null">
        #{updatedBy,jdbcType=VARCHAR},
      </if>
      <if test="updatedOn != null">
        #{updatedOn,jdbcType=TIMESTAMP},
      </if>
      <if test="invalidFlag != null">
        #{invalidFlag,jdbcType=DECIMAL},
      </if>
      <if test="invalidBy != null">
        #{invalidBy,jdbcType=VARCHAR},
      </if>
      <if test="invalidOn != null">
        #{invalidOn,jdbcType=TIMESTAMP},
      </if>
      <if test="initials != null">
        #{initials,jdbcType=VARCHAR},
      </if>
      <if test="countClientCode != null">
        #{countClientCode,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.ag.dynamicmodule.basecode.pojo.CClient">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update c_client
    <set>
      <if test="tenancyId != null">
        TENANCY_ID = #{tenancyId,jdbcType=VARCHAR},
      </if>
      <if test="clientCode != null">
        CLIENT_CODE = #{clientCode,jdbcType=VARCHAR},
      </if>
      <if test="clientName != null">
        CLIENT_NAME = #{clientName,jdbcType=VARCHAR},
      </if>
      <if test="enClientName != null">
        EN_CLIENT_NAME = #{enClientName,jdbcType=VARCHAR},
      </if>
      <if test="clientShort != null">
        CLIENT_SHORT = #{clientShort,jdbcType=VARCHAR},
      </if>
      <if test="clientShortEn != null">
        CLIENT_SHORT_EN = #{clientShortEn,jdbcType=VARCHAR},
      </if>
      <if test="clientType != null">
        CLIENT_TYPE = #{clientType,jdbcType=VARCHAR},
      </if>
      <if test="createdBy != null">
        CREATED_BY = #{createdBy,jdbcType=VARCHAR},
      </if>
      <if test="createdOn != null">
        CREATED_ON = #{createdOn,jdbcType=TIMESTAMP},
      </if>
      <if test="updatedBy != null">
        UPDATED_BY = #{updatedBy,jdbcType=VARCHAR},
      </if>
      <if test="updatedOn != null">
        UPDATED_ON = #{updatedOn,jdbcType=TIMESTAMP},
      </if>
      <if test="invalidFlag != null">
        INVALID_FLAG = #{invalidFlag,jdbcType=DECIMAL},
      </if>
      <if test="invalidBy != null">
        INVALID_BY = #{invalidBy,jdbcType=VARCHAR},
      </if>
      <if test="invalidOn != null">
        INVALID_ON = #{invalidOn,jdbcType=TIMESTAMP},
      </if>
      <if test="initials != null">
        INITIALS = #{initials,jdbcType=VARCHAR},
      </if>
      <if test="countClientCode != null">
        COUNT_CLIENT_CODE = #{countClientCode,jdbcType=VARCHAR},
      </if>
    </set>
    where ID = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.ag.dynamicmodule.basecode.pojo.CClient">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update c_client
    set TENANCY_ID = #{tenancyId,jdbcType=VARCHAR},
      CLIENT_CODE = #{clientCode,jdbcType=VARCHAR},
      CLIENT_NAME = #{clientName,jdbcType=VARCHAR},
      EN_CLIENT_NAME = #{enClientName,jdbcType=VARCHAR},
      CLIENT_SHORT = #{clientShort,jdbcType=VARCHAR},
      CLIENT_SHORT_EN = #{clientShortEn,jdbcType=VARCHAR},
      CLIENT_TYPE = #{clientType,jdbcType=VARCHAR},
      CREATED_BY = #{createdBy,jdbcType=VARCHAR},
      CREATED_ON = #{createdOn,jdbcType=TIMESTAMP},
      UPDATED_BY = #{updatedBy,jdbcType=VARCHAR},
      UPDATED_ON = #{updatedOn,jdbcType=TIMESTAMP},
      INVALID_FLAG = #{invalidFlag,jdbcType=DECIMAL},
      INVALID_BY = #{invalidBy,jdbcType=VARCHAR},
      INVALID_ON = #{invalidOn,jdbcType=TIMESTAMP},
      INITIALS = #{initials,jdbcType=VARCHAR},
      COUNT_CLIENT_CODE = #{countClientCode,jdbcType=VARCHAR}
    where ID = #{id,jdbcType=VARCHAR}
  </update>
</mapper>