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.
212 lines
17 KiB
212 lines
17 KiB
<?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.manufacture.mapper.MaterialRequisitionInfoMapper">
|
|
|
|
<resultMap type="MaterialRequisitionInfo" id="MaterialRequisitionInfoResult">
|
|
<result property="materialRequisitionId" column="material_requisition_id" />
|
|
<result property="materialRequisitionNumber" column="material_requisition_number" />
|
|
<result property="salesOrderNumber" column="sales_order_number" />
|
|
<result property="workOrderNumber" column="work_order_number" />
|
|
<result property="deptName" column="dept_name" />
|
|
<result property="materialRequisitionPerson" column="material_requisition_person" />
|
|
<result property="deptNumber" column="dept_number" />
|
|
<result property="stockNumber" column="stock_number" />
|
|
<result property="stockName" column="stock_name" />
|
|
<result property="stockManager" column="stock_manager" />
|
|
<result property="outputClass" column="output_class" />
|
|
<result property="outputDate" column="output_date" />
|
|
<result property="finishProductCode" column="finish_product_code" />
|
|
<result property="typeMachine" column="type_machine" />
|
|
<result property="workOrderQuantity" column="work_order_quantity" />
|
|
<result property="remarkContent" column="remark_content" />
|
|
<result property="getMaterialFlag" column="get_material_flag" />
|
|
<result property="firstAddTime" column="first_add_time" />
|
|
<result property="updateInfoTime" column="update_info_time" />
|
|
<result property="standbyOne" column="standby_one" />
|
|
<result property="standbyTwo" column="standby_two" />
|
|
<result property="outsourceOrderNumber" column="outsource_order_number" />
|
|
<result property="batchNumber" column="batch_number" />
|
|
<result property="supplierCode" column="supplier_code" />
|
|
<result property="supplierName" column="supplier_name" />
|
|
</resultMap>
|
|
|
|
<sql id="selectMaterialRequisitionInfoVo">
|
|
select material_requisition_id, material_requisition_number, sales_order_number, work_order_number, dept_name, material_requisition_person, dept_number, stock_number, stock_name, stock_manager, output_class, output_date, finish_product_code, type_machine, work_order_quantity, remark_content, get_material_flag, first_add_time, update_info_time, standby_one, standby_two, outsource_order_number, batch_number, supplier_code, supplier_name from material_requisition_info
|
|
</sql>
|
|
|
|
<select id="selectMaterialRequisitionInfoList" parameterType="MaterialRequisitionInfo" resultMap="MaterialRequisitionInfoResult">
|
|
<include refid="selectMaterialRequisitionInfoVo"/>
|
|
<where>
|
|
<if test="materialRequisitionNumber != null and materialRequisitionNumber != ''"> and material_requisition_number like concat('%', #{materialRequisitionNumber}, '%')</if>
|
|
<if test="salesOrderNumber != null and salesOrderNumber != ''"> and sales_order_number like concat('%', #{salesOrderNumber}, '%')</if>
|
|
<if test="workOrderNumber != null and workOrderNumber != ''"> and work_order_number like concat('%', #{workOrderNumber}, '%')</if>
|
|
<if test="deptName != null and deptName != ''"> and dept_name = #{deptName}</if>
|
|
<if test="stockName != null and stockName != ''"> and stock_name like concat('%', #{stockName}, '%')</if>
|
|
<if test="outputClass != null and outputClass != ''"> and output_class = #{outputClass}</if>
|
|
<if test="params.beginOutputDate != null and params.beginOutputDate != '' and params.endOutputDate != null and params.endOutputDate != ''"> and output_date between #{params.beginOutputDate} and #{params.endOutputDate}</if>
|
|
<if test="getMaterialFlag != null and getMaterialFlag != ''"> and get_material_flag = #{getMaterialFlag}</if>
|
|
</where>
|
|
</select>
|
|
<select id="selectMaterialRequisitionInfoListRaw" parameterType="MaterialRequisitionInfo" resultMap="MaterialRequisitionInfoResult">
|
|
<include refid="selectMaterialRequisitionInfoVo"/>
|
|
<where>
|
|
material_requisition_number like '%YLLL%'
|
|
<if test="materialRequisitionNumber != null and materialRequisitionNumber != ''"> and material_requisition_number like concat('%', #{materialRequisitionNumber}, '%')</if>
|
|
<if test="salesOrderNumber != null and salesOrderNumber != ''"> and sales_order_number like concat('%', #{salesOrderNumber}, '%')</if>
|
|
<if test="workOrderNumber != null and workOrderNumber != ''"> and work_order_number like concat('%', #{workOrderNumber}, '%')</if>
|
|
<if test="deptName != null and deptName != ''"> and dept_name = #{deptName}</if>
|
|
<if test="stockName != null and stockName != ''"> and stock_name like concat('%', #{stockName}, '%')</if>
|
|
<if test="outputClass != null and outputClass != ''"> and output_class = #{outputClass}</if>
|
|
<if test="params.beginOutputDate != null and params.beginOutputDate != '' and params.endOutputDate != null and params.endOutputDate != ''"> and output_date between #{params.beginOutputDate} and #{params.endOutputDate}</if>
|
|
<if test="getMaterialFlag != null and getMaterialFlag != ''"> and get_material_flag = #{getMaterialFlag}</if>
|
|
</where>
|
|
</select>
|
|
<select id="selectMaterialRequisitionInfoListSubsidiary" parameterType="MaterialRequisitionInfo" resultMap="MaterialRequisitionInfoResult">
|
|
<include refid="selectMaterialRequisitionInfoVo"/>
|
|
<where>
|
|
material_requisition_number like '%FLLL%'
|
|
<if test="materialRequisitionNumber != null and materialRequisitionNumber != ''"> and material_requisition_number like concat('%', #{materialRequisitionNumber}, '%')</if>
|
|
<if test="salesOrderNumber != null and salesOrderNumber != ''"> and sales_order_number like concat('%', #{salesOrderNumber}, '%')</if>
|
|
<if test="workOrderNumber != null and workOrderNumber != ''"> and work_order_number like concat('%', #{workOrderNumber}, '%')</if>
|
|
<if test="deptName != null and deptName != ''"> and dept_name = #{deptName}</if>
|
|
<if test="stockName != null and stockName != ''"> and stock_name like concat('%', #{stockName}, '%')</if>
|
|
<if test="outputClass != null and outputClass != ''"> and output_class = #{outputClass}</if>
|
|
<if test="params.beginOutputDate != null and params.beginOutputDate != '' and params.endOutputDate != null and params.endOutputDate != ''"> and output_date between #{params.beginOutputDate} and #{params.endOutputDate}</if>
|
|
<if test="getMaterialFlag != null and getMaterialFlag != ''"> and get_material_flag = #{getMaterialFlag}</if>
|
|
</where>
|
|
</select>
|
|
<select id="selectMaterialRequisitionInfoListBcp" parameterType="MaterialRequisitionInfo" resultMap="MaterialRequisitionInfoResult">
|
|
<include refid="selectMaterialRequisitionInfoVo"/>
|
|
<where>
|
|
material_requisition_number like '%CPLL%'
|
|
<if test="materialRequisitionNumber != null and materialRequisitionNumber != ''"> and material_requisition_number like concat('%', #{materialRequisitionNumber}, '%')</if>
|
|
<if test="salesOrderNumber != null and salesOrderNumber != ''"> and sales_order_number like concat('%', #{salesOrderNumber}, '%')</if>
|
|
<if test="workOrderNumber != null and workOrderNumber != ''"> and work_order_number like concat('%', #{workOrderNumber}, '%')</if>
|
|
<if test="deptName != null and deptName != ''"> and dept_name = #{deptName}</if>
|
|
<if test="stockName != null and stockName != ''"> and stock_name like concat('%', #{stockName}, '%')</if>
|
|
<if test="outputClass != null and outputClass != ''"> and output_class = #{outputClass}</if>
|
|
<if test="params.beginOutputDate != null and params.beginOutputDate != '' and params.endOutputDate != null and params.endOutputDate != ''"> and output_date between #{params.beginOutputDate} and #{params.endOutputDate}</if>
|
|
<if test="getMaterialFlag != null and getMaterialFlag != ''"> and get_material_flag = #{getMaterialFlag}</if>
|
|
</where>
|
|
</select>
|
|
<select id="selectMaterialRequisitionInfoListOutsource" parameterType="MaterialRequisitionInfo" resultMap="MaterialRequisitionInfoResult">
|
|
<include refid="selectMaterialRequisitionInfoVo"/>
|
|
<where>
|
|
material_requisition_number like '%OWLL%'
|
|
<if test="materialRequisitionNumber != null and materialRequisitionNumber != ''"> and material_requisition_number like concat('%', #{materialRequisitionNumber}, '%')</if>
|
|
<if test="salesOrderNumber != null and salesOrderNumber != ''"> and sales_order_number like concat('%', #{salesOrderNumber}, '%')</if>
|
|
<if test="workOrderNumber != null and workOrderNumber != ''"> and work_order_number like concat('%', #{workOrderNumber}, '%')</if>
|
|
<if test="deptName != null and deptName != ''"> and dept_name = #{deptName}</if>
|
|
<if test="stockName != null and stockName != ''"> and stock_name like concat('%', #{stockName}, '%')</if>
|
|
<if test="outputClass != null and outputClass != ''"> and output_class = #{outputClass}</if>
|
|
<if test="params.beginOutputDate != null and params.beginOutputDate != '' and params.endOutputDate != null and params.endOutputDate != ''"> and output_date between #{params.beginOutputDate} and #{params.endOutputDate}</if>
|
|
<if test="getMaterialFlag != null and getMaterialFlag != ''"> and get_material_flag = #{getMaterialFlag}</if>
|
|
<if test="outsourceOrderNumber != null and outsourceOrderNumber != ''"> and outsource_order_number like concat('%', #{outsourceOrderNumber}, '%')</if>
|
|
<if test="supplierCode != null and supplierCode != ''"> and supplier_code like concat('%', #{supplierCode}, '%')</if>
|
|
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectMaterialRequisitionInfoById" parameterType="Long" resultMap="MaterialRequisitionInfoResult">
|
|
<include refid="selectMaterialRequisitionInfoVo"/>
|
|
where material_requisition_id = #{materialRequisitionId}
|
|
</select>
|
|
|
|
<insert id="insertMaterialRequisitionInfo" parameterType="MaterialRequisitionInfo" useGeneratedKeys="true" keyProperty="materialRequisitionId">
|
|
insert into material_requisition_info
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="materialRequisitionNumber != null and materialRequisitionNumber != ''">material_requisition_number,</if>
|
|
<if test="salesOrderNumber != null">sales_order_number,</if>
|
|
<if test="workOrderNumber != null">work_order_number,</if>
|
|
<if test="deptName != null">dept_name,</if>
|
|
<if test="materialRequisitionPerson != null">material_requisition_person,</if>
|
|
<if test="deptNumber != null">dept_number,</if>
|
|
<if test="stockNumber != null">stock_number,</if>
|
|
<if test="stockName != null">stock_name,</if>
|
|
<if test="stockManager != null">stock_manager,</if>
|
|
<if test="outputClass != null">output_class,</if>
|
|
<if test="outputDate != null">output_date,</if>
|
|
<if test="finishProductCode != null">finish_product_code,</if>
|
|
<if test="typeMachine != null">type_machine,</if>
|
|
<if test="workOrderQuantity != null">work_order_quantity,</if>
|
|
<if test="remarkContent != null">remark_content,</if>
|
|
<if test="getMaterialFlag != null">get_material_flag,</if>
|
|
<if test="standbyOne != null">standby_one,</if>
|
|
<if test="standbyTwo != null">standby_two,</if>
|
|
<if test="outsourceOrderNumber != null">outsource_order_number,</if>
|
|
<if test="batchNumber != null">batch_number,</if>
|
|
<if test="supplierCode != null">supplier_code,</if>
|
|
<if test="supplierName != null">supplier_name,</if>
|
|
first_add_time,
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="materialRequisitionNumber != null and materialRequisitionNumber != ''">#{materialRequisitionNumber},</if>
|
|
<if test="salesOrderNumber != null">#{salesOrderNumber},</if>
|
|
<if test="workOrderNumber != null">#{workOrderNumber},</if>
|
|
<if test="deptName != null">#{deptName},</if>
|
|
<if test="materialRequisitionPerson != null">#{materialRequisitionPerson},</if>
|
|
<if test="deptNumber != null">#{deptNumber},</if>
|
|
<if test="stockNumber != null">#{stockNumber},</if>
|
|
<if test="stockName != null">#{stockName},</if>
|
|
<if test="stockManager != null">#{stockManager},</if>
|
|
<if test="outputClass != null">#{outputClass},</if>
|
|
<if test="outputDate != null">#{outputDate},</if>
|
|
<if test="finishProductCode != null">#{finishProductCode},</if>
|
|
<if test="typeMachine != null">#{typeMachine},</if>
|
|
<if test="workOrderQuantity != null">#{workOrderQuantity},</if>
|
|
<if test="remarkContent != null">#{remarkContent},</if>
|
|
<if test="getMaterialFlag != null">#{getMaterialFlag},</if>
|
|
<if test="standbyOne != null">#{standbyOne},</if>
|
|
<if test="standbyTwo != null">#{standbyTwo},</if>
|
|
<if test="outsourceOrderNumber != null">#{outsourceOrderNumber},</if>
|
|
<if test="batchNumber != null">#{batchNumber},</if>
|
|
<if test="supplierCode != null">#{supplierCode},</if>
|
|
<if test="supplierName != null">#{supplierName},</if>
|
|
now(),
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateMaterialRequisitionInfo" parameterType="MaterialRequisitionInfo">
|
|
update material_requisition_info
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="materialRequisitionNumber != null and materialRequisitionNumber != ''">material_requisition_number = #{materialRequisitionNumber},</if>
|
|
<if test="salesOrderNumber != null">sales_order_number = #{salesOrderNumber},</if>
|
|
<if test="workOrderNumber != null">work_order_number = #{workOrderNumber},</if>
|
|
<if test="deptName != null">dept_name = #{deptName},</if>
|
|
<if test="materialRequisitionPerson != null">material_requisition_person = #{materialRequisitionPerson},</if>
|
|
<if test="deptNumber != null">dept_number = #{deptNumber},</if>
|
|
<if test="stockNumber != null">stock_number = #{stockNumber},</if>
|
|
<if test="stockName != null">stock_name = #{stockName},</if>
|
|
<if test="stockManager != null">stock_manager = #{stockManager},</if>
|
|
<if test="outputClass != null">output_class = #{outputClass},</if>
|
|
<if test="outputDate != null">output_date = #{outputDate},</if>
|
|
<if test="finishProductCode != null">finish_product_code = #{finishProductCode},</if>
|
|
<if test="typeMachine != null">type_machine = #{typeMachine},</if>
|
|
<if test="workOrderQuantity != null">work_order_quantity = #{workOrderQuantity},</if>
|
|
<if test="remarkContent != null">remark_content = #{remarkContent},</if>
|
|
<if test="getMaterialFlag != null">get_material_flag = #{getMaterialFlag},</if>
|
|
<if test="standbyOne != null">standby_one = #{standbyOne},</if>
|
|
<if test="standbyTwo != null">standby_two = #{standbyTwo},</if>
|
|
<if test="outsourceOrderNumber != null">outsource_order_number = #{outsourceOrderNumber},</if>
|
|
<if test="batchNumber != null">batch_number = #{batchNumber},</if>
|
|
<if test="supplierCode != null">supplier_code = #{supplierCode},</if>
|
|
<if test="supplierName != null">supplier_name = #{supplierName},</if>
|
|
update_info_time = CONCAT_WS(',',NOW(),update_info_time),
|
|
</trim>
|
|
where material_requisition_id = #{materialRequisitionId}
|
|
</update>
|
|
|
|
<delete id="deleteMaterialRequisitionInfoById" parameterType="Long">
|
|
delete from material_requisition_info where material_requisition_id = #{materialRequisitionId}
|
|
</delete>
|
|
|
|
<delete id="deleteMaterialRequisitionInfoByIds" parameterType="String">
|
|
delete from material_requisition_info where material_requisition_id in
|
|
<foreach item="materialRequisitionId" collection="array" open="(" separator="," close=")">
|
|
#{materialRequisitionId}
|
|
</foreach>
|
|
</delete>
|
|
|
|
</mapper>
|