<?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.rongwei.bscommon.sys.dao.SrmInterimActionDao">
  <resultMap id="BaseResultMap" type="com.rongwei.bsentity.domin.SrmInterimActionDo">
    <id column="ID" jdbcType="VARCHAR" property="id" />
    <result column="TENANTID" jdbcType="VARCHAR" property="tenantid" />
    <result column="ROPTION" jdbcType="VARCHAR" property="roption" />
    <result column="DELETED" jdbcType="VARCHAR" property="deleted" />
    <result column="REMARK" jdbcType="VARCHAR" property="remark" />
    <result column="CREATEDATE" jdbcType="TIMESTAMP" property="createdate" />
    <result column="CREATEUSERID" jdbcType="VARCHAR" property="createuserid" />
    <result column="MODIFYDATE" jdbcType="TIMESTAMP" property="modifydate" />
    <result column="MODIFYUSERID" jdbcType="VARCHAR" property="modifyuserid" />
    <result column="CREATEUSERNAME" jdbcType="VARCHAR" property="createusername" />
    <result column="MODIFYUSERNAME" jdbcType="VARCHAR" property="modifyusername" />
    <result column="CORRECTIVEACTION" jdbcType="VARCHAR" property="correctiveaction" />
    <result column="RESPONSIBILITY" jdbcType="VARCHAR" property="responsibility" />
    <result column="PLANNEDDATE" jdbcType="TIMESTAMP" property="planneddate" />
    <result column="MAINID" jdbcType="VARCHAR" property="mainid" />
  </resultMap>
  <sql id="Base_Column_List">
    ID, TENANTID, ROPTION, DELETED, REMARK, CREATEDATE, CREATEUSERID, MODIFYDATE, MODIFYUSERID, 
    CREATEUSERNAME, MODIFYUSERNAME, CORRECTIVEACTION, RESPONSIBILITY, PLANNEDDATE, MAINID
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from srm_interim_action
    where ID = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from srm_interim_action
    where ID = #{id,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" keyColumn="ID" keyProperty="id" parameterType="com.rongwei.bsentity.domin.SrmInterimActionDo" useGeneratedKeys="true">
    insert into srm_interim_action (TENANTID, ROPTION, DELETED, 
      REMARK, CREATEDATE, CREATEUSERID, 
      MODIFYDATE, MODIFYUSERID, CREATEUSERNAME, 
      MODIFYUSERNAME, CORRECTIVEACTION, RESPONSIBILITY, 
      PLANNEDDATE, MAINID)
    values (#{tenantid,jdbcType=VARCHAR}, #{roption,jdbcType=VARCHAR}, #{deleted,jdbcType=VARCHAR}, 
      #{remark,jdbcType=VARCHAR}, #{createdate,jdbcType=TIMESTAMP}, #{createuserid,jdbcType=VARCHAR}, 
      #{modifydate,jdbcType=TIMESTAMP}, #{modifyuserid,jdbcType=VARCHAR}, #{createusername,jdbcType=VARCHAR}, 
      #{modifyusername,jdbcType=VARCHAR}, #{correctiveaction,jdbcType=VARCHAR}, #{responsibility,jdbcType=VARCHAR}, 
      #{planneddate,jdbcType=TIMESTAMP}, #{mainid,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" keyColumn="ID" keyProperty="id" parameterType="com.rongwei.bsentity.domin.SrmInterimActionDo" useGeneratedKeys="true">
    insert into srm_interim_action
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="tenantid != null">
        TENANTID,
      </if>
      <if test="roption != null">
        ROPTION,
      </if>
      <if test="deleted != null">
        DELETED,
      </if>
      <if test="remark != null">
        REMARK,
      </if>
      <if test="createdate != null">
        CREATEDATE,
      </if>
      <if test="createuserid != null">
        CREATEUSERID,
      </if>
      <if test="modifydate != null">
        MODIFYDATE,
      </if>
      <if test="modifyuserid != null">
        MODIFYUSERID,
      </if>
      <if test="createusername != null">
        CREATEUSERNAME,
      </if>
      <if test="modifyusername != null">
        MODIFYUSERNAME,
      </if>
      <if test="correctiveaction != null">
        CORRECTIVEACTION,
      </if>
      <if test="responsibility != null">
        RESPONSIBILITY,
      </if>
      <if test="planneddate != null">
        PLANNEDDATE,
      </if>
      <if test="mainid != null">
        MAINID,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="tenantid != null">
        #{tenantid,jdbcType=VARCHAR},
      </if>
      <if test="roption != null">
        #{roption,jdbcType=VARCHAR},
      </if>
      <if test="deleted != null">
        #{deleted,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="createdate != null">
        #{createdate,jdbcType=TIMESTAMP},
      </if>
      <if test="createuserid != null">
        #{createuserid,jdbcType=VARCHAR},
      </if>
      <if test="modifydate != null">
        #{modifydate,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyuserid != null">
        #{modifyuserid,jdbcType=VARCHAR},
      </if>
      <if test="createusername != null">
        #{createusername,jdbcType=VARCHAR},
      </if>
      <if test="modifyusername != null">
        #{modifyusername,jdbcType=VARCHAR},
      </if>
      <if test="correctiveaction != null">
        #{correctiveaction,jdbcType=VARCHAR},
      </if>
      <if test="responsibility != null">
        #{responsibility,jdbcType=VARCHAR},
      </if>
      <if test="planneddate != null">
        #{planneddate,jdbcType=TIMESTAMP},
      </if>
      <if test="mainid != null">
        #{mainid,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.rongwei.bsentity.domin.SrmInterimActionDo">
    update srm_interim_action
    <set>
      <if test="tenantid != null">
        TENANTID = #{tenantid,jdbcType=VARCHAR},
      </if>
      <if test="roption != null">
        ROPTION = #{roption,jdbcType=VARCHAR},
      </if>
      <if test="deleted != null">
        DELETED = #{deleted,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        REMARK = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="createdate != null">
        CREATEDATE = #{createdate,jdbcType=TIMESTAMP},
      </if>
      <if test="createuserid != null">
        CREATEUSERID = #{createuserid,jdbcType=VARCHAR},
      </if>
      <if test="modifydate != null">
        MODIFYDATE = #{modifydate,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyuserid != null">
        MODIFYUSERID = #{modifyuserid,jdbcType=VARCHAR},
      </if>
      <if test="createusername != null">
        CREATEUSERNAME = #{createusername,jdbcType=VARCHAR},
      </if>
      <if test="modifyusername != null">
        MODIFYUSERNAME = #{modifyusername,jdbcType=VARCHAR},
      </if>
      <if test="correctiveaction != null">
        CORRECTIVEACTION = #{correctiveaction,jdbcType=VARCHAR},
      </if>
      <if test="responsibility != null">
        RESPONSIBILITY = #{responsibility,jdbcType=VARCHAR},
      </if>
      <if test="planneddate != null">
        PLANNEDDATE = #{planneddate,jdbcType=TIMESTAMP},
      </if>
      <if test="mainid != null">
        MAINID = #{mainid,jdbcType=VARCHAR},
      </if>
    </set>
    where ID = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.rongwei.bsentity.domin.SrmInterimActionDo">
    update srm_interim_action
    set TENANTID = #{tenantid,jdbcType=VARCHAR},
      ROPTION = #{roption,jdbcType=VARCHAR},
      DELETED = #{deleted,jdbcType=VARCHAR},
      REMARK = #{remark,jdbcType=VARCHAR},
      CREATEDATE = #{createdate,jdbcType=TIMESTAMP},
      CREATEUSERID = #{createuserid,jdbcType=VARCHAR},
      MODIFYDATE = #{modifydate,jdbcType=TIMESTAMP},
      MODIFYUSERID = #{modifyuserid,jdbcType=VARCHAR},
      CREATEUSERNAME = #{createusername,jdbcType=VARCHAR},
      MODIFYUSERNAME = #{modifyusername,jdbcType=VARCHAR},
      CORRECTIVEACTION = #{correctiveaction,jdbcType=VARCHAR},
      RESPONSIBILITY = #{responsibility,jdbcType=VARCHAR},
      PLANNEDDATE = #{planneddate,jdbcType=TIMESTAMP},
      MAINID = #{mainid,jdbcType=VARCHAR}
    where ID = #{id,jdbcType=VARCHAR}
  </update>
</mapper>
