<?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.shkj.wms.mapper.BaseLogicareaVmMapper">


    <select id="queryBaseLogicAreaVmList" parameterType="com.shkj.wms.bo.BaseLogicareaVmQueryListBo"
            resultType="com.shkj.wms.vo.BaseLogicareaDeriveVo">
        select area.logic_area_no,area.logic_area_name,	areaderive.remark,area.is_activity,
        derive.derive,
        derive.vehiche_model,derive.vehiche_code,derive.rear_split,derive.rear_punching,derive.rear_location,
        derive.front_split,derive.front_punching,derive.front_location
        from base_logicarea_derive areaderive left join
        base_logic_area area on areaderive.logicarea_id=area.id
        left join base_derive derive on derive.id =areaderive.derive_id

        <where>
            <if test="logicAreaNo != null">
                and derive.logicarea_no = #{logicAreaNo}
            </if>

            <if test="logicAreaName != null">
                and area.logic_area_name like concat('%', #{logicAreaName} ,'%')
            </if>

            <if test="vehicleModel != null">
                and derive.vehicle_Model = #{vehicleModel}
            </if>

            <if test="vehicheCode != null">
                and derive.vehiche_code = #{vehicheCode}
            </if>

        </where>

    </select>

</mapper>
