万材erp项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

200 lines
15 KiB

2 years ago
<?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.ruoyi.stock.mapper.WarehousingManufactureNoticeMapper">
<resultMap type="WarehousingManufactureNotice" id="WarehousingManufactureNoticeResult">
<result property="warehousingmanufacturenoticeNo" column="warehousingManufactureNotice_NO" />
<result property="customerId" column="customer_ID" />
<result property="customerName" column="customer_name" />
<result property="warehousingType" column="warehousing_type" />
<result property="warehousingDate" column="warehousing_date" />
<result property="workorderNo" column="workOrder_NO" />
<result property="domesticOrExport" column="domesticOrExport" />
<result property="warehouseNo" column="warehouse_NO" />
<result property="warehouseName" column="warehouse_name" />
<result property="projectTimes" column="projectTimes" />
<result property="warehousingmanufactureNo" column="warehousingManufacture_NO" />
<result property="itemNo" column="item_NO" />
<result property="itemName" column="item_name" />
<result property="specificationModel" column="specificationModel" />
<result property="machineType" column="machine_type" />
<result property="unit" column="unit" />
<result property="warehousingAmt" column="warehousing_amt" />
<result property="noticeTime" column="notice_time" />
<result property="spell1" column="spell_1" />
<result property="spell2" column="spell_2" />
<result property="spell3" column="spell_3" />
</resultMap>
<resultMap id="WarehousingManufactureNoticeWarehousingCheckResult" type="WarehousingManufactureNotice" extends="WarehousingManufactureNoticeResult">
<collection property="warehousingCheckList" notNullColumn="sub_warehousingCheck_id" javaType="java.util.List" resultMap="WarehousingCheckResult" />
</resultMap>
<resultMap type="WarehousingCheck" id="WarehousingCheckResult">
<result property="warehousingcheckId" column="sub_warehousingCheck_id" />
<result property="warehousingnoticeId" column="sub_warehousingNotice_id" />
<result property="materialCode" column="sub_material_Code" />
<result property="materialName" column="sub_material_name" />
<result property="specificationModel" column="sub_specificationModel" />
<result property="machineType" column="sub_machineType" />
<result property="unit" column="sub_unit" />
<result property="orderAmt" column="sub_order_amt" />
<result property="qualifiedAmt" column="sub_qualified_amt" />
<result property="unqualifiedAmt" column="sub_unqualified_amt" />
<result property="qualifiedRate" column="sub_qualifiedRate" />
<result property="note" column="sub_note" />
<result property="batchNumber" column="sub_batchNumber" />
<result property="notcieTime" column="sub_notcieTime" />
<result property="checkTime" column="sub_checkTime" />
<result property="isQualified" column="sub_isQualified" />
<result property="inspector" column="sub_inspector" />
<result property="spell1" column="sub_spell_1" />
<result property="spell2" column="sub_spell_2" />
<result property="spell3" column="sub_spell_3" />
</resultMap>
<sql id="selectWarehousingManufactureNoticeVo">
select warehousingManufactureNotice_NO, customer_ID, customer_name, warehousing_type, warehousing_date, workOrder_NO, domesticOrExport, warehouse_NO, warehouse_name, projectTimes, warehousingManufacture_NO, item_NO, item_name, specificationModel, machine_type, unit, warehousing_amt, notice_time, spell_1, spell_2, spell_3 from warehousing_manufacture_notice
</sql>
<select id="selectWarehousingManufactureNoticeList" parameterType="WarehousingManufactureNotice" resultMap="WarehousingManufactureNoticeResult">
<include refid="selectWarehousingManufactureNoticeVo"/>
<where>
<if test="warehousingmanufacturenoticeNo != null and warehousingmanufacturenoticeNo != ''"> and warehousingManufactureNotice_NO = #{warehousingmanufacturenoticeNo}</if>
<if test="customerId != null and customerId != ''"> and customer_ID like concat('%', #{customerId}, '%')</if>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<if test="warehousingType != null and warehousingType != ''"> and warehousing_type like concat('%', #{warehousingType}, '%')</if>
<if test="params.beginWarehousingDate != null and params.beginWarehousingDate != '' and params.endWarehousingDate != null and params.endWarehousingDate != ''"> and warehousing_date between #{params.beginWarehousingDate} and #{params.endWarehousingDate}</if>
<if test="workorderNo != null and workorderNo != ''"> and workOrder_NO like concat('%', #{workorderNo}, '%')</if>
<if test="domesticOrExport != null and domesticOrExport != ''"> and domesticOrExport like concat('%', #{domesticOrExport}, '%')</if>
<if test="warehouseNo != null and warehouseNo != ''"> and warehouse_NO like concat('%', #{warehouseNo}, '%')</if>
<if test="warehouseName != null and warehouseName != ''"> and warehouse_name like concat('%', #{warehouseName}, '%')</if>
<if test="projectTimes != null and projectTimes != ''"> and projectTimes = #{projectTimes}</if>
<if test="warehousingmanufactureNo != null and warehousingmanufactureNo != ''"> and warehousingManufacture_NO like concat('%', #{warehousingmanufactureNo}, '%')</if>
<if test="itemNo != null and itemNo != ''"> and item_NO like concat('%', #{itemNo}, '%')</if>
<if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if>
<if test="specificationModel != null and specificationModel != ''"> and specificationModel like concat('%', #{specificationModel}, '%')</if>
<if test="machineType != null and machineType != ''"> and machine_type like concat('%', #{machineType}, '%')</if>
<if test="unit != null and unit != ''"> and unit like concat('%', #{unit}, '%')</if>
<if test="warehousingAmt != null and warehousingAmt != ''"> and warehousing_amt = #{warehousingAmt}</if>
<if test="params.beginNoticeTime != null and params.beginNoticeTime != '' and params.endNoticeTime != null and params.endNoticeTime != ''"> and notice_time between #{params.beginNoticeTime} and #{params.endNoticeTime}</if>
</where>
</select>
<select id="selectWarehousingManufactureNoticeById" parameterType="String" resultMap="WarehousingManufactureNoticeWarehousingCheckResult">
select a.warehousingManufactureNotice_NO, a.customer_ID, a.customer_name, a.warehousing_type, a.warehousing_date, a.workOrder_NO, a.domesticOrExport, a.warehouse_NO, a.warehouse_name, a.projectTimes, a.warehousingManufacture_NO, a.item_NO, a.item_name, a.specificationModel, a.machine_type, a.unit, a.warehousing_amt, a.notice_time, a.spell_1, a.spell_2, a.spell_3,
b.warehousingCheck_id as sub_warehousingCheck_id, b.warehousingNotice_id as sub_warehousingNotice_id, b.material_Code as sub_material_Code, b.material_name as sub_material_name, b.specificationModel as sub_specificationModel, b.machineType as sub_machineType, b.unit as sub_unit, b.order_amt as sub_order_amt, b.qualified_amt as sub_qualified_amt, b.unqualified_amt as sub_unqualified_amt, b.qualifiedRate as sub_qualifiedRate, b.note as sub_note, b.batchNumber as sub_batchNumber, b.notcieTime as sub_notcieTime, b.checkTime as sub_checkTime, b.isQualified as sub_isQualified, b.inspector as sub_inspector, b.spell_1 as sub_spell_1, b.spell_2 as sub_spell_2, b.spell_3 as sub_spell_3
from warehousing_manufacture_notice a
left join warehousing_check b on b.warehousingNotice_id = a.warehousingManufactureNotice_NO
where a.warehousingManufactureNotice_NO = #{warehousingmanufacturenoticeNo}
</select>
<insert id="insertWarehousingManufactureNotice" parameterType="WarehousingManufactureNotice">
insert into warehousing_manufacture_notice
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="warehousingmanufacturenoticeNo != null">warehousingManufactureNotice_NO,</if>
<if test="customerId != null">customer_ID,</if>
<if test="customerName != null">customer_name,</if>
<if test="warehousingType != null">warehousing_type,</if>
<if test="warehousingDate != null">warehousing_date,</if>
<if test="workorderNo != null and workorderNo != ''">workOrder_NO,</if>
<if test="domesticOrExport != null">domesticOrExport,</if>
<if test="warehouseNo != null">warehouse_NO,</if>
<if test="warehouseName != null">warehouse_name,</if>
<if test="projectTimes != null">projectTimes,</if>
<if test="warehousingmanufactureNo != null">warehousingManufacture_NO,</if>
<if test="itemNo != null">item_NO,</if>
<if test="itemName != null">item_name,</if>
<if test="specificationModel != null">specificationModel,</if>
<if test="machineType != null">machine_type,</if>
<if test="unit != null">unit,</if>
<if test="warehousingAmt != null and warehousingAmt != ''">warehousing_amt,</if>
<if test="noticeTime != null">notice_time,</if>
<if test="spell1 != null">spell_1,</if>
<if test="spell2 != null">spell_2,</if>
<if test="spell3 != null">spell_3,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="warehousingmanufacturenoticeNo != null">#{warehousingmanufacturenoticeNo},</if>
<if test="customerId != null">#{customerId},</if>
<if test="customerName != null">#{customerName},</if>
<if test="warehousingType != null">#{warehousingType},</if>
<if test="warehousingDate != null">#{warehousingDate},</if>
<if test="workorderNo != null and workorderNo != ''">#{workorderNo},</if>
<if test="domesticOrExport != null">#{domesticOrExport},</if>
<if test="warehouseNo != null">#{warehouseNo},</if>
<if test="warehouseName != null">#{warehouseName},</if>
<if test="projectTimes != null">#{projectTimes},</if>
<if test="warehousingmanufactureNo != null">#{warehousingmanufactureNo},</if>
<if test="itemNo != null">#{itemNo},</if>
<if test="itemName != null">#{itemName},</if>
<if test="specificationModel != null">#{specificationModel},</if>
<if test="machineType != null">#{machineType},</if>
<if test="unit != null">#{unit},</if>
<if test="warehousingAmt != null and warehousingAmt != ''">#{warehousingAmt},</if>
<if test="noticeTime != null">#{noticeTime},</if>
<if test="spell1 != null">#{spell1},</if>
<if test="spell2 != null">#{spell2},</if>
<if test="spell3 != null">#{spell3},</if>
</trim>
</insert>
<update id="updateWarehousingManufactureNotice" parameterType="WarehousingManufactureNotice">
update warehousing_manufacture_notice
<trim prefix="SET" suffixOverrides=",">
<if test="customerId != null">customer_ID = #{customerId},</if>
<if test="customerName != null">customer_name = #{customerName},</if>
<if test="warehousingType != null">warehousing_type = #{warehousingType},</if>
<if test="warehousingDate != null">warehousing_date = #{warehousingDate},</if>
<if test="workorderNo != null and workorderNo != ''">workOrder_NO = #{workorderNo},</if>
<if test="domesticOrExport != null">domesticOrExport = #{domesticOrExport},</if>
<if test="warehouseNo != null">warehouse_NO = #{warehouseNo},</if>
<if test="warehouseName != null">warehouse_name = #{warehouseName},</if>
<if test="projectTimes != null">projectTimes = #{projectTimes},</if>
<if test="warehousingmanufactureNo != null">warehousingManufacture_NO = #{warehousingmanufactureNo},</if>
<if test="itemNo != null">item_NO = #{itemNo},</if>
<if test="itemName != null">item_name = #{itemName},</if>
<if test="specificationModel != null">specificationModel = #{specificationModel},</if>
<if test="machineType != null">machine_type = #{machineType},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="warehousingAmt != null and warehousingAmt != ''">warehousing_amt = #{warehousingAmt},</if>
<if test="noticeTime != null">notice_time = #{noticeTime},</if>
<if test="spell1 != null">spell_1 = #{spell1},</if>
<if test="spell2 != null">spell_2 = #{spell2},</if>
<if test="spell3 != null">spell_3 = #{spell3},</if>
</trim>
where warehousingManufactureNotice_NO = #{warehousingmanufacturenoticeNo}
</update>
<delete id="deleteWarehousingManufactureNoticeById" parameterType="String">
delete from warehousing_manufacture_notice where warehousingManufactureNotice_NO = #{warehousingmanufacturenoticeNo}
</delete>
<delete id="deleteWarehousingManufactureNoticeByIds" parameterType="String">
delete from warehousing_manufacture_notice where warehousingManufactureNotice_NO in
<foreach item="warehousingmanufacturenoticeNo" collection="array" open="(" separator="," close=")">
#{warehousingmanufacturenoticeNo}
</foreach>
</delete>
<delete id="deleteWarehousingCheckByWarehousingnoticeIds" parameterType="String">
delete from warehousing_check where warehousingNotice_id in
<foreach item="warehousingnoticeId" collection="array" open="(" separator="," close=")">
#{warehousingnoticeId}
</foreach>
</delete>
<delete id="deleteWarehousingCheckByWarehousingnoticeId" parameterType="Long">
delete from warehousing_check where warehousingNotice_id = #{warehousingnoticeId}
</delete>
<insert id="batchWarehousingCheck">
insert into warehousing_check( warehousingCheck_id, warehousingNotice_id, material_Code, material_name, specificationModel, machineType, unit, order_amt, qualified_amt, unqualified_amt, qualifiedRate, note, batchNumber, notcieTime, checkTime, isQualified, inspector, spell_1, spell_2, spell_3) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.warehousingcheckId}, #{item.warehousingnoticeId}, #{item.materialCode}, #{item.materialName}, #{item.specificationModel}, #{item.machineType}, #{item.unit}, #{item.orderAmt}, #{item.qualifiedAmt}, #{item.unqualifiedAmt}, #{item.qualifiedRate}, #{item.note}, #{item.batchNumber}, #{item.notcieTime}, #{item.checkTime}, #{item.isQualified}, #{item.inspector}, #{item.spell1}, #{item.spell2}, #{item.spell3})
</foreach>
</insert>
</mapper>