万材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.
 
 
 
 

185 lines
13 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.WorkOrderInfoMapper">
<resultMap type="WorkOrderInfo" id="WorkOrderInfoResult">
<result property="workOrderId" column="work_order_id" />
<result property="salesOrderNumber" column="sales_order_number" />
<result property="workOrderNumber" column="work_order_number" />
<result property="line" column="line" />
<result property="processDept" column="process_dept" />
<result property="enterpriseCode" column="enterprise_code" />
<result property="enterpriseName" column="enterprise_name" />
<result property="finishProductCode" column="finish_product_code" />
<result property="finishProductName" column="finish_product_name" />
<result property="specificationModel" column="specification_model" />
<result property="typeMachine" column="type_machine" />
<result property="inventoryUnit" column="inventory_unit" />
<result property="orderQuantity" column="order_quantity" />
<result property="deliveryOrderQuantity" column="delivery_order_quantity" />
<result property="beginOrderQuantity" column="begin_order_quantity" />
<result property="notBeginOrderQuantity" column="not_begin_order_quantity" />
<result property="customerFactory" column="customer_factory" />
<result property="beginDate" column="begin_date" />
<result property="endDate" column="end_date" />
<result property="billingTime" column="billing_time" />
<result property="deliveryTime" column="delivery_time" />
<result property="versionNumber" column="version_number" />
<result property="salesExplain" column="sales_explain" />
<result property="workOrderClass" column="work_order_class" />
<result property="firstAddTime" column="first_add_time" />
<result property="updateInfoTime" column="update_info_time" />
<result property="closeCaseFlag" column="close_case_flag" />
<result property="closeCasePerson" column="close_case_person" />
<result property="closeCaseTime" column="close_case_time" />
<result property="standbyOne" column="standby_one" />
<result property="standbyTwo" column="standby_two" />
</resultMap>
<sql id="selectWorkOrderInfoVo">
select work_order_id, sales_order_number, work_order_number, line, process_dept, enterprise_code, enterprise_name, finish_product_code, finish_product_name, specification_model, type_machine, inventory_unit, order_quantity, delivery_order_quantity, begin_order_quantity, not_begin_order_quantity, customer_factory, begin_date, end_date, billing_time, delivery_time, version_number, sales_explain, work_order_class, first_add_time, update_info_time, close_case_flag, close_case_person, close_case_time, standby_one, standby_two from work_order_info
</sql>
<select id="selectWorkOrderInfoList" parameterType="WorkOrderInfo" resultMap="WorkOrderInfoResult">
<include refid="selectWorkOrderInfoVo"/>
<where>
<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="processDept != null and processDept != ''"> and process_dept like concat('%', #{processDept}, '%')</if>
<if test="enterpriseCode != null and enterpriseCode != ''"> and enterprise_code like concat('%', #{enterpriseCode}, '%')</if>
<if test="finishProductCode != null and finishProductCode != ''"> and finish_product_code like concat('%', #{finishProductCode}, '%')</if>
<if test="finishProductName != null and finishProductName != ''"> and finish_product_name like concat('%', #{finishProductName}, '%')</if>
<if test="params.beginBillingTime != null and params.beginBillingTime != '' and params.endBillingTime != null and params.endBillingTime != ''"> and billing_time between #{params.beginBillingTime} and #{params.endBillingTime}</if>
<if test="params.beginDeliveryTime != null and params.beginDeliveryTime != '' and params.endDeliveryTime != null and params.endDeliveryTime != ''"> and delivery_time between #{params.beginDeliveryTime} and #{params.endDeliveryTime}</if>
<if test="workOrderClass != null and workOrderClass != ''"> and work_order_class = #{workOrderClass}</if>
<if test="closeCaseFlag != null and closeCaseFlag != ''"> and close_case_flag = #{closeCaseFlag}</if>
</where>
</select>
<select id="selectWorkOrderInfoById" parameterType="Long" resultMap="WorkOrderInfoResult">
<include refid="selectWorkOrderInfoVo"/>
where work_order_id = #{workOrderId}
</select>
<insert id="insertWorkOrderInfo" parameterType="WorkOrderInfo" useGeneratedKeys="true" keyProperty="workOrderId">
insert into work_order_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="salesOrderNumber != null">sales_order_number,</if>
<if test="workOrderNumber != null">work_order_number,</if>
<if test="line != null">line,</if>
<if test="processDept != null">process_dept,</if>
<if test="enterpriseCode != null">enterprise_code,</if>
<if test="enterpriseName != null">enterprise_name,</if>
<if test="finishProductCode != null">finish_product_code,</if>
<if test="finishProductName != null">finish_product_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="orderQuantity != null">order_quantity,</if>
<if test="deliveryOrderQuantity != null">delivery_order_quantity,</if>
<if test="beginOrderQuantity != null">begin_order_quantity,</if>
<if test="notBeginOrderQuantity != null">not_begin_order_quantity,</if>
<if test="customerFactory != null">customer_factory,</if>
<if test="beginDate != null">begin_date,</if>
<if test="endDate != null">end_date,</if>
<if test="billingTime != null">billing_time,</if>
<if test="deliveryTime != null">delivery_time,</if>
<if test="versionNumber != null">version_number,</if>
<if test="salesExplain != null">sales_explain,</if>
<if test="workOrderClass != null">work_order_class,</if>
<if test="firstAddTime != null">first_add_time,</if>
<if test="updateInfoTime != null">update_info_time,</if>
<if test="closeCaseFlag != null">close_case_flag,</if>
<if test="closeCasePerson != null">close_case_person,</if>
<if test="closeCaseTime != null">close_case_time,</if>
<if test="standbyOne != null">standby_one,</if>
<if test="standbyTwo != null">standby_two,</if>
first_add_time,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="salesOrderNumber != null">#{salesOrderNumber},</if>
<if test="workOrderNumber != null">#{workOrderNumber},</if>
<if test="line != null">#{line},</if>
<if test="processDept != null">#{processDept},</if>
<if test="enterpriseCode != null">#{enterpriseCode},</if>
<if test="enterpriseName != null">#{enterpriseName},</if>
<if test="finishProductCode != null">#{finishProductCode},</if>
<if test="finishProductName != null">#{finishProductName},</if>
<if test="specificationModel != null">#{specificationModel},</if>
<if test="typeMachine != null">#{typeMachine},</if>
<if test="inventoryUnit != null">#{inventoryUnit},</if>
<if test="orderQuantity != null">#{orderQuantity},</if>
<if test="deliveryOrderQuantity != null">#{deliveryOrderQuantity},</if>
<if test="beginOrderQuantity != null">#{beginOrderQuantity},</if>
<if test="notBeginOrderQuantity != null">#{notBeginOrderQuantity},</if>
<if test="customerFactory != null">#{customerFactory},</if>
<if test="beginDate != null">#{beginDate},</if>
<if test="endDate != null">#{endDate},</if>
<if test="billingTime != null">#{billingTime},</if>
<if test="deliveryTime != null">#{deliveryTime},</if>
<if test="versionNumber != null">#{versionNumber},</if>
<if test="salesExplain != null">#{salesExplain},</if>
<if test="workOrderClass != null">#{workOrderClass},</if>
<if test="firstAddTime != null">#{firstAddTime},</if>
<if test="updateInfoTime != null">#{updateInfoTime},</if>
<if test="closeCaseFlag != null">#{closeCaseFlag},</if>
<if test="closeCasePerson != null">#{closeCasePerson},</if>
<if test="closeCaseTime != null">#{closeCaseTime},</if>
<if test="standbyOne != null">#{standbyOne},</if>
<if test="standbyTwo != null">#{standbyTwo},</if>
now(),
</trim>
</insert>
<update id="updateWorkOrderInfo" parameterType="WorkOrderInfo">
update work_order_info
<trim prefix="SET" suffixOverrides=",">
<if test="salesOrderNumber != null">sales_order_number = #{salesOrderNumber},</if>
<if test="workOrderNumber != null">work_order_number = #{workOrderNumber},</if>
<if test="line != null">line = #{line},</if>
<if test="processDept != null">process_dept = #{processDept},</if>
<if test="enterpriseCode != null">enterprise_code = #{enterpriseCode},</if>
<if test="enterpriseName != null">enterprise_name = #{enterpriseName},</if>
<if test="finishProductCode != null">finish_product_code = #{finishProductCode},</if>
<if test="finishProductName != null">finish_product_name = #{finishProductName},</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="orderQuantity != null">order_quantity = #{orderQuantity},</if>
<if test="deliveryOrderQuantity != null">delivery_order_quantity = #{deliveryOrderQuantity},</if>
<if test="beginOrderQuantity != null">begin_order_quantity = #{beginOrderQuantity},</if>
<if test="notBeginOrderQuantity != null">not_begin_order_quantity = #{notBeginOrderQuantity},</if>
<if test="customerFactory != null">customer_factory = #{customerFactory},</if>
<if test="beginDate != null">begin_date = #{beginDate},</if>
<if test="endDate != null">end_date = #{endDate},</if>
<if test="billingTime != null">billing_time = #{billingTime},</if>
<if test="deliveryTime != null">delivery_time = #{deliveryTime},</if>
<if test="versionNumber != null">version_number = #{versionNumber},</if>
<if test="salesExplain != null">sales_explain = #{salesExplain},</if>
<if test="workOrderClass != null">work_order_class = #{workOrderClass},</if>
<if test="firstAddTime != null">first_add_time = #{firstAddTime},</if>
<if test="updateInfoTime != null">update_info_time = #{updateInfoTime},</if>
<if test="closeCaseFlag != null">close_case_flag = #{closeCaseFlag},</if>
<if test="closeCasePerson != null">close_case_person = #{closeCasePerson},</if>
<if test="closeCaseTime != null">close_case_time = #{closeCaseTime},</if>
<if test="standbyOne != null">standby_one = #{standbyOne},</if>
<if test="standbyTwo != null">standby_two = #{standbyTwo},</if>
update_info_time = CONCAT_WS(',',NOW(),update_info_time),
</trim>
where work_order_id = #{workOrderId}
</update>
<delete id="deleteWorkOrderInfoById" parameterType="Long">
delete from work_order_info where work_order_id = #{workOrderId}
</delete>
<delete id="deleteWorkOrderInfoByIds" parameterType="String">
delete from work_order_info where work_order_id in
<foreach item="workOrderId" collection="array" open="(" separator="," close=")">
#{workOrderId}
</foreach>
</delete>
</mapper>