Files
klp-oa/klp-crm/src/main/resources/mapper/CrmOrderMapper.xml

174 lines
8.0 KiB
XML
Raw Normal View History

<?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.klp.crm.mapper.CrmOrderMapper">
<resultMap type="com.klp.crm.domain.CrmOrder" id="CrmOrderResult">
<result property="orderId" column="order_id"/>
<result property="orderCode" column="order_code"/>
<result property="orderType" column="order_type"/>
<result property="customerId" column="customer_id"/>
<result property="orderAmount" column="order_amount"/>
<result property="salesman" column="salesman"/>
<result property="deliveryDate" column="delivery_date"/>
<result property="preOrderStatus" column="pre_order_status"/>
<result property="auditUser" column="audit_user"/>
<result property="auditTime" column="audit_time"/>
<result property="orderStatus" column="order_status"/>
<result property="financeStatus" column="finance_status"/>
<result property="unpaidAmount" column="unpaid_amount"/>
<result property="remark" column="remark"/>
<result property="contractCode" column="contract_code"/>
<result property="contractName" column="contract_name"/>
<result property="supplier" column="supplier"/>
<result property="customer" column="customer"/>
<result property="signTime" column="sign_time"/>
<result property="signLocation" column="sign_location"/>
<result property="productContent" column="product_content"/>
<result property="contractContent" column="contract_content"/>
<result property="supplierAddress" column="supplier_address"/>
<result property="supplierPhone" column="supplier_phone"/>
<result property="supplierBank" column="supplier_bank"/>
<result property="supplierAccount" column="supplier_account"/>
<result property="supplierTaxNo" column="supplier_tax_no"/>
<result property="customerAddress" column="customer_address"/>
<result property="customerPhone" column="customer_phone"/>
<result property="customerBank" column="customer_bank"/>
<result property="customerAccount" column="customer_account"/>
<result property="customerTaxNo" column="customer_tax_no"/>
<result property="techAnnex" column="tech_annex"/>
<result property="businessAnnex" column="business_annex"/>
<result property="productionSchedule" column="production_schedule"/>
<result property="unitPriceRemark" column="unit_price_remark"/>
<result property="depositPayable" column="deposit_payable"/>
<result property="depositPaid" column="deposit_paid"/>
<result property="depositRatio" column="deposit_ratio"/>
<result property="status" column="status"/>
<result property="contractId" column="contract_id"/>
<result property="annexFiles" column="annex_files"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="delFlag" column="del_flag"/>
</resultMap>
<select id="selectVoPagePlus" resultType="com.klp.crm.domain.vo.CrmOrderVo">
SELECT
co.order_id AS orderId,
co.order_code AS orderCode,
co.order_type AS orderType,
co.customer_id AS customerId,
co.order_amount AS orderAmount,
co.salesman,
co.delivery_date AS deliveryDate,
co.pre_order_status AS preOrderStatus,
co.audit_user AS auditUser,
co.audit_time AS auditTime,
co.order_status AS orderStatus,
co.finance_status AS financeStatus,
co.unpaid_amount AS unpaidAmount,
co.remark,
co.contract_code AS contractCode,
co.contract_name AS contractName,
co.supplier,
co.customer,
co.sign_time AS signTime,
co.sign_location AS signLocation,
co.product_content AS productContent,
co.contract_content AS contractContent,
co.supplier_address AS supplierAddress,
co.supplier_phone AS supplierPhone,
co.supplier_bank AS supplierBank,
co.supplier_account AS supplierAccount,
co.supplier_tax_no AS supplierTaxNo,
co.customer_address AS customerAddress,
co.customer_phone AS customerPhone,
co.customer_bank AS customerBank,
co.customer_account AS customerAccount,
co.customer_tax_no AS customerTaxNo,
co.tech_annex AS techAnnex,
co.business_annex AS businessAnnex,
co.production_schedule AS productionSchedule,
co.unit_price_remark AS unitPriceRemark,
co.deposit_payable AS depositPayable,
co.deposit_paid AS depositPaid,
co.deposit_ratio AS depositRatio,
co.status,
co.contract_id AS contractId,
co.annex_files AS annexFiles,
co.create_by AS createBy,
co.create_time AS createTime,
co.update_by AS updateBy,
co.update_time AS updateTime,
cu.customer_code AS customerCode,
cu.contact_person AS contactPerson,
cu.contact_way AS contactWay,
cu.company_name AS companyName,
cu.address AS address
FROM crm_order co
LEFT JOIN crm_customer cu ON co.customer_id = cu.customer_id
${ew.customSqlSegment}
</select>
<select id="selectVoById" resultType="com.klp.crm.domain.vo.CrmOrderVo">
SELECT
co.order_id AS orderId,
co.order_code AS orderCode,
co.order_type AS orderType,
co.customer_id AS customerId,
co.order_amount AS orderAmount,
co.salesman,
co.delivery_date AS deliveryDate,
co.pre_order_status AS preOrderStatus,
co.audit_user AS auditUser,
co.audit_time AS auditTime,
co.order_status AS orderStatus,
co.finance_status AS financeStatus,
co.unpaid_amount AS unpaidAmount,
co.remark,
co.contract_code AS contractCode,
co.contract_name AS contractName,
co.supplier,
co.customer,
co.sign_time AS signTime,
co.sign_location AS signLocation,
co.product_content AS productContent,
co.contract_content AS contractContent,
co.supplier_address AS supplierAddress,
co.supplier_phone AS supplierPhone,
co.supplier_bank AS supplierBank,
co.supplier_account AS supplierAccount,
co.supplier_tax_no AS supplierTaxNo,
co.customer_address AS customerAddress,
co.customer_phone AS customerPhone,
co.customer_bank AS customerBank,
co.customer_account AS customerAccount,
co.customer_tax_no AS customerTaxNo,
co.tech_annex AS techAnnex,
co.business_annex AS businessAnnex,
co.production_schedule AS productionSchedule,
co.unit_price_remark AS unitPriceRemark,
co.deposit_payable AS depositPayable,
co.deposit_paid AS depositPaid,
co.deposit_ratio AS depositRatio,
co.status,
co.contract_id AS contractId,
co.annex_files AS annexFiles,
co.create_by AS createBy,
co.create_time AS createTime,
co.update_by AS updateBy,
co.update_time AS updateTime,
cu.customer_code AS customerCode,
cu.contact_person AS contactPerson,
cu.contact_way AS contactWay,
cu.company_name AS companyName,
cu.address AS address
FROM crm_order co
LEFT JOIN crm_customer cu ON co.customer_id = cu.customer_id
WHERE co.order_id = #{orderId}
</select>
</mapper>