|
|
@@ -1,447 +1,257 @@
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.goafanti.common.dao.UserMapper">
|
|
|
- <select id="selectCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
|
|
|
- <choose>
|
|
|
- <when test="type == 0">
|
|
|
- select
|
|
|
- a.id as uid,a.type,a.status, date_format(a.create_time,'%Y-%m-%d %H:%i:%s') as createTime,a.service_certification as serviceCertification,
|
|
|
- a.user_certification as userCertification,a.current_member_status as currentMemberStatus,a.identify_name as name,a.lvl,
|
|
|
- b.contacts,b.contact_mobile as contactMobile,b.international,b.expert,b.celebrity,
|
|
|
- dg1.name as province,dg2.name as city, dg3.name as area,c.name as industry
|
|
|
- from
|
|
|
- (select
|
|
|
- id,type,status,create_time,service_certification,user_certification,current_member_status,identify_name,lvl
|
|
|
- from user
|
|
|
- where type = 0
|
|
|
- <if test="aid != null and aid !=''">
|
|
|
- and aid = #{aid,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="shareType != null">
|
|
|
- and share_type = #{shareType,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="status != null">
|
|
|
- and status = #{status,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="serviceCertification != null">
|
|
|
- and service_certification = #{serviceCertification,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="userCertification != null">
|
|
|
- and user_certification = #{userCertification,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="currentMemberStatus != null">
|
|
|
- and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="startDate != null and startDate != ''">
|
|
|
- and 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')
|
|
|
- </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
|
|
|
- where 1=1
|
|
|
- <if test="name != null and name !=''">
|
|
|
- and b.username = #{name,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="province != null">
|
|
|
- and b.province = #{province,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="city != null">
|
|
|
- and b.city = #{province,city=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="province != null">
|
|
|
- and b.area = #{area,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="industry != null">
|
|
|
- and b.industry = #{industry,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- </when>
|
|
|
- <when test="type == 1">
|
|
|
- select
|
|
|
- a.id as uid,a.type,a.status, date_format(a.create_time,'%Y-%m-%d %H:%i:%s') as createTime,a.service_certification as serviceCertification,
|
|
|
- a.user_certification as userCertification,a.current_member_status as currentMemberStatus,a.identify_name as name,a.lvl,
|
|
|
- b.contacts,b.contact_mobile as contactMobile,b.international,0 as expert,0 as celebrity,
|
|
|
- dg1.name as province,dg2.name as city, dg3.name as area,c.name as industry
|
|
|
- from
|
|
|
- (select
|
|
|
- id,type,status,create_time,service_certification,user_certification,current_member_status,identify_name,lvl
|
|
|
- from user
|
|
|
- where type = 1
|
|
|
- <if test="aid != null and aid !=''">
|
|
|
- and aid = #{aid,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="shareType != null">
|
|
|
- and share_type = #{shareType,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="status != null">
|
|
|
- and status = #{status,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="serviceCertification != null">
|
|
|
- and service_certification = #{serviceCertification,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="userCertification != null">
|
|
|
- and user_certification = #{userCertification,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="currentMemberStatus != null">
|
|
|
- and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="startDate != null and startDate != ''">
|
|
|
- and 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')
|
|
|
- </if>
|
|
|
- )as a inner join organization_identity b on a.id = b.uid
|
|
|
- left join district_glossory dg1 on b.licence_province = dg1.id
|
|
|
- left join district_glossory dg2 on b.licence_city = dg2.id
|
|
|
- left join district_glossory dg3 on b.licence_area = dg3.id
|
|
|
- left join industry_category c on b.industry = c.id
|
|
|
- where 1=1
|
|
|
- <if test="name != null and name != ''">
|
|
|
- and b.unit_name = #{name,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="province != null">
|
|
|
- and b.licence_province = #{province,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="city != null">
|
|
|
- and b.licence_city = #{province,city=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="province != null">
|
|
|
- and b.licence_area = #{area,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="industry != null">
|
|
|
- and b.industry = #{industry,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- select * from (
|
|
|
- select
|
|
|
- a.id as uid,a.type,a.status, date_format(a.create_time,'%Y-%m-%d %H:%i:%s') as createTime,a.service_certification as serviceCertification,
|
|
|
- a.user_certification as userCertification,a.current_member_status as currentMemberStatus,a.identify_name as name,a.lvl,
|
|
|
- b.contacts,b.contact_mobile as contactMobile,b.international,b.expert,b.celebrity,
|
|
|
- dg1.name as province,dg2.name as city, dg3.name as area,c.name as industry
|
|
|
- from
|
|
|
- (select
|
|
|
- id,type,status,create_time,service_certification,user_certification,current_member_status,identify_name,lvl
|
|
|
- from user
|
|
|
- where type = 0
|
|
|
- <if test="aid != null and aid !=''">
|
|
|
- and aid = #{aid,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="shareType != null">
|
|
|
- and share_type = #{shareType,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="status != null">
|
|
|
- and status = #{status,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="serviceCertification != null">
|
|
|
- and service_certification = #{serviceCertification,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="userCertification != null">
|
|
|
- and user_certification = #{userCertification,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="currentMemberStatus != null">
|
|
|
- and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="startDate != null and startDate != ''">
|
|
|
- and 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')
|
|
|
- </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
|
|
|
- where 1=1
|
|
|
- <if test="name != null and name != ''">
|
|
|
- and b.username = #{name,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="province != null">
|
|
|
- and b.province = #{province,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="city != null">
|
|
|
- and b.city = #{province,city=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="province != null">
|
|
|
- and b.area = #{area,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="industry != null">
|
|
|
- and b.industry = #{industry,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- union
|
|
|
- select
|
|
|
- a.id as uid,a.type,a.status, date_format(a.create_time,'%Y-%m-%d %H:%i:%s') as createTime,a.service_certification as serviceCertification,
|
|
|
- a.user_certification as userCertification,a.current_member_status as currentMemberStatus,a.identify_name as name,a.lvl,
|
|
|
- b.contacts,b.contact_mobile as contactMobile,b.international,0 as expert,0 as celebrity,
|
|
|
- dg1.name as province,dg2.name as city, dg3.name as area,c.name as industry
|
|
|
- from
|
|
|
- (select
|
|
|
- id,type,status,create_time,service_certification,user_certification,current_member_status,identify_name,lvl
|
|
|
- from user
|
|
|
- where type = 1
|
|
|
- <if test="aid != null and aid !=''">
|
|
|
- and aid = #{aid,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="shareType != null">
|
|
|
- and share_type = #{shareType,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="status != null">
|
|
|
- and status = #{status,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="serviceCertification != null">
|
|
|
- and service_certification = #{serviceCertification,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="userCertification != null">
|
|
|
- and user_certification = #{userCertification,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="currentMemberStatus != null">
|
|
|
- and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="startDate != null and startDate != ''">
|
|
|
- and 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')
|
|
|
- </if>
|
|
|
- )as a inner join organization_identity b on a.id = b.uid
|
|
|
- left join district_glossory dg1 on b.licence_province = dg1.id
|
|
|
- left join district_glossory dg2 on b.licence_city = dg2.id
|
|
|
- left join district_glossory dg3 on b.licence_area = dg3.id
|
|
|
- left join industry_category c on b.industry = c.id
|
|
|
- where 1=1
|
|
|
- <if test="name != null and name != ''">
|
|
|
- and b.unit_name = #{name,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="province != null">
|
|
|
- and b.licence_province = #{province,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="city != null">
|
|
|
- and b.licence_city = #{province,city=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="province != null">
|
|
|
- and b.licence_area = #{area,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="industry != null">
|
|
|
- and b.industry = #{industry,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- )y
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
- order by createTime desc
|
|
|
- <if test="page_sql!=null">
|
|
|
- ${page_sql}
|
|
|
+ <select id="selectPersonalCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
|
|
|
+ select
|
|
|
+ a.id as uid,a.type,a.status, date_format(a.create_time,'%Y-%m-%d %H:%i:%s') as createTime,
|
|
|
+ a.service_certification as serviceCertification,
|
|
|
+ a.user_certification as userCertification,a.current_member_status as
|
|
|
+ currentMemberStatus,a.identify_name as name,a.lvl,
|
|
|
+ b.contacts,b.contact_mobile as
|
|
|
+ contactMobile,b.international,b.expert,b.celebrity,
|
|
|
+ dg1.name as province,dg2.name as city, dg3.name as area,c.name as industry
|
|
|
+ from
|
|
|
+ (select
|
|
|
+ id,type,status,create_time,service_certification,user_certification,current_member_status,identify_name,lvl
|
|
|
+ from user
|
|
|
+ where type = 0
|
|
|
+ <if test="aid != null and aid !=''">
|
|
|
+ and aid = #{aid,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
+ <if test="shareType != null">
|
|
|
+ and share_type = #{shareType,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ and status = #{status,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="serviceCertification != null">
|
|
|
+ and service_certification = #{serviceCertification,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="userCertification != null">
|
|
|
+ and user_certification = #{userCertification,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="currentMemberStatus != null">
|
|
|
+ and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null and startDate != ''">
|
|
|
+ and 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')
|
|
|
+ </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
|
|
|
+ where 1=1
|
|
|
+ <if test="name != null and name !=''">
|
|
|
+ and b.username = #{name,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="province != null">
|
|
|
+ and b.province = #{province,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="city != null">
|
|
|
+ and b.city = #{province,city=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="province != null">
|
|
|
+ and b.area = #{area,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="industry != null">
|
|
|
+ and b.industry = #{industry,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="expert != null">
|
|
|
+ and b.expert = #{expert,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="celebrity != null">
|
|
|
+ and b.celebrity = #{celebrity,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="selectPersonalCustomerCount" resultType="java.lang.Integer">
|
|
|
+ select
|
|
|
+ count(0)
|
|
|
+ from
|
|
|
+ (select
|
|
|
+ id
|
|
|
+ from user
|
|
|
+ where type = 0
|
|
|
+ <if test="aid != null and aid !=''">
|
|
|
+ and aid = #{aid,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="shareType != null">
|
|
|
+ and share_type = #{shareType,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ and status = #{status,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="serviceCertification != null">
|
|
|
+ and service_certification = #{serviceCertification,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="userCertification != null">
|
|
|
+ and user_certification = #{userCertification,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="currentMemberStatus != null">
|
|
|
+ and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null and startDate != ''">
|
|
|
+ and 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')
|
|
|
+ </if>
|
|
|
+ )as a inner join organization_identity b on a.id = b.uid
|
|
|
+ where 1=1
|
|
|
+ <if test="name != null and name !=''">
|
|
|
+ and b.unit_name = #{name,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="province != null">
|
|
|
+ and b.location_province = #{province,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="city != null">
|
|
|
+ and b.location_city = #{province,city=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="province != null">
|
|
|
+ and b.location_area = #{area,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="industry != null">
|
|
|
+ and b.industry = #{industry,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="expert != null">
|
|
|
+ and b.expert = #{expert,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="celebrity != null">
|
|
|
+ and b.celebrity = #{celebrity,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="selectOrganizationCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
|
|
|
+ select
|
|
|
+ a.id as uid,a.type,a.status, date_format(a.create_time,'%Y-%m-%d
|
|
|
+ %H:%i:%s') as createTime,a.service_certification as
|
|
|
+ serviceCertification,
|
|
|
+ a.user_certification as userCertification,a.current_member_status as
|
|
|
+ currentMemberStatus,a.identify_name as name,a.lvl,
|
|
|
+ b.contacts,b.contact_mobile as contactMobile,b.international,b.listed,b.high_tech_zone as highTechZone,
|
|
|
+ dg1.name as province,dg2.name as city, dg3.name as area,c.name as industry
|
|
|
+ from
|
|
|
+ (select
|
|
|
+ id,type,status,create_time,service_certification,user_certification,current_member_status,identify_name,lvl
|
|
|
+ from user
|
|
|
+ where type = 1
|
|
|
+ <if test="aid != null and aid !=''">
|
|
|
+ and aid = #{aid,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="shareType != null">
|
|
|
+ and share_type = #{shareType,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ and status = #{status,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="serviceCertification != null">
|
|
|
+ and service_certification = #{serviceCertification,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="userCertification != null">
|
|
|
+ and user_certification = #{userCertification,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="currentMemberStatus != null">
|
|
|
+ and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null and startDate != ''">
|
|
|
+ and 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')
|
|
|
+ </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
|
|
|
+ where 1=1
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ and b.unit_name = #{name,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="province != null">
|
|
|
+ and b.location_province = #{province,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="city != null">
|
|
|
+ and b.location_city = #{province,city=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="province != null">
|
|
|
+ and b.location_area = #{area,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="industry != null">
|
|
|
+ and b.industry = #{industry,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="listed != null">
|
|
|
+ and b.listed = #{listed,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="highTechZone != null">
|
|
|
+ and b.high_tech_zone = #{highTechZone,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="selectOrganizationCustomerCount" resultType="java.lang.Integer">
|
|
|
+ select
|
|
|
+ count(0)
|
|
|
+ from
|
|
|
+ (select
|
|
|
+ id
|
|
|
+ from user
|
|
|
+ where type = 1
|
|
|
+ <if test="aid != null and aid !=''">
|
|
|
+ and aid = #{aid,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="shareType != null">
|
|
|
+ and share_type = #{shareType,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ and status = #{status,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="serviceCertification != null">
|
|
|
+ and service_certification = #{serviceCertification,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="userCertification != null">
|
|
|
+ and user_certification = #{userCertification,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="currentMemberStatus != null">
|
|
|
+ and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null and startDate != ''">
|
|
|
+ and 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')
|
|
|
+ </if>
|
|
|
+ )as a inner join organization_identity b on a.id = b.uid
|
|
|
+ where 1=1
|
|
|
+ <if test="name != null and name !=''">
|
|
|
+ and b.unit_name = #{name,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="province != null">
|
|
|
+ and b.location_province = #{province,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="city != null">
|
|
|
+ and b.location_city = #{province,city=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="province != null">
|
|
|
+ and b.location_area = #{area,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="industry != null">
|
|
|
+ and b.industry = #{industry,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="listed != null">
|
|
|
+ and b.listed = #{listed,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="highTechZone != null">
|
|
|
+ and b.high_tech_zone = #{highTechZone,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findCustomerByName" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerSimpleBo">
|
|
|
+ select id,name from user where name like
|
|
|
+ concat('%',#{identify_name},'%')
|
|
|
</select>
|
|
|
- <select id="selectCustomerCount" resultType="java.lang.Integer">
|
|
|
- <choose>
|
|
|
- <when test="type == 0">
|
|
|
- select
|
|
|
- count(0)
|
|
|
- from
|
|
|
- (select
|
|
|
- id
|
|
|
- from user
|
|
|
- where type = 0
|
|
|
- <if test="aid != null and aid !=''">
|
|
|
- and aid = #{aid,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="shareType != null">
|
|
|
- and share_type = #{shareType,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="status != null">
|
|
|
- and status = #{status,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="serviceCertification != null">
|
|
|
- and service_certification = #{serviceCertification,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="userCertification != null">
|
|
|
- and user_certification = #{userCertification,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="currentMemberStatus != null">
|
|
|
- and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="startDate != null and startDate != ''">
|
|
|
- and 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')
|
|
|
- </if>
|
|
|
- )as a inner join user_identity b on a.id = b.uid
|
|
|
- where 1=1
|
|
|
- <if test="name != null and name !=''">
|
|
|
- and b.username = #{name,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="province != null">
|
|
|
- and b.province = #{province,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="city != null">
|
|
|
- and b.city = #{province,city=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="province != null">
|
|
|
- and b.area = #{area,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="industry != null">
|
|
|
- and b.industry = #{industry,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- </when>
|
|
|
- <when test="type == 1">
|
|
|
- select
|
|
|
- count(0)
|
|
|
- from
|
|
|
- (select
|
|
|
- id
|
|
|
- from user
|
|
|
- where type = 1
|
|
|
- <if test="aid != null and aid !=''">
|
|
|
- and aid = #{aid,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="shareType != null">
|
|
|
- and share_type = #{shareType,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="status != null">
|
|
|
- and status = #{status,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="serviceCertification != null">
|
|
|
- and service_certification = #{serviceCertification,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="userCertification != null">
|
|
|
- and user_certification = #{userCertification,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="currentMemberStatus != null">
|
|
|
- and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="startDate != null and startDate != ''">
|
|
|
- and 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')
|
|
|
- </if>
|
|
|
- )as a inner join organization_identity b on a.id = b.uid
|
|
|
- where 1=1
|
|
|
- <if test="name != null and name !=''">
|
|
|
- and b.unit_name = #{name,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="province != null">
|
|
|
- and b.licence_province = #{province,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="city != null">
|
|
|
- and b.licence_city = #{province,city=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="province != null">
|
|
|
- and b.licence_area = #{area,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="industry != null">
|
|
|
- and b.industry = #{industry,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- select count(0)
|
|
|
- from(
|
|
|
- select
|
|
|
- a.id
|
|
|
- from
|
|
|
- (select
|
|
|
- id
|
|
|
- from user
|
|
|
- where type = 0
|
|
|
- <if test="aid != null and aid !=''">
|
|
|
- and aid = #{aid,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="shareType != null">
|
|
|
- and share_type = #{shareType,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="status != null">
|
|
|
- and status = #{status,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="serviceCertification != null">
|
|
|
- and service_certification = #{serviceCertification,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="userCertification != null">
|
|
|
- and user_certification = #{userCertification,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="currentMemberStatus != null">
|
|
|
- and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="startDate != null and startDate != ''">
|
|
|
- and 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')
|
|
|
- </if>
|
|
|
- )as a inner join user_identity b on a.id = b.uid
|
|
|
- where 1=1
|
|
|
- <if test="name != null and name !=''">
|
|
|
- and b.username = #{name,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="province != null">
|
|
|
- and b.province = #{province,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="city != null">
|
|
|
- and b.city = #{province,city=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="province != null">
|
|
|
- and b.area = #{area,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="industry != null">
|
|
|
- and b.industry = #{industry,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- union
|
|
|
- select
|
|
|
- a.id
|
|
|
- from
|
|
|
- (select
|
|
|
- id
|
|
|
- from user
|
|
|
- where type = 1
|
|
|
- <if test="aid != null and aid !=''">
|
|
|
- and aid = #{aid,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="shareType != null">
|
|
|
- and share_type = #{shareType,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="status != null">
|
|
|
- and status = #{status,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="serviceCertification != null">
|
|
|
- and service_certification = #{serviceCertification,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="userCertification != null">
|
|
|
- and user_certification = #{userCertification,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="currentMemberStatus != null">
|
|
|
- and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="startDate != null and startDate != ''">
|
|
|
- and 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')
|
|
|
- </if>
|
|
|
- )as a inner join organization_identity b on a.id = b.uid
|
|
|
- where 1=1
|
|
|
- <if test="name != null and name !=''">
|
|
|
- and b.unit_name = #{name,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="province != null">
|
|
|
- and b.licence_province = #{province,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="city != null">
|
|
|
- and b.licence_city = #{province,city=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="province != null">
|
|
|
- and b.licence_area = #{area,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="industry != null">
|
|
|
- and b.industry = #{industry,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- ) x
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
+
|
|
|
+ <select id="judgeCustomerByName" parameterType="java.lang.String" resultType="java.lang.Integer">
|
|
|
+ select count(0) from user where identify_name = #{name,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
</mapper>
|