You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
458 lines
26 KiB
XML
458 lines
26 KiB
XML
<?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.hw.mes.mapper.MesBaseBarcodeInfoMapper">
|
|
|
|
<resultMap type="MesBaseBarcodeInfo" id="MesBaseBarcodeInfoResult">
|
|
<result property="barcodeId" column="barcode_id"/>
|
|
<result property="printTime" column="print_time"/>
|
|
<result property="printPerson" column="print_person"/>
|
|
<result property="printFlag" column="print_flag"/>
|
|
<result property="batchFlag" column="batch_flag"/>
|
|
<result property="barcodeType" column="barcode_type"/>
|
|
<result property="singleFlag" column="single_flag"/>
|
|
<result property="barcodeInfo" column="barcode_info"/>
|
|
<result property="batchCode" column="batch_code"/>
|
|
<result property="palletInfoCode" column="pallet_info_code"/>
|
|
<result property="bindBarcode" column="bind_barcode"/>
|
|
<result property="materialId" column="material_id"/>
|
|
<result property="barcodeSpec" column="barcode_spec"/>
|
|
<result property="manufacturerId" column="manufacturer_id"/>
|
|
<result property="amount" column="amount"/>
|
|
<result property="productBarcode" column="product_barcode"/>
|
|
<result property="machineName" column="machine_name"/>
|
|
<result property="printNumber" column="print_number"/>
|
|
<result property="purchaseOrderId" column="purchase_order_id"/>
|
|
<result property="poNo" column="po_no"/>
|
|
<result property="productionDate" column="production_date"/>
|
|
<result property="acceptedDate" column="accepted_date"/>
|
|
<result property="lastOutstockDate" column="last_outstock_date"/>
|
|
<result property="planCode" column="plan_code"/>
|
|
<result property="planDetailCode" column="plan_detail_code"/>
|
|
<result property="safeFlag" column="safe_flag"/>
|
|
<result property="saleOrderId" column="sale_order_id"/>
|
|
<result property="saleorderCode" column="saleorder_code"/>
|
|
<result property="projectNo" column="project_no"/>
|
|
<result property="completeFlag" column="complete_flag"/>
|
|
<result property="transferredPlanDetailCode" column="transferred_plan_detail_code"/>
|
|
<result property="serialNumber" column="serial_number"/>
|
|
<result property="remark" column="remark"/>
|
|
<result property="bindStatus" column="bind_status"/>
|
|
<result property="bindBy" column="bind_by"/>
|
|
<result property="bindTime" column="bind_time"/>
|
|
<result property="updateBy" column="update_by"/>
|
|
<result property="updateTime" column="update_time"/>
|
|
<result property="materialCode" column="material_code"/>
|
|
<result property="materialName" column="material_name"/>
|
|
<result property="materialSpec" column="material_spec"/>
|
|
<result property="alwaysFlag" column="always_flag"/>
|
|
<result property="checkStatus" column="checkStatus"/>
|
|
<result property="locationBarcodeId" column="location_barcode_id"/>
|
|
</resultMap>
|
|
|
|
<sql id="selectMesBaseBarcodeInfoVo">
|
|
select bbi.barcode_id,
|
|
bbi.print_time,
|
|
bbi.print_person,
|
|
bbi.batch_flag,
|
|
bbi.barcode_type,
|
|
bbi.barcode_info,
|
|
bbi.batch_code,
|
|
bbi.single_flag,
|
|
bbi.pallet_info_code,
|
|
bbi.bind_barcode,
|
|
bbi.material_id,
|
|
bbi.barcode_spec,
|
|
bmi.material_code,
|
|
bmi.material_name,
|
|
bmi.material_spec,
|
|
bbi.manufacturer_id,
|
|
bbi.product_barcode,
|
|
bbi.amount,
|
|
bbi.machine_name,
|
|
bbi.print_number,
|
|
bbi.purchase_order_id,
|
|
bbi.po_no,
|
|
bbi.production_date,
|
|
bbi.accepted_date,
|
|
bbi.complete_flag,
|
|
bbi.last_outstock_date,
|
|
bbi.plan_code,
|
|
bbi.plan_detail_code,
|
|
bbi.safe_flag,
|
|
bbi.sale_order_id,
|
|
bbi.saleorder_code,
|
|
bbi.project_no,
|
|
bbi.transferred_plan_detail_code,
|
|
bbi.print_flag,
|
|
bbi.serial_number,
|
|
bbi.remark,
|
|
bbi.bind_status,
|
|
bbi.bind_by,
|
|
bbi.bind_time,
|
|
bbi.update_by,
|
|
bbi.update_time
|
|
from mes_base_barcode_info bbi
|
|
left join mes_base_material_info bmi on bmi.material_id = bbi.material_id
|
|
</sql>
|
|
|
|
<select id="selectMesBaseBarcodeInfoList" parameterType="MesBaseBarcodeInfo" resultMap="MesBaseBarcodeInfoResult">
|
|
<include refid="selectMesBaseBarcodeInfoVo"/>
|
|
<where>
|
|
<if test="printTime != null ">and bbi.print_time = #{printTime}</if>
|
|
<if test="printPerson != null and printPerson != ''">and bbi.print_person = #{printPerson}</if>
|
|
<if test="printFlag != null and printFlag != ''">and bbi.print_flag = #{printFlag}</if>
|
|
<if test="batchFlag != null and batchFlag != ''">and bbi.batch_flag = #{batchFlag}</if>
|
|
<if test="barcodeType != null and barcodeType != ''">and bbi.barcode_type = #{barcodeType}</if>
|
|
<if test="singleFlag != null and singleFlag != ''">and bbi.single_flag = #{singleFlag}</if>
|
|
<if test="barcodeInfo != null and barcodeInfo != ''">and bbi.barcode_info = #{barcodeInfo}</if>
|
|
<if test="batchCode != null and batchCode != ''">and bbi.batch_code = #{batchCode}</if>
|
|
<if test="palletInfoCode != null and palletInfoCode != ''">and bbi.pallet_info_code = #{palletInfoCode}</if>
|
|
<if test="bindBarcode != null and bindBarcode != ''">and bbi.bind_barcode = #{bindBarcode}</if>
|
|
<if test="rawFlag != null and rawFlag != ''">and bbi.single_flag in ('0','3')</if>
|
|
<if test="materialId != null ">and bbi.material_id = #{materialId}</if>
|
|
|
|
<if test="materialCode != null and materialCode != '' ">and bmi.material_code like concat('%', #{materialCode},
|
|
'%')</if>
|
|
<if test="materialName != null and materialName != '' ">and bmi.material_name like concat('%', #{materialName},
|
|
'%')</if>
|
|
<if test="materialSpec != null and materialSpec != '' ">and replace(bmi.material_spec,' ','') like concat('%', #{materialSpec},
|
|
'%')</if>
|
|
<if test="barcodeSpec != null and barcodeSpec != '' ">and replace(bbi.barcode_spec,' ','') like concat('%', #{barcodeSpec},
|
|
'%')</if>
|
|
|
|
<if test="manufacturerId != null ">and bbi.manufacturer_id = #{manufacturerId}</if>
|
|
<if test="amount != null ">and bbi.amount = #{amount}</if>
|
|
<if test="machineName != null and machineName != ''">and bbi.machine_name like concat('%', #{machineName},
|
|
'%')
|
|
</if>
|
|
<if test="printNumber != null ">and bbi.print_number = #{printNumber}</if>
|
|
<if test="poNo != null and poNo != ''">and bbi.po_no like concat('%', #{poNo},
|
|
'%')</if>
|
|
<if test="productionDate != null ">and bbi.production_date = #{productionDate}</if>
|
|
<if test="acceptedDate != null ">and bbi.accepted_date = #{acceptedDate}</if>
|
|
<if test="lastOutstockDate != null ">and bbi.last_outstock_date = #{lastOutstockDate}</if>
|
|
<if test="planCode != null and planCode != ''">and bbi.plan_code = #{planCode}</if>
|
|
<if test="planDetailCode != null and planDetailCode != ''">and bbi.plan_detail_code = #{planDetailCode}</if>
|
|
<if test="saleOrderId != null ">and bbi.sale_order_id = #{saleOrderId}</if>
|
|
<if test="saleorderCode != null and saleorderCode != ''">and bbi.saleorder_code like concat('%', #{saleorderCode},
|
|
'%')</if>
|
|
<if test="projectNo != null and projectNo != ''">and bbi.project_no = #{projectNo}</if>
|
|
<if test="serialNumber != null and serialNumber != ''">and bbi.serial_number = #{serialNumber}</if>
|
|
<if test="bindStatus != null and bindStatus != ''">and bbi.bind_status = #{bindStatus}</if>
|
|
<if test="bindBy != null and bindBy != ''">and bbi.bind_by = #{bindBy}</if>
|
|
<if test="bindTime != null ">and bbi.bind_time = #{bindTime}</if>
|
|
<if test="updateBy != null and updateBy != ''">and bbi.update_by = #{updateBy}</if>
|
|
<if test="updateTime != null ">and bbi.update_time = #{updateTime}</if>
|
|
<if test="barcodeTypeStr != null and barcodeTypeStr != ''">and bbi.barcode_type in (${barcodeTypeStr})</if>
|
|
|
|
<if test="bindOrFlag != null and bindOrFlag != '' and planDetailCode != null and planDetailCode != ''">
|
|
or exists
|
|
(select 1 from mes_base_barcode_info mbbi where mbbi.plan_detail_code =#{planDetailCode}
|
|
and bbi.bind_barcode=mbbi.barcode_info)</if>
|
|
|
|
</where>
|
|
order by bbi.barcode_id desc
|
|
</select>
|
|
|
|
<select id="selectMesBaseBarcodeInfoByBarcodeId" parameterType="Long" resultMap="MesBaseBarcodeInfoResult">
|
|
<include refid="selectMesBaseBarcodeInfoVo"/>
|
|
where bbi.barcode_id = #{barcodeId}
|
|
</select>
|
|
|
|
<insert id="insertMesBaseBarcodeInfo" parameterType="MesBaseBarcodeInfo" useGeneratedKeys="true"
|
|
keyProperty="barcodeId">
|
|
insert into mes_base_barcode_info
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="printTime != null">print_time,</if>
|
|
<if test="printPerson != null">print_person,</if>
|
|
<if test="printFlag != null and printFlag != ''">print_flag,</if>
|
|
<if test="batchFlag != null and batchFlag != ''">batch_flag,</if>
|
|
<if test="barcodeType != null and barcodeType != ''">barcode_type,</if>
|
|
<if test="singleFlag != null and singleFlag != ''">single_flag,</if>
|
|
<if test="barcodeInfo != null and barcodeInfo != ''">barcode_info,</if>
|
|
<if test="batchCode != null and batchCode != ''">batch_code,</if>
|
|
<if test="palletInfoCode != null">pallet_info_code,</if>
|
|
<if test="bindBarcode != null">bind_barcode,</if>
|
|
<if test="materialId != null">material_id,</if>
|
|
<if test="barcodeSpec != null and barcodeSpec != ''">barcode_spec,</if>
|
|
<if test="manufacturerId != null">manufacturer_id,</if>
|
|
<if test="amount != null">amount,</if>
|
|
<if test="productBarcode != null">product_barcode,</if>
|
|
<if test="machineName != null">machine_name,</if>
|
|
<if test="printNumber != null">print_number,</if>
|
|
<if test="purchaseOrderId != null">purchase_order_id,</if>
|
|
<if test="poNo != null">po_no,</if>
|
|
<if test="productionDate != null">production_date,</if>
|
|
<if test="acceptedDate != null">accepted_date,</if>
|
|
<if test="lastOutstockDate != null">last_outstock_date,</if>
|
|
<if test="planCode != null">plan_code,</if>
|
|
<if test="planDetailCode != null">plan_detail_code,</if>
|
|
<if test="safeFlag != null">safe_flag,</if>
|
|
<if test="saleOrderId != null">sale_order_id,</if>
|
|
<if test="saleorderCode != null">saleorder_code,</if>
|
|
<if test="projectNo != null">project_no,</if>
|
|
<if test="completeFlag != null">complete_flag,</if>
|
|
<if test="serialNumber != null">serial_number,</if>
|
|
<if test="remark != null">remark,</if>
|
|
<if test="bindStatus != null">bind_status,</if>
|
|
<if test="bindBy != null">bind_by,</if>
|
|
<if test="bindTime != null">bind_time,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="printTime != null">#{printTime},</if>
|
|
<if test="printPerson != null">#{printPerson},</if>
|
|
<if test="printFlag != null and printFlag != ''">#{printFlag},</if>
|
|
<if test="batchFlag != null and batchFlag != ''">#{batchFlag},</if>
|
|
<if test="barcodeType != null and barcodeType != ''">#{barcodeType},</if>
|
|
<if test="singleFlag != null and singleFlag != ''">#{singleFlag},</if>
|
|
<if test="barcodeInfo != null and barcodeInfo != ''">#{barcodeInfo},</if>
|
|
<if test="batchCode != null and batchCode != ''">#{batchCode},</if>
|
|
<if test="palletInfoCode != null">#{palletInfoCode},</if>
|
|
<if test="bindBarcode != null">#{bindBarcode},</if>
|
|
<if test="materialId != null">#{materialId},</if>
|
|
<if test="barcodeSpec != null and barcodeSpec != ''">#{barcodeSpec},</if>
|
|
<if test="manufacturerId != null">#{manufacturerId},</if>
|
|
<if test="amount != null">#{amount},</if>
|
|
<if test="productBarcode != null">#{productBarcode},</if>
|
|
<if test="machineName != null">#{machineName},</if>
|
|
<if test="printNumber != null">#{printNumber},</if>
|
|
<if test="purchaseOrderId != null">#{purchaseOrderId},</if>
|
|
<if test="poNo != null">#{poNo},</if>
|
|
<if test="productionDate != null">#{productionDate},</if>
|
|
<if test="acceptedDate != null">#{acceptedDate},</if>
|
|
<if test="lastOutstockDate != null">#{lastOutstockDate},</if>
|
|
<if test="planCode != null">#{planCode},</if>
|
|
<if test="planDetailCode != null">#{planDetailCode},</if>
|
|
<if test="safeFlag != null">#{safeFlag},</if>
|
|
<if test="saleOrderId != null">#{saleOrderId},</if>
|
|
<if test="saleorderCode != null">#{saleorderCode},</if>
|
|
<if test="projectNo != null">#{projectNo},</if>
|
|
<if test="completeFlag != null">#{completeFlag},</if>
|
|
<if test="serialNumber != null">#{serialNumber},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
<if test="bindStatus != null">#{bindStatus},</if>
|
|
<if test="bindBy != null">#{bindBy},</if>
|
|
<if test="bindTime != null">#{bindTime},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateMesBaseBarcodeInfo" parameterType="MesBaseBarcodeInfo">
|
|
update mes_base_barcode_info
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="printTime != null">print_time = #{printTime},</if>
|
|
<if test="printPerson != null">print_person = #{printPerson},</if>
|
|
<if test="batchFlag != null and batchFlag != ''">batch_flag = #{batchFlag},</if>
|
|
<if test="printFlag != null and printFlag != ''">print_flag = #{printFlag},</if>
|
|
<if test="barcodeType != null and barcodeType != ''">barcode_type = #{barcodeType},</if>
|
|
<if test="barcodeInfo != null and barcodeInfo != ''">barcode_info = #{barcodeInfo},</if>
|
|
<if test="batchCode != null and batchCode != ''">batch_code = #{batchCode},</if>
|
|
<if test="palletInfoCode != null">pallet_info_code = #{palletInfoCode},</if>
|
|
<if test="materialId != null">material_id = #{materialId},</if>
|
|
<if test="manufacturerId != null">manufacturer_id = #{manufacturerId},</if>
|
|
<if test="amount != null">amount = #{amount},</if>
|
|
<if test="machineName != null">machine_name = #{machineName},</if>
|
|
<if test="printNumber != null">print_number = #{printNumber},</if>
|
|
<if test="poNo != null">po_no = #{poNo},</if>
|
|
<if test="productionDate != null">production_date = #{productionDate},</if>
|
|
<if test="acceptedDate != null">accepted_date = #{acceptedDate},</if>
|
|
<if test="lastOutstockDate != null">last_outstock_date = #{lastOutstockDate},</if>
|
|
<if test="planCode != null">plan_code = #{planCode},</if>
|
|
<if test="planDetailCode != null">plan_detail_code = #{planDetailCode},</if>
|
|
<if test="saleOrderId != null">sale_order_id = #{saleOrderId},</if>
|
|
<if test="saleorderCode != null">saleorder_code = #{saleorderCode},</if>
|
|
<if test="safeFlag != null and safeFlag != ''">safe_flag = #{safeFlag},</if>
|
|
<if test="projectNo != null">project_no = #{projectNo},</if>
|
|
<if test="transferredPlanDetailCode != null">transferred_plan_detail_code = #{transferredPlanDetailCode},</if>
|
|
<if test="serialNumber != null">serial_number = #{serialNumber},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
<if test="bindBarcode != null">bind_barcode = #{bindBarcode},</if>
|
|
<if test="bindStatus != null">bind_status = #{bindStatus},</if>
|
|
<if test="bindBy != null">bind_by = #{bindBy},</if>
|
|
<if test="bindTime != null">bind_time = #{bindTime},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
</trim>
|
|
where barcode_id = #{barcodeId}
|
|
</update>
|
|
|
|
<delete id="deleteMesBaseBarcodeInfoByBarcodeId" parameterType="Long">
|
|
delete
|
|
from mes_base_barcode_info
|
|
where barcode_id = #{barcodeId}
|
|
</delete>
|
|
|
|
<delete id="deleteMesBaseBarcodeInfoByBarcodeIds" parameterType="String">
|
|
delete from mes_base_barcode_info where barcode_id in
|
|
<foreach item="barcodeId" collection="array" open="(" separator="," close=")">
|
|
#{barcodeId}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<select id="selectMesBaseBarcodeInfoByBarcodeInfo" parameterType="String" resultMap="MesBaseBarcodeInfoResult">
|
|
<include refid="selectMesBaseBarcodeInfoVo"/>
|
|
where bbi.barcode_info = #{barcodeInfo} limit 1
|
|
</select>
|
|
|
|
<select id="selectMesBaseBarcodeInfoByBindBarcode" parameterType="String" resultMap="MesBaseBarcodeInfoResult">
|
|
<include refid="selectMesBaseBarcodeInfoVo"/>
|
|
where bbi.bind_barcode = #{bindBarcode} limit 1
|
|
</select>
|
|
|
|
|
|
<select id="selectMesBaseBarcodeInfoByProductBarcode" parameterType="String" resultMap="MesBaseBarcodeInfoResult">
|
|
<include refid="selectMesBaseBarcodeInfoVo"/>
|
|
where bbi.product_barcode = #{productBarcode} limit 1
|
|
</select>
|
|
|
|
|
|
<select id="selectMesBaseBarcodeInfoByLikeProductBarcode" parameterType="String" resultMap="MesBaseBarcodeInfoResult">
|
|
<include refid="selectMesBaseBarcodeInfoVo"/>
|
|
where bbi.product_barcode like concat('%', #{productBarcode},'%') limit 1
|
|
</select>
|
|
|
|
<select id="selectMesBaseBarcodeInfoCount" parameterType="MesBaseBarcodeInfo">
|
|
select count(1) from mes_base_barcode_info bbi
|
|
<where>
|
|
<if test="purchaseOrderId != null ">and bbi.purchase_order_id = #{purchaseOrderId}</if>
|
|
<if test="productBarcode != null and productBarcode != ''">and bbi.product_barcode = #{productBarcode}</if>
|
|
|
|
|
|
<if test="printTime != null ">and bbi.print_time = #{printTime}</if>
|
|
<if test="printPerson != null and printPerson != ''">and bbi.print_person = #{printPerson}</if>
|
|
<if test="printFlag != null and printFlag != ''">and bbi.print_flag = #{printFlag}</if>
|
|
<if test="batchFlag != null and batchFlag != ''">and bbi.batch_flag = #{batchFlag}</if>
|
|
<if test="barcodeType != null and barcodeType != ''">and bbi.barcode_type = #{barcodeType}</if>
|
|
<if test="barcodeInfo != null and barcodeInfo != ''">and bbi.barcode_info = #{barcodeInfo}</if>
|
|
<if test="batchCode != null and batchCode != ''">and bbi.batch_code = #{batchCode}</if>
|
|
<if test="palletInfoCode != null and palletInfoCode != ''">and bbi.pallet_info_code = #{palletInfoCode}</if>
|
|
<if test="materialId != null ">and bbi.material_id = #{materialId}</if>
|
|
<if test="manufacturerId != null ">and bbi.manufacturer_id = #{manufacturerId}</if>
|
|
<if test="amount != null ">and bbi.amount = #{amount}</if>
|
|
<if test="machineName != null and machineName != ''">and bbi.machine_name like concat('%', #{machineName},
|
|
'%')
|
|
</if>
|
|
<if test="printNumber != null ">and bbi.print_number = #{printNumber}</if>
|
|
<if test="poNo != null and poNo != ''">and bbi.po_no = #{poNo}</if>
|
|
<if test="productionDate != null ">and bbi.production_date = #{productionDate}</if>
|
|
<if test="acceptedDate != null ">and bbi.accepted_date = #{acceptedDate}</if>
|
|
<if test="lastOutstockDate != null ">and bbi.last_outstock_date = #{lastOutstockDate}</if>
|
|
<if test="planCode != null and planCode != ''">and bbi.plan_code = #{planCode}</if>
|
|
<if test="planDetailCode != null and planDetailCode != ''">and bbi.plan_detail_code = #{planDetailCode}</if>
|
|
<if test="saleOrderId != null ">and bbi.sale_order_id = #{saleOrderId}</if>
|
|
<if test="saleorderCode != null and saleorderCode != ''">and bbi.saleorder_code = #{saleorderCode}</if>
|
|
<if test="projectNo != null and projectNo != ''">and bbi.project_no = #{projectNo}</if>
|
|
<if test="serialNumber != null and serialNumber != ''">and bbi.serial_number = #{serialNumber}</if>
|
|
<if test="bindStatus != null and bindStatus != ''">and bbi.bind_status = #{bindStatus}</if>
|
|
<if test="bindBy != null and bindBy != ''">and bbi.bind_by = #{bindBy}</if>
|
|
<if test="bindTime != null ">and bbi.bind_time = #{bindTime}</if>
|
|
<if test="updateBy != null and updateBy != ''">and bbi.update_by = #{updateBy}</if>
|
|
<if test="updateTime != null ">and bbi.update_time = #{updateTime}</if>
|
|
</where>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectMesBaseBarcodeInfoJoinByBarcodeId" parameterType="Long" resultMap="MesBaseBarcodeInfoResult">
|
|
select bbi.barcode_id,
|
|
bbi.print_time,
|
|
bbi.print_person,
|
|
bbi.batch_flag,
|
|
bbi.barcode_type,
|
|
bbi.barcode_info,
|
|
bbi.batch_code,
|
|
bbi.pallet_info_code,
|
|
bbi.bind_barcode,
|
|
bbi.material_id,
|
|
bbi.barcode_spec,
|
|
bbi.manufacturer_id,
|
|
bbi.product_barcode,
|
|
bbi.amount,
|
|
bbi.machine_name,
|
|
bbi.print_number,
|
|
bbi.purchase_order_id,
|
|
bbi.po_no,
|
|
bbi.production_date,
|
|
bbi.accepted_date,
|
|
bbi.last_outstock_date,
|
|
bbi.plan_code,
|
|
bbi.plan_detail_code,
|
|
bbi.safe_flag,
|
|
bbi.sale_order_id,
|
|
bbi.saleorder_code,
|
|
bbi.project_no,
|
|
bbi.print_flag,
|
|
bbi.bind_status,
|
|
bbi.bind_by,
|
|
bbi.bind_time,
|
|
bmi.material_code,
|
|
bmi.material_name,
|
|
bmi.material_spec,
|
|
bmi.always_flag,
|
|
qcr.check_status
|
|
from mes_base_barcode_info bbi
|
|
left join mes_base_material_info bmi on bmi.material_id = bbi.material_id
|
|
left join qms_check_result qcr on bbi.batch_code = qcr.material_batch
|
|
where bbi.barcode_id = #{barcodeId}
|
|
</select>
|
|
|
|
|
|
|
|
<insert id="batchMesBaseBarcodeInfo">
|
|
INSERT INTO mes_base_barcode_info (batch_flag,barcode_type,barcode_info,batch_code,material_id,barcode_spec,manufacturer_id,amount,purchase_order_id,po_no,production_date,accepted_date,last_outstock_date,plan_code,plan_detail_code,safe_flag,sale_order_id,saleorder_code,project_no,serial_number,remark,bind_status,update_by,update_time) VALUES
|
|
<foreach item="item" index="index" collection="list" separator=",">
|
|
( #{item.batchFlag}, #{item.barcodeType}, #{item.barcodeInfo}, #{item.batchCode}, #{item.materialId}, #{item.barcodeSpec}, #{item.manufacturerId}, #{item.amount}, #{item.purchaseOrderId}, #{item.poNo}, #{item.productionDate}, #{item.acceptedDate}, #{item.lastOutstockDate}, #{item.planCode},#{item.planDetailCode}, #{item.safeFlag},#{item.saleOrderId}, #{item.saleorderCode},#{item.projectNo}, #{item.serialNumber},#{item.remark}, #{item.bindStatus},#{item.updateBy}, #{item.updateTime})
|
|
</foreach>
|
|
</insert>
|
|
|
|
<select id="selectBarCodeAllocationWarehouse" parameterType="MesBaseBarcodeInfo" resultMap="MesBaseBarcodeInfoResult">
|
|
select bbi.barcode_id,
|
|
bbi.print_time,
|
|
bbi.print_person,
|
|
bbi.batch_flag,
|
|
bbi.barcode_type,
|
|
bbi.barcode_info,
|
|
bbi.material_id,
|
|
bmi.material_code,
|
|
bmi.material_name,
|
|
bmi.material_spec
|
|
from mes_base_barcode_info bbi
|
|
left join mes_base_material_info bmi on bmi.material_id = bbi.material_id
|
|
<where>
|
|
bbi.barcode_type = '9'
|
|
and not exists(select 1
|
|
from wms_location_barcode wlb
|
|
where bbi.barcode_info = wlb.barcode_info
|
|
and wlb.location_code = #{locationCode})
|
|
<if test="materialCode != null and materialCode != ''">and bmi.material_code like concat('%', #{materialCode},'%')</if>
|
|
<if test="materialName != null and materialName != ''">and bmi.material_name like concat('%', #{materialName},'%')</if>
|
|
<if test="barcodeInfo != null and barcodeInfo != ''">and bbi.barcode_info like concat('%', #{barcodeInfo},'%')</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectWarehouseBarCodeList" parameterType="MesBaseBarcodeInfo" resultMap="MesBaseBarcodeInfoResult">
|
|
select wlb.location_barcode_id,
|
|
wlb.location_code,
|
|
wlb.barcode_info,
|
|
bmi.material_id,
|
|
bmi.material_code,
|
|
bmi.material_name,
|
|
bmi.material_spec
|
|
from wms_location_barcode wlb
|
|
left join mes_base_material_info bmi on bmi.material_id = wlb.material_id
|
|
<where>
|
|
<if test="locationCode != null and locationCode != ''"> and wlb.location_code = #{locationCode}</if>
|
|
<if test="materialCode != null and materialCode != ''">and bmi.material_code like concat('%', #{materialCode},'%')</if>
|
|
<if test="materialName != null and materialName != ''">and bmi.material_name like concat('%', #{materialName},'%')</if>
|
|
<if test="barcodeInfo != null and barcodeInfo != ''">and wlb.barcode_info like concat('%', #{barcodeInfo},'%')</if>
|
|
</where>
|
|
</select>
|
|
|
|
</mapper>
|