feat(repository): 添加报价单调整项和购物车项相关实体及服务
- 新增 QuotationShoppingOrderAdjustItem 实体类定义调价相关字段 - 新增 QuotationShoppingOrderItem 实体类定义购物车项基本结构 - 创建 IQuotationShoppingOrderAdjustItemService 接口并实现获取配件方法 - 创建 IQuotationShoppingOrderItemService 接口用于购物车项基础操作 - 实现 QuotationShoppingOrderAdjustItemMapper 并添加 getParts 查询方法 - 配置 MyBatis XML 映射文件实现最大ID过滤逻辑 - 完成 QuotationShoppingOrderAdjustItemServiceImpl 服务实现类 - 完成 QuotationShoppingOrderItemServiceImpl 服务实现类
This commit is contained in:
parent
70d2c2f606
commit
2db60b5539
|
|
@ -0,0 +1,57 @@
|
|||
package com.nflg.mobilebroken.repository.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 报价-报价单-子项
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2026
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("quotation_shopping_order_adjust_item")
|
||||
public class QuotationShoppingOrderAdjustItem implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 调价id
|
||||
*/
|
||||
private Long adjustId;
|
||||
|
||||
/**
|
||||
* 报价单id
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 购物车id
|
||||
*/
|
||||
private Long cartId;
|
||||
|
||||
/**
|
||||
* 配置项id
|
||||
*/
|
||||
private Long configItemId;
|
||||
|
||||
/**
|
||||
* 调价前价格
|
||||
*/
|
||||
private BigDecimal oldFee;
|
||||
|
||||
/**
|
||||
* 调价后价格
|
||||
*/
|
||||
private BigDecimal newFee;
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package com.nflg.mobilebroken.repository.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2026
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("quotation_shopping_order_item")
|
||||
public class QuotationShoppingOrderItem implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 报价单id
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 购物车id
|
||||
*/
|
||||
private Long cartId;
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.nflg.mobilebroken.repository.mapper;
|
||||
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationShoppingOrderAdjustItem;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 报价-报价单-子项 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2026
|
||||
*/
|
||||
public interface QuotationShoppingOrderAdjustItemMapper extends BaseMapper<QuotationShoppingOrderAdjustItem> {
|
||||
|
||||
List<QuotationShoppingOrderAdjustItem> getParts(Long orderId);
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.nflg.mobilebroken.repository.mapper;
|
||||
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationShoppingOrderItem;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2026
|
||||
*/
|
||||
public interface QuotationShoppingOrderItemMapper extends BaseMapper<QuotationShoppingOrderItem> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.nflg.mobilebroken.repository.service;
|
||||
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationShoppingOrderAdjustItem;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 报价-报价单-子项 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2026
|
||||
*/
|
||||
public interface IQuotationShoppingOrderAdjustItemService extends IService<QuotationShoppingOrderAdjustItem> {
|
||||
|
||||
List<QuotationShoppingOrderAdjustItem> getParts(Long orderId);
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.nflg.mobilebroken.repository.service;
|
||||
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationShoppingOrderItem;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2026
|
||||
*/
|
||||
public interface IQuotationShoppingOrderItemService extends IService<QuotationShoppingOrderItem> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.nflg.mobilebroken.repository.service.impl;
|
||||
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationShoppingOrderAdjustItem;
|
||||
import com.nflg.mobilebroken.repository.mapper.QuotationShoppingOrderAdjustItemMapper;
|
||||
import com.nflg.mobilebroken.repository.service.IQuotationShoppingOrderAdjustItemService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 报价-报价单-子项 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2026
|
||||
*/
|
||||
@Service
|
||||
public class QuotationShoppingOrderAdjustItemServiceImpl extends ServiceImpl<QuotationShoppingOrderAdjustItemMapper, QuotationShoppingOrderAdjustItem> implements IQuotationShoppingOrderAdjustItemService {
|
||||
|
||||
@Override
|
||||
public List<QuotationShoppingOrderAdjustItem> getParts(Long orderId) {
|
||||
return baseMapper.getParts(orderId);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.nflg.mobilebroken.repository.service.impl;
|
||||
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationShoppingOrderItem;
|
||||
import com.nflg.mobilebroken.repository.mapper.QuotationShoppingOrderItemMapper;
|
||||
import com.nflg.mobilebroken.repository.service.IQuotationShoppingOrderItemService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2026
|
||||
*/
|
||||
@Service
|
||||
public class QuotationShoppingOrderItemServiceImpl extends ServiceImpl<QuotationShoppingOrderItemMapper, QuotationShoppingOrderItem> implements IQuotationShoppingOrderItemService {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?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.nflg.mobilebroken.repository.mapper.QuotationShoppingOrderAdjustItemMapper">
|
||||
|
||||
<select id="getParts" resultType="com.nflg.mobilebroken.repository.entity.QuotationShoppingOrderAdjustItem">
|
||||
SELECT it1.*
|
||||
FROM quotation_shopping_order_adjust_item it1
|
||||
INNER JOIN
|
||||
(
|
||||
SELECT MAX(id) as id,cart_id,config_item_id
|
||||
FROM quotation_shopping_order_adjust_item
|
||||
WHERE order_id=#{orderId}
|
||||
GROUP BY cart_id,config_item_id
|
||||
) it2 ON it1.id=it2.id
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?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.nflg.mobilebroken.repository.mapper.QuotationShoppingOrderItemMapper">
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue