<?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.huimv.getdata.mapper.ErpShengChanMapper">

    <select id="getShiJiChanLiang" resultType="com.huimv.getdata.entity.shengcan.ShiJiChanLiang"
            parameterType="java.util.Date">
        SELECT B.FREALQTY , A.FDATE , A.FSTOCKORGID ,A.FPRDORGID ,C.FNAME wuLiaoName ,D.FNAME ,E.FNAME cheJianName , B.FWORKSHOPID  FROM T_PRD_INSTOCK A
        INNER JOIN T_PRD_INSTOCKENTRY  B ON A.FID  = B.FID
        INNER JOIN T_BD_MATERIAL_l  C ON C.FMATERIALID  = B.FMATERIALID
        INNER JOIN T_BD_STOCK_L  D ON D.FSTOCKID  = B.FSTOCKID
        INNER JOIN T_BD_DEPARTMENT_l  E ON E.FDEPTID  = B.FWORKSHOPID

        <if test="date !=null">
            where  A.FDATE >= #{date}
        </if>
    </select>
</mapper>
