|
|
@@ -25,62 +25,46 @@
|
|
|
dg3.name as area,
|
|
|
c.name as industry,
|
|
|
d.name as adminName
|
|
|
- from
|
|
|
- (select
|
|
|
- id,
|
|
|
- aid,
|
|
|
- type,
|
|
|
- status,
|
|
|
- create_time,
|
|
|
- business_audit,
|
|
|
- current_member_status,
|
|
|
- identify_name,
|
|
|
- lvl,
|
|
|
- is_member,
|
|
|
- society_tag,
|
|
|
- share_type
|
|
|
- from user
|
|
|
- where type = 0 and status != 1
|
|
|
+ from user a inner join user_identity b on a.id = b.uid
|
|
|
+ left join district_glossory dg1 on b.province = dg1.id
|
|
|
+ left join district_glossory dg2 on b.city = dg2.id
|
|
|
+ left join district_glossory dg3 on b.area = dg3.id
|
|
|
+ left join industry_category c on b.industry = c.id
|
|
|
+ left join admin d on a.aid = d.id
|
|
|
+ where a.type = 0 and a.status != 1
|
|
|
<if test="aid != null and aid !=''">
|
|
|
- and aid = #{aid,jdbcType=VARCHAR}
|
|
|
+ and a.aid = #{aid,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="name != null and name != ''">
|
|
|
- and identify_name like concat('%',#{name},'%')
|
|
|
+ and a.identify_name like concat('%',#{name},'%')
|
|
|
</if>
|
|
|
<if test="shareType != null">
|
|
|
- and share_type = #{shareType,jdbcType=VARCHAR}
|
|
|
+ and a.share_type = #{shareType,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="status != null">
|
|
|
- and status = #{status,jdbcType=INTEGER}
|
|
|
+ and a.status = #{status,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="businessAudit != null">
|
|
|
- and business_audit = #{businessAudit,jdbcType=INTEGER}
|
|
|
+ and a.business_audit = #{businessAudit,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="isMember != null">
|
|
|
- and is_member = #{isMember,jdbcType=INTEGER}
|
|
|
+ and a.is_member = #{isMember,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="lvl != null">
|
|
|
- and lvl = #{lvl,jdbcType=INTEGER}
|
|
|
+ and a.lvl = #{lvl,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="currentMemberStatus != null">
|
|
|
- and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
|
|
|
+ and a.current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="societyTag != null and societyTag != ''">
|
|
|
- and society_tag = #{societyTag,jdbcType=VARCHAR}
|
|
|
+ and a.society_tag = #{societyTag,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="startDate != null and startDate != ''">
|
|
|
- and create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
|
|
|
+ and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
|
|
|
</if>
|
|
|
<if test="endDate != null and endDate != ''">
|
|
|
- and create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
|
|
|
+ and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
|
|
|
</if>
|
|
|
- )as a inner join user_identity b on a.id = b.uid
|
|
|
- left join district_glossory dg1 on b.province = dg1.id
|
|
|
- left join district_glossory dg2 on b.city = dg2.id
|
|
|
- left join district_glossory dg3 on b.area = dg3.id
|
|
|
- left join industry_category c on b.industry = c.id
|
|
|
- left join admin d on a.aid = d.id
|
|
|
- where 1=1
|
|
|
<if test="province != null">
|
|
|
and b.province = #{province,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
@@ -111,48 +95,42 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
<select id="selectPersonalCustomerCount" resultType="java.lang.Integer">
|
|
|
- select
|
|
|
- count(0)
|
|
|
- from
|
|
|
- (select
|
|
|
- id
|
|
|
- from user
|
|
|
- where type = 0 and status != 1
|
|
|
+ select count(0)
|
|
|
+ from user a inner join user_identity b on a.id = b.uid
|
|
|
+ where a.type = 0 and a.status != 1
|
|
|
<if test="aid != null and aid !=''">
|
|
|
- and aid = #{aid,jdbcType=VARCHAR}
|
|
|
+ and a.aid = #{aid,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="name != null and name != ''">
|
|
|
- and identify_name like concat('%',#{name},'%')
|
|
|
+ and a.identify_name like concat('%',#{name},'%')
|
|
|
</if>
|
|
|
<if test="shareType != null">
|
|
|
- and share_type = #{shareType,jdbcType=VARCHAR}
|
|
|
+ and a.share_type = #{shareType,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="status != null">
|
|
|
- and status = #{status,jdbcType=INTEGER}
|
|
|
+ and a.status = #{status,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="businessAudit != null">
|
|
|
- and business_audit = #{businessAudit,jdbcType=INTEGER}
|
|
|
+ and a.business_audit = #{businessAudit,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="isMember != null">
|
|
|
- and is_member = #{isMember,jdbcType=INTEGER}
|
|
|
+ and a.is_member = #{isMember,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="lvl != null">
|
|
|
- and lvl = #{lvl,jdbcType=INTEGER}
|
|
|
+ and a.lvl = #{lvl,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="currentMemberStatus != null">
|
|
|
- and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
|
|
|
+ and a.current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="societyTag != null and societyTag != ''">
|
|
|
- and society_tag = #{societyTag,jdbcType=VARCHAR}
|
|
|
+ and a.society_tag = #{societyTag,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="startDate != null and startDate != ''">
|
|
|
- and create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
|
|
|
+ and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
|
|
|
</if>
|
|
|
<if test="endDate != null and endDate != ''">
|
|
|
- and create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
|
|
|
+ and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
|
|
|
</if>
|
|
|
- )as a inner join user_identity b on a.id = b.uid
|
|
|
- where 1=1
|
|
|
<if test="province != null">
|
|
|
and b.province = #{province,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
@@ -201,62 +179,47 @@
|
|
|
dg2.name as city,
|
|
|
dg3.name as area,
|
|
|
c.name as industry,
|
|
|
- d.name as adminName
|
|
|
- from
|
|
|
- (select
|
|
|
- id,
|
|
|
- aid,
|
|
|
- type,
|
|
|
- status,
|
|
|
- create_time,
|
|
|
- business_audit,
|
|
|
- current_member_status,
|
|
|
- identify_name,lvl,
|
|
|
- is_member,
|
|
|
- society_tag,
|
|
|
- share_type
|
|
|
- from user
|
|
|
- where type = 1 and status != 1
|
|
|
+ d.name as adminName
|
|
|
+ from user a inner join organization_identity b on a.id = b.uid
|
|
|
+ left join district_glossory dg1 on b.location_province = dg1.id
|
|
|
+ left join district_glossory dg2 on b.location_city = dg2.id
|
|
|
+ left join district_glossory dg3 on b.location_area = dg3.id
|
|
|
+ left join industry_category c on b.industry = c.id
|
|
|
+ left join admin d on a.aid = d.id
|
|
|
+ where a.type = 1 and a.status != 1
|
|
|
<if test="aid != null and aid !=''">
|
|
|
- and aid = #{aid,jdbcType=VARCHAR}
|
|
|
+ and a.aid = #{aid,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="name != null and name != ''">
|
|
|
- and identify_name like concat('%',#{name},'%')
|
|
|
+ and a.identify_name like concat('%',#{name},'%')
|
|
|
</if>
|
|
|
<if test="shareType != null">
|
|
|
- and share_type = #{shareType,jdbcType=VARCHAR}
|
|
|
+ and a.share_type = #{shareType,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="status != null">
|
|
|
- and status = #{status,jdbcType=INTEGER}
|
|
|
+ and a.status = #{status,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="businessAudit != null">
|
|
|
- and business_audit = #{businessAudit,jdbcType=INTEGER}
|
|
|
+ and a.business_audit = #{businessAudit,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="isMember != null">
|
|
|
- and is_member = #{isMember,jdbcType=INTEGER}
|
|
|
+ and a.is_member = #{isMember,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="currentMemberStatus != null">
|
|
|
- and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
|
|
|
+ and a.current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="lvl != null">
|
|
|
- and lvl = #{lvl,jdbcType=INTEGER}
|
|
|
+ and a.lvl = #{lvl,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="societyTag != null and societyTag != ''">
|
|
|
- and society_tag = #{societyTag,jdbcType=VARCHAR}
|
|
|
+ and a.society_tag = #{societyTag,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="startDate != null and startDate != ''">
|
|
|
- and create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
|
|
|
+ and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
|
|
|
</if>
|
|
|
<if test="endDate != null and endDate != ''">
|
|
|
- and create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
|
|
|
+ and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
|
|
|
</if>
|
|
|
- )as a inner join organization_identity b on a.id = b.uid
|
|
|
- left join district_glossory dg1 on b.location_province = dg1.id
|
|
|
- left join district_glossory dg2 on b.location_city = dg2.id
|
|
|
- left join district_glossory dg3 on b.location_area = dg3.id
|
|
|
- left join industry_category c on b.industry = c.id
|
|
|
- left join admin d on a.aid = d.id
|
|
|
- where 1=1
|
|
|
<if test="province != null">
|
|
|
and b.location_province = #{province,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
@@ -287,45 +250,40 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
<select id="selectOrganizationCustomerCount" resultType="java.lang.Integer">
|
|
|
- select
|
|
|
- count(0)
|
|
|
- from
|
|
|
- (select
|
|
|
- id
|
|
|
- from user
|
|
|
- where type = 1 and status != 1
|
|
|
+ select
|
|
|
+ count(0)
|
|
|
+ from user a inner join organization_identity b on a.id = b.uid
|
|
|
+ where a.type = 1 and a.status != 1
|
|
|
<if test="aid != null and aid !=''">
|
|
|
- and aid = #{aid,jdbcType=VARCHAR}
|
|
|
+ and a.aid = #{aid,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="name != null and name != ''">
|
|
|
- and identify_name like concat('%',#{name},'%')
|
|
|
+ and a.identify_name like concat('%',#{name},'%')
|
|
|
</if>
|
|
|
<if test="shareType != null">
|
|
|
- and share_type = #{shareType,jdbcType=VARCHAR}
|
|
|
+ and a.share_type = #{shareType,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="status != null">
|
|
|
- and status = #{status,jdbcType=INTEGER}
|
|
|
+ and a.status = #{status,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="businessAudit != null">
|
|
|
- and business_audit = #{businessAudit,jdbcType=INTEGER}
|
|
|
+ and a.business_audit = #{businessAudit,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="currentMemberStatus != null">
|
|
|
- and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
|
|
|
+ and a.current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="isMember != null">
|
|
|
- and is_member = #{isMember,jdbcType=INTEGER}
|
|
|
+ and a.is_member = #{isMember,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="societyTag != null and societyTag != ''">
|
|
|
- and society_tag = #{societyTag,jdbcType=VARCHAR}
|
|
|
+ and a.society_tag = #{societyTag,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="startDate != null and startDate != ''">
|
|
|
- and create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
|
|
|
+ and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
|
|
|
</if>
|
|
|
<if test="endDate != null and endDate != ''">
|
|
|
- and create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
|
|
|
+ and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
|
|
|
</if>
|
|
|
- )as a inner join organization_identity b on a.id = b.uid
|
|
|
- where 1=1
|
|
|
<if test="province != null">
|
|
|
and b.location_province = #{province,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
@@ -395,18 +353,9 @@
|
|
|
b.investment,
|
|
|
b.audit_status as auditStatus
|
|
|
from
|
|
|
- (select
|
|
|
- id,
|
|
|
- identify_name,
|
|
|
- society_tag,
|
|
|
- company_logo_url,
|
|
|
- introduction,
|
|
|
- business_audit
|
|
|
- from
|
|
|
- user
|
|
|
+ user a inner join organization_identity b on a.id = b.uid
|
|
|
where
|
|
|
- id = #{uid,jdbcType=VARCHAR}
|
|
|
- )as a inner join organization_identity b on a.id = b.uid
|
|
|
+ a.id = #{uid,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
|
|
|
<select id="findPersonalCustomerDetail" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerPersonalDetailBo">
|
|
|
@@ -449,20 +398,10 @@
|
|
|
b.consultant,
|
|
|
b.consultation_price as consultationPrice
|
|
|
from
|
|
|
- (
|
|
|
- select
|
|
|
- id,
|
|
|
- identify_name,
|
|
|
- society_tag,
|
|
|
- head_portrait_url,
|
|
|
- introduction,
|
|
|
- business_audit
|
|
|
- from
|
|
|
- user
|
|
|
- where
|
|
|
- id = #{uid,jdbcType=VARCHAR}
|
|
|
- ) as a inner join user_identity b on
|
|
|
+ user a inner join user_identity b on
|
|
|
a.id = b.uid
|
|
|
+ where
|
|
|
+ a.id = #{uid,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectFollowHistoryList" resultType="com.goafanti.customer.bo.FollowListBo">
|