<?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.ruoyi.zhdd.mapper.ResourceDetailMapper">

    <resultMap type="com.ruoyi.zhdd.domain.ResourceDetail" id="ResourceDetailResult">
        <result property="id" column="id"/>
        <result property="resourceId" column="resource_id"/>
        <result property="name" column="name"/>
        <result property="model" column="model"/>
        <result property="size" column="size"/>
        <result property="num" column="num"/>
        <result property="unit" column="unit"/>
        <result property="delFlag" column="del_flag"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
    </resultMap>

    <select id="searchWarehouseByGoods" resultType="com.ruoyi.zhdd.domain.Resource">
        select distinct t2.id,
                        resource_type resourceType,
                        t2.name,
                        address,
                        longitude,
                        latitude,
                        manage_unit   manageUnit,
                        t2.num,
                        carry_goods   carryGoods,
                        contact_name  contactName,
                        contact_phone contactPhone,
                        car_type      carType,
                        location_type locationType
        from b_resource_detail t1
                 left join b_resource t2 on t1.resource_id = t2.id
        where t1.name like concat('%', #{name}, '%')
    </select>


</mapper>
