feat(api): 添加订单信息查询接口

- 新增 ApiDataQueryDto 类用于查询参数
- 新增 DeliveryInfoVo 类用于条码信息返回
- 实现了根据时间查询订单信息的功能
- 优化了订单信息的查询和展示逻辑
master
chenhao 2025-05-14 10:59:09 +08:00
parent 8bbd8b3a65
commit adfa574c39
20 changed files with 373 additions and 416 deletions

View File

@ -34,6 +34,7 @@
<tomcat.version>9.0.102</tomcat.version>
<logback.version>1.2.13</logback.version>
<spring-framework.version>5.3.39</spring-framework.version>
<hutool.version>5.8.26</hutool.version>
</properties>
<!-- 依赖声明 -->
@ -193,6 +194,14 @@
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-bom</artifactId>
<version>${hutool.version}</version>
<type>pom</type>
<!-- 注意这里是import -->
<scope>import</scope>
</dependency>
<!-- 定时任务-->
<dependency>

View File

@ -93,9 +93,9 @@
<label class="col-sm-4 control-label is-required">代表处:</label>
<div class="col-sm-8">
<div class="input-group">
<input name="orderDept" type="hidden" th:field="*{orderDept}" id="treeId"/>
<input class="form-control" type="text" name="orderDeptName" onclick="selectDeptTree()" id="treeName" th:field="*{orderDeptName}" required>
<span class="input-group-addon"><i class="fa fa-search"></i></span>
<!-- <input name="orderDept" type="hidden" th:field="*{orderDept}" id="treeId"/>-->
<!-- <input class="form-control" type="text" name="orderDeptName" onclick="selectDeptTree()" id="treeName" th:field="*{orderDeptName}" required>-->
<!-- <span class="input-group-addon"><i class="fa fa-search"></i></span>-->
</div>
</div>
</div>

View File

@ -83,7 +83,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">所属行业:</label>
<div class="col-sm-8">
<input name="industryTyoe" class="form-control" type="text">
<input name="industryType" class="form-control" type="text">
</div>
</div>
</div>

View File

@ -84,7 +84,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">所属行业:</label>
<div class="col-sm-8">
<input name="industryTyoe" th:field="*{industryTyoe}" class="form-control" type="text">
<input name="industryType" th:field="*{industryType}" class="form-control" type="text">
</div>
</div>
</div>

View File

