<?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.xinxincaravan.caravan.vehicle.mapper.AccompanyingItemMapper">

    <select id="getAllByPage" parameterType="java.util.Map" resultType="com.xinxincaravan.caravan.vehicle.entity.AccompanyingItem">
        select
        `id`, `type`, `name`, `remark`, `create_time`, `update_time`
        from
             vehicle.accompanying_item
        where
          1  = 1
        <if test="name != null and name != ''">
            and name = #{name}
        </if>

        <if test="type != null">
            and type = #{type}
        </if>


    </select>



    <select id="getByIdList" parameterType="java.util.List" resultType="com.xinxincaravan.caravan.vehicle.entity.AccompanyingItem">
        select
        `id`, `type`, `name`, `remark`, `create_time`, `update_time`
        from
        vehicle.accompanying_item
        where `id` in
        <foreach collection="list" index="i" item="item" open="(" close=")" separator=",">
            #{item}
        </foreach>
    </select>


</mapper>