CustomerSiteSaleTargetMapper.xml
1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?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>