<?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.shunfeng.dao.AppDriverRideMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.shunfeng.model.AppDriverRide">
|
<id column="id" property="id" />
|
<result column="addTime" property="addTime" />
|
<result column="companyId" property="companyId" />
|
<result column="carType" property="carType" />
|
<result column="carNum" property="carNum" />
|
<result column="license" property="license" />
|
<result column="licenseImg" property="licenseImg" />
|
<result column="comInsuranceTime" property="comInsuranceTime" />
|
<result column="comInsuranceImg" property="comInsuranceImg" />
|
<result column="businessInsuranceTime" property="businessInsuranceTime" />
|
<result column="businessInsuranceImg" property="businessInsuranceImg" />
|
<result column="dutyInsuranceTime" property="dutyInsuranceTime" />
|
<result column="dutyInsuranceImg" property="dutyInsuranceImg" />
|
<result column="annualInspectionTime" property="annualInspectionTime" />
|
<result column="annualInspectionImg" property="annualInspectionImg" />
|
<result column="userId" property="userId" />
|
<result column="state" property="state" />
|
<result column="byInviteCode" property="byInviteCode" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id, addTime, companyId, carType, carNum, license, licenseImg, comInsuranceTime, comInsuranceImg, businessInsuranceTime, businessInsuranceImg, dutyInsuranceTime, dutyInsuranceImg, annualInspectionTime, annualInspectionImg, userId, state, byInviteCode
|
</sql>
|
<!--获取顺风车司机列表-->
|
<select id="getAppDriverRide" resultType="map">
|
select r.*,u.phone,u.nickName as realName,u.idCard as `identity`,r.id as uid
|
from app_driver_ride r
|
left join t_user u on r.userId=u.id
|
<where>
|
and r.isDelete = 0
|
<if test="phone !=null and phone !=''">
|
and u.phone like '%${phone}%'
|
</if>
|
<if test="carType!=null and carType!=''">
|
and r.carType like '%${carType}%'
|
</if>
|
<if test="carNum!=null and carNum!=''">
|
and r.carNum like '%${carNum}%'
|
</if>
|
<if test="license!=null and license!=''">
|
and r.license like '%${license}%'
|
</if>
|
<if test="state!=null">
|
and r.state = #{state}
|
</if>
|
<if test="userId!=null">
|
and r.userId = #{userId}
|
</if>
|
<if test="realName!=null and realName!=''">
|
and u.nickName = #{realName}
|
</if>
|
<if test="excep!=null">
|
<if test="excep==1">
|
and now() > r.comInsuranceTime and now() > r.businessInsuranceTime and now() > r.dutyInsuranceTime and now() > r.annualInspectionTime
|
</if>
|
<if test="excep==2">
|
and r.comInsuranceTime now() > and r.businessInsuranceTime > now() and r.dutyInsuranceTime > now() and r.annualInspectionTime > now()
|
</if>
|
</if>
|
</where>
|
order by r.addTime desc
|
</select>
|
|
</mapper>
|