CrmGuiderMapper.xml 2.67 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.portal.base.dao.CrmGuiderMapper" >
  <resultMap id="BaseResultMap" type="cn.runsa.portal.base.entity.CrmGuider" >
  	<id column="ID" property="id" jdbcType="INTEGER" />
    <id column="GUIDER_ID" property="guiderId" jdbcType="VARCHAR" />
    <result column="EMP_ID" property="empId" jdbcType="INTEGER" />
    <result column="SITE_ID" property="siteId" jdbcType="INTEGER" />
    <result column="role" property="role" jdbcType="INTEGER" />
    <result column="HEADER" property="header" jdbcType="VARCHAR" />
    <result column="role_description" property="roleDescription" jdbcType="INTEGER" />
    <result column="state" property="state" jdbcType="INTEGER" />
    <result column="REC_TIME" property="recTime" jdbcType="TIMESTAMP" />
  </resultMap>
  <sql id="Base_Column_List" >
    ID, GUIDER_ID, EMP_ID, SITE_ID, role, HEADER, role_description, state, REC_TIME
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    from crm_guider
    where ID = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from crm_guider
    where ID = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="cn.runsa.portal.base.entity.CrmGuider" >
    insert into crm_guider (GUIDER_ID, EMP_ID, SITE_ID, 
      role, HEADER, role_description, state, 
      REC_TIME)
    values (#{guiderId,jdbcType=VARCHAR}, #{empId,jdbcType=INTEGER}, #{siteId,jdbcType=INTEGER}, 
      #{role,jdbcType=INTEGER}, #{header,jdbcType=VARCHAR}, #{roleDescription,jdbcType=INTEGER}, #{state,jdbcType=INTEGER}, 
      now())
  </insert>
  <update id="updateByPrimaryKey" parameterType="cn.runsa.portal.base.entity.CrmGuider" >
    update crm_guider
    set 
      GUIDER_ID = #{guiderId,jdbcType=VARCHAR},
      EMP_ID = #{empId,jdbcType=INTEGER},
      SITE_ID = #{siteId,jdbcType=INTEGER},
      role = #{role,jdbcType=INTEGER},
      HEADER = #{header,jdbcType=VARCHAR},
      role_description = #{roleDescription,jdbcType=INTEGER},
      state = #{state,jdbcType=INTEGER},
      REC_TIME = now()
    where ID = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateRoleByPrimaryKey" parameterType="cn.runsa.portal.base.entity.CrmGuider" >
    UPDATE crm_guider t SET t.role  = #{role,jdbcType=INTEGER} WHERE t.ID = #{id,jdbcType=INTEGER}
  </update>
  <delete id="deleteBySiid" parameterType="java.lang.Integer" >
    delete from crm_guider
    where SITE_ID = #{siid,jdbcType=INTEGER}
  </delete>
</mapper>