TemplateMapper.xml 7.78 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.TemplateMapper">
  <resultMap id="BaseResultMap" type="cn.runsa.crmapp.common.entity.Template">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="TPL_ID" jdbcType="VARCHAR" property="tplId" />
    <result column="SCOPE" jdbcType="VARCHAR" property="scope" />
    <result column="TPL_DESC" jdbcType="VARCHAR" property="tplDesc" />
    <result column="EXE_TYPE" jdbcType="TINYINT" property="exeType" />
    <result column="EXE_NAME" jdbcType="VARCHAR" property="exeName" />
    <result column="PSR_TYPE" jdbcType="TINYINT" property="psrType" />
    <result column="PSR_NAME" jdbcType="VARCHAR" property="psrName" />
    <result column="REC_TIME" jdbcType="TIMESTAMP" property="recTime" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="cn.runsa.crmapp.common.entity.Template">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <result column="EXECUTER" jdbcType="LONGVARBINARY" property="executer" />
    <result column="PARSER" jdbcType="LONGVARBINARY" property="parser" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    `TPL_ID`, `SCOPE`, `TPL_DESC`, `EXE_TYPE`, `EXE_NAME`, `PSR_TYPE`, `PSR_NAME`, `REC_TIME`
  </sql>
  <sql id="Blob_Column_List">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    `EXECUTER`, `PARSER`
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from crm_template
    where `TPL_ID` = #{tplId,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from crm_template
    where `TPL_ID` = #{tplId,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="cn.runsa.crmapp.common.entity.Template">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into crm_template (`TPL_ID`, `SCOPE`, `TPL_DESC`, 
      `EXE_TYPE`, `EXE_NAME`, `PSR_TYPE`, 
      `PSR_NAME`, `REC_TIME`, `EXECUTER`, 
      `PARSER`)
    values (#{tplId,jdbcType=VARCHAR}, #{scope,jdbcType=VARCHAR}, #{tplDesc,jdbcType=VARCHAR}, 
      #{exeType,jdbcType=TINYINT}, #{exeName,jdbcType=VARCHAR}, #{psrType,jdbcType=TINYINT}, 
      #{psrName,jdbcType=VARCHAR}, #{recTime,jdbcType=TIMESTAMP}, #{executer,jdbcType=LONGVARBINARY}, 
      #{parser,jdbcType=LONGVARBINARY})
  </insert>
  <insert id="insertSelective" parameterType="cn.runsa.crmapp.common.entity.Template">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into crm_template
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="tplId != null">
        `TPL_ID`,
      </if>
      <if test="scope != null">
        `SCOPE`,
      </if>
      <if test="tplDesc != null">
        `TPL_DESC`,
      </if>
      <if test="exeType != null">
        `EXE_TYPE`,
      </if>
      <if test="exeName != null">
        `EXE_NAME`,
      </if>
      <if test="psrType != null">
        `PSR_TYPE`,
      </if>
      <if test="psrName != null">
        `PSR_NAME`,
      </if>
      <if test="recTime != null">
        `REC_TIME`,
      </if>
      <if test="executer != null">
        `EXECUTER`,
      </if>
      <if test="parser != null">
        `PARSER`,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="tplId != null">
        #{tplId,jdbcType=VARCHAR},
      </if>
      <if test="scope != null">
        #{scope,jdbcType=VARCHAR},
      </if>
      <if test="tplDesc != null">
        #{tplDesc,jdbcType=VARCHAR},
      </if>
      <if test="exeType != null">
        #{exeType,jdbcType=TINYINT},
      </if>
      <if test="exeName != null">
        #{exeName,jdbcType=VARCHAR},
      </if>
      <if test="psrType != null">
        #{psrType,jdbcType=TINYINT},
      </if>
      <if test="psrName != null">
        #{psrName,jdbcType=VARCHAR},
      </if>
      <if test="recTime != null">
        #{recTime,jdbcType=TIMESTAMP},
      </if>
      <if test="executer != null">
        #{executer,jdbcType=LONGVARBINARY},
      </if>
      <if test="parser != null">
        #{parser,jdbcType=LONGVARBINARY},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="cn.runsa.crmapp.common.entity.Template">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update crm_template
    <set>
      <if test="scope != null">
        `SCOPE` = #{scope,jdbcType=VARCHAR},
      </if>
      <if test="tplDesc != null">
        `TPL_DESC` = #{tplDesc,jdbcType=VARCHAR},
      </if>
      <if test="exeType != null">
        `EXE_TYPE` = #{exeType,jdbcType=TINYINT},
      </if>
      <if test="exeName != null">
        `EXE_NAME` = #{exeName,jdbcType=VARCHAR},
      </if>
      <if test="psrType != null">
        `PSR_TYPE` = #{psrType,jdbcType=TINYINT},
      </if>
      <if test="psrName != null">
        `PSR_NAME` = #{psrName,jdbcType=VARCHAR},
      </if>
      <if test="recTime != null">
        `REC_TIME` = #{recTime,jdbcType=TIMESTAMP},
      </if>
      <if test="executer != null">
        `EXECUTER` = #{executer,jdbcType=LONGVARBINARY},
      </if>
      <if test="parser != null">
        `PARSER` = #{parser,jdbcType=LONGVARBINARY},
      </if>
    </set>
    where `TPL_ID` = #{tplId,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="cn.runsa.crmapp.common.entity.Template">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update crm_template
    set `SCOPE` = #{scope,jdbcType=VARCHAR},
      `TPL_DESC` = #{tplDesc,jdbcType=VARCHAR},
      `EXE_TYPE` = #{exeType,jdbcType=TINYINT},
      `EXE_NAME` = #{exeName,jdbcType=VARCHAR},
      `PSR_TYPE` = #{psrType,jdbcType=TINYINT},
      `PSR_NAME` = #{psrName,jdbcType=VARCHAR},
      `REC_TIME` = #{recTime,jdbcType=TIMESTAMP},
      `EXECUTER` = #{executer,jdbcType=LONGVARBINARY},
      `PARSER` = #{parser,jdbcType=LONGVARBINARY}
    where `TPL_ID` = #{tplId,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.runsa.crmapp.common.entity.Template">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update crm_template
    set `SCOPE` = #{scope,jdbcType=VARCHAR},
      `TPL_DESC` = #{tplDesc,jdbcType=VARCHAR},
      `EXE_TYPE` = #{exeType,jdbcType=TINYINT},
      `EXE_NAME` = #{exeName,jdbcType=VARCHAR},
      `PSR_TYPE` = #{psrType,jdbcType=TINYINT},
      `PSR_NAME` = #{psrName,jdbcType=VARCHAR},
      `REC_TIME` = #{recTime,jdbcType=TIMESTAMP}
    where `TPL_ID` = #{tplId,jdbcType=VARCHAR}
  </update>
  
  <select id="selectTemplatesByScope" parameterType="java.lang.String" resultMap="BaseResultMap">
  	select 
    <include refid="Base_Column_List" />
    from crm_template
    where SCOPE = #{scope}
  </select>
</mapper>