<?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.xxfc.platform.vehicle.mapper.AccompanyingItemMapper">

    <select id="getAllPageByNameOrType" parameterType="java.util.Map" resultType="com.xxfc.platform.vehicle.entity.AccompanyingItem">
        select
        `id`, `type`, `name`, `remark`,`price`, `create_time`, `update_time`
        from
             `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.xxfc.platform.vehicle.entity.AccompanyingItem">
        select
        `id`, `type`, `name`,`price`,`remark`, `create_time`, `update_time`
        from
          accompanying_item
        where `id` in
        <foreach collection="list" index="i" item="item" open="(" close=")" separator=",">
            #{item}
        </foreach>
    </select>


</mapper>