<?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="cn.ezhizao.project.business.mapper.BizMaterialBaseMapper">

    <resultMap type="cn.ezhizao.project.business.domain.BizMaterialBase" id="BizMaterialBaseResult">
        <id column="id" property="id"/>
    </resultMap>


    <select id="getList" parameterType="BizMaterialBase" resultMap="BizMaterialBaseResult">
        SELECT * FROM biz_material_base_info
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            deleted = 0
            <if test="materialCode != null  and materialCode != ''"> AND material_code = #{materialCode}</if>
            <if test="type != null  and type != ''"> AND type = #{type}</if>
            <if test="mnemonicCode != null  and mnemonicCode != ''"> AND mnemonic_code = #{mnemonicCode}</if>
            <if test="itemtype != null  and itemtype != ''"> AND itemtype = #{itemtype}</if>
            <if test="steelClass != null  and steelClass != ''"> AND steel_class = #{steelClass}</if>
            <if test="repCode != null  and repCode != ''"> AND rep_code = #{repCode}</if>
            <if test="barcode != null  and barcode != ''"> AND barcode = #{barcode}</if>
            <if test="prloc != null  and prloc != ''"> AND prloc = #{prloc}</if>
            <if test="dept != null  and dept != ''"> AND dept = #{dept}</if>
            <if test="description != null  and description != ''"> AND description = #{description}</if>
            <if test="specification != null  and specification != ''"> AND specification = #{specification}</if>
            <if test="uom != null  and uom != ''"> AND uom = #{uom}</if>
            <if test="pounit != null  and pounit != ''"> AND pounit = #{pounit}</if>
            <if test="pofact != null "> AND pofact = #{pofact}</if>
            <if test="counit != null  and counit != ''"> AND counit = #{counit}</if>
            <if test="cofact != null "> AND cofact = #{cofact}</if>
            <if test="sounit != null  and sounit != ''"> AND sounit = #{sounit}</if>
            <if test="sofact != null "> AND sofact = #{sofact}</if>
            <if test="wunit != null  and wunit != ''"> AND wunit = #{wunit}</if>
            <if test="weight != null "> AND weight = #{weight}</if>
            <if test="weigs != null "> AND weigs = #{weigs}</if>
            <if test="volume != null "> AND volume = #{volume}</if>
            <if test="rounded != null  and rounded != ''"> AND rounded = #{rounded}</if>
            <if test="draw != null  and draw != ''"> AND draw = #{draw}</if>
            <if test="mpsok != null  and mpsok != ''"> AND mpsok = #{mpsok}</if>
            <if test="isstype != null  and isstype != ''"> AND isstype = #{isstype}</if>
            <if test="bypass != null  and bypass != ''"> AND bypass = #{bypass}</if>
            <if test="batchqty != null "> AND batchqty = #{batchqty}</if>
            <if test="yield != null "> AND yield = #{yield}</if>
            <if test="commodity != null  and commodity != ''"> AND commodity = #{commodity}</if>
            <if test="prdline != null  and prdline != ''"> AND prdline = #{prdline}</if>
            <if test="salgrp != null  and salgrp != ''"> AND salgrp = #{salgrp}</if>
            <if test="prcgrp != null  and prcgrp != ''"> AND prcgrp = #{prcgrp}</if>
            <if test="fixmo != null  and fixmo != ''"> AND fixmo = #{fixmo}</if>
            <if test="prpart != null  and prpart != ''"> AND prpart = #{prpart}</if>
            <if test="attrctl != null  and attrctl != ''"> AND attrctl = #{attrctl}</if>
            <if test="abc != null  and abc != ''"> AND abc = #{abc}</if>
            <if test="abcctl != null  and abcctl != ''"> AND abcctl = #{abcctl}</if>
            <if test="lcydate != null "> AND lcydate = #{lcydate}</if>
            <if test="price != null "> AND price = #{price}</if>
            <if test="stdcost != null "> AND stdcost = #{stdcost}</if>
            <if test="material != null "> AND material = #{material}</if>
            <if test="thismaterial != null "> AND thismaterial = #{thismaterial}</if>
            <if test="prematerial != null "> AND prematerial = #{prematerial}</if>
            <if test="labor != null "> AND labor = #{labor}</if>
            <if test="thislabor != null "> AND thislabor = #{thislabor}</if>
            <if test="prelabor != null "> AND prelabor = #{prelabor}</if>
            <if test="overhead != null "> AND overhead = #{overhead}</if>
            <if test="thisoverhead != null "> AND thisoverhead = #{thisoverhead}</if>
            <if test="preoverhead != null "> AND preoverhead = #{preoverhead}</if>
            <if test="varover != null "> AND varover = #{varover}</if>
            <if test="mutqty2 != null "> AND mutqty2 = #{mutqty2}</if>
            <if test="avgprc != null "> AND avgprc = #{avgprc}</if>
            <if test="stdctl != null  and stdctl != ''"> AND stdctl = #{stdctl}</if>
            <if test="purchaser != null  and purchaser != ''"> AND purchaser = #{purchaser}</if>
            <if test="planner != null  and planner != ''"> AND planner = #{planner}</if>
            <if test="vendor1 != null  and vendor1 != ''"> AND vendor1 = #{vendor1}</if>
            <if test="safqty != null "> AND safqty = #{safqty}</if>
            <if test="reorder != null "> AND reorder = #{reorder}</if>
            <if test="minqty != null "> AND minqty = #{minqty}</if>
            <if test="maxqty != null "> AND maxqty = #{maxqty}</if>
            <if test="mutqty != null "> AND mutqty = #{mutqty}</if>
            <if test="maxperiod != null "> AND maxperiod = #{maxperiod}</if>
            <if test="merge != null  and merge != ''"> AND merge = #{merge}</if>
            <if test="lead != null "> AND lead = #{lead}</if>
            <if test="duration != null "> AND duration = #{duration}</if>
            <if test="varbase1 != null "> AND varbase1 = #{varbase1}</if>
            <if test="varbase != null "> AND varbase = #{varbase}</if>
            <if test="planitem != null  and planitem != ''"> AND planitem = #{planitem}</if>
            <if test="police != null  and police != ''"> AND police = #{police}</if>
            <if test="llc != null "> AND llc = #{llc}</if>
            <if test="onhand != null "> AND onhand = #{onhand}</if>
            <if test="onorder != null "> AND onorder = #{onorder}</if>
            <if test="allocate != null "> AND allocate = #{allocate}</if>
            <if test="iqcqty != null "> AND iqcqty = #{iqcqty}</if>
            <if test="priceflag != null  and priceflag != ''"> AND priceflag = #{priceflag}</if>
            <if test="merchandise != null  and merchandise != ''"> AND merchandise = #{merchandise}</if>
            <if test="lot != null  and lot != ''"> AND lot = #{lot}</if>
            <if test="aux != null  and aux != ''"> AND aux = #{aux}</if>
            <if test="auxunit != null  and auxunit != ''"> AND auxunit = #{auxunit}</if>
            <if test="auxqty != null "> AND auxqty = #{auxqty}</if>
            <if test="status != null  and status != ''"> AND status = #{status}</if>
            <if test="lsttxdate != null "> AND lsttxdate = #{lsttxdate}</if>
            <if test="subor != null "> AND subor = #{subor}</if>
            <if test="thissubor != null "> AND thissubor = #{thissubor}</if>
            <if test="presubor != null "> AND presubor = #{presubor}</if>
            <if test="other != null "> AND other = #{other}</if>
            <if test="thisother != null "> AND thisother = #{thisother}</if>
            <if test="preother != null "> AND preother = #{preother}</if>
            <if test="createdate != null "> AND createdate = #{createdate}</if>
            <if test="createuser != null  and createuser != ''"> AND createuser = #{createuser}</if>
            <if test="modifydate != null "> AND modifydate = #{modifydate}</if>
            <if test="modifyuser != null  and modifyuser != ''"> AND modifyuser = #{modifyuser}</if>
            <if test="rs != null  and rs != ''"> AND rs = #{rs}</if>
            <if test="bkitem != null  and bkitem != ''"> AND bkitem = #{bkitem}</if>
            <if test="bond != null  and bond != ''"> AND bond = #{bond}</if>
            <if test="bissue != null  and bissue != ''"> AND bissue = #{bissue}</if>
            <if test="qclead != null "> AND qclead = #{qclead}</if>
            <if test="tfcode != null  and tfcode != ''"> AND tfcode = #{tfcode}</if>
            <if test="stdlabor != null "> AND stdlabor = #{stdlabor}</if>
            <if test="stdmachine != null "> AND stdmachine = #{stdmachine}</if>
            <if test="accumlabor != null "> AND accumlabor = #{accumlabor}</if>
            <if test="accumachine != null "> AND accumachine = #{accumachine}</if>
            <if test="mpsprice != null "> AND mpsprice = #{mpsprice}</if>
            <if test="mpscost != null "> AND mpscost = #{mpscost}</if>
            <if test="bigclass != null  and bigclass != ''"> AND bigclass = #{bigclass}</if>
            <if test="smlclass != null  and smlclass != ''"> AND smlclass = #{smlclass}</if>
            <if test="potype != null  and potype != ''"> AND potype = #{potype}</if>
            <if test="cstDynamical != null "> AND cst_dynamical = #{cstDynamical}</if>
            <if test="cstFactory != null  and cstFactory != ''"> AND cst_factory = #{cstFactory}</if>
            <if test="cstEquipment != null "> AND cst_equipment = #{cstEquipment}</if>
            <if test="cstType != null  and cstType != ''"> AND cst_type = #{cstType}</if>
            <if test="cstZj != null  and cstZj != ''"> AND cst_zj = #{cstZj}</if>
            <if test="cstPartm != null  and cstPartm != ''"> AND cst_partm = #{cstPartm}</if>
            <if test="cstKamt != null "> AND cst_kamt = #{cstKamt}</if>
            <if test="jsyq != null  and jsyq != ''"> AND jsyq = #{jsyq}</if>
            <if test="xzcode != null  and xzcode != ''"> AND xzcode = #{xzcode}</if>
            <if test="zjunprc != null "> AND zjunprc = #{zjunprc}</if>
            <if test="purtype != null  and purtype != ''"> AND purtype = #{purtype}</if>
            <if test="phcode != null  and phcode != ''"> AND phcode = #{phcode}</if>
            <if test="xhcode != null  and xhcode != ''"> AND xhcode = #{xhcode}</if>
            <if test="addcode != null  and addcode != ''"> AND addcode = #{addcode}</if>
            <if test="cdcode != null  and cdcode != ''"> AND cdcode = #{cdcode}</if>
            <if test="cptype != null  and cptype != ''"> AND cptype = #{cptype}</if>
            <if test="shaft != null  and shaft != ''"> AND shaft = #{shaft}</if>
            <if test="density != null "> AND density = #{density}</if>
            <if test="lenght != null "> AND lenght = #{lenght}</if>
            <if test="dzj != null "> AND dzj = #{dzj}</if>
            <if test="lenghts != null  and lenghts != ''"> AND lenghts = #{lenghts}</if>
            <if test="gccd != null "> AND gccd = #{gccd}</if>
            <if test="dzjs != null  and dzjs != ''"> AND dzjs = #{dzjs}</if>
            <if test="onqty != null "> AND onqty = #{onqty}</if>
            <if test="khjc != null  and khjc != ''"> AND khjc = #{khjc}</if>
            <if test="invdate != null "> AND invdate = #{invdate}</if>
            <if test="khpart != null  and khpart != ''"> AND khpart = #{khpart}</if>
            <if test="zlcd != null  and zlcd != ''"> AND zlcd = #{zlcd}</if>
            <if test="jsyq1 != null  and jsyq1 != ''"> AND jsyq1 = #{jsyq1}</if>
            <if test="rkbz != null  and rkbz != ''"> AND rkbz = #{rkbz}</if>
            <if test="hpart != null  and hpart != ''"> AND hpart = #{hpart}</if>
            <if test="luhao != null  and luhao != ''"> AND luhao = #{luhao}</if>
            <if test="facno != null  and facno != ''"> AND facno = #{facno}</if>
            <if test="orderno != null  and orderno != ''"> AND orderno = #{orderno}</if>
            <if test="bzhs != null "> AND bzhs = #{bzhs}</if>
            <if test="spcode != null  and spcode != ''"> AND spcode = #{spcode}</if>
            <if test="spname != null  and spname != ''"> AND spname like concat('%', #{spname}, '%')</if>
            <if test="cust != null  and cust != ''"> AND cust = #{cust}</if>
            <if test="yzj != null "> AND yzj = #{yzj}</if>
            <if test="writeuser != null  and writeuser != ''"> AND writeuser = #{writeuser}</if>
            <if test="writedate != null "> AND writedate = #{writedate}</if>
            <if test="writeruser != null  and writeruser != ''"> AND writeruser = #{writeruser}</if>
            <if test="dtype != null  and dtype != ''"> AND dtype = #{dtype}</if>
            <if test="zjbxprc != null "> AND zjbxprc = #{zjbxprc}</if>
        </trim>
    </select>

    <delete id="physicalDelete">
        DELETE FROM biz_material_base
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            <if test="id != null">
                id = #{id} AND
            </if>
       <!-- 删除条件为其他外键可以在这里加 -->
        </trim>
    </delete>
</mapper>
