|
@@ -34,6 +34,15 @@
|
|
#{customerIndustry}, #{followUpPerson}, #{firsTimeRoom}, #{visitingChannels}, #{visitingTime}, #{remark}, #{status}, #{highSeas})
|
|
#{customerIndustry}, #{followUpPerson}, #{firsTimeRoom}, #{visitingChannels}, #{visitingTime}, #{remark}, #{status}, #{highSeas})
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
|
|
+ <insert id="batchInsert" 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`, `status`, `highSeas`) VALUES
|
|
|
|
+ <foreach collection="list" item="item" index="index" separator=",">
|
|
|
|
+ (#{item.organizationId}, #{item.userId}, #{item.name}, #{item.type}, #{item.person}, #{item.phone}, #{item.weChatAccount}, #{item.followUpState}, #{item.job}, #{item.demand}, #{item.decorationRequirements},
|
|
|
|
+ #{item.customerIndustry}, #{item.followUpPerson}, #{item.firsTimeRoom}, #{item.visitingChannels}, #{item.visitingTime}, #{item.remark}, #{item.status}, #{item.highSeas})
|
|
|
|
+ </foreach>
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
<delete id="delete">
|
|
<delete id="delete">
|
|
DELETE from mgr_client where id=#{id}
|
|
DELETE from mgr_client where id=#{id}
|
|
</delete>
|
|
</delete>
|
|
@@ -42,11 +51,11 @@
|
|
UPDATE mgr_client
|
|
UPDATE mgr_client
|
|
<trim prefix="set" suffixOverrides=",">
|
|
<trim prefix="set" suffixOverrides=",">
|
|
<if test="name!=null">name=#{name},</if>
|
|
<if test="name!=null">name=#{name},</if>
|
|
- <if test="type!=0">type=#{type},</if>
|
|
|
|
|
|
+ <if test="type!=null">type=#{type},</if>
|
|
<if test="person!=null">person=#{person},</if>
|
|
<if test="person!=null">person=#{person},</if>
|
|
<if test="phone!=null">phone=#{phone},</if>
|
|
<if test="phone!=null">phone=#{phone},</if>
|
|
<if test="weChatAccount!=null">weChatAccount=#{weChatAccount},</if>
|
|
<if test="weChatAccount!=null">weChatAccount=#{weChatAccount},</if>
|
|
- <if test="followUpState!=0">followUpState=#{followUpState},</if>
|
|
|
|
|
|
+ <if test="followUpState!=null">followUpState=#{followUpState},</if>
|
|
<if test="job!=null">job=#{job},</if>
|
|
<if test="job!=null">job=#{job},</if>
|
|
<if test="demand!=null">demand=#{demand},</if>
|
|
<if test="demand!=null">demand=#{demand},</if>
|
|
<if test="decorationRequirements!=null">decorationRequirements=#{decorationRequirements},</if>
|
|
<if test="decorationRequirements!=null">decorationRequirements=#{decorationRequirements},</if>
|
|
@@ -66,16 +75,41 @@
|
|
SELECT * FROM mgr_client where id = #{id}
|
|
SELECT * FROM mgr_client where id = #{id}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
+ <select id="typeCount" resultType="map">
|
|
|
|
+ SELECT type, COUNT(*) as number 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!=null">and type=#{type}</if>
|
|
|
|
+ <if test="person!=null">and person=#{person}</if>
|
|
|
|
+ <if test="weChatAccount!=null">and weChatAccount=#{weChatAccount}</if>
|
|
|
|
+ <if test="followUpState!=null">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>
|
|
|
|
+ <if test="status!=null">and status=#{status}</if>
|
|
|
|
+ <if test="highSeas!=null">and highSeas=#{highSeas}</if>
|
|
|
|
+ </where>
|
|
|
|
+ GROUP BY type
|
|
|
|
+ </select>
|
|
|
|
+
|
|
<select id="getTotalCount" parameterType="com.bosshand.virgo.core.model.MgrClient" resultType="Integer">
|
|
<select id="getTotalCount" parameterType="com.bosshand.virgo.core.model.MgrClient" resultType="Integer">
|
|
SELECT count(*) FROM mgr_client
|
|
SELECT count(*) FROM mgr_client
|
|
<where>
|
|
<where>
|
|
<if test="organizationId!=0">and organizationId=#{organizationId}</if>
|
|
<if test="organizationId!=0">and organizationId=#{organizationId}</if>
|
|
<if test="userId!=0">and userId=#{userId}</if>
|
|
<if test="userId!=0">and userId=#{userId}</if>
|
|
<if test="name!=null">and name=#{name}</if>
|
|
<if test="name!=null">and name=#{name}</if>
|
|
- <if test="type!=0">and type=#{type}</if>
|
|
|
|
|
|
+ <if test="type!=null">and type=#{type}</if>
|
|
<if test="person!=null">and person=#{person}</if>
|
|
<if test="person!=null">and person=#{person}</if>
|
|
<if test="weChatAccount!=null">and weChatAccount=#{weChatAccount}</if>
|
|
<if test="weChatAccount!=null">and weChatAccount=#{weChatAccount}</if>
|
|
- <if test="followUpState!=0">and followUpState=#{followUpState}</if>
|
|
|
|
|
|
+ <if test="followUpState!=null">and followUpState=#{followUpState}</if>
|
|
<if test="job!=null">and job=#{job}</if>
|
|
<if test="job!=null">and job=#{job}</if>
|
|
<if test="demand!=null">and demand=#{demand}</if>
|
|
<if test="demand!=null">and demand=#{demand}</if>
|
|
<if test="decorationRequirements!=null">and decorationRequirements=#{decorationRequirements}</if>
|
|
<if test="decorationRequirements!=null">and decorationRequirements=#{decorationRequirements}</if>
|
|
@@ -96,10 +130,10 @@
|
|
<if test="p.organizationId!=0">and organizationId=#{p.organizationId}</if>
|
|
<if test="p.organizationId!=0">and organizationId=#{p.organizationId}</if>
|
|
<if test="p.userId!=0">and userId=#{p.userId}</if>
|
|
<if test="p.userId!=0">and userId=#{p.userId}</if>
|
|
<if test="p.name!=null">and name=#{p.name}</if>
|
|
<if test="p.name!=null">and name=#{p.name}</if>
|
|
- <if test="p.type!=0">and type=#{p.type}</if>
|
|
|
|
|
|
+ <if test="p.type!=null">and type=#{p.type}</if>
|
|
<if test="p.person!=null">and person=#{p.person}</if>
|
|
<if test="p.person!=null">and person=#{p.person}</if>
|
|
<if test="p.weChatAccount!=null">and weChatAccount=#{p.weChatAccount}</if>
|
|
<if test="p.weChatAccount!=null">and weChatAccount=#{p.weChatAccount}</if>
|
|
- <if test="p.followUpState!=0">and followUpState=#{p.followUpState}</if>
|
|
|
|
|
|
+ <if test="p.followUpState!=null">and followUpState=#{p.followUpState}</if>
|
|
<if test="p.job!=null">and job=#{p.job}</if>
|
|
<if test="p.job!=null">and job=#{p.job}</if>
|
|
<if test="p.demand!=null">and demand=#{p.demand}</if>
|
|
<if test="p.demand!=null">and demand=#{p.demand}</if>
|
|
<if test="p.decorationRequirements!=null">and decorationRequirements=#{p.decorationRequirements}</if>
|
|
<if test="p.decorationRequirements!=null">and decorationRequirements=#{p.decorationRequirements}</if>
|