|
|
@@ -118,7 +118,7 @@
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
-->
|
|
|
- select
|
|
|
+ select
|
|
|
<include refid="Base_Column_List" />
|
|
|
from user_lock_release
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
|
@@ -149,12 +149,12 @@
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
-->
|
|
|
- insert into user_lock_release (id, type, uid,
|
|
|
- aid, business_project_id, status,
|
|
|
+ insert into user_lock_release (id, type, uid,
|
|
|
+ aid, business_project_id, status,
|
|
|
lock_time, release_time, order_no
|
|
|
)
|
|
|
- values (#{id,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR},
|
|
|
- #{aid,jdbcType=VARCHAR}, #{businessProjectId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
|
|
|
+ values (#{id,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR},
|
|
|
+ #{aid,jdbcType=VARCHAR}, #{businessProjectId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
|
|
|
#{lockTime,jdbcType=DATE}, #{releaseTime,jdbcType=DATE}, #{orderNo,jdbcType=VARCHAR}
|
|
|
)
|
|
|
</insert>
|
|
|
@@ -353,21 +353,21 @@
|
|
|
<update id="updateUserLock">
|
|
|
update user_lock_release set status = #{newStatus} where uid = #{uid} and aid = #{aid} and type = 0 and status = #{oldStatus}
|
|
|
</update>
|
|
|
-
|
|
|
+
|
|
|
<update id="updateUsersLock">
|
|
|
- update user_lock_release set status = #{newStatus}
|
|
|
+ update user_lock_release set status = #{newStatus}
|
|
|
where aid = #{aid} and type = 0 and status = #{oldStatus}
|
|
|
and uid in
|
|
|
<foreach item="item" collection="uList" separator="," open="(" close=")" index="">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</update>
|
|
|
-
|
|
|
+
|
|
|
<update id="updateUserTypeLock">
|
|
|
update user_lock_release set status = #{newStatus} , release_time= #{date}
|
|
|
where uid = #{uid} and aid = #{aid} and type = 0 and type = #{type}
|
|
|
</update>
|
|
|
-
|
|
|
+
|
|
|
<update id="updateUserTypeLockList">
|
|
|
update user_lock_release set status = #{newStatus} , release_time= #{date}
|
|
|
where aid = #{aid} and type = 0 and type = #{type} and uid in
|
|
|
@@ -375,16 +375,16 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</update>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectWaitReleaseCustomer" resultType="com.goafanti.customer.bo.LockingReleaseBo">
|
|
|
- select
|
|
|
- t0.id, t0.uid, t0.aid, t0.lock_time lockTime,
|
|
|
+ select
|
|
|
+ t0.id, t0.uid, t0.aid, t0.lock_time lockTime,u.new_channel newChannel,
|
|
|
t1.last_follow_time lastFollowTime,u.nickname userName
|
|
|
from
|
|
|
(select id,uid,aid,lock_time from user_lock_release where aid = #{aid} and type = 0 and status = 0)t0
|
|
|
- left join
|
|
|
+ left join
|
|
|
(select uid,aid,max(create_time) as last_follow_time from user_follow where aid = #{aid} group by uid)t1
|
|
|
- on t0.uid = t1.uid
|
|
|
+ on t0.uid = t1.uid
|
|
|
left join user u on t0.uid=u.id
|
|
|
where u.channel=0
|
|
|
<if test="type==0">
|
|
|
@@ -394,7 +394,7 @@
|
|
|
and datediff(now(),t0.lock_time)>270
|
|
|
</if>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectWaitReleaseBusiness" resultType="com.goafanti.customer.bo.LockingReleaseBo">
|
|
|
select
|
|
|
t0.id,
|
|
|
@@ -404,21 +404,21 @@
|
|
|
t1.last_follow_time
|
|
|
from
|
|
|
(select id,uid,aid,lock_time from user_lock_release t0 where aid = #{aid} and type = 1 and status = 0)t0
|
|
|
- left join
|
|
|
+ left join
|
|
|
(select uid,aid,max(create_time) as last_follow_time from user_follow where aid = #{aid} group by uid)t1
|
|
|
- on t0.uid = t1.uid
|
|
|
+ on t0.uid = t1.uid
|
|
|
where datediff(t1.last_follow_time,lock_time)>360 or datediff(now(),t0.lock_time)>900
|
|
|
</select>
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
<update id="updatePendingReleaseLock" parameterType="java.lang.String">
|
|
|
update user_lock_release set status = 1 where id in (${lockIds})
|
|
|
</update>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectPendinglockUserList" resultType="com.goafanti.customer.bo.LockingReleaseBo">
|
|
|
select id,uid,type from user_lock_release where status=1
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<update id="updateProject" parameterType="java.lang.String">
|
|
|
update user_lock_release set status = 2,release_time=now()
|
|
|
where uid= #{uid,jdbcType=VARCHAR}
|
|
|
@@ -426,120 +426,120 @@
|
|
|
and business_project_id= #{businessProjectId,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
<select id="checkTask" resultType="com.goafanti.customer.bo.LockingReleaseBo">
|
|
|
- select
|
|
|
- id, type, uid, aid, business_project_id as businessProjectId, status
|
|
|
+ select
|
|
|
+ id, type, uid, aid, business_project_id as businessProjectId, status
|
|
|
from user_lock_release where type =1
|
|
|
and status=0
|
|
|
and uid=#{buyerId,jdbcType=VARCHAR}
|
|
|
and business_project_id=#{commodityId,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
<update id="updatePrivateBusinessTransfer">
|
|
|
- update user_lock_release set aid=#{inputId} where uid= #{uid} and business_project_id= #{pid} and aid= #{aid};
|
|
|
+ update user_lock_release set aid=#{inputId} where uid= #{uid} and business_project_id= #{pid} and aid= #{aid};
|
|
|
</update>
|
|
|
-
|
|
|
+
|
|
|
<select id="checkUserProject" resultType="com.goafanti.customer.bo.LockingReleaseBo">
|
|
|
- select
|
|
|
- id, type, uid, aid, business_project_id as businessProjectId, status
|
|
|
+ select
|
|
|
+ id, type, uid, aid, business_project_id as businessProjectId, status
|
|
|
from user_lock_release where type =1
|
|
|
and status=0
|
|
|
and uid=#{uid,jdbcType=VARCHAR}
|
|
|
and aid=#{aid,jdbcType=VARCHAR}
|
|
|
and business_project_id=#{pid,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectUserDays" resultType="com.goafanti.common.bo.userDaysBo">
|
|
|
- select t0.uid, t0.aid, u.nickname name ,u.channel ,1 type
|
|
|
+ select t0.uid, t0.aid, u.nickname name ,u.channel ,1 type,u.new_channel newChannel
|
|
|
from
|
|
|
(select id,uid,aid,lock_time from user_lock_release where aid = #{aid} and type = 0 and status = 0)t0
|
|
|
- left join
|
|
|
+ left join
|
|
|
(select uid,aid,max(create_time) as last_follow_time from user_follow where aid = #{aid} group by uid)t1
|
|
|
- on t0.uid = t1.uid
|
|
|
+ on t0.uid = t1.uid
|
|
|
left join user u on t0.uid=u.id
|
|
|
where u.channel=0
|
|
|
and datediff(now(),t0.lock_time)> #{x}
|
|
|
- UNION
|
|
|
- select t0.uid, t0.aid, u.nickname name ,u.channel ,0 type
|
|
|
+ UNION
|
|
|
+ select t0.uid, t0.aid, u.nickname name ,u.channel ,0 type,u.new_channel newChannel
|
|
|
from
|
|
|
(select id,uid,aid,lock_time from user_lock_release where aid = #{aid} and type = 0 and status = 0)t0
|
|
|
- left join
|
|
|
+ left join
|
|
|
(select uid,aid,max(create_time) as last_follow_time from user_follow where aid = #{aid} group by uid)t1
|
|
|
- on t0.uid = t1.uid
|
|
|
+ on t0.uid = t1.uid
|
|
|
left join user u on t0.uid=u.id
|
|
|
where u.channel=0
|
|
|
- and datediff(now(),if(t0.lock_time < t1.last_follow_time,t1.last_follow_time,t1.t0.lock_time)) > 15
|
|
|
- UNION
|
|
|
- select t0.uid, t0.aid, u.nickname name ,u.channel ,0 type
|
|
|
+ and datediff(now(),if(t0.lock_time < t1.last_follow_time,t1.last_follow_time,t0.lock_time)) > 15
|
|
|
+ UNION
|
|
|
+ select t0.uid, t0.aid, u.nickname name ,u.channel ,0 type,u.new_channel newChannel
|
|
|
from
|
|
|
(select id,uid,aid,lock_time from user_lock_release where aid = #{aid} and type = 0 and status = 0)t0
|
|
|
- left join
|
|
|
+ left join
|
|
|
(select uid,aid,max(create_time) as last_follow_time from user_follow where aid = #{aid} group by uid)t1
|
|
|
- on t0.uid = t1.uid
|
|
|
+ on t0.uid = t1.uid
|
|
|
left join user u on t0.uid=u.id
|
|
|
where u.channel=1
|
|
|
and datediff(now(),t0.lock_time)> #{y}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectChannelUserDays" resultType="com.goafanti.common.bo.userDaysBo">
|
|
|
- select t0.uid, t0.aid, u.nickname name,c.recovery
|
|
|
+ select t0.uid, t0.aid, u.nickname name,c.recovery
|
|
|
from (select id,uid,aid,lock_time from user_lock_release where type = 0 and status = 0 and aid=#{aid} )t0
|
|
|
left join user u on t0.uid=u.id
|
|
|
left join user_channel c on u.id=c.uid
|
|
|
where u.channel =1 and c.status < 3
|
|
|
and datediff(now(),t0.lock_time) > #{days}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectChannelNotFollow" resultType="com.goafanti.common.bo.userDaysBo">
|
|
|
- select t0.uid, t0.aid, u.nickname name ,u.channel
|
|
|
+ select t0.uid, t0.aid, u.nickname name ,u.channel
|
|
|
from
|
|
|
(select id,uid,aid,lock_time from user_lock_release where aid = #{aid} and type = 0 and status = 0)t0
|
|
|
- left join
|
|
|
+ left join
|
|
|
(select uid,aid,max(create_time) as last_follow_time from user_follow where aid = #{aid} group by uid)t1
|
|
|
- on t0.uid = t1.uid
|
|
|
+ on t0.uid = t1.uid
|
|
|
left join user u on t0.uid=u.id
|
|
|
where 1=1 and u.channel=1
|
|
|
- and datediff(now(),if(t0.lock_time < t1.last_follow_time,t1.last_follow_time,t1.t0.lock_time)) > #{days}
|
|
|
+ and datediff(now(),if(t0.lock_time < t1.last_follow_time,t1.last_follow_time,t0.lock_time)) > #{days}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insertList" >
|
|
|
- insert into user_lock_release (id, type, uid,
|
|
|
- aid, business_project_id, status,
|
|
|
+ insert into user_lock_release (id, type, uid,
|
|
|
+ aid, business_project_id, status,
|
|
|
lock_time, release_time, order_no
|
|
|
)
|
|
|
values
|
|
|
<foreach item="item" collection="list" separator="," index="">
|
|
|
- (#{item.id,jdbcType=VARCHAR}, #{item.type,jdbcType=INTEGER}, #{item.uid,jdbcType=VARCHAR},
|
|
|
- #{item.aid,jdbcType=VARCHAR}, #{item.businessProjectId,jdbcType=VARCHAR}, #{item.status,jdbcType=INTEGER},
|
|
|
+ (#{item.id,jdbcType=VARCHAR}, #{item.type,jdbcType=INTEGER}, #{item.uid,jdbcType=VARCHAR},
|
|
|
+ #{item.aid,jdbcType=VARCHAR}, #{item.businessProjectId,jdbcType=VARCHAR}, #{item.status,jdbcType=INTEGER},
|
|
|
#{item.lockTime,jdbcType=DATE}, #{item.releaseTime,jdbcType=DATE}, #{item.orderNo,jdbcType=VARCHAR})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
-
|
|
|
+
|
|
|
<select id="checkLock" resultType="java.lang.Integer">
|
|
|
- select count(*) from user_lock_release
|
|
|
+ select count(*) from user_lock_release
|
|
|
where aid= #{aid} and uid= #{uid} and business_project_id = #{pid}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<update id="updateReleaseList" >
|
|
|
- update user_lock_release
|
|
|
+ update user_lock_release
|
|
|
set release_time =now(),status =2
|
|
|
- where id in
|
|
|
+ where id in
|
|
|
<foreach item="item" collection="list" separator="," open="(" close=")" index="">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</update>
|
|
|
<select id="selectByUidGetCount" resultType="java.lang.Integer">
|
|
|
- select count(*) from user_lock_release
|
|
|
- where `type` =1 and status=0 and aid = #{aid} and uid= #{uid}
|
|
|
+ select count(*) from user_lock_release
|
|
|
+ where `type` =1 and status=0 and aid = #{aid} and uid= #{uid}
|
|
|
</select>
|
|
|
<update id="updateReleaseUser">
|
|
|
update t_order_new a ,user b ,user_business c
|
|
|
set b.share_type =1,b.transfer_time =now(),b.sign_bills=0,
|
|
|
c.customer_status =6,c.follow_situation =8
|
|
|
- where a.order_no = #{orderNo} and a.buyer_id =b.id
|
|
|
+ where a.order_no = #{orderNo} and a.buyer_id =b.id
|
|
|
and a.buyer_id =c.uid and a.salesman_id =c.aid and c.follow_situation =5
|
|
|
</update>
|
|
|
-
|
|
|
+
|
|
|
<update id="updateByAidAndUid">
|
|
|
- update user_lock_release
|
|
|
+ update user_lock_release
|
|
|
set status =2,release_time =now()
|
|
|
where aid= #{aid} and uid= #{uid} and `type` =0
|
|
|
</update>
|
|
|
@@ -567,4 +567,4 @@ VALUES
|
|
|
</foreach>
|
|
|
)
|
|
|
</update>
|
|
|
-</mapper>
|
|
|
+</mapper>
|