|
@@ -1,5 +1,109 @@
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<?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">
|
|
<!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">
|
|
<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
|
|
|
|
+ FROM driver_view_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>
|
|
|
|
+ <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 = '7'
|
|
|
|
+ </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">
|
|
|
|
+ SELECT
|
|
|
|
+ d.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.card_address_url as cardAddressUrl,
|
|
|
|
+ p.payee_address_url as payeeAddressUrl,
|
|
|
|
+ p.card_address_url as cardAddressUrl1,
|
|
|
|
+ d.update_date as updateDate
|
|
|
|
+ FROM driver_view_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>
|
|
|
|
+ <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 = '7'
|
|
|
|
+ </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
|
|
|
|
+ <if test="currentPage != null and currentPage != ''">
|
|
|
|
+ LIMIT ${startRecord}, ${pageSize}
|
|
|
|
+ </if>
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|