|
|
|
|
@ -8,22 +8,24 @@
|
|
|
|
|
|
|
|
|
|
<select id="selectCustomCrmQuoteInfoVoList" resultMap="CrmQuoteInfoResult">
|
|
|
|
|
select t.quote_id, t.tenant_id, t.quote_code, t.quote_name, t.quote_round, t.quote_category,
|
|
|
|
|
t.quote_type, t.business_direction, t.quote_dept_id, t.quote_date, t.valid_from, t.valid_days, t.valid_to,
|
|
|
|
|
t.delivery_period, t.delivery_method, t.payment_method, t.currency_type, t.tax_included_info, t.tax_rate, t.total_price, t.total_before_tax,
|
|
|
|
|
t.total_tax, t.total_including_tax, t.customer_contact_id, t.customer_contact_name, t.customer_contact_phone, t.customer_contact_email,
|
|
|
|
|
t.supplier_contact_id, t.supplier_contact_name, t.supplier_contact_phone, t.supplier_contact_email, t.project_id, t.template_id, t.oss_id, t.quote_status,
|
|
|
|
|
t.flow_status, t.remark,
|
|
|
|
|
ci.customer_name as customerName,
|
|
|
|
|
s.supplier_name as supplierName,
|
|
|
|
|
d.dept_name as deptName,
|
|
|
|
|
u3.nick_name as createName,
|
|
|
|
|
t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
|
|
|
|
|
t.quote_type, t.business_direction, t.quote_dept_id, t.quote_date, t.valid_from, t.valid_days, t.valid_to,
|
|
|
|
|
t.delivery_period, t.warranty_period, t.delivery_method, t.payment_method, t.currency_type, t.tax_included_info, t.tax_rate,
|
|
|
|
|
t.total_price, t.total_before_tax,
|
|
|
|
|
t.total_tax, t.total_including_tax, t.customer_id, t.customer_contact_id, t.customer_contact_name,
|
|
|
|
|
t.customer_contact_phone, t.customer_contact_email,
|
|
|
|
|
t.supplier_contact_id, t.supplier_contact_name, t.supplier_contact_phone, t.supplier_contact_email,
|
|
|
|
|
t.project_id, t.template_id, t.oss_id, t.quote_status,
|
|
|
|
|
t.flow_status, t.remark,
|
|
|
|
|
ci.customer_name as customerName,
|
|
|
|
|
s.supplier_name as supplierName,
|
|
|
|
|
d.dept_name as deptName,
|
|
|
|
|
u3.nick_name as createName,
|
|
|
|
|
t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
|
|
|
|
|
from crm_quote_info t
|
|
|
|
|
left join sys_user u3 on t.create_by = u3.user_id
|
|
|
|
|
left join sys_dept d on d.dept_id = t.quote_dept_id
|
|
|
|
|
left join crm_customer_contact cc on t.customer_contact_id = cc.contact_id
|
|
|
|
|
left join crm_customer_info ci on ci.customer_id = cc.customer_id
|
|
|
|
|
left join crm_supplier_info s on s.supplier_id = t.supplier_contact_id
|
|
|
|
|
left join sys_user u3 on t.create_by = u3.user_id
|
|
|
|
|
left join sys_dept d on d.dept_id = t.quote_dept_id
|
|
|
|
|
left join crm_customer_info ci on ci.customer_id = t.customer_id
|
|
|
|
|
left join crm_supplier_info s on s.supplier_id = t.supplier_contact_id
|
|
|
|
|
<where>
|
|
|
|
|
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
|
|
|
|
|
AND ${ew.sqlSegment}
|
|
|
|
|
@ -33,17 +35,67 @@
|
|
|
|
|
|
|
|
|
|
<!-- 根据ID查询详情 -->
|
|
|
|
|
<select id="selectCustomCrmQuoteInfoVoById" resultMap="CrmQuoteInfoResult">
|
|
|
|
|
select t.quote_id, t.tenant_id, t.quote_code, t.quote_name, t.quote_round, t.quote_category, t.quote_type, t.business_direction, t.quote_dept_id, t.quote_date, t.valid_from, t.valid_days, t.valid_to, t.delivery_period, t.delivery_method, t.payment_method, t.currency_type, t.tax_included_info, t.tax_rate, t.total_price, t.total_before_tax, t.total_tax, t.total_including_tax, t.customer_contact_id, t.customer_contact_name, t.customer_contact_phone, t.customer_contact_email, t.supplier_contact_id, t.supplier_contact_name, t.supplier_contact_phone, t.supplier_contact_email, t.project_id, t.template_id, t.oss_id, t.quote_status, t.flow_status, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
|
|
|
|
|
select t.quote_id,
|
|
|
|
|
t.tenant_id,
|
|
|
|
|
t.quote_code,
|
|
|
|
|
t.quote_name,
|
|
|
|
|
t.quote_round,
|
|
|
|
|
t.quote_category,
|
|
|
|
|
t.quote_type,
|
|
|
|
|
t.business_direction,
|
|
|
|
|
t.quote_dept_id,
|
|
|
|
|
t.quote_date,
|
|
|
|
|
t.valid_from,
|
|
|
|
|
t.valid_days,
|
|
|
|
|
t.valid_to,
|
|
|
|
|
t.delivery_period,
|
|
|
|
|
t.warranty_period,
|
|
|
|
|
t.delivery_method,
|
|
|
|
|
t.payment_method,
|
|
|
|
|
t.currency_type,
|
|
|
|
|
t.tax_included_info,
|
|
|
|
|
t.tax_rate,
|
|
|
|
|
t.total_price,
|
|
|
|
|
t.total_before_tax,
|
|
|
|
|
t.total_tax,
|
|
|
|
|
t.total_including_tax,
|
|
|
|
|
t.customer_id,
|
|
|
|
|
t.customer_contact_id,
|
|
|
|
|
t.customer_contact_name,
|
|
|
|
|
t.customer_contact_phone,
|
|
|
|
|
t.customer_contact_email,
|
|
|
|
|
t.supplier_contact_id,
|
|
|
|
|
t.supplier_contact_name,
|
|
|
|
|
t.supplier_contact_phone,
|
|
|
|
|
t.supplier_contact_email,
|
|
|
|
|
t.project_id,
|
|
|
|
|
t.template_id,
|
|
|
|
|
t.oss_id,
|
|
|
|
|
t.quote_status,
|
|
|
|
|
t.flow_status,
|
|
|
|
|
t.remark,
|
|
|
|
|
ci.customer_name as customerName,
|
|
|
|
|
t.del_flag,
|
|
|
|
|
t.create_dept,
|
|
|
|
|
t.create_by,
|
|
|
|
|
t.create_time,
|
|
|
|
|
t.update_by,
|
|
|
|
|
t.update_time
|
|
|
|
|
from crm_quote_info t
|
|
|
|
|
left join crm_customer_info ci on ci.customer_id = t.customer_id
|
|
|
|
|
where t.quote_id = #{quoteId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!-- 批量查询 - 根据ID列表 -->
|
|
|
|
|
<select id="selectCustomCrmQuoteInfoVoByIds" resultMap="CrmQuoteInfoResult">
|
|
|
|
|
select t.quote_id, t.tenant_id, t.quote_code, t.quote_name, t.quote_round, t.quote_category,
|
|
|
|
|
t.quote_type, t.business_direction, t.quote_dept_id, t.quote_date, t.valid_from, t.valid_days,
|
|
|
|
|
t.valid_to, t.delivery_period, t.delivery_method, t.payment_method, t.currency_type, t.tax_included_info,
|
|
|
|
|
t.tax_rate, t.total_price, t.total_before_tax, t.total_tax, t.total_including_tax, t.customer_contact_id, t.customer_contact_name, t.customer_contact_phone, t.customer_contact_email, t.supplier_contact_id, t.supplier_contact_name, t.supplier_contact_phone, t.supplier_contact_email, t.project_id, t.template_id, t.oss_id, t.quote_status, t.flow_status, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
|
|
|
|
|
t.quote_type, t.business_direction, t.quote_dept_id, t.quote_date, t.valid_from, t.valid_days,
|
|
|
|
|
t.valid_to, t.delivery_period, t.warranty_period, t.delivery_method, t.payment_method, t.currency_type, t.tax_included_info,
|
|
|
|
|
t.tax_rate, t.total_price, t.total_before_tax, t.total_tax, t.total_including_tax, t.customer_id,
|
|
|
|
|
t.customer_contact_id, t.customer_contact_name, t.customer_contact_phone, t.customer_contact_email,
|
|
|
|
|
t.supplier_contact_id, t.supplier_contact_name, t.supplier_contact_phone, t.supplier_contact_email,
|
|
|
|
|
t.project_id, t.template_id, t.oss_id, t.quote_status, t.flow_status, t.remark, t.del_flag, t.create_dept,
|
|
|
|
|
t.create_by, t.create_time, t.update_by, t.update_time
|
|
|
|
|
from crm_quote_info t
|
|
|
|
|
where t.quote_id in
|
|
|
|
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
|
|
|
|
@ -63,7 +115,7 @@
|
|
|
|
|
|
|
|
|
|
<!-- 分页查询(带自定义条件) -->
|
|
|
|
|
<select id="selectCustomCrmQuoteInfoVoPage" resultMap="CrmQuoteInfoResult">
|
|
|
|
|
select quote_id, tenant_id, quote_code, quote_name, quote_round, quote_category, quote_type, business_direction, quote_dept_id, quote_date, valid_from, valid_days, valid_to, delivery_period, delivery_method, payment_method, currency_type, tax_included_info, tax_rate, total_price, total_before_tax, total_tax, total_including_tax, customer_contact_id, customer_contact_name, customer_contact_phone, customer_contact_email, supplier_contact_id, supplier_contact_name, supplier_contact_phone, supplier_contact_email, project_id, template_id, oss_id, quote_status, flow_status, remark, del_flag, create_dept, create_by, create_time, update_by, update_time
|
|
|
|
|
select quote_id, tenant_id, quote_code, quote_name, quote_round, quote_category, quote_type, business_direction, quote_dept_id, quote_date, valid_from, valid_days, valid_to, delivery_period, warranty_period, delivery_method, payment_method, currency_type, tax_included_info, tax_rate, total_price, total_before_tax, total_tax, total_including_tax, customer_id, customer_contact_id, customer_contact_name, customer_contact_phone, customer_contact_email, supplier_contact_id, supplier_contact_name, supplier_contact_phone, supplier_contact_email, project_id, template_id, oss_id, quote_status, flow_status, remark, del_flag, create_dept, create_by, create_time, update_by, update_time
|
|
|
|
|
from crm_quote_info t
|
|
|
|
|
<where>
|
|
|
|
|
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
|
|
|
|
|
@ -101,6 +153,8 @@
|
|
|
|
|
|
|
|
|
|
delivery_period,
|
|
|
|
|
|
|
|
|
|
warranty_period,
|
|
|
|
|
|
|
|
|
|
delivery_method,
|
|
|
|
|
|
|
|
|
|
payment_method,
|
|
|
|
|
@ -119,6 +173,8 @@
|
|
|
|
|
|
|
|
|
|
total_including_tax,
|
|
|
|
|
|
|
|
|
|
customer_id,
|
|
|
|
|
|
|
|
|
|
customer_contact_id,
|
|
|
|
|
|
|
|
|
|
customer_contact_name,
|
|
|
|
|
@ -189,6 +245,8 @@
|
|
|
|
|
|
|
|
|
|
#{item.deliveryPeriod},
|
|
|
|
|
|
|
|
|
|
#{item.warrantyPeriod},
|
|
|
|
|
|
|
|
|
|
#{item.deliveryMethod},
|
|
|
|
|
|
|
|
|
|
#{item.paymentMethod},
|
|
|
|
|
@ -207,6 +265,8 @@
|
|
|
|
|
|
|
|
|
|
#{item.totalIncludingTax},
|
|
|
|
|
|
|
|
|
|
#{item.customerId},
|
|
|
|
|
|
|
|
|
|
#{item.customerContactId},
|
|
|
|
|
|
|
|
|
|
#{item.customerContactName},
|
|
|
|
|
@ -295,6 +355,9 @@
|
|
|
|
|
<if test="item.deliveryPeriod != null">
|
|
|
|
|
delivery_period = #{item.deliveryPeriod},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="item.warrantyPeriod != null">
|
|
|
|
|
warranty_period = #{item.warrantyPeriod},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="item.deliveryMethod != null and item.deliveryMethod != ''">
|
|
|
|
|
delivery_method = #{item.deliveryMethod},
|
|
|
|
|
</if>
|
|
|
|
|
@ -322,6 +385,9 @@
|
|
|
|
|
<if test="item.totalIncludingTax != null">
|
|
|
|
|
total_including_tax = #{item.totalIncludingTax},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="item.customerId != null">
|
|
|
|
|
customer_id = #{item.customerId},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="item.customerContactId != null">
|
|
|
|
|
customer_contact_id = #{item.customerContactId},
|
|
|
|
|
</if>
|
|
|
|
|
|