@ -48,7 +48,7 @@
</li>
<li>
<label>所属行业:</label>
<input type="text" name="industryTyoe"/>
<input type="text" name="industryType"/>
</li>
<li>
<label>创建时间:</label>
@ -149,7 +149,7 @@
title: '联系邮件'
},
{
field: 'industryTyoe',
field: 'industryType',
title: '所属行业'
},
{

View File

@ -31,5 +31,9 @@
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-core</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,49 @@
package com.ruoyi.sip.controller;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.sip.dto.ApiDataQueryDto;
import com.ruoyi.sip.service.IDeliveryListService;
import com.ruoyi.sip.service.IOrderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author : ch
* @version : 1.0
* @ClassName : ExternalController
* @Description :
* @DATE : Created in 17:34 2025/5/13
* <pre> Copyright: Copyright(c) 2025 </pre>
* <pre> Company : </pre>
* Modification History:
* Date Author Version Discription
* --------------------------------------------------------------------------
* 2025/05/13 ch 1.0 Why & What is modified: <> *
*/
@RestController
@RequestMapping("/api")
public class ExternalController {
@Autowired
private IDeliveryListService deliveryListService;
@Autowired
private IOrderInfoService orderInfoService;
@GetMapping("/v1/order/info")
@Anonymous
public AjaxResult getOrderInfo(@Validated ApiDataQueryDto dto) {
return AjaxResult.success(orderInfoService.getOrderInfo(dto));
}
@GetMapping("/v1/number/info")
@Anonymous
private AjaxResult getNumberInfo(@Validated ApiDataQueryDto dto){
return AjaxResult.success(deliveryListService.getNumberInfo(dto));
}
}

View File

@ -1,7 +1,11 @@
package com.ruoyi.sip.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.ToString;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
@ -13,6 +17,8 @@ import com.ruoyi.common.core.domain.BaseEntity;
* @author mula
* @date 2025-05-13
*/
@Data
@ToString
public class AgentInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
@ -23,6 +29,7 @@ public class AgentInfo extends BaseEntity
/** 办事处编码 */
@Excel(name = "办事处编码")
private String agentCode;
private List<String> agentCodeList;
/** 办公处名称 */
@Excel(name = "办公处名称")
@ -62,153 +69,4 @@ public class AgentInfo extends BaseEntity
/** 数据状态 */
private Integer status;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setAgentCode(String agentCode)
{
this.agentCode = agentCode;
}
public String getAgentCode()
{
return agentCode;
}
public void setAgentName(String agentName)
{
this.agentName = agentName;
}
public String getAgentName()
{
return agentName;
}
public void setProvince(String province)
{
this.province = province;
}
public String getProvince()
{
return province;
}
public void setCity(String city)
{
this.city = city;
}
public String getCity()
{
return city;
}
public void setAddress(String address)
{
this.address = address;
}
public String getAddress()
{
return address;
}
public void setContactPerson(String contactPerson)
{
this.contactPerson = contactPerson;
}
public String getContactPerson()
{
return contactPerson;
}
public void setContactPhone(String contactPhone)
{
this.contactPhone = contactPhone;
}
public String getContactPhone()
{
return contactPhone;
}
public void setContactEmail(String contactEmail)
{
this.contactEmail = contactEmail;
}
public String getContactEmail()
{
return contactEmail;
}
public void setCreateAt(Date createAt)
{
this.createAt = createAt;
}
public Date getCreateAt()
{
return createAt;
}
public void setUpdateAt(Date updateAt)
{
this.updateAt = updateAt;
}
public Date getUpdateAt()
{
return updateAt;
}
public void setDeleteAt(Date deleteAt)
{
this.deleteAt = deleteAt;
}
public Date getDeleteAt()
{
return deleteAt;
}
public void setStatus(Integer status)
{
this.status = status;
}
public Integer getStatus()
{
return status;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("agentCode", getAgentCode())
.append("agentName", getAgentName())
.append("province", getProvince())
.append("city", getCity())
.append("address", getAddress())
.append("contactPerson", getContactPerson())
.append("contactPhone", getContactPhone())
.append("contactEmail", getContactEmail())
.append("remark", getRemark())
.append("createAt", getCreateAt())
.append("updateAt", getUpdateAt())
.append("deleteAt", getDeleteAt())
.append("status", getStatus())
.toString();
}
}

View File

@ -1,6 +1,8 @@
package com.ruoyi.sip.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.ToString;
@ -27,6 +29,7 @@ public class CustomerInfo extends BaseEntity
/** 客户编码 */
@Excel(name = "客户编码")
private String customerCode;
private List<String> customerCodeList;
/** 客户名称 */
@Excel(name = "客户名称")
@ -62,7 +65,7 @@ public class CustomerInfo extends BaseEntity
/** 所属行业 */
@Excel(name = "所属行业")
private String industryTyoe;
private String industryType;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")

View File

