Compare commits

..

No commits in common. "08fa8e80848e24bdead6b549ddd0f12333375154" and "0d79babfac929630a26b9036c03791c58da6a509" have entirely different histories.

20 changed files with 144 additions and 446 deletions

View File

@ -171,8 +171,6 @@ public class Constant {
public static final String DICTIONARY_TICKET_QUESTION = "Question";
public static final Integer TICKET_TYPE_MOBILE_BROKEN = 0;
public static final Integer TICKET_TYPE_GONGFU = 1;
public static final String COMPANY_NAME="福建南方路面机械股份有限公司";
}

View File

@ -1,32 +0,0 @@
package com.nflg.mobilebroken.common.pojo.request;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.util.List;
@Data
public class SubordinateQuotationSearchRequest extends PageRequest{
/**
* 报价主体
*/
private Integer targetId;
/**
* 创建人id
*/
private Integer createById;
/**
* 用户类型,0:内部用户,1:代理商
*/
@JsonIgnore
private Integer userType;
/**
* 创建人id列表
*/
@JsonIgnore
private List<Integer> createByIds;
}

View File

@ -5,7 +5,6 @@ import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nflg.mobilebroken.common.constant.Constant;
import com.nflg.mobilebroken.common.pojo.ApiResult;
import com.nflg.mobilebroken.common.pojo.PageData;
import com.nflg.mobilebroken.common.pojo.dto.ModelConfigEffectiveDTO;
@ -13,7 +12,6 @@ import com.nflg.mobilebroken.common.pojo.dto.QuotationDiscountDTO;
import com.nflg.mobilebroken.common.pojo.dto.QuotationModelRatioDirectItemDTO;
import com.nflg.mobilebroken.common.pojo.request.QuotationSearchRequest;
import com.nflg.mobilebroken.common.pojo.request.ShoppingSearchRequest;
import com.nflg.mobilebroken.common.pojo.request.SubordinateQuotationSearchRequest;
import com.nflg.mobilebroken.common.pojo.vo.ModelPrice1VO;
import com.nflg.mobilebroken.common.pojo.vo.QuotationSearchVO;
import com.nflg.mobilebroken.common.pojo.vo.ShoppingSearchVO;
@ -134,9 +132,6 @@ public class ShoppingController extends ControllerBase {
@Resource
private RedisTemplate<String, Integer> redisTemplate;
@Resource
private ITBaseDepartmentService departmentService;
/**
* 购物车-获取报价主体
*/
@ -155,8 +150,8 @@ public class ShoppingController extends ControllerBase {
} else {
return ApiResult.success(List.of(
new SimpleUserVO()
.setUserId(0)
.setUserName(Constant.COMPANY_NAME)
.setUserId(AppUserUtil.getUserId())
.setUserName("福建南方路面机械股份有限公司")
)
);
}
@ -528,19 +523,23 @@ public class ShoppingController extends ControllerBase {
*/
@Transactional
@PostMapping("/quotation/generate")
public ApiResult<Long> generateQuotation(@Valid @RequestBody QuotationGenerateRequest request) {
public ApiResult<Long> generateQuotation(@RequestBody @NotEmpty List<Long> cartIds) {
List<QuotationShoppingCart> carts = shoppingCartService.lambdaQuery()
.eq(QuotationShoppingCart::getStatus, 0)
.eq(QuotationShoppingCart::getCreateByType, AppUserUtil.isAgent() ? 1 : 0)
.eq(QuotationShoppingCart::getCreateById, AppUserUtil.getUserId())
.in(QuotationShoppingCart::getId, request.getCartIds())
.in(QuotationShoppingCart::getId, cartIds)
.list();
VUtils.trueThrowBusinessError(CollectionUtil.isEmpty(carts)).throwMessage("未找到购物车信息");
VUtils.trueThrowBusinessError(request.getCartIds().size() != carts.size()).throwMessage("数据无效");
VUtils.trueThrowBusinessError(cartIds.size() != carts.size()).throwMessage("数据无效");
VUtils.trueThrowBusinessError(carts.stream().map(QuotationShoppingCart::getCustomerName).collect(Collectors.toSet()).size() > 1)
.throwMessage("客户名称不一致");
VUtils.trueThrowBusinessError(carts.stream().map(QuotationShoppingCart::getTargetId).collect(Collectors.toSet()).size() > 1)
.throwMessage("报价主体不一致");
VUtils.trueThrowBusinessError(carts.stream().map(QuotationShoppingCart::getCurrency).collect(Collectors.toSet()).size() > 1)
.throwMessage("币种不一致");
VUtils.trueThrowBusinessError(carts.stream().map(QuotationShoppingCart::getExchangeRate).collect(Collectors.toSet()).size() > 1)
.throwMessage("汇率不一致");
QuotationShoppingOrder order = new QuotationShoppingOrder()
.setCreateByType(AppUserUtil.isAgent() ? 1 : 0)
.setCreateBy(AppUserUtil.getUserName())
@ -554,7 +553,7 @@ public class ShoppingController extends ControllerBase {
.setTargetId(carts.get(0).getTargetId())
.setTotalFee(carts.stream().map(QuotationShoppingCart::getActualFee).reduce(BigDecimal::add).get());
order.setActualFee(order.getTotalFee());
order.setExchangeFee(NumberUtil.multiply(order.getActualFee(), request.getExchangeRate()));
order.setExchangeFee(NumberUtil.multiply(order.getActualFee(), carts.get(0).getExchangeRate()));
shoppingOrderItemService.saveBatch(
carts.stream()
.map(cart -> new QuotationShoppingOrderItem()
@ -567,7 +566,7 @@ public class ShoppingController extends ControllerBase {
shoppingCartService.lambdaUpdate()
.set(QuotationShoppingCart::getStatus, 1)
.eq(QuotationShoppingCart::getStatus, 0)
.in(QuotationShoppingCart::getId, request.getCartIds())
.in(QuotationShoppingCart::getId, cartIds)
.update();
return ApiResult.success(order.getId());
}
@ -620,11 +619,14 @@ public class ShoppingController extends ControllerBase {
}
boolean isAgent = AppUserUtil.isAgent();
List<TBaseCustomer> customers;
List<AppUser> endUsers;
if (isAgent) {
customers = customerService.lambdaQuery()
.in(TBaseCustomer::getId, datas.getRecords().stream().map(QuotationSearchVO::getTargetId).collect(Collectors.toList()))
.list();
endUsers = null;
} else {
endUsers = appUserService.getEndUsers();
customers = null;
}
return ApiResult.success(datas, data -> {
@ -637,8 +639,14 @@ public class ShoppingController extends ControllerBase {
.orElse("")
);
} else {
data.setTargetName(Constant.COMPANY_NAME);
data.setTargetName(endUsers.stream()
.filter(item -> item.getId().equals(data.getTargetId()))
.map(AppUser::getName)
.findFirst()
.orElse("")
);
}
//TODO 设置汇率价格
return data;
});
}
@ -990,57 +998,4 @@ public class ShoppingController extends ControllerBase {
return adminUserService.getById(AppUserUtil.getUserId()).getQuotationCode();
}
}
/**
* 获取下属列表
*/
@GetMapping("/getSubordinate")
public ApiResult<List<SimpleUserVO>> getSubordinate() {
if (AppUserUtil.isAgent()) {
return ApiResult.success(
appUserService.getChildren(appUserService.getById(AppUserUtil.getUserId()))
.stream()
.map(user -> new SimpleUserVO()
.setUserId(user.getId())
.setUserName(user.getName())
)
.collect(Collectors.toList())
);
} else {
AdminUser adminUser = adminUserService.getById(AppUserUtil.getUserId());
Set<Long> deptIds = departmentService.getAllChildrenIds(adminUser.getDepartmentId());
return ApiResult.success(
adminUserService.getByDepartmentIds(deptIds)
.stream()
.map(user -> new SimpleUserVO()
.setUserId(user.getId())
.setUserName(user.getUserName())
)
.collect(Collectors.toList())
);
}
}
/**
* 获取下属报价单
*/
@PostMapping("/getQuotationOfSubordinate")
public ApiResult<PageData<QuotationSearchVO>> getQuotationOfSubordinate(@Valid @RequestBody SubordinateQuotationSearchRequest request){
VUtils.trueThrowBusinessError(AppUserUtil.isAgent() && !AppUserUtil.isPrimary())
.throwMessage("你不是代理商主账号无权查看");
if (Objects.isNull(request.getCreateById())){
request.setCreateByIds(
appUserService.getChildren(appUserService.getById(AppUserUtil.getUserId()))
.stream()
.map(AppUser::getId)
.collect(Collectors.toList())
);
}else {
request.setCreateByIds(List.of(request.getCreateById()));
}
if (!AppUserUtil.isAgent()){
request.setTargetId(null);
}
return ApiResult.success(shoppingOrderService.getQuotationOfSubordinate(request));
}
}

View File

@ -1,60 +0,0 @@
package com.nflg.mobilebroken.quotation.pojo.request;
import lombok.Data;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.math.BigDecimal;
import java.util.List;
@Data
public class QuotationGenerateRequest {
/**
* 购物车id列表
*/
@NotEmpty
private List<Long> cartIds;
/**
* 交货方式列表
*/
@Valid
@NotEmpty
private List<QuotationShoppingOrderDeliveryMethodRequest> deliveryMethods;
/**
* 付款方式
*/
@NotBlank(message = "付款方式不能为空")
private String paymentMethod;
/**
* 付款方式产生的费用
*/
@NotBlank(message = "付款方式产生的费用不能为空")
private BigDecimal paymentFee;
/**
* 币种字典id
*/
@NotBlank(message = "币种不能为空")
private Long currency;
/**
* 汇率
*/
@NotBlank(message = "汇率不能为空")
private BigDecimal exchangeRate;
/**
* 补充说明
*/
private String additionalNotes;
/**
* 备注
*/
private String remark;
}

View File

@ -1,35 +0,0 @@
package com.nflg.mobilebroken.quotation.pojo.request;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
@Data
public class QuotationShoppingOrderDeliveryMethodRequest {
/**
* 交货方式字典id
*/
@NotNull(message = "交货方式不能为空")
private Long deliveryMethod;
/**
* 交货时间
*/
@NotBlank(message = "交货时间不能为空")
private String deliveryDate;
/**
* 交货地点
*/
@NotBlank(message = "交货地点不能为空")
private String deliveryAddress;
/**
* 运费
*/
@NotNull(message = "运费不能为空")
private BigDecimal deliveryFee;
}

View File

@ -19,19 +19,19 @@ public class ShoppingSaveRequest {
/**
* 机型batch_number
*/
@NotNull(message = "机型不能为空")
@NotNull
private Long modelId;
/**
* 价格id
*/
@NotNull(message = "价格id不能为空")
@NotNull
private Long priceId;
/**
* 配置id
*/
@NotNull(message = "配置id不能为空")
@NotNull
private Long configId;
/**
@ -52,43 +52,52 @@ public class ShoppingSaveRequest {
/**
* 客户名称
*/
@NotBlank(message = "客户名称不能为空")
@NotBlank
private String customerName;
/**
* 报价主体代理商时为公司id内部用户时为其用户id
*/
@NotNull(message = "报价主体不能为空")
@NotNull
private Integer targetId;
/**
* 其他要求总费用
* 油漆要求
*/
@NotNull(message = "其他要求总费用不能为空")
private BigDecimal otherRequirementsFee;
private String paintRequirements;
/**
* 其他要求
*/
private String otherRequirements;
/**
* 其他要求费用
*/
private BigDecimal otherFee;
/**
* 标配价格
*/
@NotNull(message = "标配价格不能为空")
@NotNull
private BigDecimal standardFee;
/**
* 选配价格
*/
@NotNull(message = "选配价格不能为空")
@NotNull
private BigDecimal optionalFee;
/**
* 总价
*/
@NotNull(message = "总价不能为空")
@NotNull
private BigDecimal totalFee;
/**
* 实际总价
*/
@NotNull(message = "实际总价不能为空")
@NotNull
private BigDecimal actualFee;
/**
@ -101,35 +110,57 @@ public class ShoppingSaveRequest {
*/
private BigDecimal serviceFee = BigDecimal.ZERO;
/**
* 交货方式字典id
*/
@NotNull
private Long deliveryMethod;
/**
* 交货时间
*/
@NotBlank
private String deliveryDate;
/**
* 交货地点
*/
@NotBlank
private String deliveryAddress;
/**
* 运费
*/
@NotNull
private BigDecimal deliveryFee;
/**
* 付款方式
*/
@NotBlank
private String paymentMethod;
/**
* 付款方式产生的费用
*/
private BigDecimal paymentFee;
/**
* 币种字典id
*/
@NotNull
private Long currency;
/**
* 汇率
*/
private BigDecimal exchangeRate;
/**
* 优惠金额
*/
private BigDecimal discount;
/**
* 质保服务描述
*/
@NotBlank(message = "质保服务描述不能为空")
private String warrantyServiceDesc;
/**
* 质保服务费用
*/
@NotNull(message = "质保服务费用不能为空")
private BigDecimal warrantyServiceFee;
/**
* 随机配件包装费
*/
@NotNull(message = "随机配件包装费不能为空")
private BigDecimal accessoryPackagingFee;
/**
* 随机配件运费
*/
@NotNull(message = "随机配件运费不能为空")
private BigDecimal accessoryShippingFee;
/**
* 部件列表
*/

View File

@ -31,14 +31,4 @@ public class ShoppingSaveServiceRequest {
*/
@NotNull
private BigDecimal totalFee;
/**
* 地点
*/
private String address;
/**
* 备注
*/
private String remark;
}

View File

@ -67,9 +67,19 @@ public class QuotationShoppingCart implements Serializable {
private Integer targetId;
/**
* 其他要求总费用
* 油漆要求
*/
private BigDecimal otherRequirementsFee;
private String paintRequirements;
/**
* 其他要求
*/
private String otherRequirements;
/**
* 其他要求费用
*/
private BigDecimal otherFee;
/**
* 标配价格
@ -101,6 +111,46 @@ public class QuotationShoppingCart implements Serializable {
*/
private BigDecimal serviceFee;
/**
* 交货方式字典id
*/
private Long deliveryMethod;
/**
* 交货时间
*/
private String deliveryDate;
/**
* 交货地点
*/
private String deliveryAddress;
/**
* 运费
*/
private BigDecimal deliveryFee;
/**
* 付款方式
*/
private String paymentMethod;
/**
* 付款方式产生的费用
*/
private BigDecimal paymentFee;
/**
* 币种字典id
*/
private Long currency;
/**
* 汇率
*/
private BigDecimal exchangeRate;
/**
* 创建人类型0内部人员1代理商
*/
@ -135,24 +185,4 @@ public class QuotationShoppingCart implements Serializable {
* 状态0未生成报价单1已生成报价单
*/
private Integer status;
/**
* 质保服务描述
*/
private String warrantyServiceDesc;
/**
* 质保服务费用
*/
private BigDecimal warrantyServiceFee;
/**
* 随机配件包装费
*/
private BigDecimal accessoryPackagingFee;
/**
* 随机配件运费
*/
private BigDecimal accessoryShippingFee;
}

View File

@ -54,14 +54,4 @@ public class QuotationShoppingCartService implements Serializable {
* 服务总费用
*/
private BigDecimal totalFee;
/**
* 地点
*/
private String address;
/**
* 备注
*/
private String remark;
}

View File

@ -105,34 +105,4 @@ public class QuotationShoppingOrder implements Serializable {
* 最后修改时间
*/
private LocalDateTime updateTime;
/**
* 付款方式
*/
private String paymentMethod;
/**
* 付款方式产生的费用
*/
private BigDecimal paymentFee;
/**
* 币种字典id
*/
private Long currency;
/**
* 汇率
*/
private BigDecimal exchangeRate;
/**
* 补充说明
*/
private String additionalNotes;
/**
* 备注
*/
private String remark;
}

View File

@ -1,54 +0,0 @@
package com.nflg.mobilebroken.repository.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* <p>
* 报价-报价单-交货方式
* </p>
*
* @author 代码生成器生成
* @since 2026
*/
@Getter
@Setter
@Accessors(chain = true)
@TableName("quotation_shopping_order_delivery_method")
public class QuotationShoppingOrderDeliveryMethod implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
/**
* 报价单id
*/
private Long orderId;
/**
* 交货方式字典id
*/
private Long deliveryMethod;
/**
* 交货时间
*/
private String deliveryDate;
/**
* 交货地点
*/
private String deliveryAddress;
/**
* 运费
*/
private BigDecimal deliveryFee;
}

View File

@ -1,16 +0,0 @@
package com.nflg.mobilebroken.repository.mapper;
import com.nflg.mobilebroken.repository.entity.QuotationShoppingOrderDeliveryMethod;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 报价-报价单-交货方式 Mapper 接口
* </p>
*
* @author 代码生成器生成
* @since 2026
*/
public interface QuotationShoppingOrderDeliveryMethodMapper extends BaseMapper<QuotationShoppingOrderDeliveryMethod> {
}

View File

@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nflg.mobilebroken.common.pojo.request.QuotationAdminSearchRequest;
import com.nflg.mobilebroken.common.pojo.request.QuotationSearchRequest;
import com.nflg.mobilebroken.common.pojo.request.SubordinateQuotationSearchRequest;
import com.nflg.mobilebroken.common.pojo.vo.QuotationSearchVO;
import com.nflg.mobilebroken.repository.entity.QuotationShoppingOrder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -22,6 +21,4 @@ public interface QuotationShoppingOrderMapper extends BaseMapper<QuotationShoppi
IPage<QuotationSearchVO> search(QuotationSearchRequest request, Page<?> page);
IPage<QuotationSearchVO> searchFromAdmin(QuotationAdminSearchRequest request, Page<?> page);
IPage<QuotationSearchVO> getQuotationOfSubordinate(SubordinateQuotationSearchRequest request, Page<?> page);
}

View File

@ -7,7 +7,6 @@ import com.nflg.mobilebroken.common.pojo.vo.AdminUserSimpleVO;
import com.nflg.mobilebroken.common.pojo.vo.AdminUserVO;
import com.nflg.mobilebroken.repository.entity.AdminUser;
import java.util.Collection;
import java.util.List;
/**
@ -64,5 +63,5 @@ public interface IAdminUserService extends IService<AdminUser> {
List<AdminUserVO> searchNew(SearchAccountRequest request);
List<AdminUser> getByDepartmentIds(Collection<Long> departmentIds);
List<AdminUser> getByDepartmentIds(List<Long> departmentIds);
}

View File

@ -1,16 +0,0 @@
package com.nflg.mobilebroken.repository.service;
import com.nflg.mobilebroken.repository.entity.QuotationShoppingOrderDeliveryMethod;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 报价-报价单-交货方式 服务类
* </p>
*
* @author 代码生成器生成
* @since 2026
*/
public interface IQuotationShoppingOrderDeliveryMethodService extends IService<QuotationShoppingOrderDeliveryMethod> {
}

View File

@ -1,10 +1,8 @@
package com.nflg.mobilebroken.repository.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.nflg.mobilebroken.common.pojo.PageData;
import com.nflg.mobilebroken.common.pojo.request.QuotationAdminSearchRequest;
import com.nflg.mobilebroken.common.pojo.request.QuotationSearchRequest;
import com.nflg.mobilebroken.common.pojo.request.SubordinateQuotationSearchRequest;
import com.nflg.mobilebroken.common.pojo.vo.QuotationSearchVO;
import com.nflg.mobilebroken.repository.entity.QuotationShoppingOrder;
import com.baomidou.mybatisplus.extension.service.IService;
@ -24,6 +22,4 @@ public interface IQuotationShoppingOrderService extends IService<QuotationShoppi
IPage<QuotationSearchVO> search(QuotationSearchRequest request);
IPage<QuotationSearchVO> searchFromAdmin(QuotationAdminSearchRequest request);
IPage<QuotationSearchVO> getQuotationOfSubordinate(SubordinateQuotationSearchRequest request);
}

View File

@ -527,7 +527,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
}
@Override
public List<AdminUser> getByDepartmentIds(Collection<Long> departmentIds) {
public List<AdminUser> getByDepartmentIds(List<Long> departmentIds) {
return lambdaQuery()
.eq(AdminUser::getIsDel, false)
.eq(AdminUser::getState, 1)

View File

@ -1,20 +0,0 @@
package com.nflg.mobilebroken.repository.service.impl;
import com.nflg.mobilebroken.repository.entity.QuotationShoppingOrderDeliveryMethod;
import com.nflg.mobilebroken.repository.mapper.QuotationShoppingOrderDeliveryMethodMapper;
import com.nflg.mobilebroken.repository.service.IQuotationShoppingOrderDeliveryMethodService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 报价-报价单-交货方式 服务实现类
* </p>
*
* @author 代码生成器生成
* @since 2026
*/
@Service
public class QuotationShoppingOrderDeliveryMethodServiceImpl extends ServiceImpl<QuotationShoppingOrderDeliveryMethodMapper, QuotationShoppingOrderDeliveryMethod> implements IQuotationShoppingOrderDeliveryMethodService {
}

View File

@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nflg.mobilebroken.common.pojo.request.QuotationAdminSearchRequest;
import com.nflg.mobilebroken.common.pojo.request.QuotationSearchRequest;
import com.nflg.mobilebroken.common.pojo.request.SubordinateQuotationSearchRequest;
import com.nflg.mobilebroken.common.pojo.vo.QuotationSearchVO;
import com.nflg.mobilebroken.repository.entity.QuotationShoppingOrder;
import com.nflg.mobilebroken.repository.mapper.QuotationShoppingOrderMapper;
@ -32,9 +31,4 @@ public class QuotationShoppingOrderServiceImpl extends ServiceImpl<QuotationShop
public IPage<QuotationSearchVO> searchFromAdmin(QuotationAdminSearchRequest request) {
return baseMapper.searchFromAdmin(request, new Page<>(request.getPage(), request.getPageSize()));
}
@Override
public IPage<QuotationSearchVO> getQuotationOfSubordinate(SubordinateQuotationSearchRequest request) {
return baseMapper.getQuotationOfSubordinate(request, new Page<>(request.getPage(), request.getPageSize()));
}
}

View File

@ -24,7 +24,7 @@
</select>
<select id="searchFromAdmin" resultType="com.nflg.mobilebroken.common.pojo.vo.QuotationSearchVO">
SELECT qso.*,if(qso.create_by_type=0,'${@com.nflg.mobilebroken.common.constant.Constant@COMPANY_NAME}',bc.agency_company_name) as target_name
SELECT qso.*,if(qso.create_by_type=0,au.user_name,bc.agency_company_name) as target_name
FROM quotation_shopping_order qso
INNER JOIN
(
@ -63,6 +63,7 @@
</where>
) AS t ON t.id=qso.id
left join t_base_customer bc on qso.target_id=bc.id
left join admin_user au on qso.target_id=au.id
<where>
<if test="request.targetId!=null">
AND qso.target_id=#{request.targetId}
@ -82,24 +83,4 @@
</where>
order by qso.id desc
</select>
<select id="getQuotationOfSubordinate" resultType="com.nflg.mobilebroken.common.pojo.vo.QuotationSearchVO">
SELECT qso.*,if(qso.create_by_type=0,'${@com.nflg.mobilebroken.common.constant.Constant@COMPANY_NAME}',bc.agency_company_name) as targetName
FROM quotation_shopping_order qso
LEFT JOIN t_base_customer bc ON qso.target_id=bc.id
where qso.create_by_type=#{request.userType} and qso.create_by_id in
<foreach item="item" collection="request.createByIds" separator="," open="(" close=")">
#{item}
</foreach>
<if test="request.targetId!=null">
and qso.target_id = #{request.targetId}
</if>
<if test="request.createTimeStart!=null and request.createTimeStart!=''">
and qso.create_time>=#{request.createTimeStart}
</if>
<if test="request.createTimeEnd!=null and request.createTimeEnd!=''">
and qso.create_time &lt;= #{request.createTimeEnd}
</if>
order by qso.id desc
</select>
</mapper>