|
@@ -5,34 +5,47 @@
|
|
|
|
|
|
<!-- 获得司机总数 -->
|
|
<!-- 获得司机总数 -->
|
|
<select id="getCountByCondition" parameterType="Map" resultType="java.lang.Integer">
|
|
<select id="getCountByCondition" parameterType="Map" resultType="java.lang.Integer">
|
|
- select
|
|
|
|
- count(id)
|
|
|
|
- FROM hy_driver_info
|
|
|
|
- WHERE
|
|
|
|
- delete_flag = '0'
|
|
|
|
- <if test="searchType != null and searchType != ''">
|
|
|
|
- <if test="searchType == 1">
|
|
|
|
- AND authentication_status_key = '1'
|
|
|
|
- </if>
|
|
|
|
- <if test="searchType == 2">
|
|
|
|
- AND authentication_status_key = '3'
|
|
|
|
- </if>
|
|
|
|
- <if test="searchType == 3">
|
|
|
|
- AND authentication_status_key = '5'
|
|
|
|
- </if>
|
|
|
|
- <if test="searchType == 4">
|
|
|
|
- AND authentication_status_key = '7'
|
|
|
|
|
|
+ select
|
|
|
|
+ count(c.id)
|
|
|
|
+ FROM common_user c
|
|
|
|
+ LEFT JOIN hy_driver_info d on c.id = d.common_id and d.delete_flag = 0
|
|
|
|
+ WHERE c.delete_flag = '0'
|
|
|
|
+ AND c.identification = '1'
|
|
|
|
+ <if test="searchType != null and searchType != ''">
|
|
|
|
+ <if test="searchType == 1">
|
|
|
|
+ AND d.authentication_status_key = '1'
|
|
|
|
+ </if>
|
|
|
|
+ <if test="searchType == 2">
|
|
|
|
+ AND d.authentication_status_key = '5'
|
|
|
|
+ </if>
|
|
|
|
+ <if test="searchType == 3">
|
|
|
|
+ AND d.authentication_status_key = '3'
|
|
|
|
+ </if>
|
|
|
|
+ <if test="searchType == 4">
|
|
|
|
+ AND d.authentication_status_key = '9'
|
|
|
|
+ </if>
|
|
|
|
+ <if test="searchType == 5">
|
|
|
|
+ AND d.authentication_status_key = '11'
|
|
|
|
+ </if>
|
|
|
|
+ <if test="searchType == 6">
|
|
|
|
+ AND d.authentication_status_key = '7'
|
|
|
|
+ </if>
|
|
|
|
+ <if test="searchType == 7">
|
|
|
|
+ AND ISNULL(d.id)
|
|
|
|
+ </if>
|
|
|
|
+ <if test="searchType == 8">
|
|
|
|
+ AND (((select COUNT(DISTINCT f.common_id) FROM hy_feedback_report f where f.passive_common_id = d.common_id and f.delete_flag = 0
|
|
|
|
+ and f.object_flag = 1 and DATE_SUB(NOW(),INTERVAL 1 YEAR)) >= 3)
|
|
|
|
+ OR (d.complaints_number + d.reported_number) >= 10)
|
|
|
|
+ </if>
|
|
</if>
|
|
</if>
|
|
- <if test="searchType == 5">
|
|
|
|
- AND authentication_status_key = '9'
|
|
|
|
|
|
+ <if test="searchKeyWord != null and searchKeyWord != ''">
|
|
|
|
+ AND (lower(d.driver_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
|
+ OR lower(d.driver_phone) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
|
+ OR lower(d.number_card) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
|
+ OR lower(c.user_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
|
+ OR lower(c.phone) like lower(CONCAT('%',#{searchKeyWord},'%')))
|
|
</if>
|
|
</if>
|
|
- </if>
|
|
|
|
- <if test="searchKeyWord != null and searchKeyWord != ''">
|
|
|
|
- AND (lower(driver_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
|
- OR lower(driver_phone) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
|
- OR lower(number_card) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
|
- OR lower(number_card) like lower(CONCAT('%',#{searchKeyWord},'%')))
|
|
|
|
- </if>
|
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
@@ -43,49 +56,73 @@
|
|
SELECT
|
|
SELECT
|
|
d.id,
|
|
d.id,
|
|
d.common_id as commonId,
|
|
d.common_id as commonId,
|
|
- d.driver_name as driverName,
|
|
|
|
- d.driver_phone as driverPhone,
|
|
|
|
|
|
+ case when d.driver_name is null then c.user_name else d.driver_name end as driverName,
|
|
|
|
+ case when d.driver_phone is null then c.phone else d.driver_phone end as driverPhone,
|
|
d.number_card as numberCard,
|
|
d.number_card as numberCard,
|
|
|
|
+ d.shipments_number as shipmentsNumber,
|
|
|
|
+ d.favorable_rate as favorableRate,
|
|
|
|
+ d.complaints_number as complaintsNumber,
|
|
|
|
+ d.reported_number as reportedNumber,
|
|
|
|
+ d.accumulated_freight as accumulatedFreight,
|
|
|
|
+ d.advance_payment as advancePayment,
|
|
d.card_address_url as cardAddressUrl,
|
|
d.card_address_url as cardAddressUrl,
|
|
d.card_back_address_url as cardBackAddressUrl,
|
|
d.card_back_address_url as cardBackAddressUrl,
|
|
|
|
+ d.card_validity_date as cardValidityDate,
|
|
d.driver_license_home_page as driverLicenseHomePage,
|
|
d.driver_license_home_page as driverLicenseHomePage,
|
|
d.driver_license_back_page as driverLicenseBackPage,
|
|
d.driver_license_back_page as driverLicenseBackPage,
|
|
|
|
+ d.driver_license_validity_date as driverLicenseValidityDate,
|
|
|
|
+ d.quasi_driving_vehicle as quasiDrivingVehicle,
|
|
|
|
+ d.lssuing_authority as lssuingAuthority,
|
|
d.qualification_certificate as qualificationCertificate,
|
|
d.qualification_certificate as qualificationCertificate,
|
|
- d.authentication_status_key as authenticationStatusKey,
|
|
|
|
- d.authentication_status as authenticationStatus,
|
|
|
|
- d.create_date as createDate,
|
|
|
|
- d.update_date as updateDate,
|
|
|
|
|
|
+ d.qualification_certificate_validity_date as qualificationCertificateValidityDate,
|
|
|
|
+ d.qualification_certificate_number as qualificationCertificateNumber,
|
|
d.overdue_flag as overdueFlag,
|
|
d.overdue_flag as overdueFlag,
|
|
d.driver_overdue_flag as driverOverdueFlag,
|
|
d.driver_overdue_flag as driverOverdueFlag,
|
|
d.qualification_overdue_flag as qualificationOverdueFlag,
|
|
d.qualification_overdue_flag as qualificationOverdueFlag,
|
|
- d.advance_payment as advancePayment,
|
|
|
|
- c.avatar_url as avatarUrl
|
|
|
|
- FROM hy_driver_info d
|
|
|
|
- LEFT JOIN common_user c on c.id = d.common_id and c.delete_flag = 0
|
|
|
|
- WHERE d.delete_flag = '0'
|
|
|
|
|
|
+ d.authentication_status_key as authenticationStatusKey,
|
|
|
|
+ case when d.authentication_status is null then '未认证' else d.authentication_status end as authenticationStatus,
|
|
|
|
+ d.create_date as createDate,
|
|
|
|
+ d.update_date as updateDate
|
|
|
|
+ FROM common_user c
|
|
|
|
+ LEFT JOIN hy_driver_info d on c.id = d.common_id and d.delete_flag = 0
|
|
|
|
+ WHERE c.delete_flag = '0'
|
|
|
|
+ AND c.identification = '1'
|
|
<if test="searchType != null and searchType != ''">
|
|
<if test="searchType != null and searchType != ''">
|
|
<if test="searchType == 1">
|
|
<if test="searchType == 1">
|
|
AND d.authentication_status_key = '1'
|
|
AND d.authentication_status_key = '1'
|
|
</if>
|
|
</if>
|
|
<if test="searchType == 2">
|
|
<if test="searchType == 2">
|
|
- AND d.authentication_status_key = '3'
|
|
|
|
|
|
+ AND d.authentication_status_key = '5'
|
|
</if>
|
|
</if>
|
|
<if test="searchType == 3">
|
|
<if test="searchType == 3">
|
|
- AND d.authentication_status_key = '5'
|
|
|
|
|
|
+ AND d.authentication_status_key = '3'
|
|
</if>
|
|
</if>
|
|
<if test="searchType == 4">
|
|
<if test="searchType == 4">
|
|
- AND d.authentication_status_key = '7'
|
|
|
|
|
|
+ AND d.authentication_status_key = '9'
|
|
</if>
|
|
</if>
|
|
<if test="searchType == 5">
|
|
<if test="searchType == 5">
|
|
- AND d.authentication_status_key = '9'
|
|
|
|
|
|
+ AND d.authentication_status_key = '11'
|
|
|
|
+ </if>
|
|
|
|
+ <if test="searchType == 6">
|
|
|
|
+ AND d.authentication_status_key = '7'
|
|
|
|
+ </if>
|
|
|
|
+ <if test="searchType == 7">
|
|
|
|
+ AND ISNULL(d.id)
|
|
|
|
+ </if>
|
|
|
|
+ <if test="searchType == 8">
|
|
|
|
+ AND (((select COUNT(DISTINCT f.common_id) FROM hy_feedback_report f where f.passive_common_id = d.common_id and f.delete_flag = 0
|
|
|
|
+ and f.object_flag = 1 and DATE_SUB(NOW(),INTERVAL 1 YEAR)) >= 3)
|
|
|
|
+ OR (d.complaints_number + d.reported_number) >= 10)
|
|
</if>
|
|
</if>
|
|
</if>
|
|
</if>
|
|
<if test="searchKeyWord != null and searchKeyWord != ''">
|
|
<if test="searchKeyWord != null and searchKeyWord != ''">
|
|
AND (lower(d.driver_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
AND (lower(d.driver_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
OR lower(d.driver_phone) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
OR lower(d.driver_phone) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
- OR lower(d.number_card) like lower(CONCAT('%',#{searchKeyWord},'%')))
|
|
|
|
|
|
+ OR lower(d.number_card) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
|
+ OR lower(c.user_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
|
+ OR lower(c.phone) like lower(CONCAT('%',#{searchKeyWord},'%')))
|
|
</if>
|
|
</if>
|
|
- ORDER BY d.create_date DESC
|
|
|
|
|
|
+ ORDER BY d.authentication_status_key ASC,d.create_date DESC
|
|
<if test="currentPage != null and currentPage != ''">
|
|
<if test="currentPage != null and currentPage != ''">
|
|
LIMIT ${startRecord}, ${pageSize}
|
|
LIMIT ${startRecord}, ${pageSize}
|
|
</if>
|
|
</if>
|