<?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.BaseBarcodesInMapper">

    <resultMap type="com.shkj.wms.domain.BaseBarcodesIn" id="BaseBarcodesInResult">
        <result property="qrCode" column="qr_Code"/>
        <result property="vehicheModel" column="vehiche_Model"/>
        <result property="color" column="color"/>
        <result property="location" column="location"/>
        <result property="isSplit" column="is_Split"/>
        <result property="isPunching" column="is_Punching"/>
        <result property="isRepair" column="is_Repair"/>
        <result property="goodsNo" column="goods_No"/>
        <result property="locationCode" column="location_Code"/>
        <result property="orientation" column="orientation"/>
        <result property="punchingResult" column="punching_Result"/>
    </resultMap>

    <select id="getBaseBarcodesInByQuery" resultMap="BaseBarcodesInResult"
            parameterType="String">
        SELECT
        *
        FROM
        base_barcodes_in
        <if test="qrCode !=null and qrCode != '' ">
            WHERE
            base_barcodes_in.qr_code =#{qrCode}
        </if>
    </select>

    <select id="getBaseBarcodesInByDerice" resultMap="BaseBarcodesInResult"
            parameterType="com.shkj.wms.domain.BaseDerive">
        SELECT
        *
        FROM
        base_barcodes_in
        WHERE 1=1
        <if test="color != null and color != ''">
            AND color = #{color}
        </if>
        <if test="vehicheModel != null  and vehicheModel != '' ">
            AND vehiche_model = #{vehicheModel}
        </if>
        <if test="isSplit != null  and isSplit != '' ">
            AND is_split = #{isSplit}
        </if>
        <if test="isPunching != null  and isPunching != '' ">
            AND is_punching = #{isPunching}
        </if>
        <if test="orientation != null  and orientation != '' ">
            AND orientation = #{orientation}
        </if>
        <if test="locationCode != null  and locationCode != '' ">
            AND location_code = #{locationCode}
        </if>
        LIMIT 1
    </select>

    <select id="getBillInPlanData" resultMap="BaseBarcodesInResult"
            parameterType="com.shkj.wms.bo.BaseBarcodesInQueryBo">
        SELECT
        *
        FROM
        base_barcodes_in
        WHERE 1=1
        <if test="color != null  and color != '' ">
            AND color = #{color}
        </if>
        <if test="vehicheModel != null  and vehicheModel != '' ">
            AND vehiche_model = #{vehicheModel}
        </if>
        <if test="isSplit != null  and isSplit != '' ">
            AND is_split = #{isSplit}
        </if>
        <if test="isPunching != null  and isPunching != '' ">
            AND is_punching = #{isPunching}
        </if>
        <if test="orientation != null  and orientation != '' ">
            AND orientation = #{orientation}
        </if>
        <if test="locationCode != null  and locationCode != ''">
            AND location_code = #{locationCode}
        </if>
        <if test="qrCode != null  and qrCode != '' ">
            AND qr_code = #{qrCode}
        </if>

        <if test="inStatus != null  and inStatus != ''">
            AND in_status = #{inStatus}
        </if>

        <if test="createTimeS != null ">
            AND create_Time &gt;= #{createTimeS}
        </if>

        <if test="createTimeE != null ">
            AND create_Time &lt;= #{createTimeE}
        </if>

    </select>

</mapper>
