<?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.TpLogisticscompanyMapper">
  <resultMap id="BaseResultMap" type="com.fuxi.ws.data.entity.TpLogisticscompany">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 19 17:20:00 CST 2015.
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="code" jdbcType="VARCHAR" property="code" />
    <result column="expresscompany" jdbcType="VARCHAR" property="expresscompany" />
    <result column="reg_mail_no" jdbcType="VARCHAR" property="regMailNo" />
    <result column="PrinterName" jdbcType="VARCHAR" property="printername" />
    <result column="enableflag" jdbcType="BIT" property="enableflag" />
    <result column="IndexNo" jdbcType="INTEGER" property="indexno" />
    <result column="tp_departmentid" jdbcType="VARCHAR" property="tpDepartmentid" />
    <result column="defaultflag" jdbcType="BIT" property="defaultflag" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.fuxi.ws.data.entity.TpLogisticscompany">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 19 17:20:00 CST 2015.
    -->
    <result column="template" jdbcType="LONGVARBINARY" property="template" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 19 17:20:00 CST 2015.
    -->
    <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="Base_Column_List">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 19 17:20:00 CST 2015.
    -->
    id, code, expresscompany, reg_mail_no, PrinterName, enableflag, IndexNo, tp_departmentid, 
    defaultflag
  </sql>
  <sql id="Blob_Column_List">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 19 17:20:00 CST 2015.
    -->
    template
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="com.fuxi.ws.data.entity.TpLogisticscompanyExample" resultMap="ResultMapWithBLOBs">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 19 17:20:00 CST 2015.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    'false' as QUERYID,
    <include refid="Base_Column_List" />
   <!--  ,
    <include refid="Blob_Column_List" /> -->
    from tp_LogisticsCompany
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByExample" parameterType="com.fuxi.ws.data.entity.TpLogisticscompanyExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 19 17:20:00 CST 2015.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    'false' as QUERYID,
    <include refid="Base_Column_List" />
    from tp_LogisticsCompany
    <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.Integer" resultMap="ResultMapWithBLOBs">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 19 17:20:00 CST 2015.
    -->
    select 
    <include refid="Base_Column_List" />
   <!--  ,
    <include refid="Blob_Column_List" /> -->
    from tp_LogisticsCompany
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 19 17:20:00 CST 2015.
    -->
    delete from tp_LogisticsCompany
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.fuxi.ws.data.entity.TpLogisticscompany">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 19 17:20:00 CST 2015.
    -->
    insert into tp_LogisticsCompany (id, code, expresscompany, 
      reg_mail_no, PrinterName, enableflag, 
      IndexNo, tp_departmentid, defaultflag, 
      template)
    values (#{id,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}, #{expresscompany,jdbcType=VARCHAR}, 
      #{regMailNo,jdbcType=VARCHAR}, #{printername,jdbcType=VARCHAR}, #{enableflag,jdbcType=BIT}, 
      #{indexno,jdbcType=INTEGER}, #{tpDepartmentid,jdbcType=VARCHAR}, #{defaultflag,jdbcType=BIT}, 
      #{template,jdbcType=LONGVARBINARY})
  </insert>
  <insert id="insertSelective" parameterType="com.fuxi.ws.data.entity.TpLogisticscompany">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 19 17:20:00 CST 2015.
    -->
    insert into tp_LogisticsCompany
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="code != null">
        code,
      </if>
      <if test="expresscompany != null">
        expresscompany,
      </if>
      <if test="regMailNo != null">
        reg_mail_no,
      </if>
      <if test="printername != null">
        PrinterName,
      </if>
      <if test="enableflag != null">
        enableflag,
      </if>
      <if test="indexno != null">
        IndexNo,
      </if>
      <if test="tpDepartmentid != null">
        tp_departmentid,
      </if>
      <if test="defaultflag != null">
        defaultflag,
      </if>
      <if test="template != null">
        template,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="code != null">
        #{code,jdbcType=VARCHAR},
      </if>
      <if test="expresscompany != null">
        #{expresscompany,jdbcType=VARCHAR},
      </if>
      <if test="regMailNo != null">
        #{regMailNo,jdbcType=VARCHAR},
      </if>
      <if test="printername != null">
        #{printername,jdbcType=VARCHAR},
      </if>
      <if test="enableflag != null">
        #{enableflag,jdbcType=BIT},
      </if>
      <if test="indexno != null">
        #{indexno,jdbcType=INTEGER},
      </if>
      <if test="tpDepartmentid != null">
        #{tpDepartmentid,jdbcType=VARCHAR},
      </if>
      <if test="defaultflag != null">
        #{defaultflag,jdbcType=BIT},
      </if>
      <if test="template != null">
        #{template,jdbcType=LONGVARBINARY},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.fuxi.ws.data.entity.TpLogisticscompanyExample" resultType="java.lang.Integer">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 19 17:20:00 CST 2015.
    -->
    select count(*) from tp_LogisticsCompany
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByPrimaryKeySelective" parameterType="com.fuxi.ws.data.entity.TpLogisticscompany">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 19 17:20:00 CST 2015.
    -->
    update tp_LogisticsCompany
    <set>
      <if test="code != null">
        code = #{code,jdbcType=VARCHAR},
      </if>
      <if test="expresscompany != null">
        expresscompany = #{expresscompany,jdbcType=VARCHAR},
      </if>
      <if test="regMailNo != null">
        reg_mail_no = #{regMailNo,jdbcType=VARCHAR},
      </if>
      <if test="printername != null">
        PrinterName = #{printername,jdbcType=VARCHAR},
      </if>
      <if test="enableflag != null">
        enableflag = #{enableflag,jdbcType=BIT},
      </if>
      <if test="indexno != null">
        IndexNo = #{indexno,jdbcType=INTEGER},
      </if>
      <if test="tpDepartmentid != null">
        tp_departmentid = #{tpDepartmentid,jdbcType=VARCHAR},
      </if>
      <if test="defaultflag != null">
        defaultflag = #{defaultflag,jdbcType=BIT},
      </if>
      <if test="template != null">
        template = #{template,jdbcType=LONGVARBINARY},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.fuxi.ws.data.entity.TpLogisticscompany">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 19 17:20:00 CST 2015.
    -->
    update tp_LogisticsCompany
    set code = #{code,jdbcType=VARCHAR},
      expresscompany = #{expresscompany,jdbcType=VARCHAR},
      reg_mail_no = #{regMailNo,jdbcType=VARCHAR},
      PrinterName = #{printername,jdbcType=VARCHAR},
      enableflag = #{enableflag,jdbcType=BIT},
      IndexNo = #{indexno,jdbcType=INTEGER},
      tp_departmentid = #{tpDepartmentid,jdbcType=VARCHAR},
      defaultflag = #{defaultflag,jdbcType=BIT},
      template = #{template,jdbcType=LONGVARBINARY}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.fuxi.ws.data.entity.TpLogisticscompany">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 19 17:20:00 CST 2015.
    -->
    update tp_LogisticsCompany
    set code = #{code,jdbcType=VARCHAR},
      expresscompany = #{expresscompany,jdbcType=VARCHAR},
      reg_mail_no = #{regMailNo,jdbcType=VARCHAR},
      PrinterName = #{printername,jdbcType=VARCHAR},
      enableflag = #{enableflag,jdbcType=BIT},
      IndexNo = #{indexno,jdbcType=INTEGER},
      tp_departmentid = #{tpDepartmentid,jdbcType=VARCHAR},
      defaultflag = #{defaultflag,jdbcType=BIT}
    where id = #{id,jdbcType=INTEGER}
  </update>
  
  <select id="getpost" parameterType="java.util.HashMap" resultType="java.util.LinkedHashMap"> 
  	select id,code,expresscompany,reg_mail_no 
	from tp_LogisticsCompany 
    <if test="conditions != null and conditions != ''">
		where			
		${conditions}
	</if>
	order by id desc
  </select>
</mapper>