<?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.steerinfo.ems.tcm0317.mapper.TCm0317Mapper">
  <resultMap id="BaseResultMap" type="com.steerinfo.ems.tcm0317.model.TCm0317">
    <id column="RECORDID" jdbcType="VARCHAR" property="recordid" />
    <result column="CHECKPERSON" jdbcType="VARCHAR" property="checkperson" />
    <result column="CREATOR" jdbcType="VARCHAR" property="creator" />
    <result column="DESCRIB" jdbcType="VARCHAR" property="describ" />
    <result column="FILENAME" jdbcType="VARCHAR" property="filename" />
    <result column="PARENTCODE" jdbcType="VARCHAR" property="parentcode" />
    <result column="SIGNPERSON" jdbcType="VARCHAR" property="signperson" />
    <result column="STARTTIME" jdbcType="VARCHAR" property="starttime" />
  </resultMap>
  <sql id="columns">
    RECORDID, CHECKPERSON, CREATOR, DESCRIB, FILENAME, PARENTCODE, SIGNPERSON, STARTTIME
  </sql>
  <sql id="columns_alias">
    t.RECORDID, t.CHECKPERSON, t.CREATOR, t.DESCRIB, t.FILENAME, t.PARENTCODE, t.SIGNPERSON, 
    t.STARTTIME
  </sql>
  <sql id="select">
    SELECT <include refid="columns"/> FROM T_CM_0317
  </sql>
  <sql id="select_alias">
    SELECT <include refid="columns_alias"/> FROM T_CM_0317 t
  </sql>
  <sql id="where">
    <where> 
      <if test="checkperson != null and checkperson != ''">
        and CHECKPERSON = #{checkperson}
      </if>
      <if test="creator != null and creator != ''">
        and CREATOR = #{creator}
      </if>
      <if test="describ != null and describ != ''">
        and DESCRIB = #{describ}
      </if>
      <if test="filename != null and filename != ''">
        and FILENAME = #{filename}
      </if>
      <if test="parentcode != null and parentcode != ''">
        and PARENTCODE like '${parentcode}%'
      </if>
      <if test="signperson != null and signperson != ''">
        and SIGNPERSON = #{signperson}
      </if>
      <if test="starttime != null and starttime != ''">
        and STARTTIME = #{starttime}
      </if>
    </where>
  </sql>
  <sql id="whereLike">
    <where> 
      <if test="checkperson != null and checkperson != ''">
        and CHECKPERSON LIKE '%${checkperson}%'
      </if>
      <if test="creator != null and creator != ''">
        and CREATOR LIKE '%${creator}%'
      </if>
      <if test="describ != null and describ != ''">
        and DESCRIB LIKE '%${describ}%'
      </if>
      <if test="filename != null and filename != ''">
        and FILENAME LIKE '%${filename}%'
      </if>
      <if test="parentcode != null and parentcode != ''">
        and PARENTCODE LIKE '%${parentcode}%'
      </if>
      <if test="signperson != null and signperson != ''">
        and SIGNPERSON LIKE '%${signperson}%'
      </if>
      <if test="starttime != null and starttime != ''">
        and STARTTIME LIKE '%${starttime}%'
      </if>
    </where>
  </sql>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from T_CM_0317
    where RECORDID = #{recordid,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
    delete from T_CM_0317
    where 1!=1 
      <if test="checkperson != null and checkperson != ''">
        or CHECKPERSON = #{checkperson}
      </if>
      <if test="creator != null and creator != ''">
        or CREATOR = #{creator}
      </if>
      <if test="describ != null and describ != ''">
        or DESCRIB = #{describ}
      </if>
      <if test="filename != null and filename != ''">
        or FILENAME = #{filename}
      </if>
      <if test="parentcode != null and parentcode != ''">
        or PARENTCODE = #{parentcode}
      </if>
      <if test="signperson != null and signperson != ''">
        or SIGNPERSON = #{signperson}
      </if>
      <if test="starttime != null and starttime != ''">
        or STARTTIME = #{starttime}
      </if>
  </delete>
  <insert id="insert" parameterType="com.steerinfo.ems.tcm0317.model.TCm0317">
    insert into T_CM_0317 (RECORDID, CHECKPERSON, CREATOR, 
      DESCRIB, FILENAME, PARENTCODE, 
      SIGNPERSON, STARTTIME)
    values (#{recordid,jdbcType=VARCHAR}, #{checkperson,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR}, 
      #{describ,jdbcType=VARCHAR}, #{filename,jdbcType=VARCHAR}, #{parentcode,jdbcType=VARCHAR}, 
      #{signperson,jdbcType=VARCHAR}, #{starttime,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.steerinfo.ems.tcm0317.model.TCm0317">
    insert into T_CM_0317
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="recordid != null">
        RECORDID,
      </if>
      <if test="checkperson != null">
        CHECKPERSON,
      </if>
      <if test="creator != null">
        CREATOR,
      </if>
      <if test="describ != null">
        DESCRIB,
      </if>
      <if test="filename != null">
        FILENAME,
      </if>
      <if test="parentcode != null">
        PARENTCODE,
      </if>
      <if test="signperson != null">
        SIGNPERSON,
      </if>
      <if test="starttime != null">
        STARTTIME,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="recordid != null">
        #{recordid,jdbcType=VARCHAR},
      </if>
      <if test="checkperson != null">
        #{checkperson,jdbcType=VARCHAR},
      </if>
      <if test="creator != null">
        #{creator,jdbcType=VARCHAR},
      </if>
      <if test="describ != null">
        #{describ,jdbcType=VARCHAR},
      </if>
      <if test="filename != null">
        #{filename,jdbcType=VARCHAR},
      </if>
      <if test="parentcode != null">
        #{parentcode,jdbcType=VARCHAR},
      </if>
      <if test="signperson != null">
        #{signperson,jdbcType=VARCHAR},
      </if>
      <if test="starttime != null">
        #{starttime,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.steerinfo.ems.tcm0317.model.TCm0317">
    update T_CM_0317
    set CHECKPERSON = #{checkperson,jdbcType=VARCHAR},
      CREATOR = #{creator,jdbcType=VARCHAR},
      DESCRIB = #{describ,jdbcType=VARCHAR},
      FILENAME = #{filename,jdbcType=VARCHAR},
      PARENTCODE = #{parentcode,jdbcType=VARCHAR},
      SIGNPERSON = #{signperson,jdbcType=VARCHAR},
      STARTTIME = #{starttime,jdbcType=VARCHAR}
    where RECORDID = #{recordid,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.tcm0317.model.TCm0317">
    update T_CM_0317
    <set>
      <if test="checkperson != null">
        CHECKPERSON = #{checkperson,jdbcType=VARCHAR},
      </if>
      <if test="creator != null">
        CREATOR = #{creator,jdbcType=VARCHAR},
      </if>
      <if test="describ != null">
        DESCRIB = #{describ,jdbcType=VARCHAR},
      </if>
      <if test="filename != null">
        FILENAME = #{filename,jdbcType=VARCHAR},
      </if>
      <if test="parentcode != null">
        PARENTCODE = #{parentcode,jdbcType=VARCHAR},
      </if>
      <if test="signperson != null">
        SIGNPERSON = #{signperson,jdbcType=VARCHAR},
      </if>
      <if test="starttime != null">
        STARTTIME = #{starttime,jdbcType=VARCHAR},
      </if>
    </set>
    where RECORDID = #{recordid,jdbcType=VARCHAR}
  </update>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    <include refid="select"/>
    where RECORDID = #{recordid,jdbcType=VARCHAR}
  </select>
  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    <include refid="select"/>
    <include refid="where"/>
  </select>
  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    <include refid="select"/>
    <include refid="whereLike"/>
  </select>
  <insert id="batchInsert" parameterType="java.util.List">
    insert into T_CM_0317 
      (RECORDID, 
      CHECKPERSON, CREATOR, DESCRIB, 
      FILENAME, PARENTCODE, SIGNPERSON, 
      STARTTIME)
    ( <foreach collection="list" item="item" separator="union all"> 
   select  
      #{item.recordid,jdbcType=VARCHAR}, 
      #{item.checkperson,jdbcType=VARCHAR}, #{item.creator,jdbcType=VARCHAR}, #{item.describ,jdbcType=VARCHAR}, 
      #{item.filename,jdbcType=VARCHAR}, #{item.parentcode,jdbcType=VARCHAR}, #{item.signperson,jdbcType=VARCHAR}, 
      #{item.starttime,jdbcType=VARCHAR} from dual  
   </foreach> )
  </insert>
  <update id="batchUpdate" parameterType="java.util.List">
     update T_CM_0317
     set
       RECORDID=
       <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
          when #{item.recordid,jdbcType=VARCHAR} then #{item.recordid,jdbcType=VARCHAR}
       </foreach>
       ,CHECKPERSON=
       <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
          when #{item.recordid,jdbcType=VARCHAR} then #{item.checkperson,jdbcType=VARCHAR}
       </foreach>
       ,CREATOR=
       <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
          when #{item.recordid,jdbcType=VARCHAR} then #{item.creator,jdbcType=VARCHAR}
       </foreach>
       ,DESCRIB=
       <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
          when #{item.recordid,jdbcType=VARCHAR} then #{item.describ,jdbcType=VARCHAR}
       </foreach>
       ,FILENAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
          when #{item.recordid,jdbcType=VARCHAR} then #{item.filename,jdbcType=VARCHAR}
       </foreach>
       ,PARENTCODE=
       <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
          when #{item.recordid,jdbcType=VARCHAR} then #{item.parentcode,jdbcType=VARCHAR}
       </foreach>
       ,SIGNPERSON=
       <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
          when #{item.recordid,jdbcType=VARCHAR} then #{item.signperson,jdbcType=VARCHAR}
       </foreach>
       ,STARTTIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
          when #{item.recordid,jdbcType=VARCHAR} then #{item.starttime,jdbcType=VARCHAR}
       </foreach>
     where RECORDID in 
     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
    #{item.recordid,jdbcType=VARCHAR}
     </foreach> 
  </update>
  <delete id="batchDelete" parameterType="java.util.List">
    delete from T_CM_0317
    where RECORDID in 
    <foreach collection="list" item="id" open="(" close=")" separator=",">
      #{id}
    </foreach>
  </delete>
  <!-- 友情提示！！！-->
  <!-- 请将自己写的代码放在此标签之下，方便以后粘贴复制。-->
  
</mapper>