|
|
@@ -1209,6 +1209,137 @@ order by
|
|
|
left join user_interest ui on ui.to_uid=u.id
|
|
|
where t.expert=1 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,
|
|
|
+ u.introduction, ui.industry, ui.work_unit as workUnit, ui.professional_title as professionalTitle,
|
|
|
+ ifnull( a.count, 0 ) as countInterest, if( isnull(b.to_uid), 0, 1 ) as interested,ui.expert,
|
|
|
+ ifnull( x.a, 0 ) as favorable, ifnull( x.b, 0 ) as general, ifnull( x.c, 0 ) as inferior,
|
|
|
+ ifnull( x.d, 0 ) as commentCount, ifnull( cast(x.a*100 / x.d as decimal(18, 2)), 100 ) as favorableRate
|
|
|
+from
|
|
|
+ `user` u left join user_identity ui on ui.uid = u.id
|
|
|
+ left join( select
|
|
|
+ b.seller_id as uid, sum( case when a.star > 3 then 1 else 0 end ) as a,
|
|
|
+ sum( case when a.star = 3 then 1 else 0 end ) as b,
|
|
|
+ sum( case when a.star < 3 then 1 else 0 end ) as c, count(*) as d
|
|
|
+ from jt_commodity_comment a left join jt_consult_order b on
|
|
|
+ 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 = b.to_uid
|
|
|
+ where u.status = 0 and u.source = 1
|
|
|
+ and ui.expert = 1 and ui.expert_audit=2
|
|
|
+ <if test="industry != null">
|
|
|
+ and ui.industry= #{industry,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="name != null">
|
|
|
+ and u.nickname like CONCAT('%', #{name,jdbcType=VARCHAR}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="sortType == 0">
|
|
|
+ order by u.create_time desc
|
|
|
+ </if>
|
|
|
+ <if test="sortType == 1">
|
|
|
+ order by favorableRate desc
|
|
|
+ </if>
|
|
|
+ <if test="page_sql!=null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+</select>
|
|
|
+ <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
|
|
|
+ <if test="industry != null">
|
|
|
+ and ui.industry= #{industry,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="name != null">
|
|
|
+ and u.nickname like CONCAT('%', #{name,jdbcType=VARCHAR}, '%')
|
|
|
+ </if>
|
|
|
+</select>
|
|
|
+<select id="selectAppExpertsDetail" resultType="com.goafanti.app.bo.ExpertsListBo">
|
|
|
+select a.id as uid,a.nickname as username,a.head_portrait_url as personPortraitUrl,b.consultant_type as consultantType,
|
|
|
+ b.industry,b.work_unit as workUnit,b.professional_title as professionalTitle,a.introduction,
|
|
|
+ ifnull(c.count,0) as countInterest,b.expert,ifnull(x.a,0) as favorable,ifnull(x.b,0) as general,
|
|
|
+ ifnull(x.c,0) as inferior,ifnull(x.d,0) as commentCount,ifnull( cast(x.a*100 / x.d as decimal(18, 2)), 100 ) as favorableRate,
|
|
|
+ if(isnull(d.to_uid),0,1) as interested
|
|
|
+ from `user` a left join user_identity b on a.id=b.uid left join (select b.seller_id as uid,
|
|
|
+ sum(case when a.star > 3 then 1 else 0 end) as a,
|
|
|
+ sum(case when a.star=3 then 1 else 0 end) as b,
|
|
|
+ sum(case when a.star < 3 then 1 else 0 end) as c,count(*) as d
|
|
|
+ from jt_commodity_comment a
|
|
|
+ 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
|
|
|
+where a.id=#{id,jdbcType=VARCHAR}
|
|
|
+</select>
|
|
|
+<select id="appConsultantList" resultType="com.goafanti.app.bo.ExpertsListBo">
|
|
|
+ select u.id as uid, u.nickname as username, u.head_portrait_url as personPortraitUrl,ui.consultant_type as consultantType,
|
|
|
+ u.introduction, ui.industry, ui.work_unit as workUnit, ui.professional_title as professionalTitle,
|
|
|
+ ifnull( a.count, 0 ) as countInterest, if( isnull(b.to_uid), 0, 1 ) as interested,ui.expert,
|
|
|
+ ifnull( x.a, 0 ) as favorable, ifnull( x.b, 0 ) as general, ifnull( x.c, 0 ) as inferior,
|
|
|
+ ifnull( x.d, 0 ) as commentCount, ifnull( cast(x.a*100 / x.d as decimal(18, 2)), 100 ) as favorableRate
|
|
|
+from
|
|
|
+ `user` u left join user_identity ui on ui.uid = u.id
|
|
|
+ left join(select b.seller_id as uid,
|
|
|
+ sum(case when a.star > 3 then 1 else 0 end) as a,
|
|
|
+ sum(case when a.star=3 then 1 else 0 end) as b,
|
|
|
+ sum(case when a.star < 3 then 1 else 0 end) as c,count(*) as d
|
|
|
+ from jt_commodity_comment a
|
|
|
+ left join jt_consult_order b on 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 ='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
|
|
|
+ <if test="consultantType != null">
|
|
|
+ and ui.consultant_type=#{consultantType,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="province != null">
|
|
|
+ and ui.province= #{consultantType,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="city != null">
|
|
|
+ and ui.city=#{consultantType,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="area != null">
|
|
|
+ and ui.area=#{consultantType,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="name != null">
|
|
|
+ and u.nickname like CONCAT('%', #{name,jdbcType=VARCHAR}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="sortType == 0">
|
|
|
+ order by u.create_time desc
|
|
|
+ </if>
|
|
|
+ <if test="sortType == 1">
|
|
|
+ order by favorableRate desc
|
|
|
+ </if>
|
|
|
+ <if test="page_sql!=null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+</select>
|
|
|
+<select id="appConsultantCount" resultType="java.lang.Integer">
|
|
|
+ select count(*)
|
|
|
+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
|
|
|
+ <if test="consultantType != null">
|
|
|
+ and ui.consultant_type=#{consultantType,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="province != null">
|
|
|
+ and ui.province= #{consultantType,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="city != null">
|
|
|
+ and ui.city=#{consultantType,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="area != null">
|
|
|
+ and ui.area=#{consultantType,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="name != null">
|
|
|
+ and u.nickname like CONCAT('%', #{name,jdbcType=VARCHAR}, '%')
|
|
|
+ </if>
|
|
|
+</select>
|
|
|
|
|
|
<!-- 获得专家顾问审核列表数据 -->
|
|
|
<select id="getExpertAuditList" resultMap="BaseResultMap">
|