| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257 |
- <?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="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="judgeCustomerByName" parameterType="java.lang.String" resultType="java.lang.Integer">
- select count(0) from user where identify_name = #{name,jdbcType=VARCHAR}
- </select>
- </mapper>
|