@ -3,6 +3,9 @@ package com.ruoyi.sip.domain;
import java.util.List;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
@ -14,6 +17,8 @@ import com.ruoyi.common.core.domain.BaseEntity;
* @author mula
* @date 2025-04-11
*/
@Data
@ToString
public class OrderInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
@ -39,6 +44,8 @@ public class OrderInfo extends BaseEntity
/** 客户名称 */
@Excel(name = "客户名称")
private String customerName;
//客户编码
private String customerCode;
/** 客户联系人 */
private String customerContact;
@ -54,8 +61,8 @@ public class OrderInfo extends BaseEntity
private String orderType;
/** 代表处编码 */
private Long orderDept;
private String orderDeptName;
private String orderAgentCode;
private String orderAgentName;
/** 代理商编码 */
private Long partnerDept;
@ -75,6 +82,8 @@ public class OrderInfo extends BaseEntity
/** 更新时间 */
private Date updatedAt;
private Date updatedAtStart;
private Date updatedAtEnd;
/** 删除时间,软删除 */
private Date deletedAt;
@ -82,224 +91,5 @@ public class OrderInfo extends BaseEntity
/** 合同清单信息 */
private List<OrderList> orderListList;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setProjectCode(String projectCode)
{
this.projectCode = projectCode;
}
public String getProjectCode()
{
return projectCode;
}
public void setOrderCode(String orderCode)
{
this.orderCode = orderCode;
}
public String getOrderCode()
{
return orderCode;
}
public void setVersionCode(String versionCode)
{
this.versionCode = versionCode;
}
public String getVersionCode()
{
return versionCode;
}
public void setOrderName(String orderName)
{
this.orderName = orderName;
}
public String getOrderName()
{
return orderName;
}
public void setCustomerName(String customerName)
{
this.customerName = customerName;
}
public String getCustomerName()
{
return customerName;
}
public void setCustomerContact(String customerContact)
{
this.customerContact = customerContact;
}
public String getCustomerContact()
{
return customerContact;
}
public void setCustomerPhone(String customerPhone)
{
this.customerPhone = customerPhone;
}
public String getCustomerPhone()
{
return customerPhone;
}
public void setCustomerEmail(String customerEmail)
{
this.customerEmail = customerEmail;
}
public String getCustomerEmail()
{
return customerEmail;
}
public void setOrderType(String orderType)
{
this.orderType = orderType;
}
public String getOrderType()
{
return orderType;
}
public void setOrderDept(Long orderDept)
{
this.orderDept = orderDept;
}
public Long getOrderDept()
{
return orderDept;
}
public void setPartnerDept(Long partnerDept)
{
this.partnerDept = partnerDept;
}
public Long getPartnerDept()
{
return partnerDept;
}
public void setOrderDate(Date orderDate)
{
this.orderDate = orderDate;
}
public Date getOrderDate()
{
return orderDate;
}
public void setStatus(Long status)
{
this.status = status;
}
public Long getStatus()
{
return status;
}
public void setCreatedAt(Date createdAt)
{
this.createdAt = createdAt;
}
public Date getCreatedAt()
{
return createdAt;
}
public void setUpdatedAt(Date updatedAt)
{
this.updatedAt = updatedAt;
}
public Date getUpdatedAt()
{
return updatedAt;
}
public void setDeletedAt(Date deletedAt)
{
this.deletedAt = deletedAt;
}
public Date getDeletedAt()
{
return deletedAt;
}
public List<OrderList> getOrderListList()
{
return orderListList;
}
public void setOrderListList(List<OrderList> orderListList)
{
this.orderListList = orderListList;
}
public String getOrderDeptName() {
return orderDeptName;
}
public void setOrderDeptName(String orderDeptName) {
this.orderDeptName = orderDeptName;
}
public String getPartnerDeptName() {
return partnerDeptName;
}
public void setPartnerDeptName(String partnerDeptName) {
this.partnerDeptName = partnerDeptName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("projectCode", getProjectCode())
.append("orderCode", getOrderCode())
.append("versionCode", getVersionCode())
.append("orderName", getOrderName())
.append("customerName", getCustomerName())
.append("customerContact", getCustomerContact())
.append("customerPhone", getCustomerPhone())
.append("customerEmail", getCustomerEmail())
.append("orderType", getOrderType())
.append("orderDept", getOrderDept())
.append("partnerDept", getPartnerDept())
.append("orderDate", getOrderDate())
.append("status", getStatus())
.append("remark", getRemark())
.append("createdAt", getCreatedAt())
.append("updatedAt", getUpdatedAt())
.append("deletedAt", getDeletedAt())
.append("orderListList", getOrderListList())
.toString();
}
}

