CustomerSiteSaleTargetMapper.xml 1.94 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.customer.mapper.CustomerSiteSaleTargetMapper" >
  <resultMap id="BaseResultMap" type="cn.runsa.crmapp.customer.entity.CustomerSiteSaleTarget" >
    <id column="target_id" property="id" />
    <result column="siId" property="siid"/>
    <result column="MONTH" property="month"/>
    <result column="target_sale" property="sale"/>
    <result column="target_recruit" property="recruit"/>
    <result column="REC_TIME" property="time"/>
    <result column="REC_USER" property="user"/>
    <result column="ACT_ID" property="actid"/>
  </resultMap>
  <sql id="Base_Column_List">
		target_id,siId, MONTH,target_sale, target_recruit, REC_TIME, REC_USER, ACT_ID
  </sql>
  
  <insert id="insert" parameterType="cn.runsa.crmapp.customer.entity.CustomerSiteSaleTarget">    
    insert into crm_site_sale_target (siId,MONTH,target_sale,target_recruit,REC_TIME,REC_USER,ACT_ID)   
    values  
        (#{siid},#{month},#{sale},#{recruit},now(),#{user},#{actid})  
   </insert>  
	
   <update id="update" parameterType="cn.runsa.crmapp.customer.entity.CustomerSiteSaleTarget">
		update crm_site_sale_target set target_recruit=#{recruit} where target_id=#{id}
   </update>
   
   <select id="selectbyid" resultMap="BaseResultMap" parameterType="java.lang.Integer">
   		select <include refid="Base_Column_List" /> from crm_site_sale_target where target_id=#{id}
   </select>
   
   <delete id="delete" parameterType="java.lang.Integer">
		delete from crm_site_sale_target
		where target_id = #{id,jdbcType=INTEGER}
   </delete>
   
   <select id="selectByMonthAndSiId" parameterType="cn.runsa.crmapp.customer.entity.CustomerSiteSaleTarget" resultType="java.lang.Integer">
		select count(*) from crm_site_sale_target
		where siId = #{siid,jdbcType=INTEGER} and MONTH = #{month,jdbcType=INTEGER}
   </select>
   
</mapper>