|
@@ -1,107 +1,66 @@
|
|
|
<?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.yh.saas.plugin.yiliangyiyun.mapper.DriverCarInfoMapper">
|
|
|
- <!-- 获得司机总数 -->
|
|
|
+ <!-- 获得车辆总数 -->
|
|
|
<select id="getCountByCondition" parameterType="Map" resultType="java.lang.Integer">
|
|
|
select
|
|
|
- count(1)
|
|
|
- from(
|
|
|
- SELECT
|
|
|
- d.id
|
|
|
+ count(c.id)
|
|
|
FROM driver_info d
|
|
|
- left join driver_car_info c on d.id=c.driver_id
|
|
|
- left join driver_payee_info p on d.id=p.driver_id
|
|
|
- WHERE
|
|
|
- d.delete_flag = '0'
|
|
|
- <if test="residentCityProvincial != null and residentCityProvincial != ''">
|
|
|
- AND d.resident_city_provincial = #{residentCityProvincial}
|
|
|
- </if>
|
|
|
- <if test="residentCityMunicipal != null and residentCityMunicipal != ''">
|
|
|
- AND d.resident_city_municipal = #{residentCityMunicipal}
|
|
|
- </if>
|
|
|
+ left join driver_car_info c on d.id=c.driver_id and c.delete_flag = 0
|
|
|
+ WHERE d.delete_flag = '0'
|
|
|
<if test="searchType != null and searchType != ''">
|
|
|
<if test="searchType == 1">
|
|
|
- AND d.authentication_status_key = '1'
|
|
|
+ AND c.status_key = '1'
|
|
|
</if>
|
|
|
<if test="searchType == 2">
|
|
|
- AND d.authentication_status_key = '7'
|
|
|
+ AND c.status_key = '3'
|
|
|
+ </if>
|
|
|
+ <if test="searchType == 3">
|
|
|
+ AND c.status_key = '5'
|
|
|
</if>
|
|
|
</if>
|
|
|
<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.car_number) like lower(CONCAT('%',#{searchKeyWord},'%')))
|
|
|
</if>
|
|
|
- <if test="pcFlag != null and pcFlag != ''">
|
|
|
- <if test="pcFlag == 0">
|
|
|
- AND d.common_id = #{commonId}
|
|
|
- </if>
|
|
|
- <if test="pcFlag == 1">
|
|
|
- AND d.comp_id = #{compId}
|
|
|
- </if>
|
|
|
- </if>
|
|
|
- group by
|
|
|
- d.id
|
|
|
- ) t
|
|
|
-
|
|
|
</select>
|
|
|
- <!-- 司机列表查询 -->
|
|
|
+ <!-- 车辆列表查询 -->
|
|
|
<select id="getListByCondition" parameterType="Map"
|
|
|
- resultType="com.yh.saas.plugin.yiliangyiyun.entity.DriverInfo">
|
|
|
+ resultType="com.yh.saas.plugin.yiliangyiyun.entity.DriverCarInfo">
|
|
|
SELECT
|
|
|
- d.id,
|
|
|
+ c.id,
|
|
|
d.driver_name as driverName,
|
|
|
- d.cover,
|
|
|
- d.number_card as numberCard,
|
|
|
d.driver_phone as driverPhone,
|
|
|
- d.resident_city_provincial as residentCityProvincial,
|
|
|
- d.resident_city_municipal as residentCityMunicipal,
|
|
|
- d.disable_status_flag as disableStatusFlag,
|
|
|
- d.authentication_status_key as authenticationStatusKey,
|
|
|
- d.authentication_status as authenticationStatus,
|
|
|
- d.disable_reasons as disableReasons,
|
|
|
- d.address_url as addressUrl,
|
|
|
+ d.number_card as numberCard,
|
|
|
+ c.car_number as carNumber,
|
|
|
+ c.address_url as addressUrl,
|
|
|
d.card_address_url as cardAddressUrl,
|
|
|
- p.payee_address_url as payeeAddressUrl,
|
|
|
- p.card_address_url as cardAddressUrl1,
|
|
|
- d.update_date as updateDate
|
|
|
+ d.card_back_address_url as cardBackAddressUrl,
|
|
|
+ c.status,
|
|
|
+ c.update_date as updateDate,
|
|
|
+ cu.avatar_url as avatarUrl
|
|
|
FROM driver_info d
|
|
|
- left join driver_car_info c on d.id=c.driver_id
|
|
|
- left join driver_payee_info p on d.id=p.driver_id
|
|
|
- WHERE
|
|
|
- d.delete_flag = '0'
|
|
|
- <if test="residentCityProvincial != null and residentCityProvincial != ''">
|
|
|
- AND d.resident_city_provincial = #{residentCityProvincial}
|
|
|
- </if>
|
|
|
- <if test="residentCityMunicipal != null and residentCityMunicipal != ''">
|
|
|
- AND d.resident_city_municipal = #{residentCityMunicipal}
|
|
|
- </if>
|
|
|
+ left join driver_car_info c on d.id=c.driver_id and c.delete_flag = 0
|
|
|
+ LEFT JOIN common_user cu on cu.id = d.common_id and cu.delete_flag = 0
|
|
|
+ WHERE d.delete_flag = '0'
|
|
|
<if test="searchType != null and searchType != ''">
|
|
|
<if test="searchType == 1">
|
|
|
- AND d.authentication_status_key = '1'
|
|
|
+ AND c.status_key = '1'
|
|
|
</if>
|
|
|
<if test="searchType == 2">
|
|
|
- AND d.authentication_status_key = '7'
|
|
|
+ AND c.status_key = '3'
|
|
|
+ </if>
|
|
|
+ <if test="searchType == 3">
|
|
|
+ AND c.status_key = '5'
|
|
|
</if>
|
|
|
</if>
|
|
|
<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.car_number) like lower(CONCAT('%',#{searchKeyWord},'%')))
|
|
|
</if>
|
|
|
- <if test="pcFlag != null and pcFlag != ''">
|
|
|
- <if test="pcFlag == 0">
|
|
|
- AND d.common_id = #{commonId}
|
|
|
- </if>
|
|
|
- <if test="pcFlag == 1">
|
|
|
- AND d.comp_id = #{compId}
|
|
|
- </if>
|
|
|
- </if>
|
|
|
- group by
|
|
|
- d.id
|
|
|
- ORDER BY d.update_date DESC
|
|
|
+ ORDER BY c.update_date DESC
|
|
|
<if test="currentPage != null and currentPage != ''">
|
|
|
LIMIT ${startRecord}, ${pageSize}
|
|
|
</if>
|