|
|
@@ -56,6 +56,8 @@
|
|
|
<result column="head_portrait_url" jdbcType="VARCHAR" property="headPortraitUrl" />
|
|
|
<result column="typical_case" jdbcType="VARCHAR" property="typicalCase" />
|
|
|
<result column="consultant_certificate_url" jdbcType="VARCHAR" property="consultantCertificateUrl" />
|
|
|
+ <result column="good_at_industry" jdbcType="VARCHAR" property="goodAtIndustry" />
|
|
|
+ <result column="honer" jdbcType="VARCHAR" property="honer" />
|
|
|
</resultMap>
|
|
|
<sql id="Example_Where_Clause">
|
|
|
<!--
|
|
|
@@ -136,7 +138,8 @@
|
|
|
amount_money, audit_status, process, wrong_count, payment_date, expert,
|
|
|
international, fixed_tel, qq, postal_address, postcode, review_instructions, industry,
|
|
|
contacts, email, professional_title, work_unit, education, major_category, qualification,
|
|
|
- graduate_school, consultation_price , consultant_type, typical_case, consultant_certificate_url
|
|
|
+ graduate_school, consultation_price , consultant_type, typical_case, consultant_certificate_url,
|
|
|
+ good_at_industry
|
|
|
</sql>
|
|
|
<select id="selectByExample" parameterType="com.goafanti.common.model.UserIdentityExample" resultMap="BaseResultMap">
|
|
|
<!--
|
|
|
@@ -208,7 +211,8 @@
|
|
|
work_unit, education, major_category,
|
|
|
qualification, graduate_school,
|
|
|
consultation_price,consultant_type,
|
|
|
- typical_case, consultant_certificate_url)
|
|
|
+ typical_case, consultant_certificate_url,
|
|
|
+ good_at_industry)
|
|
|
values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR},
|
|
|
#{sex,jdbcType=VARCHAR}, #{dateOfBirthYear,jdbcType=VARCHAR}, #{dateOfBirthMonth,jdbcType=VARCHAR},
|
|
|
#{idNumber,jdbcType=VARCHAR}, #{positiveIdUrl,jdbcType=VARCHAR}, #{oppositeIdUrl,jdbcType=VARCHAR},
|
|
|
@@ -223,7 +227,8 @@
|
|
|
#{workUnit,jdbcType=VARCHAR}, #{education,jdbcType=VARCHAR}, #{majorCategory,jdbcType=VARCHAR},
|
|
|
#{qualification,jdbcType=VARCHAR}, #{graduateSchool,jdbcType=VARCHAR},
|
|
|
#{consultationPrice,jdbcType=DECIMAL},#{consultantType,jdbcType=VARCHAR},
|
|
|
- #{typicalCase,jdbcType=VARCHAR}, #{consultantCertificateUrl,jdbcType=VARCHAR}
|
|
|
+ #{typicalCase,jdbcType=VARCHAR}, #{consultantCertificateUrl,jdbcType=VARCHAR},
|
|
|
+ #{goodAtIndustry,jdbcType=VARCHAR}
|
|
|
)
|
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.goafanti.common.model.UserIdentity">
|
|
|
@@ -354,6 +359,9 @@
|
|
|
<if test="consultantCertificateUrl != null">
|
|
|
consultant_certificate_url,
|
|
|
</if>
|
|
|
+ <if test="goodAtIndustry != null">
|
|
|
+ good_at_industry,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="id != null">
|
|
|
@@ -476,6 +484,9 @@
|
|
|
<if test="consultantCertificateUrl != null">
|
|
|
#{consultantCertificateUrl,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="goodAtIndustry != null">
|
|
|
+ #{goodAtIndustry,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<select id="countByExample" parameterType="com.goafanti.common.model.UserIdentityExample" resultType="java.lang.Long">
|
|
|
@@ -617,6 +628,9 @@
|
|
|
<if test="record.consultantCertificateUrl != null">
|
|
|
consultant_certificate_url = #{record.consultantCertificateUrl,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="record.goodAtIndustry != null">
|
|
|
+ good_at_industry = #{record.goodAtIndustry,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
<if test="_parameter != null">
|
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
|
@@ -668,6 +682,7 @@
|
|
|
graduate_school = #{record.graduateSchool,jdbcType=VARCHAR},
|
|
|
typical_case = #{record.typicalCase,jdbcType=VARCHAR},
|
|
|
consultant_certificate_url = #{record.consultantCertificateUrl,jdbcType=VARCHAR},
|
|
|
+ good_at_industry = #{record.goodAtIndustry,jdbcType=VARCHAR},
|
|
|
consultation_price = #{record.consultationPrice,jdbcType=DECIMAL}
|
|
|
<if test="_parameter != null">
|
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
|
@@ -804,6 +819,9 @@
|
|
|
<if test="consultantCertificateUrl != null">
|
|
|
consultant_certificate_url = #{consultantCertificateUrl,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="goodAtIndustry != null">
|
|
|
+ good_at_industry = #{goodAtIndustry,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
@@ -850,8 +868,9 @@
|
|
|
major_category = #{majorCategory,jdbcType=VARCHAR},
|
|
|
qualification = #{qualification,jdbcType=VARCHAR},
|
|
|
graduate_school = #{graduateSchool,jdbcType=VARCHAR},
|
|
|
- typical_case = #{typical_case,jdbcType=VARCHAR},
|
|
|
- consultant_certificate_url = #{consultant_certificate_url,jdbcType=VARCHAR},
|
|
|
+ typical_case = #{typicalCase,jdbcType=VARCHAR},
|
|
|
+ consultant_certificate_url = #{consultantCertificateUrl,jdbcType=VARCHAR},
|
|
|
+ good_at_industry = #{goodAtIndustry,jdbcType=VARCHAR},
|
|
|
consultation_price = #{consultationPrice,jdbcType=DECIMAL}
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
@@ -899,7 +918,9 @@
|
|
|
b.consultant_type as consultantType,
|
|
|
b.audit_info as auditInfo,
|
|
|
b.typical_case as typicalCase,
|
|
|
- b.consultant_certificate_url as consultantCertificateUrl
|
|
|
+ b.consultant_certificate_url as consultantCertificateUrl,
|
|
|
+ b.good_at_industry as goodAtIndustry,
|
|
|
+ b.professional_title as honer
|
|
|
from
|
|
|
user a left join user_identity b on
|
|
|
a.id = b.uid
|
|
|
@@ -1326,7 +1347,7 @@ select a.id as uid,a.nickname as username,a.head_portrait_url as personPortraitU
|
|
|
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, b.typical_case as typicalCase
|
|
|
+ if(isnull(d.to_uid),0,1) as interested, b.typical_case as typicalCase, b.good_at_industry as goodAtIndustry
|
|
|
from `user` a left join user_identity b on a.id=b.uid left join (select a.commodity_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,
|
|
|
@@ -1344,7 +1365,7 @@ where a.id=#{id,jdbcType=VARCHAR}
|
|
|
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
|
|
|
- ,ui.typical_case as typicalCase
|
|
|
+ ,ui.typical_case as typicalCase, ui.good_at_industry as goodAtIndustry
|
|
|
from
|
|
|
`user` u left join user_identity ui on ui.uid = u.id
|
|
|
left join(select a.commodity_id as uid,
|
|
|
@@ -1484,7 +1505,8 @@ from
|
|
|
i.expert, i.audit_status, i.positive_id_url, i.opposite_id_url, u.head_portrait_url,
|
|
|
i.education, i.major_category, i.consultant_type, i.graduate_school, i.work_unit,
|
|
|
i.qualification, i.professional_title, i.process, i.id, i.uid, i.audit_info,
|
|
|
- i.typical_case, i.consultant_certificate_url, i.work_unit as work_unit1
|
|
|
+ i.typical_case, i.consultant_certificate_url, i.work_unit as work_unit1,
|
|
|
+ i.good_at_industry as goodAtIndustry, i.professional_title as honer
|
|
|
from `user` u
|
|
|
inner join user_identity i on u.id = i.uid
|
|
|
where u.id = #{uid,jdbcType=VARCHAR}
|
|
|
@@ -1516,8 +1538,35 @@ select a.create_time as createTime,
|
|
|
|
|
|
|
|
|
<select id="selectByIdentityId" resultType="com.goafanti.app.bo.ExpertsListBo">
|
|
|
- select a.id,a.uid as uid,b.nickname as username,b.society_tag as keyword,a.expert,b.introduction from user_identity a
|
|
|
+ select a.id,a.uid as uid,b.nickname as username,b.society_tag as keyword,a.expert,b.introduction,a.consultant_type as consultantType from user_identity a
|
|
|
left join user b on a.uid=b.id
|
|
|
where a.id=#{id,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
+
|
|
|
+<!-- 获得指定数量法律顾问随机数据 -->
|
|
|
+<select id="getRandAdviserByType" 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,
|
|
|
+ ui.work_unit as workUnit, ui.professional_title as professionalTitle,
|
|
|
+ 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 a.commodity_id as uid,
|
|
|
+ sum(case when a.star > 3 then 1 else 0 end) as a,
|
|
|
+ count(*) as d
|
|
|
+ from jt_commodity_comment a
|
|
|
+ left join jt_consult_order b on a.order_no=b.order_no
|
|
|
+ group by a.commodity_id)x on u.id=x.uid
|
|
|
+ where u.status = 0 and u.source = 0
|
|
|
+ and ui.expert = 2 and ui.audit_status=2
|
|
|
+ <if test="id != null">
|
|
|
+ and u.id <> #{id,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="consultantType != null">
|
|
|
+ and ui.consultant_type = #{consultantType,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ ORDER BY RAND()
|
|
|
+ <if test="size">
|
|
|
+ LIMIT #{size,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+</select>
|
|
|
</mapper>
|