|
@@ -0,0 +1,109 @@
|
|
|
+<!DOCTYPE mapper
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+
|
|
|
+<mapper namespace="com.bosshand.virgo.core.dao.MgrClientDao">
|
|
|
+
|
|
|
+ <resultMap type="com.bosshand.virgo.core.model.MgrClient" id="clientResult">
|
|
|
+ <id column="id" property="id"/>
|
|
|
+ <result column="organizationId" property="organizationId"/>
|
|
|
+ <result column="userId" property="userId"/>
|
|
|
+ <result column="name" property="name"/>
|
|
|
+ <result column="type" property="type"/>
|
|
|
+ <result column="person" property="person"/>
|
|
|
+ <result column="phone" property="phone"/>
|
|
|
+ <result column="weChatAccount" property="weChatAccount"/>
|
|
|
+ <result column="followUpState" property="followUpState"/>
|
|
|
+ <result column="job" property="job"/>
|
|
|
+ <result column="demand" property="demand"/>
|
|
|
+ <result column="decorationRequirements" property="decorationRequirements"/>
|
|
|
+ <result column="customerIndustry" property="customerIndustry"/>
|
|
|
+ <result column="followUpPerson" property="followUpPerson"/>
|
|
|
+ <result column="firsTimeRoom" property="firsTimeRoom"/>
|
|
|
+ <result column="visitingChannels" property="visitingChannels"/>
|
|
|
+ <result column="visitingTime" property="visitingTime"/>
|
|
|
+ <result column="remark" property="remark"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <insert id="insert" parameterType="com.bosshand.virgo.core.model.MgrClient" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ INSERT INTO mgr_client(`organizationId`, `userId`, `name`, `type`, `person`, `phone`, `weChatAccount`, `followUpState`, `job`, `demand`, `decorationRequirements`,
|
|
|
+ `customerIndustry`, `followUpPerson`, `firsTimeRoom`, `visitingChannels`, `visitingTime`, `remark`)
|
|
|
+ VALUES (#{organizationId}, #{userId}, #{name}, #{type}, #{person}, #{phone}, #{weChatAccount}, #{followUpState}, #{job}, #{demand}, #{decorationRequirements},
|
|
|
+ #{customerIndustry}, #{followUpPerson}, #{firsTimeRoom}, #{visitingChannels}, #{visitingTime}, #{remark})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <delete id="delete">
|
|
|
+ DELETE from mgr_client where id=#{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <update id="update" parameterType="com.bosshand.virgo.core.model.MgrClient">
|
|
|
+ UPDATE mgr_client
|
|
|
+ <trim prefix="set" suffixOverrides=",">
|
|
|
+ <if test="name!=null">name=#{name},</if>
|
|
|
+ <if test="type!=0">type=#{type},</if>
|
|
|
+ <if test="person!=null">person=#{person},</if>
|
|
|
+ <if test="weChatAccount!=null">weChatAccount=#{weChatAccount},</if>
|
|
|
+ <if test="followUpState!=0">followUpState=#{followUpState},</if>
|
|
|
+ <if test="job!=null">job=#{job},</if>
|
|
|
+ <if test="demand!=null">demand=#{demand},</if>
|
|
|
+ <if test="decorationRequirements!=null">decorationRequirements=#{decorationRequirements},</if>
|
|
|
+ <if test="customerIndustry!=null">customerIndustry=#{customerIndustry},</if>
|
|
|
+ <if test="followUpPerson!=null">followUpPerson=#{followUpPerson},</if>
|
|
|
+ <if test="firsTimeRoom!=null">firsTimeRoom=#{firsTimeRoom},</if>
|
|
|
+ <if test="visitingChannels!=null">visitingChannels=#{visitingChannels},</if>
|
|
|
+ <if test="visitingTime!=null">visitingTime=#{visitingTime},</if>
|
|
|
+ <if test="remark!=null">remark=#{remark},</if>
|
|
|
+ </trim>
|
|
|
+ WHERE id=#{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="get" resultMap="clientResult">
|
|
|
+ SELECT * FROM mgr_client where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getTotalCount" parameterType="com.bosshand.virgo.core.model.MgrClient" resultType="Integer">
|
|
|
+ SELECT count(*) FROM mgr_client
|
|
|
+ <where>
|
|
|
+ <if test="organizationId!=0">and organizationId=#{organizationId}</if>
|
|
|
+ <if test="userId!=0">and userId=#{userId}</if>
|
|
|
+ <if test="name!=null">and name=#{name}</if>
|
|
|
+ <if test="type!=0">and type=#{type}</if>
|
|
|
+ <if test="person!=null">and person=#{person}</if>
|
|
|
+ <if test="weChatAccount!=null">and weChatAccount=#{weChatAccount}</if>
|
|
|
+ <if test="followUpState!=0">and followUpState=#{followUpState}</if>
|
|
|
+ <if test="job!=null">and job=#{job}</if>
|
|
|
+ <if test="demand!=null">and demand=#{demand}</if>
|
|
|
+ <if test="decorationRequirements!=null">and decorationRequirements=#{decorationRequirements}</if>
|
|
|
+ <if test="customerIndustry!=null">and customerIndustry=#{customerIndustry}</if>
|
|
|
+ <if test="followUpPerson!=null">and followUpPerson=#{followUpPerson}</if>
|
|
|
+ <if test="firsTimeRoom!=null">and firsTimeRoom=#{firsTimeRoom}</if>
|
|
|
+ <if test="visitingChannels!=null">and visitingChannels=#{visitingChannels}</if>
|
|
|
+ <if test="visitingTime!=null">and visitingTime=#{visitingTime}</if>
|
|
|
+ <if test="remark!=null">and remark=#{remark}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getLimit" resultMap="clientResult">
|
|
|
+ SELECT * FROM mgr_client
|
|
|
+ <where>
|
|
|
+ <if test="p.organizationId!=0">and organizationId=#{p.organizationId}</if>
|
|
|
+ <if test="p.userId!=0">and userId=#{p.userId}</if>
|
|
|
+ <if test="p.name!=null">and name=#{p.name}</if>
|
|
|
+ <if test="p.type!=0">and type=#{p.type}</if>
|
|
|
+ <if test="p.person!=null">and person=#{p.person}</if>
|
|
|
+ <if test="p.weChatAccount!=null">and weChatAccount=#{p.weChatAccount}</if>
|
|
|
+ <if test="p.followUpState!=0">and followUpState=#{p.followUpState}</if>
|
|
|
+ <if test="p.job!=null">and job=#{p.job}</if>
|
|
|
+ <if test="p.demand!=null">and demand=#{p.demand}</if>
|
|
|
+ <if test="p.decorationRequirements!=null">and decorationRequirements=#{p.decorationRequirements}</if>
|
|
|
+ <if test="p.customerIndustry!=null">and customerIndustry=#{p.customerIndustry}</if>
|
|
|
+ <if test="p.followUpPerson!=null">and followUpPerson=#{p.followUpPerson}</if>
|
|
|
+ <if test="p.firsTimeRoom!=null">and firsTimeRoom=#{p.firsTimeRoom}</if>
|
|
|
+ <if test="p.visitingChannels!=null">and visitingChannels=#{p.visitingChannels}</if>
|
|
|
+ <if test="p.visitingTime!=null">and visitingTime=#{p.visitingTime}</if>
|
|
|
+ <if test="p.remark!=null">and remark=#{p.remark}</if>
|
|
|
+ </where>
|
|
|
+ limit #{currIndex} , #{pageSize}
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|