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.
108 lines
6.8 KiB
108 lines
6.8 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.manufacture.mapper.MaterialRequisitionDetailMapper">
|
||
|
|
||
|
<resultMap type="MaterialRequisitionDetail" id="MaterialRequisitionDetailResult">
|
||
|
<result property="materialRequisitionDetailId" column="material_requisition_detail_id" />
|
||
|
<result property="materialRequisitionNumber" column="material_requisition_number" />
|
||
|
<result property="materialCode" column="material_code" />
|
||
|
<result property="materialName" column="material_name" />
|
||
|
<result property="specificationModel" column="specification_model" />
|
||
|
<result property="typeMachine" column="type_machine" />
|
||
|
<result property="inventoryUnit" column="inventory_unit" />
|
||
|
<result property="planQuantity" column="plan_quantity" />
|
||
|
<result property="description" column="description" />
|
||
|
<result property="unitUsage" column="unit_usage" />
|
||
|
<result property="storageLocation" column="storage_location" />
|
||
|
<result property="materialType" column="material_type" />
|
||
|
<result property="standbyOne" column="standby_one" />
|
||
|
<result property="standbyTwo" column="standby_two" />
|
||
|
</resultMap>
|
||
|
|
||
|
<sql id="selectMaterialRequisitionDetailVo">
|
||
|
select material_requisition_detail_id, material_requisition_number, material_code, material_name, specification_model, type_machine, inventory_unit, plan_quantity, description, unit_usage, storage_location, material_type, standby_one, standby_two from material_requisition_detail
|
||
|
</sql>
|
||
|
|
||
|
<select id="selectMaterialRequisitionDetailList" parameterType="MaterialRequisitionDetail" resultMap="MaterialRequisitionDetailResult">
|
||
|
<include refid="selectMaterialRequisitionDetailVo"/>
|
||
|
<where>
|
||
|
<if test="materialRequisitionNumber != null and materialRequisitionNumber != ''"> and material_requisition_number like concat('%', #{materialRequisitionNumber}, '%')</if>
|
||
|
<if test="materialCode != null and materialCode != ''"> and material_code like concat('%', #{materialCode}, '%')</if>
|
||
|
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
||
|
<if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if>
|
||
|
</where>
|
||
|
</select>
|
||
|
|
||
|
<select id="selectMaterialRequisitionDetailById" parameterType="Long" resultMap="MaterialRequisitionDetailResult">
|
||
|
<include refid="selectMaterialRequisitionDetailVo"/>
|
||
|
where material_requisition_detail_id = #{materialRequisitionDetailId}
|
||
|
</select>
|
||
|
|
||
|
<insert id="insertMaterialRequisitionDetail" parameterType="MaterialRequisitionDetail" useGeneratedKeys="true" keyProperty="materialRequisitionDetailId">
|
||
|
insert into material_requisition_detail
|
||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
<if test="materialRequisitionNumber != null">material_requisition_number,</if>
|
||
|
<if test="materialCode != null">material_code,</if>
|
||
|
<if test="materialName != null">material_name,</if>
|
||
|
<if test="specificationModel != null">specification_model,</if>
|
||
|
<if test="typeMachine != null">type_machine,</if>
|
||
|
<if test="inventoryUnit != null">inventory_unit,</if>
|
||
|
<if test="planQuantity != null">plan_quantity,</if>
|
||
|
<if test="description != null">description,</if>
|
||
|
<if test="unitUsage != null">unit_usage,</if>
|
||
|
<if test="storageLocation != null">storage_location,</if>
|
||
|
<if test="materialType != null">material_type,</if>
|
||
|
<if test="standbyOne != null">standby_one,</if>
|
||
|
<if test="standbyTwo != null">standby_two,</if>
|
||
|
</trim>
|
||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
<if test="materialRequisitionNumber != null">#{materialRequisitionNumber},</if>
|
||
|
<if test="materialCode != null">#{materialCode},</if>
|
||
|
<if test="materialName != null">#{materialName},</if>
|
||
|
<if test="specificationModel != null">#{specificationModel},</if>
|
||
|
<if test="typeMachine != null">#{typeMachine},</if>
|
||
|
<if test="inventoryUnit != null">#{inventoryUnit},</if>
|
||
|
<if test="planQuantity != null">#{planQuantity},</if>
|
||
|
<if test="description != null">#{description},</if>
|
||
|
<if test="unitUsage != null">#{unitUsage},</if>
|
||
|
<if test="storageLocation != null">#{storageLocation},</if>
|
||
|
<if test="materialType != null">#{materialType},</if>
|
||
|
<if test="standbyOne != null">#{standbyOne},</if>
|
||
|
<if test="standbyTwo != null">#{standbyTwo},</if>
|
||
|
</trim>
|
||
|
</insert>
|
||
|
|
||
|
<update id="updateMaterialRequisitionDetail" parameterType="MaterialRequisitionDetail">
|
||
|
update material_requisition_detail
|
||
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
<if test="materialRequisitionNumber != null">material_requisition_number = #{materialRequisitionNumber},</if>
|
||
|
<if test="materialCode != null">material_code = #{materialCode},</if>
|
||
|
<if test="materialName != null">material_name = #{materialName},</if>
|
||
|
<if test="specificationModel != null">specification_model = #{specificationModel},</if>
|
||
|
<if test="typeMachine != null">type_machine = #{typeMachine},</if>
|
||
|
<if test="inventoryUnit != null">inventory_unit = #{inventoryUnit},</if>
|
||
|
<if test="planQuantity != null">plan_quantity = #{planQuantity},</if>
|
||
|
<if test="description != null">description = #{description},</if>
|
||
|
<if test="unitUsage != null">unit_usage = #{unitUsage},</if>
|
||
|
<if test="storageLocation != null">storage_location = #{storageLocation},</if>
|
||
|
<if test="materialType != null">material_type = #{materialType},</if>
|
||
|
<if test="standbyOne != null">standby_one = #{standbyOne},</if>
|
||
|
<if test="standbyTwo != null">standby_two = #{standbyTwo},</if>
|
||
|
</trim>
|
||
|
where material_requisition_detail_id = #{materialRequisitionDetailId}
|
||
|
</update>
|
||
|
|
||
|
<delete id="deleteMaterialRequisitionDetailById" parameterType="Long">
|
||
|
delete from material_requisition_detail where material_requisition_detail_id = #{materialRequisitionDetailId}
|
||
|
</delete>
|
||
|
|
||
|
<delete id="deleteMaterialRequisitionDetailByIds" parameterType="String">
|
||
|
delete from material_requisition_detail where material_requisition_detail_id in
|
||
|
<foreach item="materialRequisitionDetailId" collection="array" open="(" separator="," close=")">
|
||
|
#{materialRequisitionDetailId}
|
||
|
</foreach>
|
||
|
</delete>
|
||
|
|
||
|
</mapper>
|