ApprovalProcessMapper.xml 3.8 KB
<?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="cn.runsa.crmapp.common.mapper.ApprovalProcessMapper" >
  <resultMap id="BaseResultMap" type="cn.runsa.crmapp.common.entity.ApprovalProcess" >
    <id column="ID" property="id" jdbcType="BIGINT" />
    <result column="TYPE" property="type" jdbcType="INTEGER" />
    <result column="TYPEID" property="typeid" jdbcType="VARCHAR" />
    <result column="DESC" property="desc" jdbcType="VARCHAR" />
    <result column="STATUS" property="status" jdbcType="INTEGER" />
    <result column="REC_TIME" property="recTime" jdbcType="TIMESTAMP" />
    <result column="REC_USER" property="recUser" jdbcType="BIGINT" />
  </resultMap>
  <sql id="Base_Column_List" >
    ID, TYPE, TYPEID, `DESC`, STATUS, REC_TIME, REC_USER
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
    select 
    <include refid="Base_Column_List" />
    from crm_approval_process
    where ID = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    delete from crm_approval_process
    where ID = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="cn.runsa.crmapp.common.entity.ApprovalProcess" >
    insert into crm_approval_process (ID, TYPE, TYPEID, 
      `DESC`, STATUS, REC_TIME, 
      REC_USER)
    values (#{id,jdbcType=BIGINT}, #{type,jdbcType=INTEGER}, #{typeid,jdbcType=VARCHAR}, 
      #{desc,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{recTime,jdbcType=TIMESTAMP}, 
      #{recUser,jdbcType=BIGINT})
  </insert>
  <insert id="insertSelective" parameterType="cn.runsa.crmapp.common.entity.ApprovalProcess" >
    insert into crm_approval_process
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        ID,
      </if>
      <if test="type != null" >
        TYPE,
      </if>
      <if test="typeid != null" >
        TYPEID,
      </if>
      <if test="desc != null" >
        `DESC`,
      </if>
      <if test="status != null" >
        STATUS,
      </if>
      <if test="recTime != null" >
        REC_TIME,
      </if>
      <if test="recUser != null" >
        REC_USER,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=BIGINT},
      </if>
      <if test="type != null" >
        #{type,jdbcType=INTEGER},
      </if>
      <if test="typeid != null" >
        #{typeid,jdbcType=VARCHAR},
      </if>
      <if test="desc != null" >
        #{desc,jdbcType=VARCHAR},
      </if>
      <if test="status != null" >
        #{status,jdbcType=INTEGER},
      </if>
      <if test="recTime != null" >
        #{recTime,jdbcType=TIMESTAMP},
      </if>
      <if test="recUser != null" >
        #{recUser,jdbcType=BIGINT},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="cn.runsa.crmapp.common.entity.ApprovalProcess" >
    update crm_approval_process
    <set >
      <if test="type != null" >
        TYPE = #{type,jdbcType=INTEGER},
      </if>
      <if test="typeid != null" >
        TYPEID = #{typeid,jdbcType=VARCHAR},
      </if>
      <if test="desc != null" >
        `DESC` = #{desc,jdbcType=VARCHAR},
      </if>
      <if test="status != null" >
        STATUS = #{status,jdbcType=INTEGER},
      </if>
      <if test="recTime != null" >
        REC_TIME = #{recTime,jdbcType=TIMESTAMP},
      </if>
      <if test="recUser != null" >
        REC_USER = #{recUser,jdbcType=BIGINT},
      </if>
    </set>
    where ID = #{id,jdbcType=BIGINT}
  </update>
  <select id="getCounts" parameterType="cn.runsa.crmapp.common.entity.ApprovalProcess" resultType="java.lang.Integer" >
    select count(*) from crm_approval_process
  </select>
</mapper>