feat(oa/crm): 新增报价单信息管理功能
- 新增报价单信息实体类 CrmQuoteInfo 及其业务对象 CrmQuoteInfoBo - 新增报价单信息控制器 CrmQuoteInfoController,支持增删改查及导出功能 - 新增报价单信息 Mapper 接口及 XML 映射文件,实现数据持久化操作 - 新增报价单信息服务实现类 CrmQuoteInfoServiceImpl,包含完整的业务逻辑处理- 支持报价单分页查询、详情查看、多轮报价查询及金额汇总计算功能 - 提供报价单子表物料明细的关联保存与更新逻辑 - 实现客户方与供货方联系人的关联查询展示- 添加权限控制注解,确保接口访问安全 - 支持报价单导出为 Excel 文件功能 - 支持根据报价单 ID 进行删除及批量删除操作 - 添加重复提交限制注解,防止重复新增或修改 - 新增报价单打印模板及附件存储字段支持 - 实现报价单状态及流程状态字段管理 - 添加报价单编号、名称、类别等基础信息维护功能 - 支持币种、税率、含税信息配置及相关金额字段计算- 实现报价有效期、交付方式、付款方式等相关业务字段管理- 提供客户及供应商联系人信息快速录入与展示功能- 新增报价单备注信息及创建/更新时间追踪功能 - 使用 MyBatis Plus 实现高效的数据访问层封装 - 利用 MapStruct 实现实体与 BO 对象之间的转换 - 添加事务管理以确保主子表数据一致性- 引入参数校验机制保障数据合法性 - 支持通过报价单号或名称进行模糊搜索查询 - 新增报价单轮次管理和相同报价历史追溯功能dev
parent
9dbb796508
commit
e409437714
@ -0,0 +1,117 @@
|
||||
package org.dromara.oa.crm.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.oa.crm.domain.bo.CrmQuoteMaterialBo;
|
||||
import org.dromara.oa.crm.domain.vo.CrmQuoteMaterialVo;
|
||||
import org.dromara.oa.crm.service.ICrmQuoteMaterialService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 报价单物料明细
|
||||
* 前端访问路由地址为:/oa/crm/crmQuoteMaterial
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-10-28
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/crm/crmQuoteMaterial")
|
||||
public class CrmQuoteMaterialController extends BaseController {
|
||||
|
||||
private final ICrmQuoteMaterialService crmQuoteMaterialService;
|
||||
|
||||
/**
|
||||
* 查询报价单物料明细列表
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmQuoteMaterial:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<CrmQuoteMaterialVo> list(CrmQuoteMaterialBo bo, PageQuery pageQuery) {
|
||||
return crmQuoteMaterialService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出报价单物料明细列表
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmQuoteMaterial:export")
|
||||
@Log(title = "报价单物料明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(CrmQuoteMaterialBo bo, HttpServletResponse response) {
|
||||
List<CrmQuoteMaterialVo> list = crmQuoteMaterialService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "报价单物料明细", CrmQuoteMaterialVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取报价单物料明细详细信息
|
||||
*
|
||||
* @param quoteMaterialId 主键
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmQuoteMaterial:query")
|
||||
@GetMapping("/{quoteMaterialId}")
|
||||
public R<CrmQuoteMaterialVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("quoteMaterialId") Long quoteMaterialId) {
|
||||
return R.ok(crmQuoteMaterialService.queryById(quoteMaterialId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增报价单物料明细
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmQuoteMaterial:add")
|
||||
@Log(title = "报价单物料明细", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody CrmQuoteMaterialBo bo) {
|
||||
return toAjax(crmQuoteMaterialService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改报价单物料明细
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmQuoteMaterial:edit")
|
||||
@Log(title = "报价单物料明细", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CrmQuoteMaterialBo bo) {
|
||||
return toAjax(crmQuoteMaterialService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除报价单物料明细
|
||||
*
|
||||
* @param quoteMaterialIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmQuoteMaterial:remove")
|
||||
@Log(title = "报价单物料明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{quoteMaterialIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("quoteMaterialIds") Long[] quoteMaterialIds) {
|
||||
return toAjax(crmQuoteMaterialService.deleteWithValidByIds(List.of(quoteMaterialIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉框查询报价单物料明细列表
|
||||
*/
|
||||
@GetMapping("/getCrmQuoteMaterialList")
|
||||
public R<List<CrmQuoteMaterialVo>> getCrmQuoteMaterialList(CrmQuoteMaterialBo bo) {
|
||||
List<CrmQuoteMaterialVo> list = crmQuoteMaterialService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
package org.dromara.oa.crm.service;
|
||||
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.oa.crm.domain.bo.CrmQuoteMaterialBo;
|
||||
import org.dromara.oa.crm.domain.vo.CrmQuoteMaterialVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 报价单物料明细Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-10-28
|
||||
*/
|
||||
public interface ICrmQuoteMaterialService {
|
||||
|
||||
/**
|
||||
* 查询报价单物料明细
|
||||
*
|
||||
* @param quoteMaterialId 主键
|
||||
* @return 报价单物料明细
|
||||
*/
|
||||
CrmQuoteMaterialVo queryById(Long quoteMaterialId);
|
||||
|
||||
/**
|
||||
* 分页查询报价单物料明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 报价单物料明细分页列表
|
||||
*/
|
||||
TableDataInfo<CrmQuoteMaterialVo> queryPageList(CrmQuoteMaterialBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的报价单物料明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 报价单物料明细列表
|
||||
*/
|
||||
List<CrmQuoteMaterialVo> queryList(CrmQuoteMaterialBo bo);
|
||||
|
||||
/**
|
||||
* 新增报价单物料明细
|
||||
*
|
||||
* @param bo 报价单物料明细
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(CrmQuoteMaterialBo bo);
|
||||
|
||||
/**
|
||||
* 修改报价单物料明细
|
||||
*
|
||||
* @param bo 报价单物料明细
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(CrmQuoteMaterialBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除报价单物料明细信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -0,0 +1,381 @@
|
||||
<?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="org.dromara.oa.crm.mapper.CrmQuoteInfoMapper">
|
||||
<resultMap type="org.dromara.oa.crm.domain.vo.CrmQuoteInfoVo" id="CrmQuoteInfoResult">
|
||||
</resultMap>
|
||||
|
||||
<select id="selectCustomCrmQuoteInfoVoList" 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 from crm_quote_info t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<!-- 根据ID查询详情 -->
|
||||
<select id="selectCustomCrmQuoteInfoVoById" 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
|
||||
from crm_quote_info t
|
||||
where t.quote_id = #{quoteId}
|
||||
</select>
|
||||
|
||||
<!-- 批量查询 - 根据ID列表 -->
|
||||
<select id="selectCustomCrmQuoteInfoVoByIds" 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
|
||||
from crm_quote_info t
|
||||
where t.quote_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!-- 统计查询 -->
|
||||
<select id="countCustomCrmQuoteInfo" resultType="java.lang.Long">
|
||||
select count(1) from crm_quote_info t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<!-- 分页查询(带自定义条件) -->
|
||||
<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
|
||||
from crm_quote_info t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<!-- 批量插入 -->
|
||||
<insert id="batchInsertCrmQuoteInfo">
|
||||
insert into crm_quote_info(
|
||||
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
|
||||
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.tenantId},
|
||||
|
||||
#{item.quoteCode},
|
||||
|
||||
#{item.quoteName},
|
||||
|
||||
#{item.quoteRound},
|
||||
|
||||
#{item.quoteCategory},
|
||||
|
||||
#{item.quoteType},
|
||||
|
||||
#{item.businessDirection},
|
||||
|
||||
#{item.quoteDeptId},
|
||||
|
||||
#{item.quoteDate},
|
||||
|
||||
#{item.validFrom},
|
||||
|
||||
#{item.validDays},
|
||||
|
||||
#{item.validTo},
|
||||
|
||||
#{item.deliveryPeriod},
|
||||
|
||||
#{item.deliveryMethod},
|
||||
|
||||
#{item.paymentMethod},
|
||||
|
||||
#{item.currencyType},
|
||||
|
||||
#{item.taxIncludedInfo},
|
||||
|
||||
#{item.taxRate},
|
||||
|
||||
#{item.totalPrice},
|
||||
|
||||
#{item.totalBeforeTax},
|
||||
|
||||
#{item.totalTax},
|
||||
|
||||
#{item.totalIncludingTax},
|
||||
|
||||
#{item.customerContactId},
|
||||
|
||||
#{item.customerContactName},
|
||||
|
||||
#{item.customerContactPhone},
|
||||
|
||||
#{item.customerContactEmail},
|
||||
|
||||
#{item.supplierContactId},
|
||||
|
||||
#{item.supplierContactName},
|
||||
|
||||
#{item.supplierContactPhone},
|
||||
|
||||
#{item.supplierContactEmail},
|
||||
|
||||
#{item.projectId},
|
||||
|
||||
#{item.templateId},
|
||||
|
||||
#{item.ossId},
|
||||
|
||||
#{item.quoteStatus},
|
||||
|
||||
#{item.flowStatus},
|
||||
|
||||
#{item.remark},
|
||||
|
||||
#{item.delFlag},
|
||||
|
||||
#{item.createDept},
|
||||
|
||||
#{item.createBy},
|
||||
|
||||
#{item.createTime},
|
||||
|
||||
#{item.updateBy},
|
||||
|
||||
#{item.updateTime}
|
||||
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 批量更新 -->
|
||||
<update id="batchUpdateCrmQuoteInfo">
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
update crm_quote_info
|
||||
<set>
|
||||
<if test="item.tenantId != null and item.tenantId != ''">
|
||||
tenant_id = #{item.tenantId},
|
||||
</if>
|
||||
<if test="item.quoteCode != null and item.quoteCode != ''">
|
||||
quote_code = #{item.quoteCode},
|
||||
</if>
|
||||
<if test="item.quoteName != null and item.quoteName != ''">
|
||||
quote_name = #{item.quoteName},
|
||||
</if>
|
||||
<if test="item.quoteRound != null">
|
||||
quote_round = #{item.quoteRound},
|
||||
</if>
|
||||
<if test="item.quoteCategory != null and item.quoteCategory != ''">
|
||||
quote_category = #{item.quoteCategory},
|
||||
</if>
|
||||
<if test="item.quoteType != null and item.quoteType != ''">
|
||||
quote_type = #{item.quoteType},
|
||||
</if>
|
||||
<if test="item.businessDirection != null and item.businessDirection != ''">
|
||||
business_direction = #{item.businessDirection},
|
||||
</if>
|
||||
<if test="item.quoteDeptId != null">
|
||||
quote_dept_id = #{item.quoteDeptId},
|
||||
</if>
|
||||
<if test="item.quoteDate != null">
|
||||
quote_date = #{item.quoteDate},
|
||||
</if>
|
||||
<if test="item.validFrom != null">
|
||||
valid_from = #{item.validFrom},
|
||||
</if>
|
||||
<if test="item.validDays != null">
|
||||
valid_days = #{item.validDays},
|
||||
</if>
|
||||
<if test="item.validTo != null">
|
||||
valid_to = #{item.validTo},
|
||||
</if>
|
||||
<if test="item.deliveryPeriod != null">
|
||||
delivery_period = #{item.deliveryPeriod},
|
||||
</if>
|
||||
<if test="item.deliveryMethod != null and item.deliveryMethod != ''">
|
||||
delivery_method = #{item.deliveryMethod},
|
||||
</if>
|
||||
<if test="item.paymentMethod != null and item.paymentMethod != ''">
|
||||
payment_method = #{item.paymentMethod},
|
||||
</if>
|
||||
<if test="item.currencyType != null and item.currencyType != ''">
|
||||
currency_type = #{item.currencyType},
|
||||
</if>
|
||||
<if test="item.taxIncludedInfo != null and item.taxIncludedInfo != ''">
|
||||
tax_included_info = #{item.taxIncludedInfo},
|
||||
</if>
|
||||
<if test="item.taxRate != null">
|
||||
tax_rate = #{item.taxRate},
|
||||
</if>
|
||||
<if test="item.totalPrice != null">
|
||||
total_price = #{item.totalPrice},
|
||||
</if>
|
||||
<if test="item.totalBeforeTax != null">
|
||||
total_before_tax = #{item.totalBeforeTax},
|
||||
</if>
|
||||
<if test="item.totalTax != null">
|
||||
total_tax = #{item.totalTax},
|
||||
</if>
|
||||
<if test="item.totalIncludingTax != null">
|
||||
total_including_tax = #{item.totalIncludingTax},
|
||||
</if>
|
||||
<if test="item.customerContactId != null">
|
||||
customer_contact_id = #{item.customerContactId},
|
||||
</if>
|
||||
<if test="item.customerContactName != null and item.customerContactName != ''">
|
||||
customer_contact_name = #{item.customerContactName},
|
||||
</if>
|
||||
<if test="item.customerContactPhone != null and item.customerContactPhone != ''">
|
||||
customer_contact_phone = #{item.customerContactPhone},
|
||||
</if>
|
||||
<if test="item.customerContactEmail != null and item.customerContactEmail != ''">
|
||||
customer_contact_email = #{item.customerContactEmail},
|
||||
</if>
|
||||
<if test="item.supplierContactId != null">
|
||||
supplier_contact_id = #{item.supplierContactId},
|
||||
</if>
|
||||
<if test="item.supplierContactName != null and item.supplierContactName != ''">
|
||||
supplier_contact_name = #{item.supplierContactName},
|
||||
</if>
|
||||
<if test="item.supplierContactPhone != null and item.supplierContactPhone != ''">
|
||||
supplier_contact_phone = #{item.supplierContactPhone},
|
||||
</if>
|
||||
<if test="item.supplierContactEmail != null and item.supplierContactEmail != ''">
|
||||
supplier_contact_email = #{item.supplierContactEmail},
|
||||
</if>
|
||||
<if test="item.projectId != null">
|
||||
project_id = #{item.projectId},
|
||||
</if>
|
||||
<if test="item.templateId != null">
|
||||
template_id = #{item.templateId},
|
||||
</if>
|
||||
<if test="item.ossId != null and item.ossId != ''">
|
||||
oss_id = #{item.ossId},
|
||||
</if>
|
||||
<if test="item.quoteStatus != null and item.quoteStatus != ''">
|
||||
quote_status = #{item.quoteStatus},
|
||||
</if>
|
||||
<if test="item.flowStatus != null and item.flowStatus != ''">
|
||||
flow_status = #{item.flowStatus},
|
||||
</if>
|
||||
<if test="item.remark != null and item.remark != ''">
|
||||
remark = #{item.remark},
|
||||
</if>
|
||||
<if test="item.delFlag != null and item.delFlag != ''">
|
||||
del_flag = #{item.delFlag},
|
||||
</if>
|
||||
<if test="item.createDept != null">
|
||||
create_dept = #{item.createDept},
|
||||
</if>
|
||||
<if test="item.createBy != null">
|
||||
create_by = #{item.createBy},
|
||||
</if>
|
||||
<if test="item.createTime != null">
|
||||
create_time = #{item.createTime},
|
||||
</if>
|
||||
<if test="item.updateBy != null">
|
||||
update_by = #{item.updateBy},
|
||||
</if>
|
||||
<if test="item.updateTime != null">
|
||||
update_time = #{item.updateTime}
|
||||
</if>
|
||||
</set>
|
||||
where quote_id = #{item.quoteId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- 根据自定义条件删除 -->
|
||||
<delete id="deleteCustomCrmQuoteInfo">
|
||||
delete from crm_quote_info
|
||||
${ew.getCustomSqlSegment}
|
||||
</delete>
|
||||
|
||||
<!-- 根据ID列表批量删除 -->
|
||||
<delete id="deleteCustomCrmQuoteInfoByIds">
|
||||
delete from crm_quote_info
|
||||
where quote_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 检查是否存在 -->
|
||||
<select id="existsCrmQuoteInfo" resultType="java.lang.Boolean">
|
||||
select count(1) > 0 from crm_quote_info t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,241 @@
|
||||
<?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="org.dromara.oa.crm.mapper.CrmQuoteMaterialMapper">
|
||||
<resultMap type="org.dromara.oa.crm.domain.vo.CrmQuoteMaterialVo" id="CrmQuoteMaterialResult">
|
||||
</resultMap>
|
||||
|
||||
<select id="selectCustomCrmQuoteMaterialVoList" resultMap="CrmQuoteMaterialResult">
|
||||
select quote_material_id, tenant_id, quote_id, item_no, product_name, specification_description, material_id, relation_material_id, amount, unit_id, unit_name, before_price, tax_rate, including_price, subtotal, remark, active_flag, del_flag, create_dept, create_by, create_time, update_by, update_time from crm_quote_material t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<!-- 根据ID查询详情 -->
|
||||
<select id="selectCustomCrmQuoteMaterialVoById" resultMap="CrmQuoteMaterialResult">
|
||||
select quote_material_id, tenant_id, quote_id, item_no, product_name, specification_description, material_id, relation_material_id, amount, unit_id, unit_name, before_price, tax_rate, including_price, subtotal, remark, active_flag, del_flag, create_dept, create_by, create_time, update_by, update_time
|
||||
from crm_quote_material t
|
||||
where t.quote_material_id = #{quoteMaterialId}
|
||||
</select>
|
||||
|
||||
<!-- 批量查询 - 根据ID列表 -->
|
||||
<select id="selectCustomCrmQuoteMaterialVoByIds" resultMap="CrmQuoteMaterialResult">
|
||||
select quote_material_id, tenant_id, quote_id, item_no, product_name, specification_description, material_id, relation_material_id, amount, unit_id, unit_name, before_price, tax_rate, including_price, subtotal, remark, active_flag, del_flag, create_dept, create_by, create_time, update_by, update_time
|
||||
from crm_quote_material t
|
||||
where t.quote_material_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!-- 统计查询 -->
|
||||
<select id="countCustomCrmQuoteMaterial" resultType="java.lang.Long">
|
||||
select count(1) from crm_quote_material t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<!-- 分页查询(带自定义条件) -->
|
||||
<select id="selectCustomCrmQuoteMaterialVoPage" resultMap="CrmQuoteMaterialResult">
|
||||
select quote_material_id, tenant_id, quote_id, item_no, product_name, specification_description, material_id, relation_material_id, amount, unit_id, unit_name, before_price, tax_rate, including_price, subtotal, remark, active_flag, del_flag, create_dept, create_by, create_time, update_by, update_time
|
||||
from crm_quote_material t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<!-- 批量插入 -->
|
||||
<insert id="batchInsertCrmQuoteMaterial">
|
||||
insert into crm_quote_material(
|
||||
tenant_id,
|
||||
|
||||
quote_id,
|
||||
|
||||
item_no,
|
||||
|
||||
product_name,
|
||||
|
||||
specification_description,
|
||||
|
||||
material_id,
|
||||
|
||||
relation_material_id,
|
||||
|
||||
amount,
|
||||
|
||||
unit_id,
|
||||
|
||||
unit_name,
|
||||
|
||||
before_price,
|
||||
|
||||
tax_rate,
|
||||
|
||||
including_price,
|
||||
|
||||
subtotal,
|
||||
|
||||
remark,
|
||||
|
||||
active_flag,
|
||||
|
||||
del_flag,
|
||||
|
||||
create_dept,
|
||||
|
||||
create_by,
|
||||
|
||||
create_time,
|
||||
|
||||
update_by,
|
||||
|
||||
update_time
|
||||
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.tenantId},
|
||||
|
||||
#{item.quoteId},
|
||||
|
||||
#{item.itemNo},
|
||||
|
||||
#{item.productName},
|
||||
|
||||
#{item.specificationDescription},
|
||||
|
||||
#{item.materialId},
|
||||
|
||||
#{item.relationMaterialId},
|
||||
|
||||
#{item.amount},
|
||||
|
||||
#{item.unitId},
|
||||
|
||||
#{item.unitName},
|
||||
|
||||
#{item.beforePrice},
|
||||
|
||||
#{item.taxRate},
|
||||
|
||||
#{item.includingPrice},
|
||||
|
||||
#{item.subtotal},
|
||||
|
||||
#{item.remark},
|
||||
|
||||
#{item.activeFlag},
|
||||
|
||||
#{item.delFlag},
|
||||
|
||||
#{item.createDept},
|
||||
|
||||
#{item.createBy},
|
||||
|
||||
#{item.createTime},
|
||||
|
||||
#{item.updateBy},
|
||||
|
||||
#{item.updateTime}
|
||||
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 批量更新 -->
|
||||
<update id="batchUpdateCrmQuoteMaterial">
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
update crm_quote_material
|
||||
<set>
|
||||
<if test="item.tenantId != null and item.tenantId != ''">
|
||||
tenant_id = #{item.tenantId},
|
||||
</if>
|
||||
<if test="item.quoteId != null">
|
||||
quote_id = #{item.quoteId},
|
||||
</if>
|
||||
<if test="item.itemNo != null">
|
||||
item_no = #{item.itemNo},
|
||||
</if>
|
||||
<if test="item.productName != null and item.productName != ''">
|
||||
product_name = #{item.productName},
|
||||
</if>
|
||||
<if test="item.specificationDescription != null and item.specificationDescription != ''">
|
||||
specification_description = #{item.specificationDescription},
|
||||
</if>
|
||||
<if test="item.materialId != null">
|
||||
material_id = #{item.materialId},
|
||||
</if>
|
||||
<if test="item.relationMaterialId != null">
|
||||
relation_material_id = #{item.relationMaterialId},
|
||||
</if>
|
||||
<if test="item.amount != null">
|
||||
amount = #{item.amount},
|
||||
</if>
|
||||
<if test="item.unitId != null">
|
||||
unit_id = #{item.unitId},
|
||||
</if>
|
||||
<if test="item.unitName != null and item.unitName != ''">
|
||||
unit_name = #{item.unitName},
|
||||
</if>
|
||||
<if test="item.beforePrice != null">
|
||||
before_price = #{item.beforePrice},
|
||||
</if>
|
||||
<if test="item.taxRate != null">
|
||||
tax_rate = #{item.taxRate},
|
||||
</if>
|
||||
<if test="item.includingPrice != null">
|
||||
including_price = #{item.includingPrice},
|
||||
</if>
|
||||
<if test="item.subtotal != null">
|
||||
subtotal = #{item.subtotal},
|
||||
</if>
|
||||
<if test="item.remark != null and item.remark != ''">
|
||||
remark = #{item.remark},
|
||||
</if>
|
||||
<if test="item.activeFlag != null and item.activeFlag != ''">
|
||||
active_flag = #{item.activeFlag},
|
||||
</if>
|
||||
<if test="item.delFlag != null and item.delFlag != ''">
|
||||
del_flag = #{item.delFlag},
|
||||
</if>
|
||||
<if test="item.createDept != null">
|
||||
create_dept = #{item.createDept},
|
||||
</if>
|
||||
<if test="item.createBy != null">
|
||||
create_by = #{item.createBy},
|
||||
</if>
|
||||
<if test="item.createTime != null">
|
||||
create_time = #{item.createTime},
|
||||
</if>
|
||||
<if test="item.updateBy != null">
|
||||
update_by = #{item.updateBy},
|
||||
</if>
|
||||
<if test="item.updateTime != null">
|
||||
update_time = #{item.updateTime}
|
||||
</if>
|
||||
</set>
|
||||
where quote_material_id = #{item.quoteMaterialId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- 根据自定义条件删除 -->
|
||||
<delete id="deleteCustomCrmQuoteMaterial">
|
||||
delete from crm_quote_material
|
||||
${ew.getCustomSqlSegment}
|
||||
</delete>
|
||||
|
||||
<!-- 根据ID列表批量删除 -->
|
||||
<delete id="deleteCustomCrmQuoteMaterialByIds">
|
||||
delete from crm_quote_material
|
||||
where quote_material_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 检查是否存在 -->
|
||||
<select id="existsCrmQuoteMaterial" resultType="java.lang.Boolean">
|
||||
select count(1) > 0 from crm_quote_material t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue