ApiResourceMapper.xml 5.36 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.ApiResourceMapper" >
  <resultMap id="BaseResultMap" type="cn.runsa.crmapp.common.entity.ApiResource" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="RES_ID" property="resId" jdbcType="INTEGER" />
    <result column="RES_NAME" property="resName" jdbcType="VARCHAR" />
    <result column="RES_DESC" property="resDesc" jdbcType="VARCHAR" />
    <result column="RES_URL" property="resUrl" jdbcType="VARCHAR" />
    <result column="RES_PID" property="resPid" jdbcType="INTEGER" />
    <result column="RES_LEVEL" property="resLevel" jdbcType="INTEGER" />
    <result column="REC_TIME" property="recTime" jdbcType="TIMESTAMP" />
  </resultMap>
  <sql id="Base_Column_List" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    `RES_ID`, `RES_NAME`, `RES_DESC`, `RES_URL`, `RES_PID`, `RES_LEVEL`, `REC_TIME`
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
    from crm_api_resource
    where `RES_ID` = #{resId,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from crm_api_resource
    where `RES_ID` = #{resId,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="cn.runsa.crmapp.common.entity.ApiResource" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <selectKey resultType="java.lang.Integer" keyProperty="resId" order="AFTER" >
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into crm_api_resource (`RES_NAME`, `RES_DESC`, `RES_URL`, 
      `RES_PID`, `RES_LEVEL`, `REC_TIME`
      )
    values (#{resName,jdbcType=VARCHAR}, #{resDesc,jdbcType=VARCHAR}, #{resUrl,jdbcType=VARCHAR}, 
      #{resPid,jdbcType=INTEGER}, #{resLevel,jdbcType=INTEGER}, #{recTime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="cn.runsa.crmapp.common.entity.ApiResource" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <selectKey resultType="java.lang.Integer" keyProperty="resId" order="AFTER" >
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into crm_api_resource
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="resName != null" >
        `RES_NAME`,
      </if>
      <if test="resDesc != null" >
        `RES_DESC`,
      </if>
      <if test="resUrl != null" >
        `RES_URL`,
      </if>
      <if test="resPid != null" >
        `RES_PID`,
      </if>
      <if test="resLevel != null" >
        `RES_LEVEL`,
      </if>
      <if test="recTime != null" >
        `REC_TIME`,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="resName != null" >
        #{resName,jdbcType=VARCHAR},
      </if>
      <if test="resDesc != null" >
        #{resDesc,jdbcType=VARCHAR},
      </if>
      <if test="resUrl != null" >
        #{resUrl,jdbcType=VARCHAR},
      </if>
      <if test="resPid != null" >
        #{resPid,jdbcType=INTEGER},
      </if>
      <if test="resLevel != null" >
        #{resLevel,jdbcType=INTEGER},
      </if>
      <if test="recTime != null" >
        #{recTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="cn.runsa.crmapp.common.entity.ApiResource" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update crm_api_resource
    <set >
      <if test="resName != null" >
        `RES_NAME` = #{resName,jdbcType=VARCHAR},
      </if>
      <if test="resDesc != null" >
        `RES_DESC` = #{resDesc,jdbcType=VARCHAR},
      </if>
      <if test="resUrl != null" >
        `RES_URL` = #{resUrl,jdbcType=VARCHAR},
      </if>
      <if test="resPid != null" >
        `RES_PID` = #{resPid,jdbcType=INTEGER},
      </if>
      <if test="resLevel != null" >
        `RES_LEVEL` = #{resLevel,jdbcType=INTEGER},
      </if>
      <if test="recTime != null" >
        `REC_TIME` = #{recTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where `RES_ID` = #{resId,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.runsa.crmapp.common.entity.ApiResource" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update crm_api_resource
    set `RES_NAME` = #{resName,jdbcType=VARCHAR},
      `RES_DESC` = #{resDesc,jdbcType=VARCHAR},
      `RES_URL` = #{resUrl,jdbcType=VARCHAR},
      `RES_PID` = #{resPid,jdbcType=INTEGER},
      `RES_LEVEL` = #{resLevel,jdbcType=INTEGER},
      `REC_TIME` = #{recTime,jdbcType=TIMESTAMP}
    where `RES_ID` = #{resId,jdbcType=INTEGER}
  </update>
</mapper>