|
|
@@ -59,13 +59,13 @@
|
|
|
create_time, ocb_id, contact_type,
|
|
|
effective, time_stamp, follow_count,
|
|
|
guidance, guidance_time, guidance_aid,
|
|
|
- guidance_name)
|
|
|
+ guidance_name,follow_name,follow_dep)
|
|
|
values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR},
|
|
|
#{paid,jdbcType=VARCHAR}, #{result,jdbcType=VARCHAR}, #{attachmentUrl,jdbcType=VARCHAR},
|
|
|
#{createTime,jdbcType=TIMESTAMP}, #{ocbId,jdbcType=VARCHAR}, #{contactType,jdbcType=INTEGER},
|
|
|
#{effective,jdbcType=INTEGER}, #{timeStamp,jdbcType=TIMESTAMP}, #{followCount,jdbcType=INTEGER},
|
|
|
#{guidance,jdbcType=VARCHAR}, #{guidanceTime,jdbcType=TIMESTAMP}, #{guidanceAid,jdbcType=VARCHAR},
|
|
|
- #{guidanceName,jdbcType=VARCHAR})
|
|
|
+ #{guidanceName,jdbcType=VARCHAR},#{followName},#{followDep})
|
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.goafanti.common.model.UserFollow">
|
|
|
<!--
|
|
|
@@ -268,20 +268,23 @@
|
|
|
|
|
|
|
|
|
<select id="userFollowList" resultType="com.goafanti.user.bo.outUserFollowList">
|
|
|
- select b.nickname,b.share_type shareType ,b.channel,b.id,date_format(b.transfer_time,'%Y-%m-%d %H:%i:%s')startTimes,
|
|
|
- a.contact_type contactType,c.name followName ,d.name followDep,a.`result` ,a.follow_count followCount,
|
|
|
- date_format(a.create_time ,'%Y-%m-%d %H:%i:%s')followTimes,a.guidance_name guidanceName,
|
|
|
- a.guidance ,date_format(a.guidance_time,'%Y-%m-%d %H:%i:%s') guidanceTimes
|
|
|
- from user_follow a left join `user`b on a.uid =b.id left join admin c on a.aid =c.id
|
|
|
- left join department d on c.department_id =d.id where 1=1
|
|
|
+ select b.nickname,b.share_type shareType ,b.channel,b.id,date_format(b.transfer_time,'%Y-%m-%d %H:%i:%s')startTimes,
|
|
|
+ a.contact_type contactType,a.follow_name followName ,a.follow_dep followDep,a.`result` ,a.follow_count followCount,
|
|
|
+ date_format(a.create_time ,'%Y-%m-%d %H:%i:%s')followTimes,a.guidance_name guidanceName, a.guidance ,
|
|
|
+ date_format(a.guidance_time,'%Y-%m-%d %H:%i:%s') guidanceTimes
|
|
|
+ from user_follow a left join `user`b on a.uid =b.id
|
|
|
+ where 1=1
|
|
|
<if test="shiroType == 0">
|
|
|
and a.aid= #{aid}
|
|
|
</if>
|
|
|
<if test="shiroType == 1">
|
|
|
- and (c.superior_id= #{aid} or a.aid= #{aid})
|
|
|
+ and aid in
|
|
|
+ <foreach close=")" collection="aids" item="listItem" open="(" separator=",">
|
|
|
+ #{listItem}
|
|
|
+ </foreach>
|
|
|
</if>
|
|
|
<if test="followName != null">
|
|
|
- and c.name like concat('%',#{followName},'%')
|
|
|
+ and a.follow_name like concat('%',#{followName},'%')
|
|
|
</if>
|
|
|
<if test="userName != null">
|
|
|
and b.nickname like concat('%',#{userName},'%')
|
|
|
@@ -311,7 +314,7 @@
|
|
|
and a.guidance_time between #{guidanceStartTime} and #{guidanceEndTime}
|
|
|
</if>
|
|
|
<if test="depId != null">
|
|
|
- and c.department_id = #{depId}
|
|
|
+ and a.follow_dep = #{depId}
|
|
|
</if>
|
|
|
order by a.create_time desc
|
|
|
<if test="page_sql != null">
|
|
|
@@ -320,20 +323,22 @@
|
|
|
</select>
|
|
|
<select id="userFollowCount" resultType="java.lang.Integer">
|
|
|
select count(*)
|
|
|
- from user_follow a left join `user`b on a.uid =b.id left join admin c on a.aid =c.id
|
|
|
- left join department d on c.department_id =d.id where 1=1
|
|
|
+ from user_follow a left join `user`b on a.uid =b.id where 1=1
|
|
|
<if test="shiroType == 0">
|
|
|
and a.aid= #{aid}
|
|
|
</if>
|
|
|
<if test="shiroType == 1">
|
|
|
- and (c.superior_id= #{aid} or a.aid= #{aid})
|
|
|
+ and aid in
|
|
|
+ <foreach close=")" collection="aids" item="listItem" open="(" separator=",">
|
|
|
+ #{listItem}
|
|
|
+ </foreach>
|
|
|
</if>
|
|
|
<if test="followName != null">
|
|
|
- and c.name like concat('%',#{followName},'%')
|
|
|
+ and a.follow_name like concat('%',#{followName},'%')
|
|
|
</if>
|
|
|
<if test="userName != null">
|
|
|
- and b.nickname like concat('%',#{userName},'%')
|
|
|
- </if>
|
|
|
+ and b.nickname like concat('%',#{userName},'%')
|
|
|
+ </if>
|
|
|
<if test="userType == 1">
|
|
|
and b.share_type =0
|
|
|
</if>
|
|
|
@@ -346,20 +351,20 @@
|
|
|
<if test="userType == 4">
|
|
|
and b.share_type =3
|
|
|
</if>
|
|
|
- <if test="contactType != null">
|
|
|
- and a.contact_type = #{contactType}
|
|
|
- </if>
|
|
|
- <if test="followStartTime !=null and followEndTime !=null">
|
|
|
- and a.create_time between #{followStartTime} and #{followEndTime}
|
|
|
- </if>
|
|
|
- <if test="createStartTime !=null and createEndTime !=null">
|
|
|
- and b.transfer_time between #{createStartTime} and #{createEndTime}
|
|
|
- </if>
|
|
|
- <if test="guidanceStartTime !=null and guidanceEndTime !=null">
|
|
|
- and a.guidance_time between #{guidanceStartTime} and #{guidanceEndTime}
|
|
|
- </if>
|
|
|
- <if test="depId != null">
|
|
|
- and c.department_id = #{depId}
|
|
|
- </if>
|
|
|
+ <if test="contactType != null">
|
|
|
+ and a.contact_type = #{contactType}
|
|
|
+ </if>
|
|
|
+ <if test="followStartTime !=null and followEndTime !=null">
|
|
|
+ and a.create_time between #{followStartTime} and #{followEndTime}
|
|
|
+ </if>
|
|
|
+ <if test="createStartTime !=null and createEndTime !=null">
|
|
|
+ and b.transfer_time between #{createStartTime} and #{createEndTime}
|
|
|
+ </if>
|
|
|
+ <if test="guidanceStartTime !=null and guidanceEndTime !=null">
|
|
|
+ and a.guidance_time between #{guidanceStartTime} and #{guidanceEndTime}
|
|
|
+ </if>
|
|
|
+ <if test="depId != null">
|
|
|
+ and a.follow_dep = #{depId}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
</mapper>
|