FieldMapper.xml 10.7 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.FieldMapper" >
  <resultMap id="BaseResultMap" type="cn.runsa.crmapp.common.entity.Field" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="FLD_SQL" property="fldSql" jdbcType="VARCHAR" />
    <result column="FLD_SCOPE" property="fldScope" jdbcType="VARCHAR" />
    <result column="FLD_NAME" property="fldName" jdbcType="VARCHAR" />
    <result column="FLD_TYPE" property="fldType" jdbcType="VARCHAR" />
    <result column="FLD_DESC" property="fldDesc" jdbcType="VARCHAR" />
    <result column="USE_NEW" property="useNew" jdbcType="BIT" />
    <result column="USE_MOD" property="useMod" jdbcType="BIT" />
    <result column="REQ_NEW" property="reqNew" jdbcType="BIT" />
    <result column="REQ_MOD" property="reqMod" jdbcType="BIT" />
    <result column="IS_SYSTEM" property="isSystem" jdbcType="BIT" />
    <result column="FLD_INDEX" property="fldIndex" jdbcType="INTEGER" />
    <result column="REC_TIME" property="recTime" jdbcType="TIMESTAMP" />
    <result column="REC_USER" property="recUser" jdbcType="BIGINT" />
  </resultMap>
  <resultMap id="ResultMapWithBLOBs" type="cn.runsa.crmapp.common.entity.Field" extends="BaseResultMap" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <result column="FLD_OPTIONS" property="fldOptions" jdbcType="LONGVARCHAR" />
    <result column="FLD_VALID" property="fldValid" jdbcType="LONGVARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    `FLD_SQL`, `FLD_SCOPE`, `FLD_NAME`, `FLD_TYPE`, `FLD_DESC`, `USE_NEW`, `USE_MOD`, 
    `REQ_NEW`, `REQ_MOD`, `IS_SYSTEM`, `FLD_INDEX`, `REC_TIME`, `REC_USER`
  </sql>
  <sql id="Blob_Column_List" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    `FLD_OPTIONS`, `FLD_VALID`
  </sql>
  <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.String" >
    <!--
      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_field
    where `FLD_SQL` = #{fldSql,jdbcType=VARCHAR}
  </select>
  
 <!--  <select id="selectFieldsCondition" resultMap="ResultMapWithBLOBs" parameterType="java.lang.String" >
    
      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_field
    where `FLD_SCOPE` = #{fldScope,jdbcType=VARCHAR}
  </select> -->
  
  <select id="selectFieldsCondition" resultMap="ResultMapWithBLOBs" parameterType="cn.runsa.crmapp.common.entity.Field" >
    select *
    from crm_field
    where `FLD_SCOPE` = #{fldScope,jdbcType=VARCHAR}
   <if test="useNew != null and useNew == true ">
	   and `USE_NEW` = 1
    </if>
    <if test="useMod != null and useMod == true ">
	   and `USE_MOD` = 1
    </if>
    order by `FLD_INDEX` asc
  </select>
  

  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from crm_field
    where `FLD_SQL` = #{fldSql,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="cn.runsa.crmapp.common.entity.Field" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into crm_field (`FLD_SQL`, `FLD_SCOPE`, `FLD_NAME`, 
      `FLD_TYPE`, `FLD_DESC`, `USE_NEW`, 
      `USE_MOD`, `REQ_NEW`, `REQ_MOD`, `IS_SYSTEM`, 
      `FLD_INDEX`, `REC_TIME`, `REC_USER`, 
      `FLD_OPTIONS`, `FLD_VALID`)
    values (#{fldSql,jdbcType=VARCHAR}, #{fldScope,jdbcType=VARCHAR}, #{fldName,jdbcType=VARCHAR}, 
      #{fldType,jdbcType=VARCHAR}, #{fldDesc,jdbcType=VARCHAR}, #{useNew,jdbcType=BIT}, 
      #{useMod,jdbcType=BIT}, #{reqNew,jdbcType=BIT}, #{reqMod,jdbcType=BIT}, #{isSystem,jdbcType=BIT}, 
      #{fldIndex,jdbcType=INTEGER}, #{recTime,jdbcType=TIMESTAMP}, #{recUser,jdbcType=BIGINT}, 
      #{fldOptions,jdbcType=LONGVARCHAR}, #{fldValid,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="cn.runsa.crmapp.common.entity.Field" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into crm_field
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="fldSql != null" >
        `FLD_SQL`,
      </if>
      <if test="fldScope != null" >
        `FLD_SCOPE`,
      </if>
      <if test="fldName != null" >
        `FLD_NAME`,
      </if>
      <if test="fldType != null" >
        `FLD_TYPE`,
      </if>
      <if test="fldDesc != null" >
        `FLD_DESC`,
      </if>
      <if test="useNew != null" >
        `USE_NEW`,
      </if>
      <if test="useMod != null" >
        `USE_MOD`,
      </if>
      <if test="reqNew != null" >
        `REQ_NEW`,
      </if>
      <if test="reqMod != null" >
        `REQ_MOD`,
      </if>
      <if test="isSystem != null" >
        `IS_SYSTEM`,
      </if>
      <if test="fldIndex != null" >
        `FLD_INDEX`,
      </if>
      <if test="recTime != null" >
        `REC_TIME`,
      </if>
      <if test="recUser != null" >
        `REC_USER`,
      </if>
      <if test="fldOptions != null" >
        `FLD_OPTIONS`,
      </if>
      <if test="fldValid != null" >
        `FLD_VALID`,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="fldSql != null" >
        #{fldSql,jdbcType=VARCHAR},
      </if>
      <if test="fldScope != null" >
        #{fldScope,jdbcType=VARCHAR},
      </if>
      <if test="fldName != null" >
        #{fldName,jdbcType=VARCHAR},
      </if>
      <if test="fldType != null" >
        #{fldType,jdbcType=VARCHAR},
      </if>
      <if test="fldDesc != null" >
        #{fldDesc,jdbcType=VARCHAR},
      </if>
      <if test="useNew != null" >
        #{useNew,jdbcType=BIT},
      </if>
      <if test="useMod != null" >
        #{useMod,jdbcType=BIT},
      </if>
      <if test="reqNew != null" >
        #{reqNew,jdbcType=BIT},
      </if>
      <if test="reqMod != null" >
        #{reqMod,jdbcType=BIT},
      </if>
      <if test="isSystem != null" >
        #{isSystem,jdbcType=BIT},
      </if>
      <if test="fldIndex != null" >
        #{fldIndex,jdbcType=INTEGER},
      </if>
      <if test="recTime != null" >
        #{recTime,jdbcType=TIMESTAMP},
      </if>
      <if test="recUser != null" >
        #{recUser,jdbcType=BIGINT},
      </if>
      <if test="fldOptions != null" >
        #{fldOptions,jdbcType=LONGVARCHAR},
      </if>
      <if test="fldValid != null" >
        #{fldValid,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="cn.runsa.crmapp.common.entity.Field" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update crm_field
    <set >
      <if test="fldScope != null" >
        `FLD_SCOPE` = #{fldScope,jdbcType=VARCHAR},
      </if>
      <if test="fldName != null" >
        `FLD_NAME` = #{fldName,jdbcType=VARCHAR},
      </if>
      <if test="fldType != null" >
        `FLD_TYPE` = #{fldType,jdbcType=VARCHAR},
      </if>
      <if test="fldDesc != null" >
        `FLD_DESC` = #{fldDesc,jdbcType=VARCHAR},
      </if>
      <if test="useNew != null" >
        `USE_NEW` = #{useNew,jdbcType=BIT},
      </if>
      <if test="useMod != null" >
        `USE_MOD` = #{useMod,jdbcType=BIT},
      </if>
      <if test="reqNew != null" >
        `REQ_NEW` = #{reqNew,jdbcType=BIT},
      </if>
      <if test="reqMod != null" >
        `REQ_MOD` = #{reqMod,jdbcType=BIT},
      </if>
      <if test="isSystem != null" >
        `IS_SYSTEM` = #{isSystem,jdbcType=BIT},
      </if>
      <if test="fldIndex != null" >
        `FLD_INDEX` = #{fldIndex,jdbcType=INTEGER},
      </if>
      <if test="recTime != null" >
        `REC_TIME` = #{recTime,jdbcType=TIMESTAMP},
      </if>
      <if test="recUser != null" >
        `REC_USER` = #{recUser,jdbcType=BIGINT},
      </if>
      <if test="fldOptions != null" >
        `FLD_OPTIONS` = #{fldOptions,jdbcType=LONGVARCHAR},
      </if>
      <if test="fldValid != null" >
        `FLD_VALID` = #{fldValid,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where `FLD_SQL` = #{fldSql,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="cn.runsa.crmapp.common.entity.Field" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update crm_field
    set `FLD_SCOPE` = #{fldScope,jdbcType=VARCHAR},
      `FLD_NAME` = #{fldName,jdbcType=VARCHAR},
      `FLD_TYPE` = #{fldType,jdbcType=VARCHAR},
      `FLD_DESC` = #{fldDesc,jdbcType=VARCHAR},
      `USE_NEW` = #{useNew,jdbcType=BIT},
      `USE_MOD` = #{useMod,jdbcType=BIT},
      `REQ_NEW` = #{reqNew,jdbcType=BIT},
      `REQ_MOD` = #{reqMod,jdbcType=BIT},
      `IS_SYSTEM` = #{isSystem,jdbcType=BIT},
      `FLD_INDEX` = #{fldIndex,jdbcType=INTEGER},
      `REC_TIME` = #{recTime,jdbcType=TIMESTAMP},
      `REC_USER` = #{recUser,jdbcType=BIGINT},
      `FLD_OPTIONS` = #{fldOptions,jdbcType=LONGVARCHAR},
      `FLD_VALID` = #{fldValid,jdbcType=LONGVARCHAR}
    where `FLD_SQL` = #{fldSql,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.runsa.crmapp.common.entity.Field" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update crm_field
    set `FLD_SCOPE` = #{fldScope,jdbcType=VARCHAR},
      `FLD_NAME` = #{fldName,jdbcType=VARCHAR},
      `FLD_TYPE` = #{fldType,jdbcType=VARCHAR},
      `FLD_DESC` = #{fldDesc,jdbcType=VARCHAR},
      `USE_NEW` = #{useNew,jdbcType=BIT},
      `USE_MOD` = #{useMod,jdbcType=BIT},
      `REQ_NEW` = #{reqNew,jdbcType=BIT},
      `REQ_MOD` = #{reqMod,jdbcType=BIT},
      `IS_SYSTEM` = #{isSystem,jdbcType=BIT},
      `FLD_INDEX` = #{fldIndex,jdbcType=INTEGER},
      `REC_TIME` = #{recTime,jdbcType=TIMESTAMP},
      `REC_USER` = #{recUser,jdbcType=BIGINT}
    where `FLD_SQL` = #{fldSql,jdbcType=VARCHAR}
  </update>
</mapper>