<?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.stylefeng.guns.modular.system.dao.DriverMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.Driver">
|
<id column="id" property="id" />
|
<result column="account" property="account" />
|
<result column="jobNumber" property="jobNumber" />
|
<result column="phone" property="phone" />
|
<result column="password" property="password" />
|
<result column="name" property="name" />
|
<result column="sex" property="sex" />
|
<result column="idCard" property="idCard" />
|
<result column="companyId" property="companyId" />
|
<result column="franchiseeId" property="franchiseeId" />
|
<result column="headImgUrl" property="headImgUrl" />
|
<result column="faceImgUrl" property="faceImgUrl" />
|
<result column="idCardImgUrl1" property="idCardImgUrl1" />
|
<result column="idCardImgUrl2" property="idCardImgUrl2" />
|
<result column="placeOfEmployment" property="placeOfEmployment" />
|
<result column="birthday" property="birthday" />
|
<result column="bankCardNumber" property="bankCardNumber" />
|
<result column="driverNationality" property="driverNationality" />
|
<result column="driverNation" property="driverNation" />
|
<result column="driverMaritalStatus" property="driverMaritalStatus" />
|
<result column="driverLanguageLevel" property="driverLanguageLevel" />
|
<result column="driverEducation" property="driverEducation" />
|
<result column="driverCensus" property="driverCensus" />
|
<result column="driverAddress" property="driverAddress" />
|
<result column="driverContactAddress" property="driverContactAddress" />
|
<result column="driverAge" property="driverAge" />
|
<result column="driveCard" property="driveCard" />
|
<result column="driveCardImgUrl" property="driveCardImgUrl" />
|
<result column="driverType" property="driverType" />
|
<result column="getDriverLicenseDate" property="getDriverLicenseDate" />
|
<result column="driverLicenseOn" property="driverLicenseOn" />
|
<result column="driverLicenseOff" property="driverLicenseOff" />
|
<result column="taxiDriver" property="taxiDriver" />
|
<result column="taxiAptitudeCard" property="taxiAptitudeCard" />
|
<result column="networkCarlssueImg" property="networkCarlssueImg"/>
|
<result column="networkCarlssueOrganization" property="networkCarlssueOrganization" />
|
<result column="networkCarlssueDate" property="networkCarlssueDate" />
|
<result column="getNetworkCarProofDate" property="getNetworkCarProofDate" />
|
<result column="networkCarProofOn" property="networkCarProofOn" />
|
<result column="networkCarProofOff" property="networkCarProofOff" />
|
<result column="registerDate" property="registerDate" />
|
<result column="fullTimeDriver" property="fullTimeDriver" />
|
<result column="inDriverBlacklist" property="inDriverBlacklist" />
|
<result column="commercialType" property="commercialType" />
|
<result column="contractCompany" property="contractCompany" />
|
<result column="contractOn" property="contractOn" />
|
<result column="contractOff" property="contractOff" />
|
<result column="emergencyContact" property="emergencyContact" />
|
<result column="emergencyContactPhone" property="emergencyContactPhone" />
|
<result column="emergencyContactAddress" property="emergencyContactAddress" />
|
<result column="remark" property="remark" />
|
<result column="isPlatCar" property="isPlatCar" />
|
<result column="carId" property="carId" />
|
<result column="authState" property="authState" />
|
<result column="state" property="state" />
|
<result column="addType" property="addType" />
|
<result column="balance" property="balance" />
|
<result column="activityMoney" property="activityMoney" />
|
<result column="laveActivityMoney" property="laveActivityMoney" />
|
<result column="businessMoney" property="businessMoney" />
|
<result column="laveBusinessMoney" property="laveBusinessMoney" />
|
<result column="laveBusinessMoney" property="laveBusinessMoney" />
|
<result column="appletsOpenId" property="appletsOpenId"/>
|
|
|
<result column="flag" property="flag"/>
|
<result column="insertTime" property="insertTime"/>
|
<result column="insertUser" property="insertUser"/>
|
<result column="updateTime" property="updateTime"/>
|
<result column="updateUser" property="updateUser"/>
|
</resultMap>
|
|
|
<select id="queryReassignDriverPrivateCar" resultType="map">
|
select
|
a.id as id,
|
CONCAT(a.`name`, '-', d.carLicensePlate) as `name`
|
from t_driver a
|
left join t_driver_service b on (a.id = b.driverId)
|
left join t_driver_orders c on (a.id = c.driverId)
|
left join t_car d on (a.carId = d.id)
|
left join t_car_service e on (d.id = e.carId)
|
where a.authState = 2 and a.state = 2 and a.flag != 3 and if(a.franchiseeId is null or a.franchiseeId = 0, a.companyId = #{companyId}, a.franchiseeId = #{companyId})
|
and a.id in (select driverId from t_driver_work where state = 1 and type like '%1%')
|
and b.type = 1 and c.type = 1 and e.type = 1 and e.serverCarModelId = #{serverCarModelId}
|
</select>
|
|
|
<select id="queryReassignDriverCrossCity" resultType="map">
|
select
|
a.id as id,
|
CONCAT(a.`name`, '-', d.carLicensePlate) as `name`
|
from t_driver a
|
left join t_driver_service b on (a.id = b.driverId)
|
left join t_driver_orders c on (a.id = c.driverId)
|
left join t_car d on (a.carId = d.id)
|
left join t_car_service e on (d.id = e.carId)
|
left join t_driver_line f on (a.id = f.driverId)
|
left join t_line_shift g on (f.lineId = g.lineId)
|
where a.authState = 2 and a.state != 1 and a.flag != 3 and if(a.franchiseeId is null or a.franchiseeId = 0, a.companyId = #{companyId}, a.franchiseeId = #{companyId})
|
and a.id in (select driverId from t_driver_work where state = 1 and type like '%3%')
|
and b.type = 3 and c.type = 3 and e.type = 3 and e.serverCarModelId = #{serverCarModelId} and f.lineId = #{lineId} and g.id = #{lineShiftId}
|
and a.id in (select driverId from t_line_shift_driver where lineShiftId = #{lineShiftId} and DATE_FORMAT(`day`, '%Y-%m-%d') = DATE_FORMAT(#{time}, '%Y-%m-%d') and laveSeat >= #{num})
|
</select>
|
|
|
<select id="queryAllDriver" resultType="map">
|
select
|
id as id,
|
CONCAT(`name`, '-', phone) as name
|
from t_driver where authState = 2 and state != 3 and flag != 3 and if(franchiseeId is null or franchiseeId = 0, companyId = #{companyId}, franchiseeId = #{companyId})
|
</select>
|
|
|
|
<select id="queryByCarId" resultType="Driver">
|
select
|
id as id,
|
account as account,
|
jobNumber as jobNumber,
|
phone as phone,
|
password as password,
|
name as name,
|
sex as sex,
|
idCard as idCard,
|
companyId as companyId,
|
franchiseeId as franchiseeId,
|
headImgUrl as headImgUrl,
|
faceImgUrl as faceImgUrl,
|
idCardImgUrl1 as idCardImgUrl1,
|
idCardImgUrl2 as idCardImgUrl2,
|
placeOfEmployment as placeOfEmployment,
|
birthday as birthday,
|
bankCardNumber as bankCardNumber,
|
driverNationality as driverNationality,
|
driverNation as driverNation,
|
driverMaritalStatus as driverMaritalStatus,
|
driverLanguageLevel as driverLanguageLevel,
|
driverEducation as driverEducation,
|
driverCensus as driverCensus,
|
driverAddress as driverAddress,
|
driverContactAddress as driverContactAddress,
|
driverAge as driverAge,
|
driveCard as driveCard,
|
driveCardImgUrl as driveCardImgUrl,
|
driverType as driverType,
|
getDriverLicenseDate as getDriverLicenseDate,
|
driverLicenseOn as driverLicenseOn,
|
driverLicenseOff as driverLicenseOff,
|
taxiDriver as taxiDriver,
|
taxiAptitudeCard as taxiAptitudeCard,
|
networkCarlssueImg as networkCarlssueImg,
|
networkCarlssueOrganization as networkCarlssueOrganization,
|
networkCarlssueDate as networkCarlssueDate,
|
getNetworkCarProofDate as getNetworkCarProofDate,
|
networkCarProofOn as networkCarProofOn,
|
networkCarProofOff as networkCarProofOff,
|
registerDate as registerDate,
|
fullTimeDriver as fullTimeDriver,
|
inDriverBlacklist as inDriverBlacklist,
|
commercialType as commercialType,
|
contractCompany as contractCompany,
|
contractOn as contractOn,
|
contractOff as contractOff,
|
emergencyContact as emergencyContact,
|
emergencyContactPhone as emergencyContactPhone,
|
emergencyContactAddress as emergencyContactAddress,
|
remark as remark,
|
isPlatCar as isPlatCar,
|
carId as carId,
|
authState as authState,
|
state as state,
|
addType as addType,
|
balance as balance,
|
activityMoney as activityMoney,
|
laveActivityMoney as laveActivityMoney,
|
businessMoney as businessMoney,
|
laveBusinessMoney as laveBusinessMoney,
|
laveBusinessMoney as laveBusinessMoney,
|
appletsOpenId as appletsOpenId,
|
flag as flag,
|
insertTime as insertTime,
|
insertUser as insertUser,
|
updateTime as updateTime,
|
updateUser as updateUser
|
from t_driver where flag != 3 and authState = 2 and carId = #{carId}
|
</select>
|
</mapper>
|