|
|
|
<?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.WorkOrderDetailMapper">
|
|
|
|
|
|
|
|
<resultMap type="WorkOrderDetail" id="WorkOrderDetailResult">
|
|
|
|
<result property="workOrderDetailId" column="work_order_detail_id" />
|
|
|
|
<result property="workOrderNumber" column="work_order_number" />
|
|
|
|
<result property="materialCode" column="material_code" />
|
|
|
|
<result property="materialName" column="material_name" />
|
|
|
|
<result property="specificationModel" column="specification_model" />
|
|
|
|
<result property="inventoryUnit" column="inventory_unit" />
|
|
|
|
<result property="materialType" column="material_type" />
|
|
|
|
<result property="materialConsumption" column="material_consumption" />
|
|
|
|
<result property="unitUsage" column="unit_usage" />
|
|
|
|
<result property="itemNumber" column="item_number" />
|
|
|
|
<result property="description" column="description" />
|
|
|
|
<result property="standbyOne" column="standby_one" />
|
|
|
|
<result property="standbyTwo" column="standby_two" />
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectWorkOrderDetailVo">
|
|
|
|
select work_order_detail_id, work_order_number, material_code, material_name, specification_model, inventory_unit, material_type, material_consumption, unit_usage, item_number, description, standby_one, standby_two from work_order_detail
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="selectWorkOrderDetailList" parameterType="WorkOrderDetail" resultMap="WorkOrderDetailResult">
|
|
|
|
<include refid="selectWorkOrderDetailVo"/>
|
|
|
|
<where>
|
|
|
|
<if test="workOrderNumber != null and workOrderNumber != ''"> and work_order_number like concat('%', #{workOrderNumber}, '%')</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="selectWorkOrderDetailById" parameterType="Long" resultMap="WorkOrderDetailResult">
|
|
|
|
<include refid="selectWorkOrderDetailVo"/>
|
|
|
|
where work_order_detail_id = #{workOrderDetailId}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<insert id="insertWorkOrderDetail" parameterType="WorkOrderDetail">
|
|
|
|
insert into work_order_detail
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="workOrderDetailId != null">work_order_detail_id,</if>
|
|
|
|
<if test="workOrderNumber != null and workOrderNumber != ''">work_order_number,</if>
|
|
|
|
<if test="materialCode != null and materialCode != ''">material_code,</if>
|
|
|
|
<if test="materialName != null">material_name,</if>
|
|
|
|
<if test="specificationModel != null">specification_model,</if>
|
|
|
|
<if test="inventoryUnit != null">inventory_unit,</if>
|
|
|
|
<if test="materialType != null">material_type,</if>
|
|
|
|
<if test="materialConsumption != null">material_consumption,</if>
|
|
|
|
<if test="unitUsage != null">unit_usage,</if>
|
|
|
|
<if test="itemNumber != null">item_number,</if>
|
|
|
|
<if test="description != null">description,</if>
|
|
|
|
<if test="standbyOne != null">standby_one,</if>
|
|
|
|
<if test="standbyTwo != null">standby_two,</if>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="workOrderDetailId != null">#{workOrderDetailId},</if>
|
|
|
|
<if test="workOrderNumber != null and workOrderNumber != ''">#{workOrderNumber},</if>
|
|
|
|
<if test="materialCode != null and materialCode != ''">#{materialCode},</if>
|
|
|
|
<if test="materialName != null">#{materialName},</if>
|
|
|
|
<if test="specificationModel != null">#{specificationModel},</if>
|
|
|
|
<if test="inventoryUnit != null">#{inventoryUnit},</if>
|
|
|
|
<if test="materialType != null">#{materialType},</if>
|
|
|
|
<if test="materialConsumption != null">#{materialConsumption},</if>
|
|
|
|
<if test="unitUsage != null">#{unitUsage},</if>
|
|
|
|
<if test="itemNumber != null">#{itemNumber},</if>
|
|
|
|
<if test="description != null">#{description},</if>
|
|
|
|
<if test="standbyOne != null">#{standbyOne},</if>
|
|
|
|
<if test="standbyTwo != null">#{standbyTwo},</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateWorkOrderDetail" parameterType="WorkOrderDetail">
|
|
|
|
update work_order_detail
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="workOrderNumber != null and workOrderNumber != ''">work_order_number = #{workOrderNumber},</if>
|
|
|
|
<if test="materialCode != null and materialCode != ''">material_code = #{materialCode},</if>
|
|
|
|
<if test="materialName != null">material_name = #{materialName},</if>
|
|
|
|
<if test="specificationModel != null">specification_model = #{specificationModel},</if>
|
|
|
|
<if test="inventoryUnit != null">inventory_unit = #{inventoryUnit},</if>
|
|
|
|
<if test="materialType != null">material_type = #{materialType},</if>
|
|
|
|
<if test="materialConsumption != null">material_consumption = #{materialConsumption},</if>
|
|
|
|
<if test="unitUsage != null">unit_usage = #{unitUsage},</if>
|
|
|
|
<if test="itemNumber != null">item_number = #{itemNumber},</if>
|
|
|
|
<if test="description != null">description = #{description},</if>
|
|
|
|
<if test="standbyOne != null">standby_one = #{standbyOne},</if>
|
|
|
|
<if test="standbyTwo != null">standby_two = #{standbyTwo},</if>
|
|
|
|
</trim>
|
|
|
|
where work_order_detail_id = #{workOrderDetailId}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="deleteWorkOrderDetailById" parameterType="Long">
|
|
|
|
delete from work_order_detail where work_order_detail_id = #{workOrderDetailId}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteWorkOrderDetailByIds" parameterType="String">
|
|
|
|
delete from work_order_detail where work_order_detail_id in
|
|
|
|
<foreach item="workOrderDetailId" collection="array" open="(" separator="," close=")">
|
|
|
|
#{workOrderDetailId}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
</mapper>
|