|
|
@@ -1199,23 +1199,36 @@ order by
|
|
|
where ui.from_uid=#{uid,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
<select id="appMyInterestedExpertList" resultType="com.goafanti.user.bo.MyInterestedBo">
|
|
|
- select t.id ,t.uid,u.identify_name as name,t.work_unit as workUnit,u.introduction,
|
|
|
+ select t.uid as id,u.nickname as name,t.work_unit as workUnit,u.introduction,
|
|
|
t.professional_title as professionalTitle,u.head_portrait_url as imgUrl,
|
|
|
if(isnull(a.count),0,a.count) as interestCount
|
|
|
- from user_identity t left JOIN `user` u on t.uid = u.id
|
|
|
- left join user_interest ui on ui.to_uid=u.id
|
|
|
+ from user_interest ui left JOIN `user` u on ui.to_uid = u.id
|
|
|
+ left join user_identity t on ui.to_uid=t.uid
|
|
|
left join (select to_uid,count(*) as count from user_interest
|
|
|
- order by to_uid) a on ui.to_uid=u.id
|
|
|
- where t.expert=1 and ui.from_uid=#{uid,jdbcType=VARCHAR}
|
|
|
+ GROUP by to_uid)a on ui.to_uid=a.to_uid
|
|
|
+ where 1=1
|
|
|
+ <if test="type==0">
|
|
|
+ and t.expert=1
|
|
|
+ </if>
|
|
|
+ <if test="type==1">
|
|
|
+ and t.expert=2
|
|
|
+ </if>
|
|
|
+ and ui.from_uid=#{uid,jdbcType=VARCHAR}
|
|
|
<if test="page_sql!=null">
|
|
|
${page_sql}
|
|
|
</if>
|
|
|
</select>
|
|
|
<select id="appMyInterestedExpertCount" resultType="java.lang.Integer">
|
|
|
- select count(0)
|
|
|
- from user_identity t left JOIN user u on t.uid = u.id
|
|
|
- left join user_interest ui on ui.to_uid=u.id
|
|
|
- where t.expert=1 and ui.from_uid=#{uid,jdbcType=VARCHAR}
|
|
|
+ select count(*)from user_interest ui
|
|
|
+ left join user_identity t on ui.to_uid=t.uid
|
|
|
+ where 1=1
|
|
|
+ <if test="type==0">
|
|
|
+ and t.expert=1
|
|
|
+ </if>
|
|
|
+ <if test="type==1">
|
|
|
+ and t.expert=2
|
|
|
+ </if>
|
|
|
+ and ui.from_uid=#{uid,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
<select id="selectCustomerAuditList" resultType="com.goafanti.app.bo.ExpertsListBo">
|
|
|
select u.id as uid, u.nickname as username, u.head_portrait_url as personPortraitUrl,
|
|
|
@@ -1233,10 +1246,10 @@ from
|
|
|
a.order_no = b.order_no group by b.seller_id
|
|
|
) x on u.id = x.uid
|
|
|
left join( select count(*) as count, to_uid from user_interest group by to_uid) a
|
|
|
- on u.id = a.to_uid left join( select to_uid from user_interest where from_uid =#{uid,jdbcType=VARCHAR} ) b
|
|
|
+ on u.id = a.to_uid left join( select to_uid from user_interest where from_uid =#{uid,jdbcType=VARCHAR} GROUP by to_uid) b
|
|
|
on u.id = b.to_uid
|
|
|
- where u.status = 0 and u.source = 1
|
|
|
- and ui.expert = 1 and ui.expert_audit=2
|
|
|
+ where u.status = 0 and u.source = 0
|
|
|
+ and ui.expert = 1 and ui.audit_status = 2
|
|
|
<if test="industry != null">
|
|
|
and ui.industry= #{industry,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
@@ -1256,7 +1269,7 @@ from
|
|
|
<select id="selectCustomerAuditCount" resultType="java.lang.Integer">
|
|
|
select count(0)from
|
|
|
`user` u left join user_identity ui on ui.uid = u.id
|
|
|
- where u.status = 0 and u.source = 1 and ui.expert = 1 and ui.expert_audit=2
|
|
|
+ where u.status = 0 and u.source = 0 and ui.expert = 1 and ui.audit_status = 2
|
|
|
<if test="industry != null">
|
|
|
and ui.industry= #{industry,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
@@ -1278,7 +1291,7 @@ select a.id as uid,a.nickname as username,a.head_portrait_url as personPortraitU
|
|
|
left join jt_consult_order b on a.order_no=b.order_no
|
|
|
group by b.seller_id)x on a.id=x.uid
|
|
|
left join (select count(*) as count,to_uid from user_interest group by to_uid)c on a.id=c.to_uid
|
|
|
-left join (select to_uid from user_interest where from_uid='1')d on a.id=d.to_uid
|
|
|
+left join (select to_uid from user_interest where from_uid= #{uid,jdbcType=VARCHAR} group by to_uid)d on a.id=d.to_uid
|
|
|
where a.id=#{id,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
<select id="appConsultantList" resultType="com.goafanti.app.bo.ExpertsListBo">
|
|
|
@@ -1300,7 +1313,7 @@ from
|
|
|
on u.id = a.to_uid left join( select to_uid from user_interest where from_uid ='1' ) b
|
|
|
on u.id = b.to_uid
|
|
|
where u.status = 0 and u.source = 1
|
|
|
- and ui.expert = 2 and ui.expert_audit=2
|
|
|
+ and ui.expert = 2 and ui.audit_status=2
|
|
|
<if test="consultantType != null">
|
|
|
and ui.consultant_type=#{consultantType,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
@@ -1331,7 +1344,7 @@ from
|
|
|
from
|
|
|
`user` u left join user_identity ui on ui.uid = u.id
|
|
|
where u.status = 0 and u.source = 1
|
|
|
- and ui.expert = 2 and ui.expert_audit=2
|
|
|
+ and ui.expert = 2 and ui.audit_status=2
|
|
|
<if test="consultantType != null">
|
|
|
and ui.consultant_type=#{consultantType,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
@@ -1418,6 +1431,19 @@ from
|
|
|
inner join user_identity i on u.id = i.uid
|
|
|
where u.id = #{uid,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
+<select id="expertsCommentByUid" resultType="com.goafanti.comment.bo.CommentDetailResult">
|
|
|
+select a.create_time as createTime,
|
|
|
+ date_format(a.create_time,'%Y-%m-%d') as createTimeFormat,
|
|
|
+ a.commodity_id,
|
|
|
+ a.content,a.star,u.identify_name as commenter
|
|
|
+ from jt_commodity_comment a
|
|
|
+ left join user u on a.uid=u.id
|
|
|
+ left join jt_consult_order b on a.order_no=b.order_no
|
|
|
+ where 1=1
|
|
|
+ and b.seller_id= #{id,jdbcType=VARCHAR}
|
|
|
+ limit 1
|
|
|
+
|
|
|
+</select>
|
|
|
|
|
|
<!-- 更改用户认证(专家/顾问审核状态) -->
|
|
|
<update id="updateAuditing" parameterType="com.goafanti.common.model.UserIdentity">
|
|
|
@@ -1428,4 +1454,4 @@ from
|
|
|
</if>
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
-</mapper>
|
|
|
+</mapper>
|