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

189 lines
12 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.purchase.mapper.PurchaseOrderMapper">
<resultMap type="PurchaseOrder" id="PurchaseOrderResult">
<result property="purchaseOrderId" column="purchase_order_id" />
<result property="purchaseOrderNumber" column="purchase_order_number" />
<result property="supplierCode" column="supplier_code" />
<result property="supplierName" column="supplier_name" />
<result property="customerContact" column="customer_contact" />
<result property="contactNumber" column="contact_number" />
<result property="customerFax" column="customer_fax" />
<result property="deliveryAddress" column="delivery_address" />
<result property="paymentTerms" column="payment_terms" />
<result property="deliveryConditions" column="delivery_conditions" />
<result property="deliveryMethod" column="delivery_method" />
<result property="purchaseName" column="purchase_name" />
<result property="billingDate" column="billing_date" />
<result property="taxRate" column="tax_rate" />
<result property="purchaseCategory" column="purchase_category" />
<result property="purchaseCommander" column="purchase_commander" />
<result property="customerOrderNumber" column="customer_order_number" />
<result property="remarkContent" column="remark_content" />
<result property="closeCaseNo" column="close_case_no" />
<result property="closeCaseName" column="close_case_name" />
<result property="closeCaseTime" column="close_case_time" />
<result property="confirmNo" column="confirm_no" />
<result property="confirmName" column="confirm_name" />
<result property="confirmTime" column="confirm_time" />
<result property="auditNo" column="audit_no" />
<result property="auditName" column="audit_name" />
<result property="auditTime" column="audit_time" />
<result property="approveNo" column="approve_no" />
<result property="approveName" column="approve_name" />
<result property="approveTime" column="approve_time" />
<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" />
</resultMap>
<sql id="selectPurchaseOrderVo">
select purchase_order_id, purchase_order_number, supplier_code, supplier_name, customer_contact, contact_number, customer_fax, delivery_address, payment_terms, delivery_conditions, delivery_method, purchase_name, billing_date, tax_rate, purchase_category, purchase_commander, customer_order_number, remark_content, close_case_no, close_case_name, close_case_time, confirm_no, confirm_name, confirm_time, audit_no, audit_name, audit_time, approve_no, approve_name, approve_time, first_add_time, update_info_time, standby_one, standby_two from purchase_order
</sql>
<select id="selectPurchaseOrderList" parameterType="PurchaseOrder" resultMap="PurchaseOrderResult">
<include refid="selectPurchaseOrderVo"/>
<where>
<if test="purchaseOrderNumber != null and purchaseOrderNumber != ''"> and purchase_order_number like concat('%', #{purchaseOrderNumber}, '%')</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>
<if test="params.beginBillingDate != null and params.beginBillingDate != '' and params.endBillingDate != null and params.endBillingDate != ''"> and billing_date between #{params.beginBillingDate} and #{params.endBillingDate}</if>
<if test="closeCaseNo != null and closeCaseNo != ''"> and close_case_no = #{closeCaseNo}</if>
<if test="confirmNo != null and confirmNo != ''"> and confirm_no = #{confirmNo}</if>
<if test="auditNo != null and auditNo != ''"> and audit_no = #{auditNo}</if>
<if test="approveNo != null and approveNo != ''"> and approve_no = #{approveNo}</if>
</where>
</select>
<select id="selectPurchaseOrderById" parameterType="Long" resultMap="PurchaseOrderResult">
<include refid="selectPurchaseOrderVo"/>
where purchase_order_id = #{purchaseOrderId}
</select>
<insert id="insertPurchaseOrder" parameterType="PurchaseOrder" useGeneratedKeys="true" keyProperty="purchaseOrderId">
insert into purchase_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="purchaseOrderNumber != null">purchase_order_number,</if>
<if test="supplierCode != null and supplierCode != ''">supplier_code,</if>
<if test="supplierName != null and supplierName != ''">supplier_name,</if>
<if test="customerContact != null">customer_contact,</if>
<if test="contactNumber != null">contact_number,</if>
<if test="customerFax != null">customer_fax,</if>
<if test="deliveryAddress != null">delivery_address,</if>
<if test="paymentTerms != null">payment_terms,</if>
<if test="deliveryConditions != null">delivery_conditions,</if>
<if test="deliveryMethod != null">delivery_method,</if>
<if test="purchaseName != null">purchase_name,</if>
<if test="billingDate != null">billing_date,</if>
<if test="taxRate != null">tax_rate,</if>
<if test="purchaseCategory != null">purchase_category,</if>
<if test="purchaseCommander != null">purchase_commander,</if>
<if test="customerOrderNumber != null">customer_order_number,</if>
<if test="remarkContent != null">remark_content,</if>
<if test="closeCaseNo != null">close_case_no,</if>
<if test="closeCaseName != null">close_case_name,</if>
<if test="closeCaseTime != null">close_case_time,</if>
<if test="confirmNo != null">confirm_no,</if>
<if test="confirmName != null">confirm_name,</if>
<if test="confirmTime != null">confirm_time,</if>
<if test="auditNo != null">audit_no,</if>
<if test="auditName != null">audit_name,</if>
<if test="auditTime != null">audit_time,</if>
<if test="approveNo != null">approve_no,</if>
<if test="approveName != null">approve_name,</if>
<if test="approveTime != null">approve_time,</if>
first_add_time,
<if test="standbyOne != null">standby_one,</if>
<if test="standbyTwo != null">standby_two,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="purchaseOrderNumber != null">#{purchaseOrderNumber},</if>
<if test="supplierCode != null and supplierCode != ''">#{supplierCode},</if>
<if test="supplierName != null and supplierName != ''">#{supplierName},</if>
<if test="customerContact != null">#{customerContact},</if>
<if test="contactNumber != null">#{contactNumber},</if>
<if test="customerFax != null">#{customerFax},</if>
<if test="deliveryAddress != null">#{deliveryAddress},</if>
<if test="paymentTerms != null">#{paymentTerms},</if>
<if test="deliveryConditions != null">#{deliveryConditions},</if>
<if test="deliveryMethod != null">#{deliveryMethod},</if>
<if test="purchaseName != null">#{purchaseName},</if>
<if test="billingDate != null">#{billingDate},</if>
<if test="taxRate != null">#{taxRate},</if>
<if test="purchaseCategory != null">#{purchaseCategory},</if>
<if test="purchaseCommander != null">#{purchaseCommander},</if>
<if test="customerOrderNumber != null">#{customerOrderNumber},</if>
<if test="remarkContent != null">#{remarkContent},</if>
<if test="closeCaseNo != null">#{closeCaseNo},</if>
<if test="closeCaseName != null">#{closeCaseName},</if>
<if test="closeCaseTime != null">#{closeCaseTime},</if>
<if test="confirmNo != null">#{confirmNo},</if>
<if test="confirmName != null">#{confirmName},</if>
<if test="confirmTime != null">#{confirmTime},</if>
<if test="auditNo != null">#{auditNo},</if>
<if test="auditName != null">#{auditName},</if>
<if test="auditTime != null">#{auditTime},</if>
<if test="approveNo != null">#{approveNo},</if>
<if test="approveName != null">#{approveName},</if>
<if test="approveTime != null">#{approveTime},</if>
now(),
<if test="standbyOne != null">#{standbyOne},</if>
<if test="standbyTwo != null">#{standbyTwo},</if>
</trim>
</insert>
<update id="updatePurchaseOrder" parameterType="PurchaseOrder">
update purchase_order
<trim prefix="SET" suffixOverrides=",">
<if test="purchaseOrderNumber != null">purchase_order_number = #{purchaseOrderNumber},</if>
<if test="supplierCode != null and supplierCode != ''">supplier_code = #{supplierCode},</if>
<if test="supplierName != null and supplierName != ''">supplier_name = #{supplierName},</if>
<if test="customerContact != null">customer_contact = #{customerContact},</if>
<if test="contactNumber != null">contact_number = #{contactNumber},</if>
<if test="customerFax != null">customer_fax = #{customerFax},</if>
<if test="deliveryAddress != null">delivery_address = #{deliveryAddress},</if>
<if test="paymentTerms != null">payment_terms = #{paymentTerms},</if>
<if test="deliveryConditions != null">delivery_conditions = #{deliveryConditions},</if>
<if test="deliveryMethod != null">delivery_method = #{deliveryMethod},</if>
<if test="purchaseName != null">purchase_name = #{purchaseName},</if>
<if test="billingDate != null">billing_date = #{billingDate},</if>
<if test="taxRate != null">tax_rate = #{taxRate},</if>
<if test="purchaseCategory != null">purchase_category = #{purchaseCategory},</if>
<if test="purchaseCommander != null">purchase_commander = #{purchaseCommander},</if>
<if test="customerOrderNumber != null">customer_order_number = #{customerOrderNumber},</if>
<if test="remarkContent != null">remark_content = #{remarkContent},</if>
<if test="closeCaseNo != null">close_case_no = #{closeCaseNo},</if>
<if test="closeCaseName != null">close_case_name = #{closeCaseName},</if>
<if test="closeCaseTime != null">close_case_time = #{closeCaseTime},</if>
<if test="confirmNo != null">confirm_no = #{confirmNo},</if>
<if test="confirmName != null">confirm_name = #{confirmName},</if>
<if test="confirmTime != null">confirm_time = #{confirmTime},</if>
<if test="auditNo != null">audit_no = #{auditNo},</if>
<if test="auditName != null">audit_name = #{auditName},</if>
<if test="auditTime != null">audit_time = #{auditTime},</if>
<if test="approveNo != null">approve_no = #{approveNo},</if>
<if test="approveName != null">approve_name = #{approveName},</if>
<if test="approveTime != null">approve_time = #{approveTime},</if>
update_info_time = CONCAT_WS(',',NOW(),update_info_time),
<if test="standbyOne != null">standby_one = #{standbyOne},</if>
<if test="standbyTwo != null">standby_two = #{standbyTwo},</if>
</trim>
where purchase_order_id = #{purchaseOrderId}
</update>
<delete id="deletePurchaseOrderById" parameterType="Long">
delete from purchase_order where purchase_order_id = #{purchaseOrderId}
</delete>
<delete id="deletePurchaseOrderByIds" parameterType="String">
delete from purchase_order where purchase_order_id in
<foreach item="purchaseOrderId" collection="array" open="(" separator="," close=")">
#{purchaseOrderId}
</foreach>
</delete>
</mapper>