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

223 lines
15 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.system.mapper.SysSalesOrderMapper">
<resultMap type="SysSalesOrder" id="SysSalesOrderResult">
<result property="salesOrderId" column="sales_order_id" />
<result property="salesOrderCode" column="sales_order_code" />
<result property="salesOrderNumber" column="sales_order_number" />
<result property="appointmentNumber" column="appointment_number" />
<result property="enterpriseCode" column="enterprise_code" />
<result property="enterpriseName" column="enterprise_name" />
<result property="paymentTerms" column="payment_terms" />
<result property="deliveryConditions" column="delivery_conditions" />
<result property="deliveryMethod" column="delivery_method" />
<result property="orderReceivingMode" column="order_receiving_mode" />
<result property="customerContact" column="customer_contact" />
<result property="customerFactory" column="customer_factory" />
<result property="contactNumber" column="contact_number" />
<result property="businessMembers" column="business_members" />
<result property="customerFax" column="customer_fax" />
<result property="deliveryAddress" column="delivery_address" />
<result property="orderReceivingTime" column="order_receiving_time" />
<result property="billingTime" column="billing_time" />
<result property="customerRemarks" column="customer_remarks" />
<result property="currentInventory" column="current_inventory" />
<result property="creditLimit" column="credit_limit" />
<result property="unpaidAmount" column="unpaid_amount" />
<result property="availableCredit" column="available_credit" />
<result property="confirmTax" column="confirm_tax" />
<result property="taxRate" column="tax_rate" />
<result property="totalAmount" column="total_amount" />
<result property="modificationTime" column="modification_time" />
<result property="confirmTime" column="confirm_time" />
<result property="confirmNo" column="confirm_no" />
<result property="confirmName" column="confirm_name" />
<result property="auditNo" column="audit_no" />
<result property="standbyOne" column="standby_one" />
<result property="auditName" column="audit_name" />
<result property="standbyTwo" column="standby_two" />
<result property="auditTime" column="audit_time" />
<result property="auditRemarks" column="audit_remarks" />
<result property="nationalTaxBill" column="national_tax_bill" />
<result property="firstAddTime" column="first_add_time" />
<result property="updateInfoTime" column="update_info_time" />
<result property="fileUpload" column="file_upload" />
</resultMap>
<sql id="selectSysSalesOrderVo">
select sales_order_id, sales_order_code, sales_order_number, appointment_number, enterprise_code, enterprise_name, payment_terms, delivery_conditions, delivery_method, order_receiving_mode, customer_contact, customer_factory, contact_number, business_members, customer_fax, delivery_address, order_receiving_time, billing_time, customer_remarks, current_inventory, credit_limit, unpaid_amount, available_credit, confirm_tax, tax_rate, total_amount, modification_time, confirm_time, confirm_no, confirm_name, audit_no, standby_one, audit_name, standby_two, audit_time, audit_remarks, national_tax_bill, first_add_time, update_info_time, file_upload
from sys_sales_order
</sql>
<select id="selectSysSalesOrderList" parameterType="SysSalesOrder" resultMap="SysSalesOrderResult">
<include refid="selectSysSalesOrderVo"/>
<where>
<if test="salesOrderCode != null and salesOrderCode != ''"> and sales_order_code like concat('%', #{salesOrderCode}, '%')</if>
<if test="salesOrderNumber != null and salesOrderNumber != ''"> and sales_order_number like concat('%', #{salesOrderNumber}, '%')</if>
<if test="appointmentNumber != null and appointmentNumber != ''"> and appointment_number like concat('%', #{appointmentNumber}, '%')</if>
<if test="enterpriseCode != null and enterpriseCode != ''"> and enterprise_code like concat('%', #{enterpriseCode}, '%')</if>
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="customerContact != null and customerContact != ''"> and customer_contact = #{customerContact}</if>
<if test="contactNumber != null and contactNumber != ''"> and contact_number = #{contactNumber}</if>
<if test="businessMembers != null and businessMembers != ''"> and business_members = #{businessMembers}</if>
<if test="auditNo != null and auditNo != ''"> and audit_no = #{auditNo}</if>
<if test="confirmNo != null and confirmNo != ''"> and confirm_no = #{confirmNo}</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(order_receiving_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(order_receiving_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
</where>
</select>
<select id="selectSysSalesOrderById" parameterType="Long" resultMap="SysSalesOrderResult">
<include refid="selectSysSalesOrderVo"/>
where sales_order_id = #{salesOrderId}
</select>
<insert id="insertSysSalesOrder" parameterType="SysSalesOrder" useGeneratedKeys="true" keyProperty="salesOrderId">
insert into sys_sales_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="salesOrderCode != null">sales_order_code,</if>
<if test="salesOrderNumber != null">sales_order_number,</if>
<if test="appointmentNumber != null">appointment_number,</if>
<if test="enterpriseCode != null">enterprise_code,</if>
<if test="enterpriseName != null">enterprise_name,</if>
<if test="paymentTerms != null">payment_terms,</if>
<if test="deliveryConditions != null">delivery_conditions,</if>
<if test="deliveryMethod != null">delivery_method,</if>
<if test="orderReceivingMode != null">order_receiving_mode,</if>
<if test="customerContact != null">customer_contact,</if>
<if test="customerFactory != null">customer_factory,</if>
<if test="contactNumber != null">contact_number,</if>
<if test="businessMembers != null">business_members,</if>
<if test="customerFax != null">customer_fax,</if>
<if test="deliveryAddress != null">delivery_address,</if>
<if test="orderReceivingTime != null">order_receiving_time,</if>
<if test="billingTime != null">billing_time,</if>
<if test="customerRemarks != null">customer_remarks,</if>
<if test="currentInventory != null">current_inventory,</if>
<if test="creditLimit != null">credit_limit,</if>
<if test="unpaidAmount != null">unpaid_amount,</if>
<if test="availableCredit != null">available_credit,</if>
<if test="confirmTax != null">confirm_tax,</if>
<if test="taxRate != null">tax_rate,</if>
<if test="totalAmount != null">total_amount,</if>
<if test="modificationTime != null">modification_time,</if>
<if test="confirmTime != null">confirm_time,</if>
<if test="confirmNo != null">confirm_no,</if>
<if test="confirmName != null">confirm_name,</if>
<if test="auditNo != null">audit_no,</if>
<if test="standbyOne != null">standby_one,</if>
<if test="auditName != null">audit_name,</if>
<if test="standbyTwo != null">standby_two,</if>
<if test="auditTime != null">audit_time,</if>
<if test="auditRemarks != null">audit_remarks,</if>
<if test="nationalTaxBill != null">national_tax_bill,</if>
<if test="fileUpload != null">file_upload,</if>
first_add_time,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="salesOrderCode != null">#{salesOrderCode},</if>
<if test="salesOrderNumber != null">#{salesOrderNumber},</if>
<if test="appointmentNumber != null">#{appointmentNumber},</if>
<if test="enterpriseCode != null">#{enterpriseCode},</if>
<if test="enterpriseName != null">#{enterpriseName},</if>
<if test="paymentTerms != null">#{paymentTerms},</if>
<if test="deliveryConditions != null">#{deliveryConditions},</if>
<if test="deliveryMethod != null">#{deliveryMethod},</if>
<if test="orderReceivingMode != null">#{orderReceivingMode},</if>
<if test="customerContact != null">#{customerContact},</if>
<if test="customerFactory != null">#{customerFactory},</if>
<if test="contactNumber != null">#{contactNumber},</if>
<if test="businessMembers != null">#{businessMembers},</if>
<if test="customerFax != null">#{customerFax},</if>
<if test="deliveryAddress != null">#{deliveryAddress},</if>
<if test="orderReceivingTime != null">#{orderReceivingTime},</if>
<if test="billingTime != null">#{billingTime},</if>
<if test="customerRemarks != null">#{customerRemarks},</if>
<if test="currentInventory != null">#{currentInventory},</if>
<if test="creditLimit != null">#{creditLimit},</if>
<if test="unpaidAmount != null">#{unpaidAmount},</if>
<if test="availableCredit != null">#{availableCredit},</if>
<if test="confirmTax != null">#{confirmTax},</if>
<if test="taxRate != null">#{taxRate},</if>
<if test="totalAmount != null">#{totalAmount},</if>
<if test="modificationTime != null">#{modificationTime},</if>
<if test="confirmTime != null">#{confirmTime},</if>
<if test="confirmNo != null">#{confirmNo},</if>
<if test="confirmName != null">#{confirmName},</if>
<if test="auditNo != null">#{auditNo},</if>
<if test="standbyOne != null">#{standbyOne},</if>
<if test="auditName != null">#{auditName},</if>
<if test="standbyTwo != null">#{standbyTwo},</if>
<if test="auditTime != null">#{auditTime},</if>
<if test="auditRemarks != null">#{auditRemarks},</if>
<if test="nationalTaxBill != null">#{nationalTaxBill},</if>
<if test="fileUpload != null">#{fileUpload},</if>
now(),
</trim>
</insert>
<update id="updateSysSalesOrder" parameterType="SysSalesOrder">
update sys_sales_order
<trim prefix="SET" suffixOverrides=",">
<if test="salesOrderCode != null">sales_order_code = #{salesOrderCode},</if>
<if test="salesOrderNumber != null">sales_order_number = #{salesOrderNumber},</if>
<if test="appointmentNumber != null">appointment_number = #{appointmentNumber},</if>
<if test="enterpriseCode != null">enterprise_code = #{enterpriseCode},</if>
<if test="enterpriseName != null">enterprise_name = #{enterpriseName},</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="orderReceivingMode != null">order_receiving_mode = #{orderReceivingMode},</if>
<if test="customerContact != null">customer_contact = #{customerContact},</if>
<if test="customerFactory != null">customer_factory = #{customerFactory},</if>
<if test="contactNumber != null">contact_number = #{contactNumber},</if>
<if test="businessMembers != null">business_members = #{businessMembers},</if>
<if test="customerFax != null">customer_fax = #{customerFax},</if>
<if test="deliveryAddress != null">delivery_address = #{deliveryAddress},</if>
<if test="orderReceivingTime != null">order_receiving_time = #{orderReceivingTime},</if>
<if test="billingTime != null">billing_time = #{billingTime},</if>
<if test="customerRemarks != null">customer_remarks = #{customerRemarks},</if>
<if test="currentInventory != null">current_inventory = #{currentInventory},</if>
<if test="creditLimit != null">credit_limit = #{creditLimit},</if>
<if test="unpaidAmount != null">unpaid_amount = #{unpaidAmount},</if>
<if test="availableCredit != null">available_credit = #{availableCredit},</if>
<if test="confirmTax != null">confirm_tax = #{confirmTax},</if>
<if test="taxRate != null">tax_rate = #{taxRate},</if>
<if test="totalAmount != null">total_amount = #{totalAmount},</if>
<if test="modificationTime != null">modification_time = #{modificationTime},</if>
<if test="confirmTime != null">confirm_time = #{confirmTime},</if>
<if test="confirmNo != null">confirm_no = #{confirmNo},</if>
<if test="confirmName != null">confirm_name = #{confirmName},</if>
<if test="auditNo != null">audit_no = #{auditNo},</if>
<if test="standbyOne != null">standby_one = #{standbyOne},</if>
<if test="auditName != null">audit_name = #{auditName},</if>
<if test="standbyTwo != null">standby_two = #{standbyTwo},</if>
<if test="auditTime != null">audit_time = #{auditTime},</if>
<if test="auditRemarks != null">audit_remarks = #{auditRemarks},</if>
<if test="nationalTaxBill != null">national_tax_bill = #{nationalTaxBill},</if>
<if test="fileUpload != null">file_upload = #{fileUpload},</if>
update_info_time = CONCAT_WS(',',NOW(),update_info_time),
</trim>
where sales_order_id = #{salesOrderId}
</update>
<delete id="deleteSysSalesOrderById" parameterType="Long">
delete from sys_sales_order where sales_order_id = #{salesOrderId}
</delete>
<delete id="deleteSysSalesOrderByIds" parameterType="String">
delete from sys_sales_order where sales_order_id in
<foreach item="salesOrderId" collection="array" open="(" separator="," close=")">
#{salesOrderId}
</foreach>
</delete>
</mapper>