<?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="cn.iocoder.yudao.module.rescue.mapper.RescueDeptDriverMapper">


    <sql id="selectRescueDeptDriverVo">
        select id, dept_id, first_driver_ids, second_driver_ids, third_driver_ids, create_time, creator, update_time, updater from rescue_dept_driver
    </sql>

    <select id="selectRescueDeptDriverList" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueDeptDriver" resultType="cn.iocoder.yudao.module.rescue.domain.RescueDeptDriver">
        select * from rescue_dept_driver where deleted = '0'
        <where>
            <if test="map.deptId != null "> and dept_id = #{deptId}</if>
            <if test="map.firstDriverIds != null  and map.firstDriverIds != ''"> and first_driver_ids = #{map.firstDriverIds}</if>
            <if test="map.secondDriverIds != null  and map.secondDriverIds != ''"> and second_driver_ids = #{map.secondDriverIds}</if>
            <if test="map.thirdDriverIds != null  and map.thirdDriverIds != ''"> and third_driver_ids = #{map.thirdDriverIds}</if>
        </where>
    </select>
    
    <select id="selectRescueDeptDriverById" parameterType="java.lang.Long" resultType="cn.iocoder.yudao.module.rescue.domain.RescueDeptDriver">
       select * from rescue_dept_driver
        where id = #{id}
    </select>

    <delete id="deleteRescueDeptDriverById" parameterType="java.lang.Long">
        delete from rescue_dept_driver where id = #{id}
    </delete>

    <delete id="deleteRescueDeptDriverByIds" parameterType="java.lang.String">
        delete from rescue_dept_driver where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>