<?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.fuxi.ws.data.dao.ATableidMapper" >
  <resultMap id="BaseResultMap" type="com.fuxi.ws.data.entity.ATableid" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Dec 15 18:15:49 CST 2015.
    -->
    <id column="TableName" property="tablename" jdbcType="VARCHAR" />
    <id column="FieldName" property="fieldname" jdbcType="VARCHAR" />
    <id column="DepartmentID" property="departmentid" jdbcType="VARCHAR" />
    <result column="LeftLetter" property="leftletter" jdbcType="NVARCHAR" />
    <result column="LastDate" property="lastdate" jdbcType="TIMESTAMP" />
    <result column="MidLetterType" property="midlettertype" jdbcType="TINYINT" />
    <result column="SeqLenth" property="seqlenth" jdbcType="TINYINT" />
    <result column="LastBillNo" property="lastbillno" jdbcType="NVARCHAR" />
  </resultMap>
  <sql id="Example_Where_Clause" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Dec 15 18:15:49 CST 2015.
    -->
    <where >
      <foreach collection="oredCriteria" item="criteria" separator="or" >
        <if test="criteria.valid" >
          <trim prefix="(" suffix=")" prefixOverrides="and" >
            <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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Dec 15 18:15:49 CST 2015.
    -->
    TableName, FieldName, DepartmentID, LeftLetter, LastDate, MidLetterType, SeqLenth, 
    LastBillNo
  </sql>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.fuxi.ws.data.entity.ATableidExample" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Dec 15 18:15:49 CST 2015.
    -->
    select
    <if test="distinct" >
      distinct
    </if>
    'false' as QUERYID,
    <include refid="Base_Column_List" />
    from A_TableID
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null" >
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="com.fuxi.ws.data.entity.ATableidKey" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Dec 15 18:15:49 CST 2015.
    -->
    select 
    <include refid="Base_Column_List" />
    from A_TableID
    where TableName = #{tablename,jdbcType=VARCHAR}
      and FieldName = #{fieldname,jdbcType=VARCHAR}
      and DepartmentID = #{departmentid,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="com.fuxi.ws.data.entity.ATableidKey" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Dec 15 18:15:49 CST 2015.
    -->
    delete from A_TableID
    where TableName = #{tablename,jdbcType=VARCHAR}
      and FieldName = #{fieldname,jdbcType=VARCHAR}
      and DepartmentID = #{departmentid,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.fuxi.ws.data.entity.ATableid" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Dec 15 18:15:49 CST 2015.
    -->
    insert into A_TableID (TableName, FieldName, DepartmentID, 
      LeftLetter, LastDate, MidLetterType, 
      SeqLenth, LastBillNo)
    values (#{tablename,jdbcType=VARCHAR}, #{fieldname,jdbcType=VARCHAR}, #{departmentid,jdbcType=VARCHAR}, 
      #{leftletter,jdbcType=NVARCHAR}, #{lastdate,jdbcType=TIMESTAMP}, #{midlettertype,jdbcType=TINYINT}, 
      #{seqlenth,jdbcType=TINYINT}, #{lastbillno,jdbcType=NVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.fuxi.ws.data.entity.ATableid" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Dec 15 18:15:49 CST 2015.
    -->
    insert into A_TableID
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="tablename != null" >
        TableName,
      </if>
      <if test="fieldname != null" >
        FieldName,
      </if>
      <if test="departmentid != null" >
        DepartmentID,
      </if>
      <if test="leftletter != null" >
        LeftLetter,
      </if>
      <if test="lastdate != null" >
        LastDate,
      </if>
      <if test="midlettertype != null" >
        MidLetterType,
      </if>
      <if test="seqlenth != null" >
        SeqLenth,
      </if>
      <if test="lastbillno != null" >
        LastBillNo,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="tablename != null" >
        #{tablename,jdbcType=VARCHAR},
      </if>
      <if test="fieldname != null" >
        #{fieldname,jdbcType=VARCHAR},
      </if>
      <if test="departmentid != null" >
        #{departmentid,jdbcType=VARCHAR},
      </if>
      <if test="leftletter != null" >
        #{leftletter,jdbcType=NVARCHAR},
      </if>
      <if test="lastdate != null" >
        #{lastdate,jdbcType=TIMESTAMP},
      </if>
      <if test="midlettertype != null" >
        #{midlettertype,jdbcType=TINYINT},
      </if>
      <if test="seqlenth != null" >
        #{seqlenth,jdbcType=TINYINT},
      </if>
      <if test="lastbillno != null" >
        #{lastbillno,jdbcType=NVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.fuxi.ws.data.entity.ATableidExample" resultType="java.lang.Integer" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Dec 15 18:15:49 CST 2015.
    -->
    select count(*) from A_TableID
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByPrimaryKeySelective" parameterType="com.fuxi.ws.data.entity.ATableid" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Dec 15 18:15:49 CST 2015.
    -->
    update A_TableID
    <set >
      <if test="leftletter != null" >
        LeftLetter = #{leftletter,jdbcType=NVARCHAR},
      </if>
      <if test="lastdate != null" >
        LastDate = #{lastdate,jdbcType=TIMESTAMP},
      </if>
      <if test="midlettertype != null" >
        MidLetterType = #{midlettertype,jdbcType=TINYINT},
      </if>
      <if test="seqlenth != null" >
        SeqLenth = #{seqlenth,jdbcType=TINYINT},
      </if>
      <if test="lastbillno != null" >
        LastBillNo = #{lastbillno,jdbcType=NVARCHAR},
      </if>
    </set>
    where TableName = #{tablename,jdbcType=VARCHAR}
      and FieldName = #{fieldname,jdbcType=VARCHAR}
      and DepartmentID = #{departmentid,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.fuxi.ws.data.entity.ATableid" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Dec 15 18:15:49 CST 2015.
    -->
    update A_TableID
    set LeftLetter = #{leftletter,jdbcType=NVARCHAR},
      LastDate = #{lastdate,jdbcType=TIMESTAMP},
      MidLetterType = #{midlettertype,jdbcType=TINYINT},
      SeqLenth = #{seqlenth,jdbcType=TINYINT},
      LastBillNo = #{lastbillno,jdbcType=NVARCHAR}
    where TableName = #{tablename,jdbcType=VARCHAR}
      and FieldName = #{fieldname,jdbcType=VARCHAR}
      and DepartmentID = #{departmentid,jdbcType=VARCHAR}
  </update>
</mapper>