View File

@ -0,0 +1,31 @@
package com.ruoyi.sip.dto;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.*;
import java.util.Date;
/**
* @author : ch
* @version : 1.0
* @ClassName : ApiDataQueryDto
* @Description :
* @DATE : Created in 17:42 2025/5/13
* <pre> Copyright: Copyright(c) 2025 </pre>
* <pre> Company : </pre>
* Modification History:
* Date Author Version Discription
* --------------------------------------------------------------------------
* 2025/05/13 ch 1.0 Why & What is modified: <> *
*/
@Data
public class ApiDataQueryDto {
@NotNull(message = "查询开始时间不能为空")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date queryStartTime;
@NotNull(message = "查询结束时间不能为空")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date queryEndTime;
}

View File

@ -4,6 +4,8 @@ import java.util.List;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.sip.domain.DeliveryList;
import com.ruoyi.sip.dto.ApiDataQueryDto;
import com.ruoyi.sip.vo.DeliveryInfoVo;
/**
* Service
@ -62,4 +64,6 @@ public interface IDeliveryListService
public int deleteDeliveryListById(Long id);
AjaxResult importData(List<DeliveryList> deliveryList, Long deliveryId);
List<DeliveryInfoVo> getNumberInfo(ApiDataQueryDto dto);
}

View File

@ -5,6 +5,8 @@ import java.util.List;
import com.ruoyi.sip.domain.MaintenanceRecordsDto;
import com.ruoyi.sip.domain.OrderInfo;
import com.ruoyi.sip.domain.OrderList;
import com.ruoyi.sip.dto.ApiDataQueryDto;
import com.ruoyi.sip.vo.OrderInfoVo;
/**
* Service
@ -63,4 +65,12 @@ public interface IOrderInfoService
public int deleteOrderInfoById(Long id);
List<OrderInfo> selectOrderInfoByMaintenance(MaintenanceRecordsDto dto);
/**
*
*
* @param dto
* @return
*/
List<OrderInfoVo> getOrderInfo(ApiDataQueryDto dto);
}

View File

@ -1,9 +1,6 @@
package com.ruoyi.sip.service.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -12,8 +9,10 @@ import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.sip.domain.OrderList;
import com.ruoyi.sip.domain.ProductInfo;
import com.ruoyi.sip.dto.ApiDataQueryDto;
import com.ruoyi.sip.mapper.OrderInfoMapper;
import com.ruoyi.sip.mapper.ProductInfoMapper;
import com.ruoyi.sip.vo.DeliveryInfoVo;
import org.springframework.stereotype.Service;
import com.ruoyi.sip.mapper.DeliveryListMapper;
import com.ruoyi.sip.domain.DeliveryList;
@ -135,4 +134,16 @@ public class DeliveryListServiceImpl implements IDeliveryListService {
deliveryListMapper.insertBatch(deliveryList);
return AjaxResult.success("导入成功");
}
@Override
public List<DeliveryInfoVo> getNumberInfo(ApiDataQueryDto dto) {
return Collections.emptyList();
}
}

View File

