<?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="bus.mapper.BBusInfoMapper">

 <select id="list" parameterType="bus.model.dto.page.BBusInfoPageDto" resultType="bus.model.dto.BBusInfoDto">
   select
   id,
   bus_name,
   bus_no,
   status,
   bus_url,
   driver_name,
   driver_phone
   from
   b_bus_info
   <where>
      is_delete = 0
      <if test="busName != null and busName != ''">
        and bus_name like concat('%',#{busName},'%')
      </if>
      <if test="busNo != null and busNo != ''">
        and bus_no like concat('%',#{busNo},'%')
      </if>
      <if test="driverName != null and driverName != ''">
        and driver_name like concat('%',#{driverName},'%')
      </if>
      <if test="driverPhone != null and driverPhone != ''">
        and driver_phone like concat('%',#{driverPhone},'%')
      </if>
       <if test="status != null and status != ''">
           and status = #{status}
       </if>
   </where>
     order by create_time desc
 </select>

</mapper>