@ -3,18 +3,22 @@ package com.ruoyi.sip.service.impl;
import java.util.Collections;
import java.util.List;
import com.ruoyi.sip.domain.MaintenanceRecordsDto;
import cn.hutool.core.collection.CollUtil;
import com.ruoyi.sip.domain.*;
import com.ruoyi.sip.dto.ApiDataQueryDto;
import com.ruoyi.sip.service.IAgentInfoService;
import com.ruoyi.sip.service.ICustomerInfoService;
import com.ruoyi.sip.vo.OrderInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.sip.domain.OrderList;
import com.ruoyi.sip.mapper.OrderInfoMapper;
import com.ruoyi.sip.domain.OrderInfo;
import com.ruoyi.sip.service.IOrderInfoService;
import com.ruoyi.common.core.text.Convert;
@ -29,7 +33,10 @@ public class OrderInfoServiceImpl implements IOrderInfoService
{
@Autowired
private OrderInfoMapper orderInfoMapper;
@Autowired
private IAgentInfoService agentInfoService;
@Autowired
private ICustomerInfoService customerInfoService;
/**
*
*
@ -144,6 +151,65 @@ public class OrderInfoServiceImpl implements IOrderInfoService
return orderInfoMapper.selectOrderInfoByMaintenance(dto);
}
@Override
public List<OrderInfoVo> getOrderInfo(ApiDataQueryDto dto) {
OrderInfo queryParams = new OrderInfo();
queryParams.setUpdatedAtStart(dto.getQueryStartTime());
queryParams.setUpdatedAtEnd(dto.getQueryEndTime());
List<OrderInfo> orderInfos = orderInfoMapper.selectOrderInfoList(queryParams);
//查询代表处信息
AgentInfo agentInfoQueryParams = new AgentInfo();
agentInfoQueryParams.setAgentCodeList(orderInfos.stream().map(OrderInfo::getOrderAgentCode).collect(Collectors.toList()));
List<AgentInfo> agentInfos = agentInfoService.selectAgentInfoList(agentInfoQueryParams);
Map<String, AgentInfo> agentInfoMap = agentInfos.stream().collect(Collectors.toMap(AgentInfo::getAgentCode, Function.identity(), (v1, v2) -> v1));
//查询客户信息
CustomerInfo customerInfoQueryParams = new CustomerInfo();
customerInfoQueryParams.setCustomerCodeList(orderInfos.stream().map(OrderInfo::getCustomerCode).collect(Collectors.toList()));
List<CustomerInfo> customerInfos = customerInfoService.selectCustomerInfoList(customerInfoQueryParams);
Map<String, CustomerInfo> customerInfoMap = customerInfos.stream().collect(Collectors.toMap(CustomerInfo::getCustomerCode, Function.identity(), (v1, v2) -> v1));
if (CollUtil.isNotEmpty(orderInfos)) {
return orderInfos.stream().map(orderInfo -> {
OrderInfoVo orderInfoVo = new OrderInfoVo();
orderInfoVo.setOrderCode(orderInfo.getOrderCode());
orderInfoVo.setOrderName(orderInfo.getOrderName());
orderInfoVo.setVersionCode(orderInfo.getVersionCode());
//todo 这里为固定值 待确认
orderInfoVo.setBgProperty("1");
AgentInfo agentInfo = agentInfoMap.get(orderInfo.getOrderAgentCode());
if (agentInfo != null) {
//目前三个代表处都是同一个
orderInfoVo.setOrderAgentCode(agentInfo.getAgentCode());
orderInfoVo.setOrderAgentName(agentInfo.getAgentName());
orderInfoVo.setDeliveredAgentCode(agentInfo.getAgentCode());
orderInfoVo.setDeliveredAgentName(agentInfo.getAgentName());
orderInfoVo.setRevenueAgentCode(agentInfo.getAgentCode());
orderInfoVo.setRevenueAgentName(agentInfo.getAgentName());
orderInfoVo.setSaleName(agentInfo.getContactPerson());
orderInfoVo.setSaleEmail(agentInfo.getContactEmail());
orderInfoVo.setSalePhone(agentInfo.getContactPhone());
}
CustomerInfo customerInfo = customerInfoMap.get(orderInfo.getCustomerCode());
if (customerInfo != null) {
orderInfoVo.setCustomerCode(customerInfo.getCustomerCode());
orderInfoVo.setCustomerName(customerInfo.getCustomerName());
orderInfoVo.setCustomerPostcode(customerInfo.getCustomerPostcode());
orderInfoVo.setIndustryType(customerInfo.getIndustryType());
orderInfoVo.setCustomerAddress(customerInfo.getAddress());
orderInfoVo.setContactPerson(customerInfo.getContactPerson());
orderInfoVo.setContactEmail(customerInfo.getContactEmail());
orderInfoVo.setContactPhone(customerInfo.getContactPhone());
}
return orderInfoVo;
}).collect(Collectors.toList());
}
return Collections.emptyList();
}
/**
*
*

View File

@ -0,0 +1,32 @@
package com.ruoyi.sip.vo;
import lombok.Data;
import java.util.Date;
/**
* @author : ch
* @version : 1.0
* @ClassName : DeliveryInfoVo
* @Description :
* @DATE : Created in 17:28 2025/5/13
* <pre> Copyright: Copyright(c) 2025 </pre>
* <pre> Company : </pre>
* Modification History:
* Date Author Version Discription
* --------------------------------------------------------------------------
* 2025/05/13 ch 1.0 Why & What is modified: <> *
*/
@Data
public class DeliveryInfoVo {
//合同号
private String orderCode;
//版本号
private String versionCode;
//条码
private String serialNumber;
//服务开始时间
private Date startTime;
//服务结束时间
private Date endTime;
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.sip.vo;
import lombok.Data;
/**
* @author : ch
* @version : 1.0
* @ClassName : OrderInfoVo
* @Description : api
* @DATE : Created in 17:23 2025/5/13
* <pre> Copyright: Copyright(c) 2025 </pre>
* <pre> Company : </pre>
* Modification History:
* Date Author Version Discription
* --------------------------------------------------------------------------
* 2025/05/13 ch 1.0 Why & What is modified: <> *
*/
@Data
public class OrderInfoVo {
//合同号
private String orderCode;
//项目名称
private String orderName;
//版本号
private String versionCode;
//下单代表处
private String orderAgentName;
private String orderAgentCode;
//交付代表
private String deliveredAgentName;
private String deliveredAgentCode;
//收益代表
private String revenueAgentName;
private String revenueAgentCode;
//销售人员
private String saleName;
private String saleEmail;
private String salePhone;
// 客户编码
private String customerCode;
// 客户名称
private String customerName;
//客户邮编
private String customerPostcode;
//BG属性
private String bgProperty;
//一级行业
private String industryType;
//客户地址
private String customerAddress;
//客户联系人
private String contactPerson;
//客户电话
private String contactPhone;
//客户邮箱
private String contactEmail;
}

View File

@ -15,7 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="contactPerson" column="contact_person" />
<result property="contactPhone" column="contact_phone" />
<result property="contactEmail" column="contact_email" />
<result property="industryTyoe" column="Industry_tyoe" />
<result property="industryType" column="Industry_type" />
<result property="remark" column="remark" />
<result property="createAt" column="create_at" />
<result property="updateAt" column="update_at" />
@ -29,21 +29,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectCustomerInfoList" parameterType="CustomerInfo" resultMap="CustomerInfoResult">
<include refid="selectCustomerInfoVo"/>
<where>
<if test="customerCode != null and customerCode != ''"> and customer_code = #{customerCode}</if>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<if test="customerPostcode != null and customerPostcode != ''"> and customer_postcode = #{customerPostcode}</if>
<if test="province != null and province != ''"> and province = #{province}</if>
<if test="city != null and city != ''"> and city = #{city}</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="contactPerson != null and contactPerson != ''"> and contact_person = #{contactPerson}</if>
<if test="contactPhone != null and contactPhone != ''"> and contact_phone = #{contactPhone}</if>
<if test="contactEmail != null and contactEmail != ''"> and contact_email = #{contactEmail}</if>
<if test="industryTyoe != null and industryTyoe != ''"> and Industry_tyoe = #{industryTyoe}</if>
<if test="createAt != null "> and create_at = #{createAt}</if>
<if test="updateAt != null "> and update_at = #{updateAt}</if>
<if test="deleteAt != null "> and delete_at = #{deleteAt}</if>
<if test="status != null "> and status = #{status}</if>
<where>
<if test="customerCode != null and customerCode != ''">and customer_code = #{customerCode}</if>
<if test="customerCodeList != null and customerCodeList.size>0">and customer_code in
<foreach collection="customerCodeList" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="customerName != null and customerName != ''">and customer_name like concat('%', #{customerName},
'%')
</if>
<if test="customerPostcode != null and customerPostcode != ''">and customer_postcode =
#{customerPostcode}
</if>
<if test="province != null and province != ''">and province = #{province}</if>
<if test="city != null and city != ''">and city = #{city}</if>
<if test="address != null and address != ''">and address = #{address}</if>
<if test="contactPerson != null and contactPerson != ''">and contact_person = #{contactPerson}</if>
<if test="contactPhone != null and contactPhone != ''">and contact_phone = #{contactPhone}</if>
<if test="contactEmail != null and contactEmail != ''">and contact_email = #{contactEmail}</if>
<if test="industryType != null and industryType != ''">and industry_type = #{industryType}</if>
<if test="createAt != null ">and create_at = #{createAt}</if>
<if test="updateAt != null ">and update_at = #{updateAt}</if>
<if test="deleteAt != null ">and delete_at = #{deleteAt}</if>
<if test="status != null ">and status = #{status}</if>
</where>
</select>
@ -65,7 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="contactPerson != null">contact_person,</if>
<if test="contactPhone != null">contact_phone,</if>
<if test="contactEmail != null">contact_email,</if>
<if test="industryTyoe != null">Industry_tyoe,</if>
<if test="industryType != null">industry_type,</if>
<if test="remark != null">remark,</if>
<if test="createAt != null">create_at,</if>
<if test="updateAt != null">update_at,</if>
@ -83,7 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="contactPerson != null">#{contactPerson},</if>
<if test="contactPhone != null">#{contactPhone},</if>
<if test="contactEmail != null">#{contactEmail},</if>
<if test="industryTyoe != null">#{industryTyoe},</if>
<if test="industryType != null">#{industryType},</if>
<if test="remark != null">#{remark},</if>
<if test="createAt != null">#{createAt},</if>
<if test="updateAt != null">#{updateAt},</if>
@ -104,7 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="contactPerson != null">contact_person = #{contactPerson},</if>
<if test="contactPhone != null">contact_phone = #{contactPhone},</if>
<if test="contactEmail != null">contact_email = #{contactEmail},</if>
<if test="industryTyoe != null">Industry_tyoe = #{industryTyoe},</if>
<if test="industryType != null">industry_type = #{industryType},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createAt != null">create_at = #{createAt},</if>
<if test="updateAt != null">update_at = #{updateAt},</if>

View File

@ -11,11 +11,12 @@
<result property="versionCode" column="version_code"/>
<result property="orderName" column="order_name"/>
<result property="customerName" column="customer_name"/>
<result property="customerCode" column="customer_code"/>
<result property="customerContact" column="customer_contact"/>
<result property="customerPhone" column="customer_phone"/>
<result property="customerEmail" column="customer_email"/>
<result property="orderType" column="order_type"/>
<result property="orderDept" column="order_dept"/>
<result property="orderAgentCode" column="order_agent_code"/>
<result property="partnerDept" column="partner_dept"/>
<result property="orderDate" column="order_date"/>
<result property="status" column="status"/>
@ -48,12 +49,13 @@
order_code,
version_code,
order_name,
customer_code,
customer_name,
customer_contact,
customer_phone,
customer_email,
order_type,
order_dept,
order_agent_code,
partner_dept,
order_date,
status,
@ -74,6 +76,18 @@
'%')
</if>
<if test="orderType != null and orderType != ''">and order_type = #{orderType}</if>
<choose>
<when test="updatedAtStart!=null and updatedAtEnd!=null">
and updated_at between #{updatedAtStart} and #{updatedAtEnd}
</when>
<when test="updatedAtStart!=null">
and updated_at <![CDATA[ >= ]]> #{updatedAtStart}
</when>
<when test="updatedAtEnd!=null">
and updated_at <![CDATA[ <= ]]> #{updatedAtEnd}
</when>
</choose>
</where>
</select>
@ -88,7 +102,7 @@
t1.customer_phone,
t1.customer_email,
t1.order_type,
t1.order_dept,
t1.order_agent_code,
t1.partner_dept,
t1.order_date,
t1.status,
@ -96,10 +110,10 @@
t1.created_at,
t1.updated_at,
t1.deleted_at,
t2.dept_name as order_dept_name,
t2.agent_name as order_agent_name,
t3.dept_name as partner_dept_name
from order_info t1
left join sys_dept t2 on t1.order_dept = t2.dept_id
left join agent_info t2 on t1.order_agent_code = t2.agent_code
left join sys_dept t3 on t1.partner_dept = t3.dept_id
where t1.id = #{id}
</select>
@ -163,12 +177,12 @@
<if test="customerPhone != null">customer_phone,</if>
<if test="customerEmail != null">customer_email,</if>
<if test="orderType != null">order_type,</if>
<if test="orderDept != null">order_dept,</if>
<if test="orderAgentCode != null">order_agent_code,</if>
<if test="partnerDept != null">partner_dept,</if>
<if test="orderDate != null">order_date,</if>
<if test="status != null">status,</if>
<if test="remark != null">remark,</if>
created_at,status
created_at,updated_at,status
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="projectCode != null">#{projectCode},</if>
@ -180,12 +194,12 @@
<if test="customerPhone != null">#{customerPhone},</if>
<if test="customerEmail != null">#{customerEmail},</if>
<if test="orderType != null">#{orderType},</if>
<if test="orderDept != null">#{orderDept},</if>
<if test="orderAgentCode != null">#{orderAgentCode},</if>
<if test="partnerDept != null">#{partnerDept},</if>
<if test="orderDate != null">#{orderDate},</if>
<if test="status != null">#{status},</if>
<if test="remark != null">#{remark},</if>
NOW(),0
NOW(),now(),0
</trim>
</insert>
@ -201,7 +215,7 @@
<if test="customerPhone != null">customer_phone = #{customerPhone},</if>
<if test="customerEmail != null">customer_email = #{customerEmail},</if>
<if test="orderType != null">order_type = #{orderType},</if>
<if test="orderDept != null">order_dept = #{orderDept},</if>
<if test="orderAgentCode != null">order_agent_code = #{orderAgentCode},</if>
<if test="partnerDept != null">partner_dept = #{partnerDept},</if>
<if test="orderDate != null">order_date = #{orderDate},</if>
<if test="status != null">status = #{status},</if>
@ -233,12 +247,13 @@
<delete id="deleteOrderInfoById" parameterType="Long">
update order_info
set deleted_at=NOW(),
updated_at=now(),
status=1
where id = #{id}
</delete>
<delete id="deleteOrderInfoByIds" parameterType="String">
update order_info set deleted_at=NOW(), status=1 where id in
update order_info set deleted_at=NOW(), updated_at=NOW(), status=1 where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>

View File

@ -29,6 +29,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectAgentInfoVo"/>
<where>
<if test="agentCode != null and agentCode != ''"> and agent_code = #{agentCode}</if>
<if test="agentCodeList != null and agentCodeList.size>0"> and agent_code in
<foreach collection="agentCodeList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="agentName != null and agentName != ''"> and agent_name like concat('%', #{agentName}, '%')</if>
</where>
</select>